Copy / Paste Preformed Notification object for director?

Probably a really daft question but I’m following the this tutorial to get basic mail alerts working

I’m at the point where I need to add the object NotificationCommand “Service Alarm By Email” to director. Is there any way of cutting and pasting the content into a file and have director pick it up from commands.conf if that is in fact the correct file? If not, any ideas which file I should be adding the content to given the list below?

I assumed there would be a single commands.conf but having looked I’ve got a few? Messed around with adding it to a couple of the files below, restarted icinga2, but thinking about it didn’t restart apache for icingaweb2? Wondering if that’s what i’ve done wrong?

root@localhost:/var/lib/icinga2/api/packages/director/localhost-1554290594-9/zones.d/ find / -name commands.conf

If you work with the Icinga Director you shouldn’t change the contents of the files in /var/lib/icinga2/api/…
These are created by the Directors deployment process. So changing them will have no effect anyway or can even break your config.
Read about how the Directors deployment works it in the docs:

You have both notification commands configured in /etc/icinga2/conf.d/commands.conf
You can include that config in your /etc/icinga2/icinga2.conf with include "conf.d/commands.conf"

After this reload icinga2 and do a kickstart via the Director interface. This way the Director will import the pre-defined commands from the ITL and the command.conf

1 Like