Mac – tool to log internet connectivity on a mac

internetmacmac-osxnetworking

My mac runs as a server with an dyndns ip. To work properly, it must be connected to the internet all the time. but unfortunately it seems that it is not connected a lot of times during the day. So I need a tool that checks i.e. once per minute if the mac is connected to the internet (i.e. by trying to reach google), and writes it to a log file.

Do you know something that can help out here? I need to check it on the machine, if itself has got internet. Mac OS 10.5. Thanks guys!!

Best Answer

You can install nagios on a normal mac, they are Unix machines too :)

Would a script like this do ?

 #!/bin/bash
 LOG=/tmp/LOG
 rm -f $LOG
 while ( true );
 do 
  date >> $LOG;
  curl http://www.google.com/ > /dev/null  2>> $LOG
  sleep 60 ;
 done