Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Re: ping problem

by mowgli (Friar)
on Mar 01, 2003 at 10:55 UTC ( [id://239685]=note: print w/replies, xml ) Need Help??


in reply to Re: ping problem
in thread ping problem

The following syntax is also valid:

$host = v127.0.0.1
This will do the Right Thing, but only from Perl 5.6 on.

--
mowgli

Replies are listed 'Best First'.
Re: Re: Re: ping problem
by ralijani (Acolyte) on Mar 04, 2003 at 13:10 UTC
    so thanks for ur help but i have other problem: Hi dear I am using Redhat 7.3 and SuSE8.0 and i want to ping on special port a server to know is it alive or not. at the first, when i run the example on cpan.org(Net::ping) it doesnt answer any, i download this module and installed it, then ping(icmp) replay. but when i want to ping on specified port with tcp or syn portocol it replay ok(no differnce that service is up or down). i mean this code: $p = Net::Ping->new("tcp", 2); # Try connecting to the www port instead of the echo port $p->{port_num} = getservbyname("http", "tcp"); #while ($stop_time > time()) #{ print "$host not reachable ", scalar(localtime()), "\n" unless $p->ping($host); sleep(3); #} undef($p); it respond ok no difrence that http service is up or down . i use ur fping : ./fping 192.168.100.12 -P 80 it shows alive in each time that service is up or down. how could i solve the problem. and what is my fault. why it shows host is alive in each time. it is important for me. Best regurds R.A

      From what you write, I'm not sure whether your test code above always reports that the host is down or that it's up, but when I tried this myself, I found that Net::Ping doesn't seem to work when $host is specified as v127.0.0.1; setting it to "localhost" works, though, so you might want to try that. Outside of that, you might also consider asking a new question in Seekers of Perl Wisdom about this; I'm sure you'd get more replies that way. :)

      --
      mowgli

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://239685]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (3)
As of 2024-04-24 03:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found