[mrtg] Help with script into config file

Frank Misak Frank.Misak at mpiresearch.com
Wed Mar 25 13:51:39 CET 2009


Hi all,

 

I am polling some Liebert UPS units and have created a script to poll
the 3 necessary OID's then produce a total (total AMP draw) however I
cannot figure out how to make the MRTG .cfg file work.  I keep getting a
*.cfg_l file but not sure what the problem is.  Can someone assist?

 

##Script##

#!/bin/ksh

 

IPS="10.10.180.45 10.10.180.46"

OIDS="1.3.6.1.4.1.476.1.42.3.5.2.3.1.6.3.1 \

      1.3.6.1.4.1.476.1.42.3.5.2.3.1.6.3.2 \

      1.3.6.1.4.1.476.1.42.3.5.2.3.1.6.3.3"

 

TOTAL=0

 

for IP in $IPS; do

        for OID in $OIDS; do

                OUT=`snmpwalk -v1 -c hermes $IP .$OID`

                INC=`echo $OUT |awk '{FS=":"}{print $4}'`

                TOTAL=`expr $TOTAL + $INC`

        done

done

 

echo $TOTAL

 

##Here is the MRTG config file which doesn't work##

Target[mo22_lieberts]: `/usr/local/mrtg-2/bin/mo22_lieberts.sh`

MaxBytes[mo22_lieberts]: 3000

Options[mo22_lieberts]: growright, gauge, perminute, nobanner,
withzeroes, nolegend

YLegend[mo22_lieberts]: Amps

ShortLegend[mo22_lieberts]: amps

WithPeak[mo22_lieberts]: ymwd

LegendI[mo22_lieberts]: Lieberts

LegendO[mo22_lieberts]:

Title[mo22_lieberts]: Power Draw

PageTop[mo22_lieberts]: <h1>Power Draw</h1>

Colours[mo22_lieberts]: GREEN#006666,BLUE#009933,DARK
GREEN#000033,VIOLET#33006

 

Thanks in advance!

 

Frank

 


This communication, including attachments, is for the exclusive use of addressee and 
may contain proprietary, confidential and/or privileged information. If you are not 
the intended recipient, any use, copying, disclosure, dissemination or distribution 
is strictly prohibited. If you are not the intended recipient, please notify the sender 
immediately by return e-mail, delete this communication and destroy all copies.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.oetiker.ch/pipermail/mrtg/attachments/20090325/20dc8914/attachment.html 


More information about the mrtg mailing list