Hey friends, today we're talking about how to monitor all your cloud thingies (Web servers, mail servers, etc.) with UptimeRobot. And I'm sharing some fun tips to monitor your internal thingies as well - without the use of any extra agent software.
A few tips:
If you have a port like 80 or 443 that you have firewalled off to not allow any ol' host to hit, and you still want UptimeRobot to monitor it, one thing you could do if it's a Linux host is create a new screen session:
screen -R uptime
Then create a new empty directory and spin up a python Web server on an arbitrary port:
mkdir /uptime cd /uptime python3 -m http.server 7777
Then have UptimeRobot monitor port 777. This is an ok option, but a better option is probably to use a heartbeat monitor.
Speaking of heartbeat monitors, if you've got a Mac system I found it worked pretty well to edit your crontab:
And then make an entry with curl to hit the long heartbeat URL that UptimeRobot gives you:
*/1 * * * * curl https://heartbeat.uptimerobot.com/x
On the Windows side of things, the instructions they shared to create a scheduled task wouldn't work for me. So what I ended up doing was making an uptimerobot.ps1 file with this in it:
Start-Transcript -Path c:\heartbeat.log -Append Invoke-Webrequest https://heartbeat.uptimerobot.com/x -UseBasicParsing Stop-Transcript
Then I used schtasks.exe to create a task that runs the uptimerobot.ps1 like so:
schtasks.exe /create /tn "Heartbeat" /tr "powershell -noprofile -executionpolicy bypass -file c:\uptimerobot.ps1" /rl highest /f /sc minute /mo 5 /ru "NT AUTHORITY\SYSTEM"
In the tangent department: