The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Data::Checker::Ping - check data to see if it contains hosts that respong to pings

SYNOPSIS

   use Data::Checker;
   $obj = new Data::Checker;

   $obj->check($data,"Ping",$check_opts);

DESCRIPTION

This module is meant to be used by the Data::Checker module.

One set of checks that is often done on sets of hosts is to check that they respond to pings. This module provides several ping related checks that can be performed.

FUNCTIONS

check

This is the only function provided by this module, and it is intended to be used by the Data::Checker module.

CHECKS OPTIONS

The $check_opts hashref defines exactly what ping checks to perform, and some options used by those checks. Known keys that specify the checks are:

tcp, udp, icmp, stream, syn, external

These specify what protocol to use for sending a ping. The default is to use tcp. Refer to the Net::Ping manual for information about each.

The following keys can also be present to specify additional options:

timeout

This is the timeout to use for a given check.

EXAMPLES

All examples include the following lines:

   use Data::Checker;
   $obj = new Data::Checker;

   $data = ...
   $opts = ...

   ($pass,$fail,$info,$warn) = $obj->check($data,"Ping",$opts);

The value of $data and $opts is listed below in the examples.

To test if a host responds to external pings
   $data = [ 'cpan.org', 'aaa.bbb.ccc' ];
   $opts = { 'external' => undef };

Produces:

   $pass = [ 'cpan.org' ]
   $fail = {'aaa.bbb.ccc' => ['Host does not respond to external pings']};

KNOWN BUGS AND LIMITATIONS

None known.

SEE ALSO

Data::Checker, Net::Ping

LICENSE

This script is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

AUTHOR

Sullivan Beck (sbeck@cpan.org)