|
NAMENet::Oping - ICMP latency measurement module using the oping library.SYNOPSISuse Net::Oping (); my $obj = Net::Oping->new (); $obj->host_add (qw(one.example.org two.example.org)); my $ret = $obj->ping (); print "Latency to `one' is " . $ret->{'one.example.org'} . "\n"; DESCRIPTIONThis Perl module is a high-level interface to the oping library <http://verplant.org/liboping/>. Its purpose it to send "ICMP ECHO_REQUEST" packets (also known as "ping") to a host and measure the time that elapses until the reception of an "ICMP ECHO_REPLY" packet (also known as "pong"). If no such packet is received after a certain timeout the host is considered to be unreachable.The used oping library supports "ping"ing multiple hosts in parallel and works with IPv4 and IPv6 transparently. Other advanced features that are provided by the underlying library, such as setting the data sent, are not yet supported by this interface. INTERFACEThe interface is kept simple and clean. First you need to create an object to which you then add hosts. Using the "ping" method you can request a latency measurement and get the current values returned. If necessary you can remove hosts from the object, too.The constructor and methods are defined as follows:
CAVEATSThe oping library opens a raw socket to be able to send ICMP packets. On most systems normal users are not allowed to do this. This is why on most systems the ping(1) utility is installed as SetUID-root. Since, when using this module, no external process is spawned this process needs the appropriate permissions. This means that either your script has to run as superuser or, under Linux, needs the "CAP_NET_RAW" capability.SEE ALSOliboping(3)The liboping homepage may be found at <http://verplant.org/liboping/>. Information about its mailing list may be found at <http://mailman.verplant.org/listinfo/liboping>. AUTHORSFirst XS port by Olivier Fredj, extended XS functionality and high-level Perl interface by Florian Forster.COPYRIGHT AND LICENSECopyright (C) 2007 by Olivier Fredj <ofredj at proxad.net>Copyright (C) 2008,2009 by Florian Forster <octo at verplant.org> This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.7 or, at your option, any later version of Perl 5 you may have available. Please note that liboping is licensed under the GPLv2. Derived works of both, Net::Oping and liboping, (i. e. binary packages) may therefore be subject to stricter licensing terms than the source code of this package.
Visit the GSP FreeBSD Man Page Interface. |