OpenNMS API 1.2.9

## org.opennms.netmgt.threshd
Class SnmpThresholder

    java.lang.Object
      org.opennms.netmgt.threshd.SnmpThresholder

All Implemented Interfaces:
  ServiceThresholder

final class SnmpThresholder
extends java.lang.Object
implements ServiceThresholder

The SnmpThresholder class ...

Author:
  Mike Davidson , OpenNMS

Field Summary
`(package private) static java.lang.String` `ALL_IF_THRESHOLD_MAP_KEY` We must maintain a map of interface level ThresholdEntity objects on a per interface basis in order to maintain separate exceeded counts and the like for each of a node's interfaces.
`(package private) static java.lang.String` `BASE_IF_THRESHOLD_MAP_KEY` Interface attribute key used to store a map of interface level ThresholdEntity objects keyed by datasource name.
`private static int` `DEFAULT_INTERVAL` Default thresholding interval (in milliseconds).
`private static int` `DEFAULT_RANGE` Default age before which a data point is considered "out of date"
`private java.lang.String` `m_host` Local host name
`(package private) static java.lang.String` `NODE_ID_KEY` Interface attribute key used to store the interface's node id
`(package private) static java.lang.String` `NODE_THRESHOLD_MAP_KEY` Interface attribute key used to store a map of node level ThresholdEntity objects keyed by datasource name.
`(package private) static java.lang.String` `RRD_REPOSITORY_KEY` Interface attribute key used to store the interface's node id
`private static java.lang.String` `SERVICE_NAME` Name of monitored service.
`private static java.lang.String` `SQL_GET_NODEID` SQL statement to retrieve interface's 'ipinterface' table information.

Fields inherited from interface org.opennms.netmgt.threshd.ServiceThresholder
`statusType, THRESHOLDING_FAILED, THRESHOLDING_SUCCEEDED, THRESHOLDING_UNKNOWN`

Constructor Summary
`(package private)` `SnmpThresholder()`

Method Summary
`int` `check(NetworkInterface iface, EventProxy eproxy, java.util.Map parameters)` Perform threshold checking.
`private void` `checkIfDir(java.io.File directory, java.lang.Integer nodeId, java.net.InetAddress primary, int interval, java.util.Date date, java.util.Map baseIfThresholdMap, java.util.Map allIfThresholdMap, Events events)` Performs threshold checking on an SNMP RRD interface directory.
`private void` `checkNodeDir(java.io.File directory, java.lang.Integer nodeId, java.net.InetAddress primary, int interval, int range, java.util.Date date, java.util.Map thresholdMap, Events events)` Performs threshold checking on an SNMP RRD node directory.
`private Event` `createEvent(java.lang.Integer nodeId, java.net.InetAddress primary, java.util.Map ifDataMap, double dsValue, Threshold threshold, java.lang.String uei, java.util.Date date, java.lang.String label)` Creates a new threshold event from the specified parms.
`void` `initialize(java.util.Map parameters)` Initialize the service thresholder.
`void` `initialize(NetworkInterface iface, java.util.Map parameters)` Responsible for performing all necessary initialization for the specified interface in preparation for thresholding.
`void` `release()` Responsible for freeing up any resources held by the thresholder.
`void` `release(NetworkInterface iface)` Responsible for releasing any resources associated with the specified interface.
`java.lang.String` `serviceName()` Returns the name of the service that the plug-in collects ("SNMP").

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### SQL_GET_NODEID

    private static final java.lang.String SQL_GET_NODEID

  SQL statement to retrieve interface's 'ipinterface' table information.

  See Also:
    Constant Field Values

### SERVICE_NAME

    private static final java.lang.String SERVICE_NAME

  Name of monitored service.

  See Also:
    Constant Field Values

### DEFAULT_INTERVAL

    private static final int DEFAULT_INTERVAL

  Default thresholding interval (in milliseconds).

  See Also:
    Constant Field Values

### DEFAULT_RANGE

    private static final int DEFAULT_RANGE

  Default age before which a data point is considered "out of date"

  See Also:
    Constant Field Values

### NODE_ID_KEY

    static final java.lang.String NODE_ID_KEY

  Interface attribute key used to store the interface's node id

  See Also:
    Constant Field Values

### RRD_REPOSITORY_KEY

    static final java.lang.String RRD_REPOSITORY_KEY

  Interface attribute key used to store the interface's node id

  See Also:
    Constant Field Values

### NODE_THRESHOLD_MAP_KEY

    static final java.lang.String NODE_THRESHOLD_MAP_KEY

  Interface attribute key used to store a map of node level ThresholdEntity objects keyed by datasource name.

  See Also:
    Constant Field Values

### BASE_IF_THRESHOLD_MAP_KEY

    static final java.lang.String BASE_IF_THRESHOLD_MAP_KEY

  Interface attribute key used to store a map of interface level ThresholdEntity objects keyed by datasource name.

  See Also:
    Constant Field Values

