LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 12-03-2005, 12:50 AM   #1
equinox
Member
 
Registered: Dec 2003
Location: Johannesburg, South Africa
Posts: 846

Rep: Reputation: 30
Script to monitor interface


Hi guys i need some help...

Sometimes my adsl script dies and so I need a script that will perhaps run under cron that chick the status of ppp0 and if it's down it will do a "service adsl restart".

The other problem is that sometmies it also gets confused when coming up and ppp0 becomes ppp1 and I need to keep it at ppp0.

Anyone know how to write such such a script that can monitor and fix whats happening? Its not for me but for a client I have and I've tried searching on the net for such a script but can't seem ti find anything.
 
Old 12-03-2005, 08:39 PM   #2
Ygrex
Member
 
Registered: Nov 2004
Location: Russia (St.Petersburg)
Distribution: Debian
Posts: 666

Rep: Reputation: 68
You could run a daemon which checks whether any site is accessed with e.g.:
Code:
while (true) ; do
ping -c1 www.linuxquestions.org >/dev/null 2>&1 sleep 1
done
If ping returns FALSE (non-zero) you could restart your interface.
 
  


Reply



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
Process monitor script? sub_moa Programming 2 11-03-2005 04:08 AM
Monitor my wireless interface n00blar Linux - Laptop and Netbook 3 01-15-2005 09:19 PM
Automatic script for shutting down interface RajaRC Linux - Networking 0 11-02-2004 11:23 PM
Web interface with a cgi script DirtyDan Programming 5 10-05-2004 07:58 AM
how to run script on event ppp0 interface going down ? qwijibow Linux - Networking 4 02-24-2004 06:08 AM

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

All times are GMT -5. The time now is 08:31 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
Open Source Consulting | Domain Registration