I'm trying to build a script to graph the load of a server using rrdtools but for some reason my graph will only show the data for 12 hours even though the graph itself is 24 hours. Any ideas what I'm doing wrong? I've never used rrdtools before so this script was pieced together from other scripts I've found. I used the same scripts to build a bandwidth graph which works properly, it's just this one that doesn't show the data for 24 hours.
#!/bin/sh
RRDFILE="/var/lib/rrd/load.rrd"
/usr/bin/rrdtool create ${RRDFILE} --start N -s 30 DS:load1:GAUGE:600:0:100 RRA:AVERAGE:0.5:2:800
date=$(date +'%s')
value=$(uptime | awk '{print substr($(NF-2), 0, length($(NF-2))-1)}')
/usr/bin/rrdtool update ${RRDFILE} N:$value
/usr/bin/rrdtool graph /var/www/html/load.png \
-N \
-E \
--start now-24hours \
-t "Average Load (24h)" --height=199 --width=500 \
--lower-limit 0 \
--vertical-label "Load Average" \
-a PNG \
DEF:load1=${RRDFILE}:load1:AVERAGE \
'VDEF:load1last=load1,LAST' \
'LINE1:load1#0000ff:Load Average' \
'GPRINT:load1:LAST:Current Load\:%3.2lf'
Here's the results: http://n3rd.info/upl/load_graph_24h.png
#!/bin/sh
RRDFILE="/var/lib/rrd/load.rrd"
/usr/bin/rrdtool create ${RRDFILE} --start N -s 30 DS:load1:GAUGE:600:0:100 RRA:AVERAGE:0.5:2:800
date=$(date +'%s')
value=$(uptime | awk '{print substr($(NF-2), 0, length($(NF-2))-1)}')
/usr/bin/rrdtool update ${RRDFILE} N:$value
/usr/bin/rrdtool graph /var/www/html/load.png \
-N \
-E \
--start now-24hours \
-t "Average Load (24h)" --height=199 --width=500 \
--lower-limit 0 \
--vertical-label "Load Average" \
-a PNG \
DEF:load1=${RRDFILE}:load1:AVERAGE \
'VDEF:load1last=load1,LAST' \
'LINE1:load1#0000ff:Load Average' \
'GPRINT:load1:LAST:Current Load\:%3.2lf'
Here's the results: http://n3rd.info/upl/load_graph_24h.png