PingPoller1

Tue Mar 10 21:13:39 EDT 2009

This is a basic 'ping' poller that executes java.net.InetAddress.isReachable(). This tests whether that address is reachable. A best effort is made by the Java implementation to try to reach the host, but firewalls and server configuration may block requests resulting in a unreachable status while some specific ports may be accessible. A typical implementation will use ICMP ECHO REQUESTs if the privilege can be obtained, otherwise it will try to establish a TCP connection on port 7 (Echo) of the destination host. Note that the exact implementation is dependent on the Java vendor, version, and operating system.

You specify a list of IP addresses or host names to test. Each address is periodically tested, resulting in an XML-formatted events:

<ping target="goodhost" response="true">
<ping target="badhost" response="false">

You can optionally specify the grace period (number of milliseconds) for each address to reply. The default is 3000 (3-seconds). You can also specify a "poll.interval.minutes" to control how often the polling repeats. The default is "1" (1-minute).

This is a single-threaded 'ping' poller. It will ping a list of hosts, one at a time, and then repeat, trying to honor the "poll.interval.minutes" property if possible (if the previous poll returned with time to spare). Since this is single-threaded, its performance is limited by the size of the "timeout" value and the number of host targets. As a rule of thumb, you should try to keep [#hosts]*[timeout] < [poll.interval.minutes]*60000, otherwise the polling interval may become longer than expected if many hosts are unavailable and pings sit for the full timeout.

This poller is safe for up to 20 targets (using default settings). For more targets, you should probably use the PingPoller2 or the PingPollerX. You should use the poller version that just fits your needs, in order to optimize use of your server resources.

Errors

Errors (i.e. exceptions) are recorded as XML-formatted events:
<ping target="goodhost" cause="java.net.ConnectException: No route to host">
<ping target="badhost" cause="java.net.ConnectException: No route to host">