Net::Ping - problems with syn proto

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I am attempting to use Net::Ping as part of a script to validate
entries in our automount maps. To speed the process of checking the
mount points, I am using Net::Ping to contact the nfs server to make
sure it is up. I know there are a few entries that reference NFS
servers that have been decommissioned, which is causing me problems.

When I try to do a $p->ack($host) and the hostname isn't registered in
DNS Net::Ping dies. Is there a trick to get the ack method to not kill
my script when the hostname lookup fails?

Currently I am thinking that I need to DNS lookups on each hostname to
verify that it resolves, but one would think that attempting to ping a
non-existant host would return undef.


Re: Net::Ping - problems with syn proto

Quoted text here. Click to load it

I can't see any reason that should happen. Can you post a (minimal)
complete script, together with expected and actual output?

In general, if a function is dieing when you don't want it to you avoid
this by wrapping the call in eval {}, but Net::Ping->ack shouldn't die
under normal circumstances.


Site Timeline