Hi All,
I am trying to setup a distributed system of icinga2 where i have one master and one agent. I had installed icinga2 and icingaweb2 on master which works perfectly fine. Now, i tried to add an agent/remote server which i want to monitor from the master i had previously setup.
I followed the node wizard setup process and did the master and agent setups in each of the machines.
Later, i added following in the conf.d/hosts.conf for the remote/agent machine:
object Zone "agent.domain" {
endpoints = [ "agent.domain" ]
parent = "master"
}
object Endpoint "agent.domain" {
host = "ip-address of agent.domain"
}
object Host "agent.domain" {
import "generic-host"
address = "ip address of agent.domain"
vars.systemd["cron"] = { friendly_name = "Cron Service", restart = false }
vars.http_vhosts["http"] = {
http_uri = "/"
}
/* vars.disks["disk"] = {
}*/
vars.disks["disk /"] = {
disk_partitions = "/"
}
vars.http_vhosts["Icinga Web 2"] = {
http_uri = "/icingaweb2"
}
vars.notification["mail"] = {
groups = [ "icingaadmins" ]
}
vars.client_endpoint = name
}
Even if i bring down the cron service on agent machine, it still shows up and the same goes down when i bring down the cron service on master.
Is there anything i am missing ?
Below is the systemd command added in commands.conf
https://exchange.icinga.com/kiminen/icinga2-check_systemd_service
object CheckCommand "systemd_service" {
command = [ PluginDir + "/check_systemd_service" ]
arguments = {
"--service_name" = {
value = "$systemd_service_name$"
description = "Name of systemd service for check"
skip_key = true
required = true
order = 1
},
"--restart" = {
set_if = "$systemd_restart$"
description = "Restart service if is not running"
required = false
order = 2
}
}
}