render_graph_main () { last_x="$1" png_file="img/wrap-$last_x.png" /usr/bin/rrdtool graph /srv/www/$png_file -a PNG --lazy -i \ -t "Wrap CPU Temperature in C" \ -w 600 \ --end now --start end-${last_x} \ DEF:cpu=$rrd_dbpath/wrap/sensors-lm77-i2c-0-48/temperature-temp1.rrd:value:AVERAGE \ VDEF:cpu_max=cpu,MAXIMUM \ VDEF:cpu_avg=cpu,AVERAGE \ VDEF:cpu_min=cpu,MINIMUM \ VDEF:cpu_last=cpu,LAST \ COMMENT:"\t\t\g" \ COMMENT:"Maximum\t\t\g" \ COMMENT:"Average\t\t\g" \ COMMENT:"Minimum\t\t\g" \ COMMENT:"Last\l" \ LINE1:cpu#FF0000:"CPU\t\t\g" \ GPRINT:cpu_max:"%.1lf\t\t\g" \ GPRINT:cpu_avg:"%.1lf\t\t\g" \ GPRINT:cpu_min:"%.1lf\t\t\g" \ GPRINT:cpu_last:"%.1lf\l" \ > /dev/null echo "" }