Network interface failure detection

Mark Hahn hahn at physics.mcmaster.ca
Fri Mar 15 18:43:43 EST 2002


> Actually I came across "IP Multipath" daemon
> in Solaris which can determine whether the
> communication failure was due to network
> card failure or due to ethernet cable pull
> out.

no.  it's nothing more than a daemon that pings routers,
at least from the man pages I can find on the net.
that has nothing to do with physical-layer diagnosis.
I consider it to be a fairly poor kind of heartbeat daemon.

> I was wondering if there was something similar
> in Linux.

use Net::Ping;

open(I,"netstat -nr|") || die("failed to netstat");
while (<I>) {
    @fields = split;
    if ($fields[3] eq "UG") {
        $gateway = $fields[1];
    }
}
close(I);

$p = Net::Ping->new("icmp");
while (1) {
    if (!$p->ping($gateway, 2)) {
        print "aww, bummer!\n";
    } else {
        print "copacetic, dude!\n";
    }
    sleep(1);
}
$p->close();

_______________________________________________
Beowulf mailing list, Beowulf at beowulf.org
To change your subscription (digest mode or unsubscribe) visit http://www.beowulf.org/mailman/listinfo/beowulf



More information about the Beowulf mailing list