Icinga2: Run check on remote host instead of master

1.8k Views Asked by At

I just updated to Icing 2.8 which needs "the new" way of checking remote hosts, so I'm trying to get that to work.

On the master I added a folder in zones.d with the hostname of the remote host. I added a few checks but they all seem to be executed from the master instead of the remote.

For example: I need to monitor Redis. My redis.conf in /etc/icinga2/zones.d/remotehostname/redis.conf:

apply Service "Redis" {
    import "generic-service"

    check_command = "Redis"

    vars.notification["pushover"] = {
            groups = [ "ADMINS" ]
    }

assign where host.name == "remotehostname"

}

A new service pops up in IcingaWeb but it errors out with:

execvpe(/usr/lib/nagios/nagios-plugins/check_redis_publish_subscribe.pl) failed: No such file or directory

Which is correct because on the master that file does not exist. It does exist on the remote host however.

How do I get Icinga to execute this on the remote host and have that host return the output to the master?

1

There are 1 best solutions below

0
On

You can write this to the service:

command_endpoint = host.name

Or you can try to create a zone and add the zone to the Host.

Maybe this could help you: NetWays Blog