Icinga director notification error

  • Director version (System - About): 1.7.2
  • Icinga Web 2 version and modules (System - About):2.9.6
  • Icinga 2 version (icinga2 --version):version: 2.13.2-1
  • Operating System and version: CentOS Linux 3.10.0-1160.59.1.el7.x86_64
  • Webserver, PHP versions:7.3.29

Dear All,
I have read many topics and other sides, and watch videos but i dont find a good dokumentation for setting up e-mail notifications in icinga-director.
I have tryed to configure in director module the notification / templates but i have many error recived for example:
[2022-03-16 15:06:52 +0100] critical/config: Error: Validation failed for object ‘xyz.hostl!mail’ of type ‘Notification’; Attribute ‘command’: Object ‘mail-host-notification’ of type ‘NotificationCommand’ does not exist. Location: in [stage]/zones.d/master/notification_templates.conf: 2:5-2:38

I assume mail-host-notification refers to the example notification command stored under /etc/icinga2/conf.d/commands.conf

check if you icinga2.conf contains a line like
// include_recursive "conf.d"

if that is the case you need to include the config file into your running configuration.
You could move it to zones.d/master/ or add include "conf.d/commands.conf" to the icinga2.conf.

Reload/Restart the icinga service afterwards and run the Directors kickstart wizard to have the command available in the Director.

Thank you in my config file i dont have // include_recursive “conf.d”
I have only:
include “conf.d/api-users.conf”
include “features-enabled/*.conf”
include
include “zones.conf”
etz.

And in conf.d/ there is no commands.conf

Then you can do one of the following.to have usable commands

  • Create your own notification command configuration with the Director
  • copy the example commands.conf file from github and include it in your config

Thank you so much!
It work’s but now i recive new error:
[2022-03-17 08:23:54 +0100] information/Notification: Completed sending ‘Custom’ notification ‘hostname’!Host (DOWN) → Mail’ for checkable ‘hostname’ and user ‘notificationuser’ using command ‘mail-host-notification’.
[2022-03-17 08:23:54 +0100] warning/PluginNotificationTask: Notification command for object ‘hostname’ (PID: 21343, arguments: ‘/etc/icinga2/scripts/mail-host-notification.sh’) terminated with exit code 1, output: Required parameter ‘LONGDATETIME’ is missing.

ok i find here the solutions, i added the arguments manualy and now :
[2022-03-17 10:13:12 +0100] information/Notification: Completed sending ‘Custom’ notification ‘hostname!Host (DOWN) → Mail’ for checkable ‘hostname’ and user ‘notificationuser’ using command ‘mail-host-notification’.

But now i need to configure mail on my centos. If we use redirector what should i install and what should i configure?

so i want to complete my solution:
First of all i have upgraded the Director version to 1.9.0
Than again imported all files, and it seem the notificication.sh script was not good implemented in the first installation.
Than it was deleted from the external command, i don’t know how but it was missing, and i have manual added that to commands with the order where it is on server.
Then i created the notification template and the notification.
After that i tested it with an normal notification sending, the icinga try to send out but that was also not working becaouse i have not configured the postfix. After the postfix configuration everything works. Now i receive emails.

1 Like