Today I adapted a script from nixCraft to check if a device (in this case a Raspberry Pi) is up. The idea is simple: my computer should check every hour to figure out if the Raspberry Pi is still alive, and report to me if it isn’t.
Checking every hour is accomplished by the following crontab entry:
@hourly bash /home/wouter/bin/checkRasp3.sh
The bash script below pings my Raspberry Pi, and when ping was unsuccessful it will use a Zapier webhook to send me a Pushbullet notification to my phone and browser, although you could use the same idea to get a slack notification, an email,…