Results 1 to 2 of 2
Enjoy an ad free experience by logging in. Not a member yet? Register.
- Join Date
- Nov 2005
How to create a ping-tracking script..?
Got a problem.
OS is Linux Mandrake 9.2 with special routing soft running on it. That
soft handles several channels: two for source hosts and others for subscriber-hosts. All hosts have ip-adresses, and the term "channel" is of logical nature. Those channels could be opened and closed from the command line with the appropriate commands (like " # chclose 123", where 123 - channel number). One of the source hosts is the main source host, the other source host - is reserved source host. Both source hosts are online (their ip-addresses could be pinged) but the channel for the main source host is up (opened).
The idea is to write a script that will at some periods of time (every 5 sec. for example) ping the main source host and when it will go down (destination host unreachable) the script will execute a command for closing its channel and another command for opening channel for reserved source host . The script must continue pinging the main source host and , when it will be up again, the script should execute a command for closing channel of the reserved source host and a command for opening channel for main source host.
- Join Date
- Feb 2005
Well, you could start with something like
while /bin/ping -c1 -w1 yourhost 2>/dev/null do sleep 5 done # ping failed, do some stuff ...