ADSL Uptime Script

LethalChicken

Expert Member
Joined
Sep 14, 2004
Messages
1,340
Reaction score
3
Location
00-07-E9-13-97-54
Ok so this is not exactly 100% adsl related question but I'm looking for a script I can put on my server (linux box) at work to check every x minutes if my connection (server sitting at home on ADSL link) is still up.

I have googled for something like that but with no luck ...

I'm looking for something like www.alertra.com does ... but on my own server

We are Telkom - Resistance is Futile - You will be Assimilated
 
I can think of a multitude of innovative, yet easy ways,
a dynamic dns running on adsl account and a ping running in a crontask on the linux box at work,
or, even easier,
run a messenger on both computers, and watch when the contact goes offline
 
try this...

<blockquote id="quote"><font size="1" face="Verdana, Arial, Helvetica" id="quote">quote:<hr height="1" noshade id="quote">
#!/bin/bash

host="google.com"
email="[email protected]"

ping_result=`ping -c 1 $host 2&gt;&1 | grep "icmp_seq"` &gt; /dev/null
if [ "$ping_result" ] ; then
echo "Host $host is up"
else
echo "Host $host is down" | mail -s "Host Down" $email
fi
<hr height="1" noshade id="quote"></blockquote id="quote"></font id="quote">
 
ok and then just cron it for every 5 minutes or so ... not a bad plan .. txs [:)]

We are Telkom - Resistance is Futile - You will be Assimilated
 
just remembered about smokeping, you might find it will do exactly what you need, as well graph the latency and uptime!
 
Top
Sign up to the MyBroadband newsletter
X