Are you worried about the state of your server?
Maybe you have a website, and you’re worried if it’s always up and running, especially when you’re asleep and can’t fix it.
Well, I’ve written an extremely simple script that will solve this issue for you. Just plug your mac into the sound system where you sleep and crank it up to full volume. Whenever there’s a problem, your system default error will start going off every three seconds. That should wake you up! Then, you can go over and check the state of things.
The underlying command here is ping. I am using what you type as a simple variable, $website, and using -A to make it audible and ring, and -i to time the ping out so you don’t accidentally crash your server. In the end, the command is
ping -A -i 3 $website
And when you type in the website, $website is replaced with whatever that is.
It’s not a complicated or amazing script, but it helps to get things done easier and faster.
To use it, download the script and navigate to it’s enclosing folder using Terminal. Then, type:
This will make the script executable. Next, type:
You will be greeted and asked to enter the URL (or IP address) of the site you want to keep track of. Type in the URL and press enter. You will see the ping output across your screen updating every three seconds. If ping stops responding, your computer will begin to make the system default error sound every time there is a request timeout. If you have the volume loud enough, that should be able to wake you up.