Give this a try.

I can't remember where the code came from so forgive me if I didn't give the
proper credit to the author.


use Net::Ping;
        $p = Net::Ping->new("icmp");
    
    if (($p->ping($your_hostip, 2)) eq 0) 
    {
        
                If no response do this.

    }


sleep(1);
   
$p->close();

-----Original Message-----
From: James Kelty [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 28, 2001 12:22 PM
To: [EMAIL PROTECTED]
Subject: System Health Checks...


So I have a bunch of systems in my network that require a monitoring system
to
test if network connectivity is there (sound familiar anyone?). So, rather
than
try some of the many programs out there for this, I, naturally, decided to
write
a cgi in perl! Woo Hoo!

At first I thought about opening a socket to each system to test it, and
that worked
except for the NT hosts.(They weren't running the ssh service that the *Nix
systems were).

Then I thought about doing a ping, but I am having trouble finding a module
for ICMP, so,
before I code a little more for ICMP, can anyone point me towards a module
that uses ICMP
with nearly the same syntax as IO::Socket has for tcp?

Thanks.

-James


James Kelty
Sr. Unix Systems Administrator
The Ashland Agency
[EMAIL PROTECTED]
541.488.0801



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to