Welcome to Questions - Ask OpenNMS, where you can ask questions and receive answers from other members of the community.

What's the correct event to fulfill my requirements?

+2 votes
572 views

I'm using  provisiond. I have some nodes like this:

 <node building="TK-038" foreign-id="1389873870543" node-label="tk-at-graz">
        <interface descr="" ip-addr="8.8.8.8" status="1" snmp-primary="P">
            <monitored-service service-name="ICMP"/>
        </interface>
        <category name="TK-AT"/>
    </node>
 
Now I need a notification which contains nodes ip address if this node isn't reachable (icmp down). %interface% doesn't work with NodeDown event. I've tried NodeLostService and InterfaceDown. With NodeLostService I didn't get a notification at all.
What's the correct way?
 
OpenNMS version
asked Jan 27, 2014 by mfuhrmann (7,350 points)

1 Answer

+2 votes
 
Best answer

Hi,

you need an event-translator because in the NodeDown event there is no "interface" specified. I had the same issue few weeks ago and from what I understood you need to enrich your notification by triggering another events (via event-translator) which piggyback the information you want: in this case the %interface%. This information are stored on the postgres db so you have to query it and add the info on a new event.

If it's allowed I link you to one of my post since everything it's already explained: 

http://www.alessandrorosa.com/event-translator-enrich-opennms-notifications/

Basically you  need to:

  • add the event translator on the /etc/opennms/translator-configuration.xml
  • create the new event on the /etc/opennms/events/Translator.defaults.events.xml
  • add the notification once this new event is triggered
  • Optionally (autoacknowledge it once the NodeUp event comes up)

Tips: Ronny suggested me to avoid to use the categoryid for checking but a "categoryname" variable: in this case if you erase the db you won't have any issues until you don't change the category name. 

answered Jan 28, 2014 by Alessandro (1,120 points)
selected Jan 29, 2014 by mfuhrmann
Thanks! At the moment I have just 10 affected nodes. Maybe it's easier to write down the IPs in asset fields for using them in notifications. But this amount of 10 will grow this year. Therefore a static solution (using asset fields) isn't very useful.
...