The Ping That Makes a Sound

Want to help support this blog? Try out Oh Dear, the best all-in-one monitoring tool for your entire website, co-founded by me (the guy that wrote this blogpost). Start with a 10-day trial, no strings attached.

We offer uptime monitoring, SSL checks, broken links checking, performance & cronjob monitoring, branded status pages & so much more. Try us out today!

Profile image of Mattias Geniar

Mattias Geniar, October 05, 2015

Follow me on Twitter as @mattiasgeniar

After so many years, you think the ping command couldn't get any better, right? Well, it may be common knowledge for a lot of sysadmins out there, but I sure as hell didn't know it yet: ping can make a sound when it can or can't ping a target.

This is super useful if you’re reconfiguring a server’s networking stack, and want to have immediate feedback when the server starts or stops ping’ing.

You can leave this ping running in the background and focus on your main task, it’ll give you a clear but subtle beep when the server starts/stops replying to ping requests.

Note: this works natively on Mac OSX, for Windows you’ll need something like bping and on Linux there’s only limited audible support (ping can only make a sound when it can ping the target).

Beep when a server starts ping’ing

Situation: a server is down, you’re trying to fix the networking and want an immediate heads-up when it starts to ping.

$ ping -a 1.2.3.4

The -a (lower case a) causes an audible bell whenever the target replies to a ping.

-a Audible.

Include a bell (ASCII 0x07) character in the output when any packet is received. This option is ignored if other format options are present.

Beep when a server stops ping’ing

Note: only supported on Mac OSX as far as I’m aware.

Situation: you’re reconfiguring a server that’s currently online, and want to know it the moment one IP stops replying (because you shutdown an interface that didn’t come up, for instance).

ping -A 1.2.3.4

In this case we use the uppercase A parameter to send us a beep sound whenever the target stops replying to our ping.

-A Audible.

Output a bell (ASCII 0x07) character when no packet is received before the next packet is transmitted. To cater for round-trip times that are longer than the interval between transmissions, further missing packets cause a bell only if the maximum number of unreceived packets has increased.

Now I no longer need to keep a visual eye on the status of my ping’s, I can just rely on the sound coming through my headset.

Hooray for obsessive efficiency!



Want to subscribe to the cron.weekly newsletter?

I write a weekly-ish newsletter on Linux, open source & webdevelopment called cron.weekly.

It features the latest news, guides & tutorials and new open source projects. You can sign up via email below.

No spam. Just some good, practical Linux & open source content.