[mrtg] Zero-value inputs to MRTG from homebrew perl script

Isaac Grover isaac at coe.engr.sjsu.edu
Fri Jul 14 18:25:33 MEST 2000


Greetings everyone,

I've been somewhat successful in being able to monitor the
temperature of my Xylan switches.  I couldn't find them in the MIB
tree, so I sniffed out the relevant OIDs over the wire and have been
able to consistently return the correct operating temperature using
my homebrew perl script.

I've RTFM and built my perl script to return data in the mrtg
format, but haven't been able to get mrtg to read the data from the
script correctly.  Could any of you with external script experience
shed some light on my dilemma?  (Below are my mrtg.cfg and perl
script)

---8<---
#!/usr/bin/perl

use POSIX;

# snmpget returns temp in celsius * 10
$record = `snmpget -q $device $commmunity_name
.1.3.6.1.4.1.800.2.18.1.20.0`;
chomp ($record);
($temp) = (split / /, $record) [1];
$temp = $temp / 10;
$ceil = ceil ($temp);
printf "$ceil\n";
$ceil = ceil (9*$temp/5+32);
printf "$ceil\nquite some time\nthis device\n";
---8<---

---8<---
Target[192.168.23.1.temp]: `./temperature.pl`$
# Target[192.168.23.1.temp]:
.1.3.6.1.2.1.2.2.1.1.1&1.3.6.1.4.1.800.2.18.1.20.0$
MaxBytes[192.168.23.1.temp]: 300
Options[192.168.23.1.temp]: nopercent, growright, integer
Title[192.168.23.1.temp]: Core operating temperature
PageTop[192.168.23.1.temp]: <h2>Core operating temperature</h2>
YLegend[192.168.23.1.temp]: degrees
ShortLegend[192.168.23.1.temp]:
Legend1[192.168.23.1.temp]: Celsius
Legend2[192.168.23.1.temp]: Fahrenheit
Legend3[192.168.23.1.temp]: Max. C
Legend4[192.168.23.1.temp]: Max. F
LegendI[192.168.23.1.temp]: Celsius
LegendO[192.168.23.1.temp]: Fahrenheit
---8<---

--
Isaac Grover - isaac at coe.engr.sjsu.edu
SJSU College of Engineering, ECS / Networking
ENG 237, (408) 924-4074

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