From OpenNMS
Contents |
The Snmp Poller in 1.9 and later
From 1.9.90 release the Snmp Poller uses Provisioning Policy to poll an interface.
To snmp poll an snmp interface you have to set up a policy for the provisiong group of the node to be 'snmp' polled, editing the foreign source and adding a policy selecting MatchSnmpInterfacePolicy and as action ENABLE_POLLING. All the interfaces that match that policy will be snmp polled by the snmp poller.
By default the nmsp poller will poll every 5 minutes every interface that is marked POLL.
It is possible to overwrite the default polling rule configuring as in the previuos versions a package/interface in snmp-interface-poller-configuration.xml.
The Snmp Poller Concepts
This Service let you poll the nodes to get Administration and Operational Status for their interfaces.
The service execs at a given time interval an Snmp GET request for two specific entries in interface.IfTable.ifEntry using as instance the IfIndex of the interfaces.
Here are the two specific entries of the Mib2 Interface IfTable polled by the service:
- 1.3.6.1.2.1.2.2.1.7 - ifAdminStatus
ifAdminStatus OBJECT-TYPE
SYNTAX INTEGER {
up(1),
down(2),
testing(3)
}
ACCESS read-write
STATUS mandatory
DESCRIPTION
"The desired state of the interface. The
testing(3) state indicates that no operational
packets can be passed."
::= { ifEntry 7 }
- 1.3.6.1.2.1.2.2.1.8 - ifOperStatus
ifOperStatus OBJECT-TYPE
SYNTAX INTEGER {
up(1),
down(2),
testing(3)
}
ACCESS read-only
STATUS mandatory
DESCRIPTION
"The current operational state of the interface.
The testing(3) state indicates that no operational
packets can be passed."
::= { ifEntry 8 }
- Action performed during each poll
The first action is: Snmp get (Using a single SNMP GET request) all the Operational and Administration Status of the specified interfaces. The second action is to get the results and for the first poll on a node do the following:
1) send an event for each interface that was found down (both Operational and Administration - see also "suppressAdminDownEvent flag" below) . 2) The Operational and Administration status of the interfaces are persisted into the database
For the following polls the service keeps the Operational and Administration status of the interfaces polled so that: 1) events are sent only when a status change occurs 2) The data is persisted to the database only when a status change occurs
The Snmp poller Service uses four events to show the Operational and Administration status of the Snmp Interface:
- Event for Operational Status Up
<uei>uei.opennms.org/nodes/snmp/interfaceOperUp</uei> <logmsg dest='logndisplay'>Operational status Up: interface: ifname=%parm[snmpifname]% ifindex=%parm[snmpifindex]% ifdescr=%parm[snmpifdescr]%</logmsg> <severity>Normal</severity>
- Event for Administration Status Up
<uei>uei.opennms.org/nodes/snmp/interfaceAdminUp</uei> <logmsg dest='logndisplay'>Administration status Up: interface: ifname=%parm[snmpifname]% ifindex=%parm[snmpifindex]% ifdescr=%parm[snmpifdescr]% </logmsg> <severity>Normal</severity>
- Event for Operational Status Down
<uei>uei.opennms.org/nodes/snmp/interfaceOperDown</uei> <event-label>OpenNMS-defined node event: snmp interface Oper Status Down</event-label> <logmsg dest='logndisplay'>Operational status Down: interface: ifname=%parm[snmpifname]% ifindex=%parm[snmpifindex]% ifdescr=%parm[snmpifdescr]%</logmsg> <severity>Minor</severity>
- Event for Administration Status Down
<uei>uei.opennms.org/nodes/snmp/interfaceAdminDown</uei> <logmsg dest='logndisplay'>Administration status Down: interface: ifname=%parm[snmpifname]% ifindex=%parm[snmpifindex]% ifdescr=%parm[snmpifdescr]%</logmsg> <severity>Minor</severity>
The service configuration will let you select the interfaces that you want to poll in the configuration file.
The Snmp Poller Configuration File
The configuration file is snmp-interface-poller-configuration.xml.
Here follows a standard configuration file:
<snmp-interface-poller-configuration threads="30" service="SNMP" suppressAdminDownEvent="false">
<node-outage>
<critical-service name="ICMP" />
<critical-service name="SNMP" />
</node-outage>
<package name="example1">
<filter>IPADDR != '0.0.0.0'</filter>
<include-range begin="1.1.1.1" end="254.254.254.254" />
<interface name="Ethernet" criteria="snmpiftype = 6" interval="300000" user-defined="false" status="on"/>
</package>
<!-- package name="overwritesnmpvalues">
<filter>IPADDR != '0.0.0.0'</filter>
<include-range begin="1.1.1.1" end="254.254.254.254" />
<interface name="Ethernet" criteria="snmpiftype = 6" interval="300000" user-defined="false" status="on"
port="161" timeout="1000" retry="1" max-vars-per-pdu="10 max-interface-per-pdu="5"
/>
</package-->
</snmp-interface-poller-configuration>
- Configuration meanings and explanations
- snmp-interface-poller-configuration
- Top-level element for the snmp-interface-poller-configuration.xml configuration file.
- threads
- The maximum number of threads used for snmp polling.
- service
- The SNMP service string usually 'SNMP'.
- suppressAdminDownEvent
- (true/false default false) Flag which indicates to suppress sending event for an interface whose Administration Status is Down event at startUp.
- node-outage
- Top Element for node-outage functionality. Because the SnmpPoller depends by other services this elements holds all the critical service needed to run an Snmp Poll. If one of the listed criticl services is down no snmp poll id done.
- Critical service
- A Critical service. Defining a critical service greatly reduces the traffic generated by the snmp poller when a service is DOWN. The snmp poller stop polling if one of the critical service is down on the SNMP primary node interface.
- package
- Package encapsulating addresses, services to be polled for these addresses, etc.. This is the default package definition into opennms:A rule which addresses belonging to this package must pass. This package is applied only to addresses that pass this filter.
- interface
- An element to select the Interfaces to be polled for addresses belonging to the package
The interface element is use to select the ifindex to be polled as to specify some details of the snmp get request. Within an Interface here are the attributes definition:
- criteria
- (type="string") This represents the SQL criteria that is performed to select interfaces to be polled. For example: (snmpifname like '%eth%' and snmpiftype=6)
- name
- (type="string") The name of the Interface element
- interval
- (type="long") The Interval at which the interfaces are to be polled
- user-defined
- (true|false) Specifies if the service is user defined. Used specifically for UI purposes.
- status
- " (default on) Status of the interfaces. The interfaces are polled only if this is set to 'on'.
In interface element It is possible to overwrite SNMP standard values using the following attributes:
- port
- If set, overrides UDP port 161 as the port where SNMP GET requests are sent.
- retry
- Default number of retries
- timeout
- Default timeout (in milliseconds)
- max-vars-per-pdu
- Number of variables to send per SNMP request.
- max-interface-per-pdu
- Max Number of Interface that is introduced in Snmp GET requestper runnable.
- To Reload Configuration file
Send an event: send-event.pl uei.opennms.org/internal/reloadSnmpPollerConfig
Enable Snmp Poller
Snmp Poller is disabled by default in 1.7.x. To enable Snmp Poller you need to uncomment the following lines in service-configuration.xml
<!-- service>
<name>OpenNMS:Name=SnmpPoller</name>
<class-name>org.opennms.netmgt.snmpinterfacepoller.jmx.SnmpPollerd</class-name>
<invoke at="start" pass="0" method="init"/>
<invoke at="start" pass="1" method="start"/>
<invoke at="status" pass="0" method="status"/>
<invoke at="stop" pass="0" method="stop"/>
</service-->






