How to add CPU load value to your InfluxDB with bash scripting

First, we going to create a database with an example value, like this example:

Now, with a bash script we going to write to our database the first value from /proc/loadavg, every 5s:

while true; do curl -i -XPOST 'http://localhost:8086/write?db=stat' --data-binary "cpu,host=SERVER001 value=`cat /proc/loadavg | awk '{print $1}'`"; sleep 5;done


Popular posts from this blog

How to fix Android when developer options are not available for this user

from: can't read /var/mail/ in Python scripts

How to fix VirtualBox error when you try to import an ova file