Configuring Alarm Notification
By default, the alarms generated by managed devices in the Junos Space platform are sent to the network monitoring functionality. To enable alarm notification for supported Junos Space applications, you can configure alarm notification files for basic filtering to specify the alarm notifications that designated Junos Space applications should receive.
Configuring a Basic Filter for Alarm Notification
The following steps show how to configure a basic filter based on unique event identifier (UEI), severity, and device family. When the alarm criteria specified in the XML file are matched, the alarm XML is passed as an argument to the invoked script.
To configure a basic filter for alarm notification:
- Configure the destination for the notification in the
script, for example,
Sample_App_Script.sh
. The script specifies how the alarm notifications are sent to the application.curl -v -u super:juniper123 -X POST -H "Content-Type:application/xml" -d "$xml" "http://localhost:8080/SampleApplication/services/Alarms"
Note: In the preceding example, the curl command is used to post the script, but the configuration of the script can vary based on the requirements of the application.
You can access sample configuration scripts from the
/opt/opennms/etc/examples/alarm-notification/scripts
directory. However, all active scripts must be present in the/opt/opennms/etc/alarm-notification/scripts
directory. - In the
alarmNotificationConf.xml
configuration file:- Enable the alarm notification feature:
<notification name="SampleAppNotification" enable="true">
- Configure the number of seconds to wait for the script
to execute before timing out:
<script timeout_in_seconds=”45”>
Note: If you do not configure the timeout_in_seconds attribute, the default time out for the script invoked is 60 seconds. In this case, the shell exit status will be ’143’ and error handling will be considered in the same way as other error exit status. If the script continues to execute after the timeout value for the script, alarm notification will not wait for the script status. During this time, processing of other alarms will not be blocked.
- Specify the name of the script that will be invoked:
<scriptname>Sample_App_Script.sh</scriptname>
The configured script must be present in the
/opt/opennms/etc/alarm-notification/scripts
directory. - Enable error handling, and configure the number of notification
retry attempts and interval (in seconds) between retry attempts, if
the initial attempt to send the notification fails:
<errorhandling enable="true">
<retry_interval_inseconds>3</retry_interval_inseconds>
<number_of_retries>2</number_of_retries>
</errorhandling>Note: The script exit status should be ’0’ if there are no errors. For other exit status values, the script will be invoked again if error handling is enabled.
- Configure the UEI of the alarms which will require notification:
<uies>
<uei name="uei.opennms.org/generic/traps/SNMP_Link_Down" notification_threshold=”5”
<filter devicefamily=”JSeries” severity=”Minor,Normal”/>
<filter devicefamily=”DevicesWithNoSysoid" severity=”Minor,Normal”/>
<uei/>
</uies>
- Enable the alarm notification feature:
Activating Alarm Notification Configuration Files for Basic Filtering
After configuring the alarm notification files for basic filtering, you must add the files to the Junos Space application to activate the alarm notification configuration:
- Log in from the Junos Space system console.
The Junos Space Appliance Settings menu displays.
- From the Junos Space Appliance Settings menu, enter 7 (or enter 8 from the Junos Space Virtual Appliance) to run the shell.
(Optional): To view the sample configuration files for alarm notification:
- Navigate to the /opt/opennms/etc/examples/alarm-notification directory to view sample files for
alarmNotificationConf.xml
,eventconf.xml
, andvacuumd-configuration.xml
. - Navigate to the /opt/opennms/etc/examples/alarm-notification/scripts directory to view the
CBU_App_Script.sh
andNA_App_Script.sh
sample scripts.
- Navigate to the /opt/opennms/etc/examples/alarm-notification directory to view sample files for
To activate configuration files for alarm notification, perform the following steps:
- Add your configured
alarmNotificationConf.xml
file to the /opt/opennms/etc/alarm-notification directory. - Add your configured
eventconf.xml
andvacuumd-configuration.xml
files to the /opt/opennms/etc directory. - Add your configured script file to the /opt/opennms/etc/alarm-notification/scripts directory.
- Add your configured
Reloading a Filter Configuration to Apply Filter Configuration Changes
After making any changes to a filter, you can reload the configuration by sending a “reloadDaemonConfig” event, for example:
You do not need to restart the server to apply the configuration
changes listed in previous steps. However, to send the event, go to /opt/opennms/bin ./send-event.pl -p 'daemonName Alarmd.AlarmNorthbounder'
uei.opennms.org/internal/reloadDaemonConfig
.
This event will reload the following files:
alarmNotficationConf.xml
devicefamily.properties
- Drool (
.drl
) files