I’ve configured notifications using Icinga Directory, but no e-mail is being sent. I’ve created a TimePeriod with Mon - Sun 24x7, I’ve created a User template that applies this template, Sends Notifications is enabled and all states have been selected.I’ve defined a user that inherits this template, has a valid e-mail address configured and I’ve configured a Notification Template with the user specified, mail-host-notification configured, Time Period and all states set, but whenever I try to apply a rule I’m receiving the following error:
[2019-02-15 14:23:29 +0100] information/cli: Icinga application loader (version: r2.10.2-1)
[2019-02-15 14:23:29 +0100] information/cli: Loading configuration file(s).
[2019-02-15 14:23:29 +0100] information/ConfigItem: Committing config item(s).
[2019-02-15 14:23:29 +0100] information/ApiListener: My API identity: monitoring.anybase.eu
[2019-02-15 14:23:29 +0100] critical/config: Error: Validation failed for object ‘8.8.8.8!Base Monitoring’ of type ‘Notification’; Attribute ‘command’: Object ‘mail-host-notification’ of type ‘NotificationCommand’ does not exist.
Location: in [stage]/zones.d/monitoring.anybase.eu/notification_templates.conf: 2:5-2:38
[stage]/zones.d/monitoring.anybase.eu/notification_templates.conf(1): template Notification “Base” {
[stage]/zones.d/monitoring.anybase.eu/notification_templates.conf(2): command = “mail-host-notification”
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[stage]/zones.d/monitoring.anybase.eu/notification_templates.conf(3): interval = 1h
[stage]/zones.d/monitoring.anybase.eu/notification_templates.conf(4): period = “24x7”
as shown in the log your notify command wasnt created properly.
d u checked to send the mail directly from the host via ssh session with all your parameters set up ?
I haven’t defined any parameters for icinga2 I though it’d accept from localhost and set-up postfix to forward mails from localhost to a relay host (ISP). Where can I define the mail parameters for icinga?
Sorry for all the questions, but I’m still getting used to icinga (used nagios in the past)
These were imported automatically when setting it up initially through the wizard, but yes I’ve disabled the conf.d configuration as I ran the node wizard after, as I’ve got a Master → Satellite → Agent setup.
Please don’t edit the topics with the [solved] prefix, marking the reply as solution is sufficient. The topic lists highlight this, and the search takes this into account too. More here.