0

I am trying to get rrdtool working to plot ifInOctets.

I created the database using:

rrdtool create bandwidth.rrd --start N DS:in:COUNTER:60:U:U RRA:AVERAGE:0.5:1:432

Once a minute I run:

 /usr/bin/rrdupdate /srv/www/htdocs/rrdtool/bandwidth.rrd N:`/usr/bin/snmpget -v 2c -Oqv -c secret 192.168.1.1 ifInOctets.2`

If I run

 /usr/bin/snmpget -v 2c -Oqv -c secret 192.168.1.1 ifInOctets.2 

it is returning the correct result.

I then create the rrd graph using:

 /usr/bin/rrdtool graph /srv/www/htdocs/mrtg/bandwidth.png -a PNG -w 785 -h 120 -s -129600 -v "Data Throughput" \
'DEF:in=/srv/www/htdocs/rrdtool/bandwidth.rrd:in:AVERAGE' \
'CDEF:kbin=in,1024,/' \
'AREA:in#00FF00:Bandwidth In'                              \
'GPRINT:kbin:LAST:Last Bandwidth In\:    %3.2lf KBps'      \
'GPRINT:kbin:AVERAGE:Average Bandwidth In\: %3.2lf KBps'

Is there something obvious I am missing?

Greg
  • 1,715
  • 5
  • 27
  • 36

1 Answers1

1

If you are collecting the data every minute, then you need to set the RRD step to be 60s (the default is 300s) using --step=60

Also, you have the Heartbeat for the 'in' DS set to 60. Normally, you should set this to be twice the step size, else you need to update every 59 seconds... What is happening is that the updates are happening every 60s which is the heartbeat time, and so most are being set to unknown.

Change the heartbeat to 120 and the step to 60, and it should work:

rrdtool create bandwidth.rrd --step 60 --start N DS:in:COUNTER:120:U:U RRA:AVERAGE:0.5:1:432
Steve Shipway
  • 3,754
  • 3
  • 22
  • 39