Missing NotificationCommand mail-host-notification

Theres a “mail-host-notification” in external commands and its visible in the dropdown for the Notification Command for notification templates.
But i get an error if my notification will be applied by an rule.

[2019-08-07 21:27:19 +0200] critical/config: Error: Validation failed for object 'uap.lan!apply_mail_host_notification' 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

Director version: 1.6.2
Icinga Web 2 version and modules: 2.7.0
Icinga 2 version: r2.10.5-1
Operating System and version: Ubuntu 18.04
Webserver, PHP versions: apache 2.4.29, php 7.2

The command came into the Director via the Directors kickstart function.

Two things I can think of now:

  • did you change the icinga2.conf to not include the /etc/icinga2/conf.d directory?
  • did you delete config files from the /etc/icinga2/conf.d directory?

Yes, /etc/icinga2/conf.d is not included.
I tought it was already parsed by the director and thus not needed anymore…

Yes and no.
There are parsed by the Director, but are placed in the “external” part of the command configuration.
Therefore the Director knows about it, but you can’t configure it with the Director. And that’s why the config files need to be always included.
Though you can omit nearly every other config file in the conf.d directory

Same goes for the commands from the ITL, I assume. If you would remove/deactivate those, the config validation would complain.

1 Like

Move the notification commands to an included save place, e.g. into /etc/icinga2/zones.d/master in the master zone being replicated to the secondary master instance. Then re-run the kickstart wizard from the Director to update the references.