
PingPoller2You 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 "timeout" (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 two-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 failed pings will block the main poller thread for the full "timeout" period, the main thread will move any failed target to a secondary thread for subsequent checks. This secondary thread contains only failed targets. It is expected that they may be unavailable for some period of time anyway, and any extra delay in discovering their return to availability on this secondary thread is less critical than reliably detecting when a target fails in a timely manner via the main thread.
As a rule of thumb, you should try to keep
[#hosts]*[averagePingDelay] < [poll.interval.millis]*60000,
otherwise the polling interval may become longer than expected.
Since the average ping delay for reachable hosts is usually small (< 100-milliseconds), this poller should be able to safely handle 600 or more targets, per instance, for an interval of 1-minute. For more targets, you could increase the interval or use the "PingPollerX" multi-threaded poller. You should use the poller version that just fits your needs, in order to optimize use of your server resources.
<ping target="goodhost" cause="java.net.ConnectException: No route to host"> <ping target="badhost" cause="java.net.ConnectException: No route to host">