I am writing temperature, cpu load and memory data to a rrdtool table, in update i am using N in order to pass the time however there is a problem with the time being way off. illegal attempt to update using time 1487152126 when last update time is 1487212862 (minimum one second step) That is quite a time difference and i dont know why it would be that far off. Any help is great - it was working perfectly fine yesterday so no idea where its went wrong. update function:
#!/bin/bash
cd /temptest/
TEMPERATURE=$(/opt/vc/bin/vcgencmd measure_temp | sed 's/[^0-9]*//g')
TEMPERATURE=$(echo $TEMPERATURE | sed 's/.$/.&/')
CPULOAD=$(top -d 0.5 -b -n2 | grep "Cpu(s)"|tail -n 1 |
awk '{print $2 +$4}')
PIMEM=$(free -h | grep "Mem:" | awk '{print $4}')
PIMEM=$(echo $PIMEM | sed 's/[^0-9]*//g')
PIMEMTOTAL=$(free -h | grep "Mem:" | awk '{print $2}')
PIMEMTOTAL=$(echo $PIMEMTOTAL | sed 's/[^0-9]*//g')
PIMEMPERCENT=
$(awk -v mem="$PIMEM" -v tot="$PIMEMTOTAL" 'BEGIN{print (mem/tot) $
/usr/bin/rrdtool update pitable.rrd N:$TEMPERATURE:$CPULOAD:0:$PIMEMPERCENT