SNMP Trap Notifications

About

OP5 Monitor is shipped with the possibility to send notifications as SNMP traps. To start use the SNMP notifications you need to

  • Add a few new commands.
  • Configure the contacts.

Adding SNMP notification commands

Add two commands one for host notifications and one for service notifications.

To add a SNMP notification command:

  1. Login to the OP5 Monitor user interface and go to Configure.
  2. Click Commands.
  3. Add the following new commands with the following settings:
  4. command_name host_notify_by_snmp command_line $USER3$/notify/notify_by_snmp.pl -h snmp.trap.host -C 
    SNMPCOMMUNITY -t nHostNotify "NOTIFICATIONTYPE=$NOTIFICATIONTYPE$" 
    "NOTIFICATIONNUMBER=$NOTIFICATIONNUMBER$" "HOSTACKAUTHOR=$HOSTACKAUTHOR$"
    "HOSTACKCOMMENT=$HOSTACKCOMMENT$" "HOSTNAME=$HOSTNAME$" "HOSTSTATEID=$HOSTSTATEID$" 
    "HOSTSTATETYPE=$HOSTSTATETYPE$" "HOSTATTEMPT=$HOSTATTEMPT$" 
    "HOSTDURATIONSEC=$HOSTDURATIONSEC$" "HOSTGROUPNAME=$HOSTGROUPNAME$" 
    "LASTHOSTCHECK=$LASTHOSTCHECK$" "LASTHOSTSTATECHANGE=$LASTHOSTSTATECHANGE$"
    "HOSTOUTPUT=$HOSTOUTPUT$"
    
    command_name service_notify_by_snmp command_line $USER3$/notify/notify_by_snmp.pl -h snmp.trap.host -C 
    SNMPCOMMUNITY -t nSvcNotify "NOTIFICATIONTYPE=$NOTIFICATIONTYPE$"
    "NOTIFICATIONNUMBER=$NOTIFICATIONNUMBER$" "SERVICEACKAUTHOR=$SERVICEACKAUTHOR$"
    "SERVICEACKCOMMENT=$SERVICEACKCOMMENT$" "HOSTNAME=$HOSTNAME$"
    "HOSTSTATEID=$HOSTSTATEID$" "SERVICEDESCRIPTION=$SERVICEDESCRIPTION$"
    "SERVICESTATEID=$SERVICESTATEID$" "SERVICEATTEMPT=$SERVICEATTEMPT$"    
    "SERVICEDURATIONSEC=$SERVICEDURATIONSEC$" "SERVICEGROUPNAME=$SERVICEGROUPNAME$"
    "LASTSERVICECHECK=$LASTSERVICECHECK$" "LASTSERVICESTATECHANGE=$LASTSERVICESTATECHANGE$"
    "SERVICEOUTPUT=$SERVICEOUTPUT$"   
    
  5. Change the snmp.trap.host and SNMPCOMMUNITY into their correct values, in both commands.
  6. Click Apply.
  7. Click Save.

Configuring the contacts

To configure the contacts:

  1. Login to the OP5 Monitor user interface.
  2. Go to Configure.
  3. Either open up an existing contact or create a new one.
  4. Set host_notification_commands to host_notify_by_snmp.
  5. Set service_notification_commands to service_notify_by_snmp.
  6. Click Apply.
  7. Click Save.

Ensure the contact is a member of the contact_group is associated with the correct objects.