I want to trigger a python script whenever I’ll get the event “A new node Added” / “uei.opennms.org/nodes/nodeAdded”. What configuration i need to do to achieve this.
I think you need to create a custom command notification, and then set that event to trigger that notification.
I’m bit confuse with “Custom command notification”, does it mean I need to create and configure a notification in opennms Admin page. (Home/Admin/Configure Notifications)
Yes, though instead of sending it to email, you need a custom Destination Path that targets a custom command notification to run your script.
I do something similar to trigger a webhook to send notices to a MS Teams channel.
For reference, documentation on using
notificationCommands.xml is currently at NotificationCommands - OpenNMS
You could also set an autoaction on the event.
<autoaction>/path/to/some/script.py</autoaction> to the event configuration.
<autoaction /> doesn’t appear in the docs.
You are correct I know something existed somewhere in the Wiki at some point.
Can’t we do this from “opennms.pollered.events.xml” file?
Suppose for the new node we want to execute a script, whenever the new node will create that time we will get the uei: “uei.opennms.org/nodes/nodeAdded” and based on this uei we will trigger a script.
It was in the wiki, and I’ve pinged the appropriate people to check on this.
Did you fixed? Do you know how to send %interface% and %ifName% to the script?