Icinga2 Snmptrap/Notifications do not work at all

An update to the situation:

I got the notifications (Traps and Mails) working now.
I don’t know what of it really made it, but I will write here what I changed until it worked:

  • There were “/” missing in the commands for the notifications directing to the script, so Icinga was getting a path like this: /this/is/the/path/to/the/scriptscript.sh. Also some typos like the wrong variable name and a variable not being in the .vars Macros were other problems that affected it and I think that’s the main reason it was solved.

  • I also added the Icinga User to the sudoers file granting it a ALL=(secure) access to the snmp.sh script specifcly even though like I said, that User had the permissions to do everything with it.

So all in all the main problem why it wasn’t working, were typos and missconfigurations from my ex-colleague leaving and I was here basically just debugging everything when in the end it just was a “you forgot a ; / wrote helo instead of hello” type of thing.

For others that will see this post: Check your parameters/variables and how they are written or in which sequence they get passed, that will save you a lot of trouble and if everything is ok, check the permissions/SELinux/Firewalls/Ports and other stuff we discussed in here.

And of course thank you Stevie, I appreciated your help a lot.

2 Likes