[rrd-users] graph file displays only the first value of RRD database

Martin T m4rtntns at gmail.com
Fri Apr 15 14:45:56 CEST 2011


Hi,

I would like to monitor the temperature of my HDD using the RRDtools.
I get the HDD temperature with the "smartctl -A /dev/ad6 | egrep
Temperature_Celsius | awk '{print $10}'" command:

[root@ /home/martin/rrd]# for i in {1..5}; do smartctl -A /dev/ad6 |
egrep Temperature_Celsius | awk '{print $10}'; done
38
38
38
38
38
[root@ /home/martin/rrd]#


I created following RRD database:

rrdtool create hddtemp.rrd \
--step '30' \
'DS:hdd:GAUGE:60:0:80' \
'RRA:AVERAGE:0.5:2:1440' \
'RRA:AVERAGE:0.5:20:1008'

Creates a RRD database named "hddtemp.rrd", which starts now(date +%s)
and database expects new values every 30 seconds.
'RRA:AVERAGE:0.5:2:1440' should create an archive point every 1 minute
and kept the archive back for one day. 'RRA:AVERAGE:0.5:20:1008'
should create an archive point every 10 minute and archive is kept for
a week back.

As far as I understand, archive was created nicely:

[root@ /home/martin/rrd]# rrdtool create hddtemp.rrd --step 30
DS:hdd:GAUGE:60:0:80 RRA:AVERAGE:0.5:2:1440 RRA:AVERAGE:0.5:20:1008
[root@ /home/martin/rrd]# ls -lh *
-rw-r--r--  1 martin  martin    20K Apr 15 15:02 hddtemp.rrd
[root@ /home/martin/rrd]#


Then I made a following script:

[root@ /home/martin/rrd]# cat rrdscript.sh
#!/usr/local/bin/bash

while true; do
hddtemerature=$(smartctl -A /dev/ad6 | egrep Temperature_Celsius | awk
'{print $10}')
rrdtool update hddtemp.rrd N:$hddtemerature
sleep 30
done
[root@ /home/martin/rrd]# ./rrdscript.sh &
[1] 7421
[root@ /home/martin/rrd]#


..which should update the hddtemp.rrd database file after every 30s
with value of $hddtemerature. Is this correct? If I check the
hddtemp.rrd file with hexdump, the content changes so I guess the
script updates the hddtemp.rrd file properly..

However, the thing is, that if I create graph files, only the very
first value is shown on the image file. I mean I regenerate image
file, but the image is always like this:
http://img820.imageshack.us/img820/9308/hddtemp.png Most likely my own
misconfiguration. I create graph files with following command:

rrdtool graph hddtemp.png --title 'HDD temp' --vertical-label 'C'
--width '800' --height '200' --start end-1d
DEF:hdd_DEF=hddtemp.rrd:hdd:AVERAGE VDEF:VDEF_hdd=hdd_DEF,LAST
LINE2:hdd_DEF#FF0000


Any suggestions, what might cause such behavior? Is the hddtemp.rrd
not properly updated? Or do I generate hddtemp.png somewhat wrong?


PS if any additional information is needed, please ask!


regards,
martin



More information about the rrd-users mailing list