Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I find it har to believe that it is sooo difficult to do simple ping testing with Perl. I've use both Net::Ping and Net::Ping::External and neither are allowing me to pass the server names from an array. I've tried both Win32 and Linux to no avail. But like any good apprentice, I think it's time I stopped and asked for guidance. NO, I'm not asking for someone to furnish the code, but I posted a question earlier today (with code) and am still unable to get the friggin modules to work. help

Replies are listed 'Best First'.
Re: Ping & Perl
by grinder (Bishop) on Oct 01, 2002 at 08:31 UTC

    I wrote pinger - ping a range of hosts some time ago, which offers one Way To Do it. The main trick is to mark the script setuid root, in order to use ICMP packets. None of my machines respond to TCP or UDP echo packets, and I see no reason for that to change.

    I don't really see the use for an array interface. If you feed an array in, you have to parse an array coming out, and match up what output corresponds to what input. Sounds like a lot of fiddly housekeeping details to me.


    print@_{sort keys %_},$/if%_=split//,'= & *a?b:e\f/h^h!j+n,o@o;r$s-t%t#u'
Re: Ping & Perl
by /dev/null (Chaplain) on Oct 01, 2002 at 00:29 UTC
    I was able to complete a script that pings several hosts in multiple subnets using the Net::Ping module. Hopefully this helps.

    /dev/null
Re: Ping & Perl
by Marza (Vicar) on Sep 30, 2002 at 21:51 UTC

    I have it running on some system check routines. Many others here have used it as well. Why not post your code?

    Update:

    Man I must be tired. If you mean this Net::Ping:External you have several replies.