Thingsboard Device
Upload von Systeminformationen zu einem Thingsboard IoT Device:
#!/bin/bash
thingsboardAccessToken='kG..........Lj'
while :
do
cpuUsage=$(top -bn1 | awk '/Cpu/ { print $2}')
memUsage=$(free -m | awk '/Mem/{print $3}')
curl -v -X POST -d "{\"Memory\": $memUsage}" https://thingsboard.cloud/api/v1/$thingsboardAccessToken/telemetry --header "Content-Type:application/json"
curl -v -X POST -d "{\"CPU\": $cpuUsage}" https://thingsboard.cloud/api/v1/$thingsboardAccessToken/telemetry --header "Content-Type:application/json"
sleep 10
done
No Comments