[mrtg] Re: Stupidity question

Bradford Woodcock bwoodcoc at bbn.com
Tue Oct 12 19:45:26 MEST 1999


Just a guess but...  "==" is used to compare numbers which you are not
comparing. I seem to remember text equating to "0" in a == statement. So
you may have an equivalent of 0 == 0 and the first if (ATM) would be true.
Instead of == try =~ or maybe eq.

cheers,
brad...
At 01:33 PM 10/12/1999 -0400, Clint Alexander wrote:
>I'm trying to create logs of MRTG variables for archiving.
>My problem is the code pasted below.
>No matter how I declare the variables,
>every 'print DATAFile' ends up in the ATMDir directory.
>ARGV[0] is the /path/to/config.cfg
>so, it should change because 4 instances of
>mrtg runs. One for each config file.
>No matter what, every ARGV[0] is /path/to/atm.cfg  or $ACFG
>Can anyone shed some light on this?
> 
>## -----   Print these variables to another Data dir. ----- ##
>    my $RCFG = "/path/to/router.cfg";
>    my $LCFG = "/path/to/linkswitch.cfg";
>    my $ACFG = "/path/to/atm.cfg";
>    my $TCFG = "/path/to/3810.cfg";
> 
>    if ($ARGV[0] == $ACFG){
>        open(DATAFile, ">>/path/to/ATMDir/$router.data");
>        print DATAFile "$time:$inlast:$outlast\n";
>        close(DATAFile);
>    } elsif ($ARGV[0] == $TCFG){
>        open(DATAFile, ">>/path/to/3810Dir/$router.data");
>        print DATAFile "$time:$inlast:$outlast\n";
>        close(DATAFile);
>    } elsif ($ARGV[0] == $LCFG){
>        open(DATAFile, ">>/path/to/LINKDir/$router.data");
>        print DATAFile "$time:$inlast:$outlast\n";
>        close(DATAFile);
>    } else {
>        open(DATAFile, ">>/path/to/ROUTERDir/$router.data");
>        print DATAFile "$time:$inlast:$outlast\n";
>        close(DATAFile);
>    }
>    ## -----
> 
>TIA
>
>------------------------------------------- 
>Clint Alexander 
>clinta at corp.ptd.net 
>PenTeleData Engineering Dept. 
>
>[- Over-Estimate everything, and nothing will surprise you -] 
>                                                                            
>             -HV 
>
> 
>
>--
>* To unsubscribe from the mrtg mailing list, send a message with the
>  subject: unsubscribe to mrtg-request at list.ee.ethz.ch
>* The mailing list archive is at http://www.ee.ethz.ch/~slist/mrtg
>
>

--
* To unsubscribe from the mrtg mailing list, send a message with the
  subject: unsubscribe to mrtg-request at list.ee.ethz.ch
* The mailing list archive is at http://www.ee.ethz.ch/~slist/mrtg


More information about the mrtg mailing list