|
OpenNMS API 1.1.4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opennms.netmgt.poller.IPv4Monitor
org.opennms.netmgt.poller.SnmpMonitor
This class is designed to be used by the service poller framework to test the availability of the SNMP 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.
Field Summary | |
private static java.lang.String |
DEFAULT_OBJECT_IDENTIFIER
Default object to collect if "oid" property not available. |
private static int |
DEFAULT_PORT
The default port on which the host is checked to see if it supports SNMP. |
private static java.lang.String |
SERVICE_NAME
Name of monitored service. |
(package private) static java.lang.String |
SNMP_PEER_KEY
Interface attribute key used to store the interface's JoeSNMP SnmpPeer object. |
Fields inherited from interface org.opennms.netmgt.poller.ServiceMonitor |
SERVICE_AVAILABLE, SERVICE_STATUS_MASK, SERVICE_UNAVAILABLE, SERVICE_UNRESPONSIVE, SURPRESS_EVENT_MASK |
Constructor Summary | |
SnmpMonitor()
|
Method Summary | |
void |
initialize(java.util.Map parameters)
Initialize the service monitor. |
void |
initialize(NetworkInterface iface)
Called by the poller framework when an interface is being added to the scheduler. |
int |
poll(NetworkInterface iface,
java.util.Map parameters,
Package pkg)
The poll() method is responsible for polling the specified address for SNMP service availability. |
void |
release()
This method is called whenever the plug-in is being unloaded, normally during framework exit. |
void |
release(NetworkInterface iface)
This method is the called whenever an interface is being removed from the scheduler. |
java.lang.String |
serviceName()
Returns the name of the service that the plug-in monitors ("SNMP"). |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final java.lang.String SERVICE_NAME
private static int DEFAULT_PORT
The default port on which the host is checked to see if it supports SNMP.
private static final java.lang.String DEFAULT_OBJECT_IDENTIFIER
static final java.lang.String SNMP_PEER_KEY
Constructor Detail |
public SnmpMonitor()
Method Detail |
public java.lang.String serviceName()
Returns the name of the service that the plug-in monitors ("SNMP").
public void initialize(java.util.Map parameters)
Initialize the service monitor.
initialize
in interface ServiceMonitor
initialize
in class IPv4Monitor
parameters
- Not currently used.
java.lang.RuntimeException
- Thrown if an unrecoverable error occurs that prevents
the plug-in from functioning.public void initialize(NetworkInterface iface)
Called by the poller framework when an interface is being added to the scheduler. Here we perform any necessary initialization to prepare the NetworkInterface object for polling.
initialize
in interface ServiceMonitor
initialize
in class IPv4Monitor
iface
- The network interface to be initialized.
java.lang.RuntimeException
- Thrown if an unrecoverable error occurs
that prevents the interface from being monitored.public int poll(NetworkInterface iface, java.util.Map parameters, Package pkg)
The poll() method is responsible for polling the specified address for SNMP service availability.
iface
- The network interface to test the service on.parameters
- The package parameters (timeout, retry, etc...) to be
used for this poll.
java.lang.RuntimeException
- Thrown for any uncrecoverable errors.ServiceMonitor.SURPRESS_EVENT_MASK
,
ServiceMonitor.SERVICE_AVAILABLE
,
ServiceMonitor.SERVICE_UNAVAILABLE
public void release()
This method is called whenever the plug-in is being unloaded, normally during framework exit. During this time the framework may release any resource and save any state information using the proxy object from the initialization routine.
Even if the plug-in throws a monitor exception, it will not prevent the plug-in from being unloaded. The plug-in should not return until all of its state information is saved. Once the plug-in returns from this call its configuration proxy object is considered invalid.
release
in interface ServiceMonitor
java.lang.RuntimeException
- Thrown if an error occurs
during deallocation.public void release(NetworkInterface iface)
This method is the called whenever an interface is being removed from the scheduler. For example, if a service is determined as being no longer supported then this method will be invoked to cleanup any information associated with this device. This gives the implementor of the interface the ability to serialize any data prior to the interface being discarded.
If an exception is thrown during the release the exception will be logged, but the interface will still be discarded for garbage collection.
release
in interface ServiceMonitor
iface
- The network interface that was being monitored.
java.lang.RuntimeException
- Thrown if an unrecoverable error
occurs that prevents the interface from being monitored.
|
OpenNMS API 1.1.4 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |