Net::Ping - problems with syn proto

N

nopohack

Hello,

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.

TIA!
 
B

Ben Morrow

Quoth nopohack said:
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?

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.

Ben
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,743
Messages
2,569,478
Members
44,899
Latest member
RodneyMcAu

Latest Threads

Top