#! /bin/bash

# check every 5 minutues for 5 weeks
#rrdtool create /var/lib/sensord/uptime.rrd --start N DS:t1g:GAUGE:600:U:U DS:t1c:COUNTER:600:U:U DS:t2g:GAUGE:600:U:U DS:t2c:COUNTER:600:U:U RRA:AVERAGE:0.5:1:10080

uptime=$(/bin/cat /proc/uptime)
seconds=$(/bin/echo $uptime | /usr/bin/cut -f1 -d" " | /usr/bin/cut -f1 -d".")
idle=$(/bin/echo $uptime | /usr/bin/cut -f2 -d" " | /usr/bin/cut -f1 -d".")
echo "uptime=${uptime} seconds=${seconds} idle=${idle}" >> /tmp/uptime.txt
/usr/bin/rrdupdate /var/lib/sensord/uptime.rrd N:${seconds}:${seconds}:${idle}:${idle}
