[mrtg] Re: Monitor for Linux

Andre stuff at emailco.co.za
Tue Jun 26 16:15:02 MEST 2001


Howdy,
Note these are scripts for linux, and also note I am very new to this, but
this works for me ... maybe someone can improve on these or tell me what I
am doing wrong ... but here's what I have !

Cfg file
-----
Target[web]: `perl traffic.pl`
PageTop[web]: <center><H1>HTTP / FTP Traffic</center></H1>
MaxBytes[web]: 5000
Options[web]: absolute, gauge, nopercent, unknaszero
Title[web]: HTTP / FTP Traffic
Ylegend[web]: Threads
ShortLegend[web]: Threads
Legend1[web]:&nbsp;Legend 1
Legend2[web]:&nbsp;Legend 2
Legend3[web]:
Legend4[web]:
LegendI[web]:&nbsp;HTTP:&nbsp
LegendO[web]:&nbsp;FTP:&nbsp
-----

Perl Scripts
SNMP Netstat
-----
#!/usr/bin/perl
my $http = `/usr/bin/snmpnetstat 10.10.10.1 public -n|grep -w
10.10.10.1.80|grep -c ESTA`;
my $ftp = `/usr/bin/snmpnetstat 10.10.10.1 public -n|grep -w
10.10.10.1.21|grep -c ESTA`;
print "$http";
print "$ftp";
-----
OR
just Netstat
-----
#!/usr/bin/perl
$http = `/bin/netstat -an|grep 10.10.10.|grep -w .80;
$ftp = `/bin/netstat -an|grep 10.10.10.|grep -w .21;
print "$http";
print "$ftp";
-----

Regards
Andre



--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive     http://www.ee.ethz.ch/~slist/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
WebAdmin    http://www.ee.ethz.ch/~slist/lsg2.cgi



More information about the mrtg mailing list