LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-14-2012, 02:56 AM   #1
sumeet inani
Member
 
Registered: Oct 2008
Posts: 898
Blog Entries: 26

Rep: Reputation: 49
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
PING www.l.google.com (74.125.236.17) 56(84) bytes of data.
^X
--- www.l.google.com ping statistics ---
192 packets transmitted, 0 received, 100% packet loss, time 190999ms
Also my interface is
Code:
$ /sbin/ifconfig 
eth0      Link encap:Ethernet  HWaddr 70:71:BC:CB:DE:47  
          inet addr:192.168.2.100  Bcast:192.168.2.255  Mask:255.255.255.0
          inet6 addr: fe80::7271:bcff:fecb:de47/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:821 errors:0 dropped:0 overruns:0 frame:0
          TX packets:742 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:120822 (117.9 KiB)  TX bytes:59717 (58.3 KiB)
          Interrupt:58 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:4115 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4115 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:8029660 (7.6 MiB)  TX bytes:8029660 (7.6 MiB)
 
Old 05-14-2012, 03:40 AM   #2
zXi
LQ Newbie
 
Registered: May 2012
Posts: 28

Rep: Reputation: Disabled
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.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how to monitor SAN connectivity with Redhat cluster suite kgvs_prasad Linux - Enterprise 1 02-04-2010 10:20 AM
Internet Connectivity Via Another Computer magnetar21 Linux - Networking 2 11-03-2007 02:05 AM
Lost internet connectivity wremote SUSE / openSUSE 3 03-19-2005 11:03 AM
No Internet Connectivity laltupi Linux - Networking 1 07-19-2004 11:34 AM
Internet Connectivity is a NO-GO Help Please!! ClericPreston Linux - Newbie 1 06-04-2004 08:36 PM


All times are GMT -5. The time now is 07:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration