monitor internet connectivity
Hi ,
I want to measure the time for which my internet connection works during whole day . Is there a software that logs the time for which internet was not accessible . I can write a script & put it in cron to check every minute . But , for that what will be parameter to check net access . I tried to ping www.google.com but did not got any reply . Though surfing was fine . Code:
ping www.google.com Code:
$ /sbin/ifconfig |
Cacti and squid might be useful in this case. In Cacti, you must be able to interpret the graph of usage. To do so, start downloading any torrent which might take a whole day and start cacti to monitor the usage, wherever you see a drop or red spikes, internet is down.
Do make sure that your firewall is allowed for ICMP [ping ] packets to go through. When you are able to ping google, using ping will also work, provided you write a small script leading to: ping -c 2 www.google.com if [$? != 0] then echo `date +%F%T` >> /tmp/loggingfile echo \e "\nnet is down\n------\n" >> /tmp/loggingfile fi elsif sleep 30 Reiterate the script for every 30 secs. I forgot shell scripting long back. But I hope you get the idea. |
All times are GMT -5. The time now is 04:58 AM. |