From OpenNMS
Contents |
HOWTO: Monitoring Cisco environment using OpenNMS
If you using Cisco equipment it could be very helpful to know if the hardware and system health is fine. Cisco provides a special CISCO-ENVMON-MIB. You´ll find the necessary MIBS on CISCO-ENVMON-MIB on Byte Spheres oidview
Prerequisites
Your OpenNMS is up and running. You have configured SNMP-Agents on your Cisco equipment and OpenNMS can access correctly. This configuration uses the feature to detecting and monitoring SNMP-Tables. Detecting SNMP tables with capsd is since OpenNMS 1.6.7 possible and monitoring SNMP tables with pollerd is possible since 1.6.3. If you have OpenNMS lower 1.6.7 you can assign the service instead of capsd with provisioning or a LoopPlugin.
This monitor supports the following SNMP OIDS from CISCO-ENVMON-MIB:
ciscoEnvMonVoltageState .1.3.6.1.4.1.9.9.13.1.2.1.7 ciscoEnvMonTemperatureState .1.3.6.1.4.1.9.9.13.1.3.1.6 ciscoEnvMonFanState .1.3.6.1.4.1.9.9.13.1.4.1.3 ciscoEnvMonSupplyState .1.3.6.1.4.1.9.9.13.1.5.1.3
Detecting with capsd
First of all you need a new service in your capsd-configuration. We use the generic SNMP-Monitor which comes with OpenNMS. For detecting the tables, We test a "normal" state.
$OPENNMS_HOME/etc/capsd-configuration.xml
<!-- Cisco environment monitoring -->
<protocol-plugin protocol="Cisco-Voltage-Monitor" class-name="org.opennms.netmgt.capsd.plugins.SnmpPlugin" scan="on">
<property key="vbname" value=".1.3.6.1.4.1.9.9.13.1.2.1.7" />
<property key="table" value="true" />
<property key="vbvalue" value="1" />
<property key="timeout" value="1000" />
<property key="retry" value="1" />
</protocol-plugin>
<protocol-plugin protocol="Cisco-Temperature-Monitor" class-name="org.opennms.netmgt.capsd.plugins.SnmpPlugin" scan="on">
<property key="vbname" value=".1.3.6.1.4.1.9.9.13.1.3.1.6" />
<property key="table" value="true" />
<property key="vbvalue" value="1" />
<property key="timeout" value="1000" />
<property key="retry" value="1" />
</protocol-plugin>
<protocol-plugin protocol="Cisco-Fan-Monitor" class-name="org.opennms.netmgt.capsd.plugins.SnmpPlugin" scan="on">
<property key="vbname" value=".1.3.6.1.4.1.9.9.13.1.4.1.3" />
<property key="table" value="true" />
<property key="vbvalue" value="1" />
<property key="timeout" value="1000" />
<property key="retry" value="1" />
</protocol-plugin>
<protocol-plugin protocol="Cisco-PowerSupply-Monitor" class-name="org.opennms.netmgt.capsd.plugins.SnmpPlugin" scan="on">
<property key="vbname" value=".1.3.6.1.4.1.9.9.13.1.5.1.3" />
<property key="table" value="true" />
<property key="vbvalue" value="1" />
<property key="timeout" value="1000" />
<property key="retry" value="1" />
</protocol-plugin>
Monitoring all this services
After this you need to create a monitor in your polling-configuration. We monitor the state normal. The following states are possible:
ciscoEnvMonVoltageState
- normal(1) - UP
- warning(2)
- critical(3)
- shutdown(4)
- notPresent(5)
- notFunctioning(6)
ciscoEnvMonTemperatureState
- normal(1) - UP
- warning(2)
- critical(3)
- shutdown(4)
- notPresent(5)
- notFunctioning(6)
ciscoEnvMonFanState
- normal(1) - UP
- warning(2)
- critical(3)
- shutdown(4)
- notPresent(5)
- notFunctioning(6)
ciscoEnvMonSupplyState
- normal(1) - UP
- warning(2)
- critical(3)
- shutdown(4)
- notPresent(5)
- notFunctioning(6)
$OPENNMS_HOME/etc/poller-configuration.xml
<!-- Cisco environment monitoring -->
<service name="Cisco-Voltage-Monitor" interval="300000" user-defined="false" status="on">
<parameter key="retry" value="3" />
<parameter key="timeout" value="3000" />
<parameter key="port" value="161" />
<parameter key="oid" value=".1.3.6.1.4.1.9.9.13.1.2.1.7" />
<parameter key="walk" value="true" />
<parameter key="operator" value="=" />
<parameter key="operand" value="1" />
<parameter key="match-all" value="true" />
<parameter key="reason-template" value="A problem with Cisco voltage detected. \
The state should be normal(${operand}) but actual value is ${observedValue}. \
Syntax: normal(1), warning(2), critical(3), shutdown(4), notPresent(5), notFunctioning(6)" />
</service>
<service name="Cisco-Temperature-Monitor" interval="300000" user-defined="false" status="on">
<parameter key="retry" value="3" />
<parameter key="timeout" value="3000" />
<parameter key="port" value="161" />
<parameter key="oid" value=".1.3.6.1.4.1.9.9.13.1.3.1.6" />
<parameter key="walk" value="true" />
<parameter key="operator" value="=" />
<parameter key="operand" value="1" />
<parameter key="match-all" value="true" />
<parameter key="reason-template" value="A problem with Cisco temperature detected. \
The state should be normal(${operand}) but actual value is ${observedValue}. \
Syntax: normal(1), warning(2), critical(3), shutdown(4), notPresent(5), notFunctioning(6)" />
</service>
<service name="Cisco-Fan-Monitor" interval="300000" user-defined="false" status="on">
<parameter key="retry" value="3" />
<parameter key="timeout" value="3000" />
<parameter key="port" value="161" />
<parameter key="oid" value=".1.3.6.1.4.1.9.9.13.1.4.1.3" />
<parameter key="walk" value="true" />
<parameter key="operator" value="=" />
<parameter key="operand" value="1" />
<parameter key="match-all" value="true" />
<parameter key="reason-template" value="A problem with Cisco fans detected. \
The state should be normal(${operand}) but actual value is ${observedValue}. \
Syntax: normal(1), warning(2), critical(3), shutdown(4), notPresent(5), notFunctioning(6)" />
</service>
<service name="Cisco-PowerSupply-Monitor" interval="300000" user-defined="false" status="on">
<parameter key="retry" value="3" />
<parameter key="timeout" value="3000" />
<parameter key="port" value="161" />
<parameter key="oid" value=".1.3.6.1.4.1.9.9.13.1.5.1.3" />
<parameter key="walk" value="true" />
<parameter key="operator" value="=" />
<parameter key="operand" value="1" />
<parameter key="match-all" value="true" />
<parameter key="reason-template" value="A problem with Cisco power supplies detected. \
The state should be normal(${operand}) but actual value is ${observedValue}. \
Syntax: normal(1), warning(2), critical(3), shutdown(4), notPresent(5), notFunctioning(6)" />
</service>
Hint: For better reading the "reason-template" has a manual line break "\". Add this parameter as one-liner.
Do not forget to activate the monitor at the of the file.
<monitor service="Cisco-Voltage-Monitor" class-name="org.opennms.netmgt.poller.monitors.SnmpMonitor"/> <monitor service="Cisco-Temperature-Monitor" class-name="org.opennms.netmgt.poller.monitors.SnmpMonitor"/> <monitor service="Cisco-Fan-Monitor" class-name="org.opennms.netmgt.poller.monitors.SnmpMonitor"/> <monitor service="Cisco-PowerSupply-Monitor" class-name="org.opennms.netmgt.poller.monitors.SnmpMonitor"/>
Cisco IOS issues
On old Cisco IOS a not existing power supply will not be listed in the SNMP table. On advanced security IOS like the following
Cisco IOS Software, 2800 Software (C2800NM-ADVSECURITYK9-M), Version 12.4(17a), RELEASE SOFTWARE (fc2)..Technicall Support: http://www.cisco.com/techsupport. Copyright (c) 1986-2007 by Cisco Systems, Inc...Compiled Wed 07-Nov-07 13:17 by prod_rel_team
the not existing power supplies are listed as value notPresent(5). So the monitor is up with the status normal(1) and notPresent(5). You can use a regular expression for this case and should look like this:
<parameter key="operator" value="~"/> <parameter key="operand" value="[1,5]"/> <parameter key="match-all" value="true"/>
--_indigo 10:12, 24 September 2010 (EDT)






