Hi all,
I’m new to Icinga2, I’m currently amending a running setup (r2.14.3-1 , Debian Bullseye) where all alerts go to one email address.
Another team are responsible for the contents of a mount point (/srv) on a certain host and have asked that they be emailed when it reaches a certain percentage (copy should also be delivered to the email address all other alerts are sent to).
So far I have added another Icinga user to users.conf, users.conf reads as below:
object User "the_it_team" {
import "generic-user"
display_name = "The IT Team"
email = "email_address_of_it_team@company.com"
}
object User "teamsrvdir" {
import "generic-user"
display_name = "team responsible for srv dir"
email = "email_address_srvdir@company.com"
I’ve been reading the docs and I am aware that you can override vars in Host object as below.
Hosts file for machine being monitored:
File: /etc/icinga2/conf.d/objects.d/machine_being_monitored.conf
object Host "hostname_being_monitored" {
import "it_team_master_template"
address = "machine_being_monitored_fqdn"
vars.distro = "Debian"
vars.distrover = 12
vars.type = "production"
vars.service_manager = "systemd"
vars.ssh_port = "ssh_port_number"
vars.ssh_ports = {
"SSH port <port number listening on>" = {
ssh_port = "<port number listening on>"
}
}
vars.ssh_ports["SSH port <number>"] = {
ssh_port = "<ssh port number>"
}
vars.disks["Disk /mount_point"] = {
disk_partitions = "/mount_point"
}
vars.notification["mail"] = {
users = [ "teamsrvdir" ]
}
}
This currently emails all alerts for this host to object User “teamsrvdir”, should I add another user to users.conf with the email address email_address_of_itteam@company.com and make both members of one group so both get the email.
So that only the alerts for /srv go to this group does the below need to be indented according so it is part of vars.disks["Disk /mount_point"]
(I’m not clear on how to do this) :
vars.notification[“mail”] = {
users = [ “other_team_responsible_for_srv” ]
Many thanks
Daniel