So there are a lot of methods of checking to see if your server(s) are running. I have spent some time adapting a simple ping script. My servers are all LAN side of a single IP address. If my external (WAN) IP goes down, it’s likely either my ISP, or a power cut that’s gone on long enough to kill the modem/router UPS. Not a lot I can do about that unless I am at the office (maybe not then!). BUT what about my multiple containerized LAN servers, which, as I now know, can just “stop working”.
I have today set-up a simple PING-TEST script (which I downloaded and adapted). I run it via cron every hour, and it emails me if a server is down. It pings each LAN server and does nothing else if all is well. If all is not well, it emails me.
Why not run it every minute? Well, if a server is down, I might not be able to fix it quickly (or even at all) and it will email me the same bad news every minute until I do fix it. I could have just left the office for a week… I don’t think I need that kind of “excitement”. Every hour will do for now. 🙂
PS – here’s a link to the script I am currently running, if anyone is interested. The source of the original script is shown in the comments. As I run the script in cron, I let cron email me if there’s any results. Nil output = no email. Any other ouput and my Inbox gets ping’d (pun intended). 🙂
Note – when viewing the link, only the first few lines are displayed. Feel free to download a copy, if you are that interested. Or just check out the referenced source.