[mrtg] Re: MRTG and QuickPage
Dannie M. Stanley
dannie at spinweb.net
Tue Jul 8 20:46:22 MEST 2003
I am new to SNMP but I am pretty sure you could use SNMP to do this and
bypass MRTG. If you are using Linux/Unix a quick shell script should do
the trick... here is some code that requires SNMP (command line tools)
and Perl:
#!/usr/bin/perl
$hostname = "myhost";
$community = "public";
$testWhichValue = "tcp.tcpOutSegs.0"; # Might need a diff object
$snmpThresh = 2; # some number
$EmailAddress = "5555551212\@mymobileprovider.net";
$snmpGet = `snmpget $hostname $community $testWhichValue`;
if($snmpGet =~ /^.*:\s*(\d{1,})\s*$/){
$snmpVal = $1;
}
if($snmpVal >= $snmpThresh){
`echo \"my value is being exceeded\" |mail -s Alert $EmailAddress`;
}
exit 0;
You may also be able to set an SNMP trap depending on your device.
Yo,
Dannie
xzhao2 wrote:
> I'm now working on integrating QuickPage into MRTG (or vice versa), meaning by
> reading the data from MRTG log file every 5 minutes and comparing with some
> thresholds, QuickPage is automatically triggered and a message is sent to a
> cellphone or pager. Anybody has any idea to do this? Thanks. Simon
>
> --
> 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
--
Dannie M Stanley
SpinWeb Net Designs, Inc.
http://www.spinweb.net
--
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