?SD-WAN: Monitoring LAN devices on your SD-WAN is as easy as pie
We have previously written about how easy it is to monitor your SD-WAN using Uptime Kuma. It has some great abilities, which include doing speedtests.
And now it can also monitor your LAN infrastructure remotely. In actual fact it is as easy as pie. Firstly, create a push monitor on Uptime Kuma than has a heartbeat interval of over 600 seconds and then:
sudo nano /usr/local/sbin/chechlanip.sh
#!/bin/bash
count=0
for ip in $1 $2 $3 $4; do
fping -c1 -t300 $ip 2>/dev/null 1>/dev/null
if [ "$?" = 0 ]; then
?? ((++count))
fi
done
if [[ $count -ne 0 ]]; then
?? curl -k -s "https://uptime.example.com/api/push/key?status=up&msg=OK&ping=$count"
fi
sudo crontab -e
*/10 * * * *??? /usr/local/sbin/checklanip.sh 192.168.10.10
Replace key with the push identifier from Uptime Kuma.
To monitor temperature on a SD-WAN edge the following can be used:
sudo nano /usr/local/sbin/checktemperature.sh
acceptable="56.0"
note=`/usr/bin/sensors`
note=$( echo $note | sed -e 's/^.*: +//; s/Core 1.*$//' )
temperature=$( echo $note | sed -e 's/°C.*//' )
if [[ "$temperature" < "$acceptable" ]]; then
?? curl -k -s "https://uptime.example.com/api/push/key?status=up&msg=OK&ping=$temperature"
fi
sudo crontab -e
@hourly /usr/local/sbin/checktemperature.sh
* Ronald works connecting Internet inhabiting things at Fusion Broadband.