Hello everyone,
I‘m really new to icinga (and tech stuff in general) and I‘m struggling to understand how notifications work. I‘ve read the docs, yes, but everything is a little bit confusing to me.
What I understood so far:
I need to install and setup postfix first (icinga is running on an Ubuntu server)
There should be an user and group object, for example like this:
object User “icingaadmin“ {
import „generic-user“
display_name = “Icinga Admin“
groups = [“icingaadmins”]
enable_notifications = true
states = [Warning, Critical]
types = [Recovery, Problem]
email = “test@icinga.com“
}
@bberg I think you may have misread some of the question.
The configuration provided by @vplm already contains apply rules.
I think the question is whether or not each host must contain the custom variable noticification.mail with the users and/or groups values.
Strictly speaking, the answer in your current setup is “yes”, but what you probably want to do is to put the
part in the generic-host object (there should be some line like template Host "generic-host" somewhere).
This way, every Host object which imports the generic-host has these values already set (but could overwrite them).
Regarding postfix etc.:
The default mail scripts (in /etc/icinga2/scripts for some reason) rely on the mail command, which again relies on some weird old school email magic.
You can use Postfix for that (and it works and probably would be my recommendation IF you can send mails internally in your setup via SMTP).
The tricky part is to configure Postfix “correctly”, most of the time the “local Postfix is just a relay/satellite and forwards everything to a proper mail server” configuration is what you want (but I don’t know your setup).
Now, you don’t have to use the default scripts, effectively icinga2 just executes some executable with some parameters (which contain the message content), so you could use other channels to communicate problems (XMPP/Matrix/Telegram/…) as long as you find a fitting program to do that (search for “icinga notification XMPP” or something like that).