I’m trying to figure out how to add/remove comments/downtimes/acknowledgments via the satellites API to the master.
Setup is:
Master → multiple Satellite-Zones → Agent with no connectivity between Agent and Master
The API call is issued on the agent host or a different host that is only able to connect to the satellite and not the master
The master and satellite have /etc/icinga2/features-enabled/api.conf as follows.
i would recommend sending the downtime api request to the primary master (or an haproxy cname) instead of the satellites other wise the request has to know which zone/satellite the host/service is in.
Thx for the feedback!
hm, sounds logical to me.
Nevertheless we don’t have network connetivity from the agents or hosts in their network to the master.Only to the(ir) zones satellite.
Seems like we really need to think about proxying.
Follow up to this:
We implemented a quick and dirty HAproxy to listen on port 5666 on the satellites that then forward the oncoming requests to the icinga api on the master:5665
#---------------------------------------------------------------------
# Forwarder Frontend for Icinga2 API
#---------------------------------------------------------------------
frontend icinga2api_frontend
bind SATELLITE-IP:5666
mode tcp
option tcplog
default_backend icinga2api_backend
#---------------------------------------------------------------------
# Forwarder Backend for Icinga2 API
#---------------------------------------------------------------------
backend icinga2api_backend
mode tcp
option tcplog
option tcpka
balance source
server master1 master1-fqdn:5665 check weight 1 inter 5s rise 2 fall 2
server master2 master2-fqdn:5665 check weight 1 inter 5s rise 2 fall 2 backup
In case of SELinux this is also needed setsebool -P haproxy_connect_any 1