LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 08-25-2013, 02:22 PM   #1
plisken
Member
 
Registered: Dec 2001
Location: Scotland
Distribution: Slackware 9.1-15 RH 6.2/7, RHEL 6.5 SuSE 8.2/11.1, Debian 10.5
Posts: 518

Rep: Reputation: 32
Methods used to check Internet connectivity


I normally check my Internet Connection is live by running a wee cron job every 30 minutes or so which will ping an external address and dump the output to a file, I then search the file for the expected response, in this case "2 received", as I ping an address twice and then if this is the case, do nothing more, if not, then I log it or whatever.

I'm looking for something a little more robust as I've noticed that there are times when I'm logging downtime but the connection is actually up, possibly missing one ping reply or so.

All ideas, comments appreciated...

O this is on an old Slackware server.

Thanks
 
Old 08-25-2013, 03:58 PM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3603Reputation: 3603Reputation: 3603Reputation: 3603Reputation: 3603Reputation: 3603Reputation: 3603Reputation: 3603Reputation: 3603Reputation: 3603Reputation: 3603
Quote:
Originally Posted by plisken View Post
there are times when I'm logging downtime but the connection is actually up
You could for example create dependencies like first check a few repo mirrors for a file ('curl -s'?), if that doesn't work tcptraceroute or ping your next hop router and if that doesn't work arping your first hop router or CPE? And why not start by making the script more robust? Just save debug output and see what condition you're missing?..
 
Old 08-26-2013, 03:49 PM   #3
jefro
Moderator
 
Registered: Mar 2008
Posts: 22,228

Rep: Reputation: 3651Reputation: 3651Reputation: 3651Reputation: 3651Reputation: 3651Reputation: 3651Reputation: 3651Reputation: 3651Reputation: 3651Reputation: 3651Reputation: 3651
Just some ideas out of the box.
There usually is a lot of chatter on a nic. Some of that may be monitored maybe also. Arp may be an idea. Some of the fail over concepts may work also.
 
Old 08-27-2013, 02:41 AM   #4
DaveQB
Member
 
Registered: Oct 2003
Location: Sydney, Australia.
Distribution: Debian, Ubuntu
Posts: 400

Rep: Reputation: 39
You can test for a connection to a port with netcat

Code:
nc -vz google.com 80
That simple line might not be your ultimate solution but I hope that helps you down a successful path.
 
  


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
Check connectivity from linux server to windwos servers sarajevo Linux - Networking 3 05-27-2009 09:10 AM
Check network connectivity ggeorgak Programming 5 08-29-2006 07:20 PM
Connectivity check, quickly, in a script jlangelier Linux - Newbie 6 12-19-2004 11:19 PM
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

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:22 AM.

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
Open Source Consulting | Domain Registration