add timestamp to the cpu usage report log

parent 656a42e9
CPU_USAGE=`top -bn 1 | awk 'NR>7{s+=$9} END {print s}'`
CORES=`grep -c processor /proc/cpuinfo`
#CPU_USAGE=`sar 1 1 | awk '/Average/{print $3+$5/$CORES}'`
CPU_USAGE=`uptime | cut -d',' -f5`
TIMESTAMP=`date +%s`
python /home/ubuntu/ $CPU_USAGE
#echo $intVal
maxUsage="$(echo "$CPU_USAGE*100/$CORES" | bc)"
echo "$TIMESTAMP : CPU Usage $CPU_USAGE $maxUsage %" >> /tmp/scaling
python /home/ubuntu/ $maxUsage
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment