Hi!
By testing I meant two things, running Spillerās host-by-mail script from the cli with manually added parameters, that manages to send out a test email. Also when on the web interface if I select a host and click āNotificationā and send a custom host notification that also works. For now, all I want is to get an email if a host goes down. I have a host added for testing that I can simulate problems with. If I could get that working I could probably figure out the restā¦
Ok so from the top:
I have a notification template called āhost_notify_templateā, looks like this:
zones.d/myserver.local/notification_templates.conf
template Notification āhost_notify_templateā {
command = āhost-by-mailā
period = āalwaysā
states = [ Down, Up ]
types = [ Acknowledgement, Custom, Problem, Recovery ]
users = [ āmyuserā ]
}
Then I have a notification with that template that looks like this (Iām not sure about the assign rule here tbh):
zones.d/myserver.local/notification_apply.conf
apply Notification āhost-notificationā to Host {
import āhost_notify_templateā
assign where host.enable_notifications == "true"
users = [ "myuser" ]
}
These call for a command called āhost-by-mailā. That looks like this:
zones.d/icinga.srvs.blkfpark.local/commands.conf
object NotificationCommand āhost-by-mailā {
import āplugin-notification-commandā
command = [ ā/etc/icinga2/scripts/host-by-mail.shā ]
arguments += {
ā-4ā = ā$address$ā
ā-6ā = ā$address6$ā
ā-dā = ā$icinga.long_date_time$ā
ā-lā = ā$host.name$ā
ā-nā = ā$host.display_name$ā
ā-oā = ā$host.output$ā
ā-rā = ā$user.email$ā
ā-sā = ā$host.state$ā
ā-tā = ā$notification.type$ā
}
}
Versions:
icinga2 - The Icinga 2 network monitoring daemon (version: r2.10.4-1)
icininga web2 version: 2.6.2
icinga director version: 1.6.2
What else do you need in regard of config files?
Also regarding logs, when I make the test host unavailable the notification doesnāt fire at all as far as I can tell.
Thanks!