Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
![Reply](https://www.linuxquestions.org/questions/images/buttons/reply.gif) |
08-25-2013, 02:22 PM
|
#1
|
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:
|
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
|
|
|
08-25-2013, 03:58 PM
|
#2
|
Moderator
Registered: May 2001
Posts: 29,415
|
Quote:
Originally Posted by plisken
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?..
|
|
|
08-26-2013, 03:49 PM
|
#3
|
Moderator
Registered: Mar 2008
Posts: 22,228
|
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.
|
|
|
08-27-2013, 02:41 AM
|
#4
|
Member
Registered: Oct 2003
Location: Sydney, Australia.
Distribution: Debian, Ubuntu
Posts: 400
Rep:
|
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.
|
|
|
All times are GMT -5. The time now is 06:22 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|