### ALL_IF_THRESHOLD_MAP_KEY

    static final java.lang.String ALL_IF_THRESHOLD_MAP_KEY

  We must maintain a map of interface level ThresholdEntity objects on a per interface basis in order to maintain separate exceeded counts and the like for each of a node's interfaces. This interface attribute key used to store a map of interface level ThresholdEntity object maps keyed by ifLabel. So it wil refer to a map of maps indexed by ifLabel.

  See Also:
    Constant Field Values

### m_host

    private java.lang.String m_host

  Local host name

Constructor Detail

### SnmpThresholder

    SnmpThresholder()

Method Detail

### serviceName

    public java.lang.String serviceName()

  Returns the name of the service that the plug-in collects ("SNMP").

  Returns:
    The service that the plug-in collects.

### initialize

    public void initialize(java.util.Map parameters)

  Initialize the service thresholder.

  Specified by:
    `initialize` in interface `ServiceThresholder`
  Parameters:
    `parameters` - Not currently used.
  Throws:
    `java.lang.RuntimeException` - Thrown if an unrecoverable error occurs that prevents the plug-in from functioning.

### release

    public void release()

  Responsible for freeing up any resources held by the thresholder.

  Specified by:
    `release` in interface `ServiceThresholder`

### initialize

    public void initialize(NetworkInterface iface,
                           java.util.Map parameters)

  Responsible for performing all necessary initialization for the specified interface in preparation for thresholding.

  Specified by:
    `initialize` in interface `ServiceThresholder`
  Parameters:
    `iface` - Network interface to be prepped for thresholding.
    `parameters` - Key/value pairs associated with the package to which the interface belongs..

### release

    public void release(NetworkInterface iface)

  Responsible for releasing any resources associated with the specified interface.

  Specified by:
    `release` in interface `ServiceThresholder`
  Parameters:
    `iface` - Network interface to be released.

### check

    public int check(NetworkInterface iface,
                     EventProxy eproxy,
                     java.util.Map parameters)

  Perform threshold checking.

  Specified by:
    `check` in interface `ServiceThresholder`
  Parameters:
    `iface` - Network interface to be data collected.
    `eproxy` - Eventy proxy for sending events.
    `parameters` - Key/value pairs from the package to which the interface belongs.

### checkNodeDir

    private void checkNodeDir(java.io.File directory,
                              java.lang.Integer nodeId,
                              java.net.InetAddress primary,
                              int interval,
                              int range,
                              java.util.Date date,
                              java.util.Map thresholdMap,
                              Events events)
                       throws java.lang.IllegalArgumentException

  Performs threshold checking on an SNMP RRD node directory.

  Parameters:
    `directory` - RRD repository directory
    `nodeId` - Node identifier
    `primary` - Primary SNMP interface address
    `interval` - Configured thresholding interval
    `date` - Source for timestamp to be used for all generated events
    `thresholdMap` - Map of node level ThresholdEntity objects keyed by datasource name.
    `events` - Castor events object containing any events to be generated as a result of threshold checking.
  Throws:
    `java.lang.IllegalArgumentException` - if path parameter is not a directory.

### checkIfDir

    private void checkIfDir(java.io.File directory,
                            java.lang.Integer nodeId,
                            java.net.InetAddress primary,
                            int interval,
                            java.util.Date date,
                            java.util.Map baseIfThresholdMap,
                            java.util.Map allIfThresholdMap,
                            Events events)
                     throws java.lang.IllegalArgumentException

  Performs threshold checking on an SNMP RRD interface directory.

  Parameters:
    `directory` - RRD repository directory
    `nodeId` - Node identifier
    `primary` - Primary SNMP interface address
    `interval` - Configured thresholding interval
    `date` - Source for timestamp to be used for all generated events
    `baseIfThresholdMap` - Map of configured interface level ThresholdEntity objects keyed by datasource name.
    `allIfThresholdMap` - Map of threshold maps indexed by ifLabel
    `events` - Castor events object containing any events to be generated as a result of threshold checking.
  Throws:
    `java.lang.IllegalArgumentException` - if path parameter is not a directory.

### createEvent

    private Event createEvent(java.lang.Integer nodeId,
                              java.net.InetAddress primary,
                              java.util.Map ifDataMap,
                              double dsValue,
                              Threshold threshold,
                              java.lang.String uei,
                              java.util.Date date,
                              java.lang.String label)

  Creates a new threshold event from the specified parms.

  Parameters:
    `nodeId` - node identifier of the affected node
    `primary` - IP address of the affected primary SNMP interface
    `ifDataMap` - Map of this node's interface information
    `dsValue` - Data source value which triggered the threshold event
    `threshold` - Configured threshold
    `uei` - Event identifier
    `date` - source of event's timestamp
  Returns:
    new threshold event to be sent to Eventd

OpenNMS API 1.2.9

Generated by ranger on May 19 2007 2335.