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