Re: checking if an interface went down

From: Nicholas Bachmann (nabachmann@yahoo.com)
Date: 02/23/02


From: Nicholas Bachmann <nabachmann@yahoo.com>
Date: Sat, 23 Feb 2002 00:09:30 GMT

hHG wrote:

> Does anyone know of any scripts that tests every few minutes whether or not
> one of your interfaces went down (Network Administration scripts)? Any help
> would be appreciated.....jdd

Note that I tested this for all of 30 seconds.

#!/bin/sh
# Interface checker by Nick Bachmann
if [ ! $1 ]
then
echo "Quick interface checker"
echo 'Nicholas Bachmann <nabachmann@yahoo.com>'
echo
echo 'Usage: ./inckr <int1> <int2> <int3> etc.'
echo
exit 1
fi
while true
        do
        for int in $@
                    do
/sbin/ifconfig $int &>/dev/null || echo "$int is down `date`" |mail root
                     done
        sleep 3m
done

-- 
         Regards,
         N
+-----------------------------------------------+
+ Nicholas Bachmann <nabachmann@yahoo.com>      +
+ "Finally, no security considerations are made +
+ with respect to the fact that over the course +
+ of infinite time, monkeys may evolve"         +
+  -RFC 2795                                    +
+-----------------------------------------------+



Relevant Pages

  • Re: checking if an interface went down
    ... >> one of your interfaces went down (Network Administration scripts)? ... > # Interface checker by Nick Bachmann ... > echo "Quick interface checker" ...
    (comp.security.unix)
  • Wireless CETK tests wzctooltest.dll
    ... SDIO card. ... ECHO:WARNING this test needs XWIFI11B1 [has PEGASSDN1] ... ECHO: Default Gateway ... ... ECHO: Interface Number .. ...
    (microsoft.public.windowsce.platbuilder)
  • Cant connect to firewall
    ... # IPCHAINS FIREWALL script for the Linux 2.2 kernel. ... # The default value below is for a 192.168.0.0 network. ... The internal interface will likely have ... echo " Enabling IP forwarding..." ...
    (Debian-User)
  • Re: about iterative loop to write numbers into file
    ... @ECHO OFF ... I would say first you design an interface ... the script engine that supports inheritance ... Should be a 100% backward compatible to WSH; ...
    (microsoft.public.scripting.vbscript)
  • Re: Set Full Duplex on AIX
    ... Actually I have written the following script that interactively ... displays all options available per interface and changes them without ... echo "\nWARNING: THIS OPERATION WILL CUTT OFF ANY APPLETALK/NFS/TCPIP ... $CHENT ...
    (comp.unix.aix)