Sending snmp traps from icinga2 to opmanager

Hi, im using a basic setup of icinga2 with icingaweb2. Using config files for hosts, and running ssh-checks from the icinga2 server using a ssh key (monitoring servers running rhel and solaris). i have users and notifications set up to mail us if we get critical alerts.
We also use opmanager for our batch ops team, for alerting support teams (on call etc). I would like to know if its possible to get icinga2 to send a trap (snmp) when an alert occurs to opmanager. And if so, how do i set this up ? Thanks…


you can write your own notification scripts. This one is doing what you want. Icinga itself installs only a bash script to send E-Mail. Instead or in Addition you write your own notification tool for using snmp. e.g. with using net-snmp.

1 Like


it’s correct. You have to write the notification scripts by yourself. As you have to do it anyway I would recommend to check if you can also use the opmanager REST API for example.

This is probably less hassle than having a script handling all the OIDs or maybe even parsing complex MIB files and the API has additional benefits like authentication and encryption if you want.

Thanks, im not using director or graphite as i found them too difficult to set up with using docker. I’m the only member of the team that has any knowledge on the icinga config we have as i set it up from scratch (probably badly). However I have a config that i can manage, and it works fine and emails when alerts occur (using ssh checks and nagios plugins). I have notifications set up ok for email, any idea what a notification script might look like for sending alerts to opmanager ? appreciate the input.


I would start simple and construct a command line with the snmptrap command, as described here.

snmptrap -v <snmp_version> -c <community> <destination_host> <uptime> <OID_or_MIB> <object> <value_type> <value>

snmptrap -v 2c -c public localhost '' i 123456

Once you’ve got that working, put it into a script with parameters and decide which inputs it needs to send a good trap, e.g. with passing in the host and service name as environment variables.

object NotificationCommand "snmptrap-sender" {

  command = [ ConfigDir + "/scripts/snmptrap-sender" ]

  env = {
    HOSTNAME = "$$"
    SERVICENAME = "$$"

vim /etc/icinga2/scripts/snmp-trapsender

LOG=/tmp/icinga-trapsender-`date +%s`.log

echo "Host: $HOSTNAME" >> $LOG
echo "Service: $SERVICENAME >> $LOG

# construct an snmptrap line here

One possible idea would be to provide the OID via host custom variable, and pass that one via environment variables to the script. Once everything is working, disable the LOG above.


Thank you, i will look at trying to set this up after xmas. i have a omprobe server i need to send the traps to. would this be the $HOST (destination_host) ?

Have abandoned. Gone opmanager route… thanks.