I have icinga v2.11.3-1 installed on 4 servers, one as master and the rest are agent nodes and they are some-what properly configured because they are visible in icingaweb2 under hosts.
what I want to do is to be able to run a check command on a remote agent.
lets say I want to monitor disks on a server called my-server
.
so in the master node I added the following configuration:
first defined the host and zone:
object Host "my-server" {
import "generic-host"
address = "my-server-host"
vars.os = "Linux"
vars.disks["disk /mnt/data"] = {
disk_partitions = "/mnt/data"
}
vars.agent_endpoint = name
}
object Endpoint "my-server" {
host = "my-server"
}
object Zone "my-server" {
endpoints = ["my-server"]
parent = "master"
}
notice that I added vars.agent_endpoint
.
that applied the following on disk
service:
apply Service "disk" {
check_command = "disk"
// Check is executed on the remote command endpoint
command_endpoint = host.vars.agent_endpoint
zone = host.vars.agent_endpoint
assign where host.vars.agent_endpoint
}
and this is the the definition that checks for host.vars.disks
that was already presented in the services.conf configuration file:
apply Service for (disk => config in host.vars.disks) {
import "generic-service"
check_command = "disk"
vars += config
}
yet it still checks for available space in the parent node and shows that result.
I probably missed something in the configuration and I don't know what
any ideas regarding this issue would be greatly appreciated.
thanks!