I followed the doc “06-distributed-monitoring/#three-levels-with-masters-satellites-and-agents” and managed to get the agent connected that is “behind” a satellite. Manually editing configs. (agent is on LAN, satellite is the only on this LAN that has a internet connection)
The agent is showing alive in icingaweb2 and when I create a new service and put in into the zones.d/satellite/ folder it shows up.
But I’m still a bit confused on how it should work.
I have alot of services created in /zones.d/master/services.conf. What would be best practice to get those working against (or on) the new agent that is behind the satellite ?
For example adding this to a service that is located in the master zone gives me a ‘error’:
apply Service “cluster-health” {
check_command = “cluster-zone”
display_name = “cluster-health-” + host.name
/* This follows the convention that the client zone name is the FQDN which is the same as the host object name. */
vars.cluster_zone = host.name
vars.grafana_graph_disable = true
assign where host.zone == “satellite” || host.vars.client_endpoint
}
Is my setup Master → Satellite → Agents not correct ? Would make sense if I read the ‘errors’ but why is it (partially) working.
Dont think that’s completely (or I dont get it right as I see for example this one sync and executed right:
// Ping Check
apply Service “External Pings” {
check_command = “ping4”
assign where host.address
}
Could you expain why that service is synchronized to the agent? Any suggestion what I’m doing wrong to get above services running on the agent behind the satellite?
You need to store the service definitions within a global zone e.g. global-templates. So /zones.d/master/services.conf will not work but /zones.d/global-templates/services.conf will do.
Found out that I used “vars.agent_endpoint = name” instead of “vars.client_endpoint = name” what I used to assign services. This resolved some issues I had earlier.
But still some unresolved questions:
Why is the cluster only showing the master endpoint and does it not count the agent (behind the satellite) ? Or how to make it count/check this agent to ?
I have alot of services in my master zone and some in the satellite zone. Strangely enough it’s also trying to target those master services against my agent ? I thought only global services where executed there or zone specific services ? ( explained by @rsx ) What am I doing wrong ?
This is what it shows. Those services exist on my master in the master zone:
3.I found out that icinga2 daemon -C" didnt give me errors on the satellite, but the startuplog gave me the errors I needed earlier. ( /var/lib/icinga2/api/zones-stage ) Still learning
Shouldnt icinga2 somehow check this before it starts on the satellite or at least give some sort of feedback or are there other way to find those when deploying services to a satellite ?