[mrtg] Re: Windows 2000 Uptime

Mike Wren mwren at burnsmcd.com
Thu Dec 4 22:02:58 MET 2003


Uptime is returned as a text string and not a number.  I use an external
script in my templates to return the interger value of days.  The target
value is:
 
Target[$router_name.uptime]: `/usr/bin/GetUptime $community
$router_name`
The script GetUptime is:
 
#
RESPONSE=`snmpget -Ov -c $1 $2 system.sysUpTime.0`
VALUE=`echo $RESPONSE | cut -d'(' -f2 | cut -d')' -f1`
CHARVAL=`echo $RESPONSE | cut -d' ' --fields=3-5`
UPTIME=`echo "scale=0; $VALUE / 8640000" | bc`
echo $UPTIME
echo $UPTIME
echo $CHARVAL
echo $2

 
 
 
Michael Wren
Senior Network Analyst
Burns & McDonnell Engineering
P.O. Box 419173
Kansas City, MO 64141-6173
816-822-3160
mwren at burnsmcd.com


>>> "C Baker" <craigbaker at blueyonder.co.uk> 12/04/2003 2:41:11 PM >>>

I am attempting to graph the uptime of a Win2k Server.

I'm using system.sysuptime (.1.3.6.1.2.1.1.3) but it fails.  The errors
are
below:

Target[cyclone_uptime][_IN_] ' $target->[7]{$mode} ' did not eval into
defined data.

Skipping Update of cyclone_uptime, inlast is not defined.

Skipping Update of cyclone_uptime, outlast is not defined.

Thanks, any ideas appreciated!

Craig

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




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