[icinga2] Define "disk" Service without arguments to get partitions dynamically
This commit is contained in:
parent
ec43b6cf31
commit
41b2ad4b20
2 changed files with 2 additions and 13 deletions
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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" {
|
||||
|
|
Loading…
Reference in a new issue