1

I know by default the "Event Command" is executed on the "Command endpoint" doing the check for a device. Is there a way to change this or define which endpoint the event command is executed on? I need the Event commands to be executed on the master node and not the client when the host goes down.

If this is not possible is there a way that a script can be executed on the icinga2 master server if a host that is been monitor by a icinga2 client server goes down?

alexis
  • 1,022
  • 3
  • 16
  • 44

1 Answers1

0

If you use Icinga2 Director you can specify the master zone in in the service service

Or just ensure you have the service object in the master node's zone.

Edit: You can set the command endpoint with command_endpoint = on your Host template. Here's an example:

template Host "LAN Distribution Switch" {
    check_command = "hostalive"
    max_check_attempts = "3"
    check_interval = 5m
    retry_interval = 1m
    enable_notifications = true
    enable_perfdata = true
    command_endpoint = "ICINGA-2"
    vars.check_fans = "true"
    vars.check_power = "true"
    vars.device_role = "lan-distro"
    vars.snmp_community = "PUBLIC"
}

Then make sure you have the template imported on your host definition.

cflinspach
  • 290
  • 1
  • 4
  • 16
  • Unfortunately we don't have director installed so that's not an option I am not sure what you mean by having a service run on the master zone. The master server dosent have access to the device been monitor that's why a separate "Command endpoint" is been used and located at a different site – alexis Aug 29 '17 at 09:07
  • Ok I updated my answer. The command endpoint is where to run the command. – cflinspach Aug 29 '17 at 15:01