script to monitor internet connection

Micah micahjon at
Fri Jan 6 21:35:59 PST 2006

Brian John wrote:
> Hello,
> I would like to write a script to monitor my internet connection status. 
> My home connection goes down fairly often and I would like to get an idea
> for just how often it goes down and if possible how long it goes down for.
>  Could someone help me write a script that will check my connection to the
> internet and log whenever it goes down and possibly how long it goes down
> for?  I want to have some evidence to give to my ISP that my connection is
> going down.
> Thanks
> /Brian

If there really is nothing in the ports collection or google, you might 
start with pinging from a cron job.  Something like:
ping -c 1 2> /dev/null > /dev/null
echo `date`: Ping returned $? >> /var/log/ispevidence.log


More information about the freebsd-questions mailing list