0% found this document useful (0 votes)
89 views15 pages

Module 10 - Passive Status Keeper

Opennms Network Monitoring official manual
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
89 views15 pages

Module 10 - Passive Status Keeper

Opennms Network Monitoring official manual
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

OpenNMS 101

Tarus Balog
[email protected]
http://www.opennms.org/Training
© 2017 The OpenNMS Group, Inc.
Module 10: Passive Status Keeper (PSK)

© 2017 The OpenNMS Group, Inc.


Passive Status Keeper (PSK)

● The Passive Status Keeper (PSK) lets you


monitor “passive” services
● Status is kept in a table in memory that stores

the status of the service:


Node – Interface – Service - Status
● The poller then checks that table for changes

and then treats it like an “active” service


● Status is changed via events

© 2017 The OpenNMS Group, Inc.


Event Translator is Key

● The Event Translator takes one event and


converts it to another.
● The event can be changed entirely or just

enriched.
● The UEI must change to avoid loops.

● For the PSK, events are turned into Passive

Service Status events.

© 2017 The OpenNMS Group, Inc.


Enriched linkDown Event
<translation>
<event-translation-spec uei="uei.opennms.org/generic/traps/SNMP_Link_Down">
<mappings>
<mapping>
<assignment name="uei" type="field" >
<value type="constant" result="uei.opennms.org/translator/traps/SNMP_Link_Down" />
</assignment>
<assignment name="ifDescr" type="parameter">
<value type="sql" result="SELECT snmp.snmpIfDescr
FROM snmpInterface snmp WHERE snmp.nodeid = ?::integer
AND snmp.snmpifindex = ?::integer" >
<value type="field" name="nodeid" matches=".*" result="${0}" />
<value type="parameter" name="~^\.1\.3\.6\.1\.2\.1\.2\.2\.1\.1\.([0-9]*)$" matches=".*" result="${0}" />
</value>
</assignment>
<assignment name="ifName" type="parameter">
<value type="sql" result="SELECT snmp.snmpIfName
FROM snmpInterface snmp WHERE snmp.nodeid = ?::integer
AND snmp.snmpifindex = ?::integer" >
<value type="field" name="nodeid" matches=".*" result="${0}" />
<value type="parameter" name="~^\.1\.3\.6\.1\.2\.1\.2\.2\.1\.1\.([0-9]*)$" matches=".*" result="${0}" />
</value>
</assignment>
© 2017 The OpenNMS Group, Inc.
Exercise #10: Add Class-Mood PSK
● “Ad hoc” add Class-Mood to 127.0.0.1
● Synchronize the requisition


Note monitoring status
● Add a monitor to the existing Class polling package

● Update the Event Translator


Restart OpenNMS
● Cause an outage

● Restore the outage

© 2017 The OpenNMS Group, Inc.


Add the Class-Mood Service
● Navigate to Configure → Manage Provisioning Requisitions
● Edit the Class Requisition
● Edit the localhost node

Edit the 127.0.0.1 interface

Save, Return
and Synchronize

© 2017 The OpenNMS Group, Inc.


The Class-Mood Service is Added

© 2017 The OpenNMS Group, Inc.


Create a Monitor Service

It’s one line, no parameters:


<service name="Class-Mood" interval="30000" user-defined="true" status="on" />

Remember to add the “monitor” to the bottom:


<monitor service="Class-Mood" class-name="org.opennms.netmgt.poller.monitors.PassiveServiceMonitor" />

© 2017 The OpenNMS Group, Inc.


Create the “down” Status Event
<event-translation-spec uei="uei.opennms.org/class/moody">
<mappings>
<mapping>
<!-- Create a parameter -->
<assignment type="parameter" name="passiveNodeLabel">
<value type="constant" result="localhost" />
</assignment>
<!-- Create a parameter -->
<assignment type="parameter" name="passiveIpAddr">
<value type="constant" result="127.0.0.1" />
</assignment>
<!-- Create a parameter -->
<assignment type="parameter" name="passiveServiceName">
<value type="constant" result="Class-Mood" />
</assignment>
<!-- Create a parameter -->
<assignment type="parameter" name="passiveStatus" >
<value type="constant" result="Down" />
</assignment>
<!-- Set the Reason -->
<assignment type="parameter" name="passiveReasonCode" >
<value type="parameter" name="~^\.1\.3\.6\.1\.4\.1\.99999\.3\.1$" matches=".*" result="${0}" />
</assignment>
<!-- Change the UEI to be a passive status event-->
<assignment type="field" name="uei">
<value type="constant" result="uei.opennms.org/services/passiveServiceStatus" />
</assignment>
</mapping>
</mappings>
</event-translation-spec>
© 2017 The OpenNMS Group, Inc.
Create the “up” Status Event
<event-translation-spec uei="uei.opennms.org/class/joyful">
<mappings>
<mapping>
<!-- Create a parameter -->
<assignment type="parameter" name="passiveNodeLabel">
<value type="constant" result="localhost" />
</assignment>
<!-- Create a parameter -->
<assignment type="parameter" name="passiveIpAddr">
<value type="constant" result="127.0.0.1" />
</assignment>
<!-- Create a parameter -->
<assignment type="parameter" name="passiveServiceName">
<value type="constant" result="Class-Mood" />
</assignment>
<!-- Create a parameter -->
<assignment type="parameter" name="passiveStatus" >
<value type="constant" result="Up" />
</assignment>
<!-- Change the UEI to be a passive status event-->
<assignment type="field" name="uei">
<value type="constant" result="uei.opennms.org/services/passiveServiceStatus" />
</assignment>
</mapping>
</mappings>
</event-translation-spec>
© 2017 The OpenNMS Group, Inc.
Update Configuration Files

● cd /opt/opennms/etc

● Run
wget -N https://www.opennms.org/Class/Config/Exercise%2010/poller-configuration.xml
wget -N https://www.opennms.org/Class/Config/Exercise%2010/translator-configuration.xml

© 2017 The OpenNMS Group, Inc.


Restart and See the Service
# systemctl restart opennms

© 2017 The OpenNMS Group, Inc.


Create an Outage
# snmptrap -v 1 -c public 127.0.0.1 .1.3.6.1.4.1.99999.2 \
localhost 6 1 ' ' .1.3.6.1.4.1.99999.3.1 s 'They be bored'

© 2017 The OpenNMS Group, Inc.


Resolve the Outage
# snmptrap -v 1 -c public 127.0.0.1 .1.3.6.1.4.1.99999.2 \
localhost 6 2 ' ' .1.3.6.1.4.1.99999.3.1 s 'They have Pizza!'

© 2017 The OpenNMS Group, Inc.

You might also like