I have downloaded the icinga editor script and I have assigned it the permissions 755 and executed as root obtaining the following result.
check: icinga2 installed - OK
ERROR: $ICINGA2_USER has not been defined
But the user icinga has been created when installing it, since it appears in /etc/passwd If I add the user in the script by adding that variable with the user icinga I get the following result.
check: icinga2 installed - OK
ERROR: $ICINGA2_USER has not been defined
[root@servrapidai1 ~]# ./icinga.bash
check: icinga2 installed - OK
./icinga.bash: line 49: ./lib/icinga2/prepare-dirs: No such file or directory
./icinga.bash: line 61: : command not found
./icinga.bash: line 66: : command not found
./icinga.bash: line 72: : command not found
./icinga.bash: line 130: ./features-available/api.conf: No such file or directory
warning/cli: Feature 'api' already enabled.
Please restart icinga2!
The errors refer to copying the certificates, the ./lib/icinga2/prepare-dirs directories actually exist, but it doesn’t catch them.
CA_TICKET, is the hash I get from icinga director when I create the host and activate the agent.
But when running the scrtip I get the following output:
1. information/pki: Writing certificate to file ‘/var/lib/icinga2/certs/trusted-master.crt’. 2. information/cli: Writing CA certificate to file ‘/var/lib/icinga2/certs/ca.crt’. 3. critical/cli: !!! Invalid ticket for CN ‘client.local’. 4. ERROR: Could not retrieve final certificate from host server.local
Now it does not receive the certificate from the server, I do not understand what is happening.