Cross-monitoring with two hosts

I monitor a couple of small clusters from a single host, “CA”. CA is a master and the cluster machines are satellites. Notification is via email, and CA is behind a single router, R. So if R dies, notification can’t happen.

Fortunately I have another machine, “NY”, outside the router. So I set up a separate Icinga instance there and have it watching R. Its notification path doesn’t use R. Problem solved.

Except I’m watching some other things on NY, and I’d really like those things to be controlled from CA and on CA’s dashboard. So what I really want is for NY to be a satellite for most checks, but for it to run a few other checks independently (like R’s liveness) and send notifications for those ones directly on its own initiative, rather than feeding them back through the master on CA.

Is that possible? I’m still an Icinga beginner, but I’ve gotten the impression that it could be done if I set up the configurations right.

I can give more details if necessary, but I’m trying to keep this short.

Welcome Back
As for the assignment of the test to come from NY , that should be fairly easy, you need to add the line

assign where == NY

service apply rule and the service check will be triggered from that
satellite too.

As for the notification logic , see this


1 Like

Thanks for the help! That seems to be exactly what I’m looking for.

Unfortunately, when I set up a simple test I’m getting an error: it claims doesn’t exist. When I run icinga2 daemon -C, I get:

[2020-03-01 18:48:28 -0800] critical/config: Error: Error while evaluating expression: Tried to access undefined script variable 'node'
/etc/icinga2/zones.d/global-templates/services.conf(48):   assign where == "NY"
/etc/icinga2/zones.d/global-templates/services.conf(49): }

        (0) Evaluating 'apply' rule (in /etc/icinga2/zones.d/global-templates/services.conf: 39:1-39:21)
        (1) Evaluating 'apply' rules for host 'host1.localdomain'

I’m running icinga2 version 2.11.2-1-el8-sles15, if version differences matter.

I tried some other guesses like, but that didn’t help. I also tried grepping the output of icinga2 object list for hints as to what to write, but wasn’t successful.