[mrtg] Stupidity question
Clint Alexander
Clint.Alexander at corp.ptd.net
Tue Oct 12 19:33:26 MEST 1999
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
More information about the mrtg
mailing list