Receiving Nagios alarms with OSE

1. General functionality
2. Installation to be performed on the Nagios server

2.1 Required Components

2.2 Installation of ose-nagios-to-opennms

2.3 Configuring Nagios

3. Configuring OSE
4. OpenNMS receiving an alarm from Nagios

4.1 Event view

4.2 Alarm view

5. OpenNMS receiving the "up" alarm

5.1 Event view

5.2 Alarm view

6. Up-down correlation

 


1. General functionality

 

When a service monitored change in state, a notification is sent by Nagios. It will execute the ose_nagios_to_opennms.pl script in order to send a SNMP trap to the OpenNMS server.

 

Once the trap is received, OpenNMS will translate it into an external event associated with the Nagios server. Next comes the role of the Event Translator to generate a new event and alarm associated with the actually monitored node. That's why the names of the monitored nodes must be the same in Nagios and in OpenNMS.

 


 

2. Installation to be performed on the Nagios server

2.1 Required Components

  • Nagios 3.x (available in version 2.x of FAN downloadable here)
  • Net-SNMP utils (snmptrap) installed on the Nagios server
  • The perl module Log::Log4perl

 

2.2 Installation of ose-nagios-to-opennms

  • Download the archive ose-nagios-to-opennms-x.x-tar.bz2 on the Download page
  • Extract the archive to a temporary directory system (/tmp for example)
  • Run the install script install as follows:

 

 

The user has to configure:

  • The Nagios plugins directory
  • The user group of Nagios user
  • The directory of system MIBs

 

2.3 Configuring Nagios

Define the following command in the configuration of Nagios:

 

define command {
send_service_trap_to_opennms
$USER1$/ose-nagios-to-opennms.pl SERVICE <IP address of OpenNMS server> "$HOSTNAME$" "$SERVICEDESC$" "$SERVICEGROUPNAME$" "$SERVICESTATE$" $SERVICESTATEID$ $LASTSERVICESTATEID$ "$SERVICEOUTPUT$" $LASTSERVICECHECK$ "$SERVICELATENCY$" "$SERVICEEXECUTIONTIME$" $LASTSERVICESTATECHANGE$ "$SERVICEDURATION$" "$SERVICEPERCENTCHANGE$" "SERVICENOTIFICATIONTYPE"
}

 

Create a new user or use an existing Nagios user and change the configuration in order to contain the elements below:

 

service_notifications_enabled 1
service_notification_period 24x7
service_notification_options w,u,c,r
service_notification_commands send_service_trap_to_opennms

 

If you want a notification sent by service, change the service configuration you want with this content:

 

notification_interval 5
notification_period 24x7
notifications_enabled 1
contacts <user created or changed in the previous step>
notification_options w,u,c,r

 

Adjust the portion <user created or changed in the previous step> to your environment.

 

Restart the Nagios service to take into account the changes.

 


 

3. Configuring OSE

Next you must configure OpenNMS in order to discover the nodes monitored by Nagios (Admin=>Discovery).

 

Be carefull : The nodes monitored in Nagios and those discovered in OpenNMS must have the same names!!!

 


 

4. OpenNMS receiving an alarm from Nagios

4.1 Event view

 

Two events appear -- one external associated with the Nagios host and the other internal associated with the monitored host.

 

4.2 Alarm view

 


 

5. OpenNMS receiving the "up" alarm

5.1 Event view

 

5.2 Event view

 


 

6. Up-down correlation

Contact

OSE (OpenNMS Sans Effort) is an Open Source distribution built and maintained by Samuel Mutel, monitoring engineer since 2005.

E-mail:

smutel@monitoring-fr.org
html templates website templates