[icinga2] Define "disk" Service without arguments to get partitions dynamically

This commit is contained in:
Tunui Franken 2025-01-31 23:56:09 +01:00
parent ec43b6cf31
commit 41b2ad4b20
2 changed files with 2 additions and 13 deletions

View file

@ -4,21 +4,10 @@ object Host "{{ icinga2_master }}" {
import "generic-host"
address = "{{ hostvars[icinga2_master].ipv4_addr }}"
vars.disks["disk /"] = {
disk_partitions = "/"
}
}
object Host "{{ icinga2_agent }}" {
import "generic-host"
address = "{{ hostvars[icinga2_agent].ipv4_addr }}"
vars.disks["disk /"] = {
disk_partitions = "/"
}
vars.disks["disk /var/vmail"] = {
disk_partitions = "/var/vmail"
}
}

View file

@ -24,11 +24,11 @@ apply Service for (http_vhost => config in host.vars.http_vhosts) {
vars += config
}
apply Service for (disk => config in host.vars.disks) {
apply Service "disk" {
import "generic-service"
check_command = "disk"
command_endpoint = host.name
vars += config
assign where true
}
apply Service "apt" {