[mrtg] RES: Re: Script issues...

Eduardo Oliveira Scricco (Service) escricco at rge-rs.com.br
Wed Nov 24 14:11:44 MET 2004

> Ok... given that obvious error here is another example:
> server:~/bin root# ./uptime.pl
> 7
> 7
> A simple script that spits out an uptime in days.
> and my cfg file:
> Target[uptime]: `/var/root/bin/uptime.pl`
> RouterUptime[uptime]: public at localhost
> MaxBytes[uptime]: 1
> Title[uptime]: Uptime
> PageTop[uptime]: <H1>Uptime</H1>
> Unscaled[uptime]: ymwd
> ShortLegend[uptime]: Days
> YLegend[uptime]: Uptime (Days)
> Options[uptime]: growright,gauge,nolegend,nobanner,nopercent
> Again flat line 0's

The value on MaxBytes must be higher than the gauge, otherwise mrtg will
ignore it.

Try change this:
MaxBytes[uptime]: 365 (or higher)
Unscaled[uptime]: n

But, maybe it's not my job, but, why you want to monitor uptime as a
separate graph?
You can get it simple monitoring your interfaces by snmp (mrtg informs
uptime unless you pass "noinfo" option) or adding a few lines above your
scripts, passing uptime and servername, like this shell script:
UPTIME=`uptime | cut -d "," -f1,2 | cut -c14-30`
echo $UPTIME

See manual for more info...


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