[mrtg] Re: External programs with MRTG

David C Prall dcp at dcptech.com
Tue Oct 26 13:50:54 MEST 1999


> I have a problem with MRTG graphing for external programs.
>
> my mrtg.cfg has:
>
> Target[cpu]: '/usr/local/apache/mrtg/cpu/get-cpu-stats'
> MaxBytes[cpu]: 100
> Options[cpu]:         growright, bits
> Title[cpu]:             CPU states for daemon.best.ca
> PageTop[cpu]:      <H1><center>CPU states for
daemon.best.ca</center></H1>
> Directory[cpu]:    cpu
>
> /usr/local/apache/mrtg/cpu/get-cpu-stats has:
>
> ps -aux | awk '{k+=$3} END {print 0; print k}'
> top | head -n 1 | awk '{print $10}'
> echo $HOSTNAME
>
> which prints out:
>
> su-2.03# ./get-cpu-stats
> 0
> 88.3
> 3+20:47:52
> daemon.best.ca
>
> MRTG graphs show 0.00 %. Any ideas?
>
> Also, is it possible to graph only 1 item and not 2 ?
>
The second value needs to be an Integer. MRTG can only handle integer
values. You need two values returned. You can modify your config file so
that it won't display anything about the second variable, but it will
still graph two items.

David C Prall, MCNE MCSE          DCP Technologies
dcp at dcptech.com                       Alexandria, VA
dcppage at dcptech.com               http://www.dcptech.com


--
* To unsubscribe from the mrtg mailing list, send a message with the
  subject: unsubscribe to mrtg-request at list.ee.ethz.ch
* The mailing list archive is at http://www.ee.ethz.ch/~slist/mrtg


More information about the mrtg mailing list