[mrtg] Graphs don't show right values

corstian at consonare.nl corstian at consonare.nl
Mon Sep 4 18:15:13 MEST 2006


Hi all,

Here's my problem:

I want to create two new graphs with mrtg. The first is the total cpu-load
of the system. The second is the disk-usage of a specific partition.

Therefore I created a script named 'partition_space'.
This script looks as follows:

#!/bin/bash
partition=$1

###     Get info from "df" command
line=`df -m | grep "^$partition " `

###     Return four lines of output
echo $line | awk '{ print $3 }'
echo $line | awk '{ print $2 }'
uptime
hostname

Output is the following:
$ /home/admin/bin/mrtg/partition_space /dev/hda1
3056
5993
  5:13pm  in bedrijf 8 days 19:05,  8 users,  belastingsgemiddelde: 0,35,
0,29, 0,19
eagle

This looks ok to me.

For mrtg I created the following configuration file:

LoadMIBs:
/usr/share/snmp/mibs/HOST-RESOURCES-MIB.txt,/usr/share/snmp/mibs/UCD-SNMP-MIB.txt

WorkDir: /home/admin/public_html/mrtg/test
Options[_]: bits,growright,nobanner,noinfo

Target[server.cpu]: \
        ssCpuRawUser.0&ssCpuRawUser.0:public at localhost + \
        ssCpuRawSystem.0&ssCpuRawSystem.0:public at localhost + \
        ssCpuRawNice.0&ssCpuRawNice.0:public at localhost
Title[server.cpu]: Server CPU Load
PageTop[server.cpu]: <H1>CPU Load - System, User and Nice Processes</H1>
MaxBytes[server.cpu]: 100
ShortLegend[server.cpu]: %
YLegend[server.cpu]: CPU Utilization
Legend1[server.cpu]: Current CPU percentage load
LegendI[server.cpu]: Used
LegendO[server.cpu]:
Options[server.cpu]: growright,nopercent
Unscaled[server.cpu]: ymwd


Target[disk.root]:      `/home/admin/bin/mrtg/partition_space /dev/hda1`
Title[disk.root]:       Disk space hda1
PageTop[disk.root]:     <H1>Disk space hda1</H1>
MaxBytes[disk.root]:    1000
Kilo[disk.root]:        1024
kMG[disk.root]:         M, G, T, P
YLegend[disk.root]:     Disk space
ShortLegend[disk.root]: b
Legend1[disk.root]:     Used
Legend2[disk.root]:     Total
LegendI[disk.root]:     Used
LegendO[disk.root]:     Total
Options[disk.root]:     growright,nopercent,gauge,nobanner,noinfo

When I run mrtg using this config file, there are no errors/warnings shown.

But, the graph's stay (almost) empty. Somehow the diskspace is set to "1",
and cpu usage is very low... :-S

This is how the first lines of the mrtg logs look:
orstian at eagle:/home/admin/public_html/mrtg/test> head disk.root.log
1157382307 3056 5993
1157382307 1 0 1 0
1157382007 1 0 1 0
1157382000 1 0 1 0
1157381700 1 0 1 0
1157381400 1 0 1 0
1157381100 1 0 1 0
1157380800 1 0 1 0
1157380500 1 0 1 0
1157380200 1 0 1 0
corstian at eagle:/home/admin/public_html/mrtg/test> head server.cpu.log
1157382307 423055964 422917432
1157382307 0 0 0 0
1157382007 0 0 0 0
1157382000 0 0 0 1
1157381700 0 1 0 1
1157381400 0 1 0 1
1157381100 0 1 0 1
1157380800 0 1 0 1
1157380500 0 0 0 1
1157380200 0 0 0 0
corstian at eagle:/home/admin/public_html/mrtg/test>

Can anybody help me out??

thanks!

kind regards,
Corstian


--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive     http://lists.ee.ethz.ch/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
WebAdmin    http://lists.ee.ethz.ch/lsg2.cgi



More information about the mrtg mailing list