org.opennms.netmgt.poller.monitors
Class TrivialTimeMonitor
java.lang.Object
org.opennms.netmgt.poller.monitors.IPv4Monitor
org.opennms.netmgt.poller.monitors.TrivialTimeMonitor
- All Implemented Interfaces:
- ServiceMonitor
@Distributable
public final class TrivialTimeMonitor
- extends IPv4Monitor
This class is designed to be used by the service poller framework to test the
availability of the trivial UNIX "time" service on remote interfaces. The class
implements the ServiceMonitor interface that allows it to be used along with
other plug-ins by the service poller framework.
- Author:
- Jeff Gehlbach, OpenNMS
|
Method Summary |
PollStatus |
poll(MonitoredService svc,
Map<String,Object> parameters)
Poll the specified address for service availability. |
PollStatus |
pollTimeTcp(MonitoredService svc,
Map<String,Object> parameters,
PollStatus serviceStatus,
TimeoutTracker tracker,
InetAddress ipv4Addr,
int port,
int allowedSkew,
boolean persistSkew)
|
PollStatus |
pollTimeUdp(MonitoredService svc,
Map<String,Object> parameters,
PollStatus serviceStatus,
TimeoutTracker tracker,
InetAddress ipv4Addr,
int port,
int allowedSkew,
boolean persistSkew)
|
void |
storeResult(PollStatus serviceStatus,
Number skew,
Double responseTime,
boolean persistSkew)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
TrivialTimeMonitor
public TrivialTimeMonitor()
poll
public PollStatus poll(MonitoredService svc,
Map<String,Object> parameters)
- Poll the specified address for service availability.
During the poll an attempt is made to retrieve the time value from the
remote system. This can be done via either TCP or UDP depending on the
provided parameters (default TCP). If the time value returned is within
the specified number of seconds of the local system's clock time, then
the service is considered available.
- Specified by:
poll in interface ServiceMonitor- Specified by:
poll in class IPv4Monitor
- Parameters:
parameters - The package parameters (timeout, retry, etc...) to be used for
this poll.iface - The network interface to test the service on.
- Returns:
- The availability of the interface and if a transition event
should be suppressed.
- Throws:
RuntimeException - Thrown if the interface experiences errors during the poll.- See Also:
PollStatus.SERVICE_AVAILABLE,
PollStatus.SERVICE_UNAVAILABLE
storeResult
public void storeResult(PollStatus serviceStatus,
Number skew,
Double responseTime,
boolean persistSkew)
pollTimeTcp
public PollStatus pollTimeTcp(MonitoredService svc,
Map<String,Object> parameters,
PollStatus serviceStatus,
TimeoutTracker tracker,
InetAddress ipv4Addr,
int port,
int allowedSkew,
boolean persistSkew)
pollTimeUdp
public PollStatus pollTimeUdp(MonitoredService svc,
Map<String,Object> parameters,
PollStatus serviceStatus,
TimeoutTracker tracker,
InetAddress ipv4Addr,
int port,
int allowedSkew,
boolean persistSkew)
Copyright © 2009. All Rights Reserved.