How to change ICINGA2_CA_PORT?

according to documentation there is no such thing as “ICINGA2_CA_PORT”. however, when deploying an agent this variable is set in the setup script and it has an incorrect value for my setup.

I had to change to port 5666 because of a proxy issue on our edge and the fact that the proxy server was also using 5665 for coms to our icinga server. I switched over in the infrastructure area as well as manually changing the few agent nodes we currently have in this new install using director.

How can I get “ICINGA2_CA_PORT” changed to show the correct port for our icinga server?

thanks

I don’t get your question completely, sorry. Hence, in general, ports can be changed at ApiListener and Endpoint objects.

at Icinga Director → Host Objects → Hosts → select a host to deploy agent on → Agent

you get to " Agent deployment instructions" and below is the " Linux commandline" section where you can download a deployment script for Icinga that will configure everything as it should be.

This is a great thing. However, if you have a non-standard Icinga port it needs to be reflected here. Now, seeing as how I installed normally on a stander 5665 port. I can not say if this is a problem from a fresh install on a non standard icinga port. I can tell you that no matter what I change (and icinga works great as well as all agents) I cannot get this script info to change.

As an example, here is the head of that script for one of my servers:

#!/bin/bash

# This generates and signs your required certificates. Please do not
# forget to install the Icinga 2 package and your desired monitoring
# plugins first.

# Config from Director
ICINGA2_NODENAME='bwnssncc02.domain.com'
ICINGA2_CA_TICKET='redacted'
ICINGA2_PARENT_ZONE='master'
ICINGA2_PARENT_ENDPOINTS=('redacted,10.3.1.50')
ICINGA2_CA_NODE='redacted'
ICINGA2_GLOBAL_ZONES=('director-global')

# Internal defaults
: "${ICINGA2_OSFAMILY:=}"
: "${ICINGA2_HOSTNAME:="$(hostname -f)"}"
: "${ICINGA2_NODENAME:="${ICINGA2_HOSTNAME}"}"
: "${ICINGA2_CA_NODE:=}"
: "${ICINGA2_CA_PORT:=5665}"

This works great on a bog standard install. However, my Icinga server is listening on 5666 and that means I have to adjust the script to set it to 5666.

can you reformat your post according to the guidelines?

https://community.icinga.com/faq

some info:

  1. the script info will not change. there is currently no implementation for that. see:
    icingaweb2-module-director/library/Director/IcingaConfig/AgentWizard.php at master · Icinga/icingaweb2-module-director · GitHub

Possible solution: Since it is just for your environment you can patch:

don’t forget to repatch it after an update because this file might get overwritten.

fun fact: 5666 is the Nagios NRPE port, keep that in mind for the future