This library is free software you can redistribute it and/or modify it under the same terms as Perl itself. This involves a small amount of risk, but no more than simply typing "ping" at a system prompt.Īlexandr Ciornii (alexchorny AT ), Colin McMillen (colinm AT ) If your PATH contains a trojan "ping" program, this module will call that program. This module calls whatever "ping" program it first finds in your PATH environment variable. Although no specific bugs are known at this time, the module could use testing on a greater variety of systems. If your system is not currently supported, e-mail me adding support to your system is probably trivial. More systems will be added as soon as any users request them. If you'd like to see better support on your system, please e-mail me. On some of these systems, some of the arguments may not be supported. If you have successful or unsuccessful test results for any of these systems, please send them to me. Support for these systems is integrated into this module but none have been tested yet. Needs testing for BSDi.ĪIX, DEC OSF, UNICOSMK, NeXTStep, HP-UX, BSD/OS (BSDi), BeOS Not sure how I'm going to resolve this yet for now, all the options but count are disabled. It appears that different versions of Linux use different versions of ping, which support different options.
#EXTERNAL PING TOOL WINDOWS#
Problem is that we may be running windows ping. It should work on other Windows systems as well.
Please note that the path to the `ping' should be somewhere in your PATH environment variable (or your system's closest equivalent thereof.) Otherwise, Net::Ping::External will be unable to locate your system's `ping' command. Support currently exists for interfacing with the standard ping utilities on the following systems. The default is 56, which translates into 64 ICMP data bytes when combined with the 8 bytes of ICMP header data. Specifies the number of data bytes to be sent. Eventually, Net::Ping::External will return the number of packets that were acknowledged by the remote host for now, however, ping() still returns just true or false. The number of ICMP ping packets to send to the remote host. If the remote system does not respond before the timeout has elapsed, ping() will return false. The maximum amount of time, in seconds, that ping() will wait for a response. You must specify either the "hostname" option or the "ip" option.Ī packed bit-string representing the 4-byte packed IP address (as returned by Socket.pm's inet_aton() function) of the host that you would like to ping. The hostname (or dotted-quad IP address) of the remote host you are trying to ping. This module is still "alpha" it is expected that more options to the ping() function will be added soon. While it is relatively trivial to write a Perl script that parses the output of the "ping" command on a given system, the aim of this module is to encapsulate this functionality and provide a single interface for it that works on many systems. The system's "ping" command uses ICMP and does not usually require privileged access. However, Net::Ping cannot use an ICMP ping unless you are running your script with privileged (AKA "root") access. ICMP ping is the most reliable way to tell whether a remote host is alive. Unless you have the ability (and willingness) to run your scripts as the superuser on your system, this module will probably provide more accurate results than Net::Ping will. It presently provides a single function, ping(), that takes in a hostname and (optionally) a timeout and returns true if the host is alive, and false otherwise. Net::Ping::External is a module which interfaces with the "ping" command on many systems. $alive = ping(hostname => $_, timeout => 5) Some examples: use Net::Ping::External qw(ping) In general: use Net::Ping::External qw(ping) Net::Ping::External - Cross-platform Perl interface to "ping" utilities SYNOPSIS