[mrtg] MRTG not populating graphs from script that works on all butCentOS

Alex van den Bogaerdt alex at vandenbogaerdt.nl
Fri Feb 12 10:56:48 CET 2010

Sorry for the empty answer (previous mail).

>I created a script to monitor uptime on a number of machines. It's rough, 
> efficient, and I will get laughed at, but it works. Here it is:
> #!/bin/bash
> ticks=$(snmpwalk -v 1 -c public hrSystemUptime.0 | awk '{ print 
> $5 }' )
> echo "$ticks"
> Now, this script works and populates data for Windows 7, Ubuntu, FreeBSD, 
> etc.
> However, MRTG WILL NOT populate the data returned from this script from a
> CentOS machine. I have gone through and verified everything I can possibly 
> think
> of. When run, the script itself returns the proper data. The config files 
> match perfectly
> with the other working machine with the exception of the host data of 
> course. To my
> knowledge, all it needs is a number to graph. The script returns a number, 
> why won't
> it graph?!

Try sending the output to a file, and look at it closely. Maybe you find an 
extra space,
return, or other invisble character which MRTG doesn't like.

bash$ yourscript > output
bash$ od -tx1 output
0000000 20 31 32 33 34 35 20 0d 0a 0a
bash$ cat output


More information about the mrtg mailing list