[mrtg] Re: Stupidity question

Clint Alexander Clint.Alexander at corp.ptd.net
Tue Oct 12 20:22:36 MEST 1999


 
open(FILE, ">>$ARGV[0]$router.data");
print FILE "$time:$inlast:$outlast\n";
close(FILE);
----------------------------------------------------------------------------
-----------

if ARGV[0] equals '/usr/local/mrtg/conf/atm.cfg'
 
then $ARGV[0]$router.data would equal
'/usr/local/mrtg/conf/atm.cfg.routername.data'
 
What I'm trying to do, is eliminate the amount of files in one directory.
MRTG monitors 15871 ports on our network. one file for each port.
To reduce the amount of I/O lag that is created, I have to create different
directories for each port Type.


-----Original Message-----
From: David Gabler [mailto:dgabler at americomusa.net]
Sent: Tuesday, October 12, 1999 1:32 PM
To: Clint Alexander
Subject: Re: [mrtg] Stupidity question


Why not do it a bit easier, e.g. ?  

open(FILE, ">>$ARGV[0]$router.data");
print FILE "$time:$inlast:$outlast\n";
close(FILE);


David


At 01:33 PM 10/12/99 -0400, you 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
<http://www.ee.ethz.ch/~slist/mrtg> 
>

  _____  

David Gabler                  Production Systems Supervisor
Americom USA       Phone 805.545.5078

  _____  


--
* 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