Hi all,
We recently put in an Icinga monitoring system and have a couple of servers that we would like to change the disk thresholds for because they’re caching servers that constantly sit at a high usage level.
We’re trying to override it in the hosts configuration but it seems to just ignore it. If we adjust vars.disk_cfree or wfree in the services configuration files (as per the commented out lines in the services.conf extract below) it works perfectly but obviously affects all systems that have that service. If we try this in hosts nothing changes:
object Host "server001" {
address = "1.2.3.4"
vars.os = "Linux"
vars.application = "my-application"
import "my-additonal-application-checks"
vars.disk_wfree = "2%"
vars.disk_wfree = "1%"
}
According to what we’ve seen on variables precedence we would expect variables in hosts’ conf files to take priority over those on the service, so we must be doing something wrong.
I’m new to Icinga so please excuse any misunderstandings or superfluous information; I’m not quite sure what’s standard. Our configuration is as below (it seems pretty logical so I imagine it’s fairly normal):
Hosts are configured in conf.d/hosts as below:
object Host "server001" {
address = "1.2.3.4"
vars.os = "Linux"
vars.application = "my-application"
import "my-additonal-application-checks"
}
Hosts are added to hostgroups in hostgroups.conf:
object HostGroup "linux-servers" {
display_name = "Linux Servers"
assign where host.vars.os == "Linux"
}
Services are then applied according to services.conf files:
apply Service "Disks" to Host {
display_name = "Linux Disks"
import "by_ssh"
vars.by_ssh_command = "/usr/lib64/nagios/plugins/check_disk"
vars.by_ssh_arguments = {
"-X" = {
value = "$disk_exclude_type$"
description = "Ignore all filesystems of indicated type (may be repeated)"
repeat_key = true
}
"-w" = {
value = "$disk_wfree$"
description = "Exit with WARNING status if less than INTEGER units of disk are free or Exit with WARNING status if less than PERCENT of disk space is free"
required = true
order = -3
}
"-c" = {
value = "$disk_cfree$"
description = "Exit with CRITICAL status if less than INTEGER units of disk are free or Exit with CRITCAL status if less than PERCENT of disk space is free"
required = true
order = -3
}
"-u" = {
value = "MB"
}
}
# vars.disk_wfree = "2%"
# vars.disk_cfree = "1%"
vars.disk_exclude_type = [
"none",
"tmpfs",
"sysfs",
"proc",
"configfs",
"devtmpfs",
"devfs",
"mtmfs",
"tracefs",
"cgroup",
"fuse.gvfsd-fuse",
"fuse.gvfs-fuse-daemon",
"fdescfs",
"overlay",
"nsfs",
"squashfs"
]
assign where "linux-servers" in host.groups && host.name != NodeName
}