Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

Is there an app for the Mac that will alert me if my Internet connection is lost?

Sometimes I work from home and lose my connection without knowing it.

share|improve this question
add comment

4 Answers

You might be able to use ControlPlane for this.

If you take a look at the features list, it suggests that you can use the "state of the network link, connected or disconnected" as an "evidence source". Once this indicates its been disconnected (or reconnected again), you can perform a practically limitless set of "actions". Some that immediately spring to mind are to display a Growl notification or speak some text.

share|improve this answer
add comment

I use pingdom for this and they have a free plan for a single monitoring trigger as well as a free iOS app. It's geared to more system administrator, but could be of use to you if you don't mind spending some time to configure a service that would then be free to use.

share|improve this answer
add comment

Growl manages this as well as alerts from all manner of other events, including from the many apps which support it, quite well.

share|improve this answer
add comment

The following script will alert you when your wireless network no longer has a connection. Though you could modify the script to require a check to locate a specific SSID, the following script simply looks for any wireless network connection. The script can be run via a Launch Daemon (login option preferred) or by simply running the script manually when you decide.

Alert mechanism:

If you do not have a wireless network connection the script will set your volume to be set at its maximum, you will then hear an alert beep and the following phrase "your wireless network has been disconnected".

NOTE: This script contains an internal loop. The loop is designed to sleep for 2 min intervals so as not to constantly beep and verbalize said phrase. This interval can be modified to your liking by modifying the "SLEEP_TIMER" variable found within the script.

ALSO: If you are interested in setting up a Launch Daemon but do not have a lot of experience with Daemons, I recommend using Lingon (was once free but Lingon 3 is $2.99).

Tested on:

  • 10.5.x
  • 10.6.x
  • 10.7.4

Please remember to utilize a testing environment prior to running on your primary environment. Feel free to modify the script in any way that suits you, enjoy.

#!/bin/bash

# MONITOR_SSID set as true will keep a loop going (Loop timer 1 minute delay)

MONITOR_SSID="true"

SLEEP_TIMER="60"

while ( ${MONITOR_SSID} == true ); do

    SSID=$(networksetup -getairportnetwork en1 | sed "s:.*\: ::g" | tr -s "[\n]" "[ ]" | sed 's/.*off.*/OFF/g')

    if [[ ${SSID} == "OFF" ]]; then
        osascript -e 'set volume 10'
        afplay -v 2 /System/Library/Sounds/Sosumi.aiff
        say "Wireless network has been disconected"
    elif [[ ${SSID} != "OFF" ]]; then
        :
    else
        /usr/bin/logger -i Error has occured while 'your_script_name' was attempting to run
    fi

    sleep ${SLEEP_TIMER}

done
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.