Hi,
my icinga installation does not start anymore.
The installation was working and I had configured icinga with Icinga Director.
I had configured a remote host (on hostname = ubuntu) and installed the agent on it. To do this I followed this guide “Working with Agents and Config Zones”.
Icinga is installed on a VM with hostname “lubuntu”.
The agent is installed in a VM with hostname “ubuntu”.
I made a mistake (I know, I’m an idiot) and from terminal I started the command: icinga2 node wizard.
Here are the commands I entered:
root@lubuntu:~# icinga2 node wizard
Welcome to the Icinga 2 Setup Wizard!
We will guide you through all required configuration details.
Please specify if this is an agent/satellite setup ('n' installs a master setup) [Y/n]: n
Starting the Master setup routine...
Please specify the common name (CN) [lubuntu]:
Reconfiguring Icinga...
Checking for existing certificates for common name 'lubuntu'...
Certificate '/var/lib/icinga2/certs//lubuntu.crt' for CN 'lubuntu' already existing. Skipping certificate generation.
Generating master configuration for Icinga 2.
'api' feature already enabled.
Master zone name [master]:
Default global zones: global-templates director-global
Do you want to specify additional global zones? [y/N]:
Please specify the API bind host/port (optional):
Bind Host []:
Bind Port []:
Do you want to disable the inclusion of the conf.d directory [Y/n]:
Disabling the inclusion of the conf.d directory...
Checking if the api-users.conf file exists...
Done.
Now restart your Icinga 2 daemon to finish the installation!
I tried to restart Icinga, but I couldn’t.
After logging into the web interface I get this message: Monitoring backend ‘icinga’ is not running.
With the command “icinga2 daemon -C” I got the following configuration errors (?):
root@lubuntu:~# sudo icinga2 daemon -C
[2020-04-24 16:30:10 +0200] information/cli: Icinga application loader (version: r2.11.3-1)
[2020-04-24 16:30:10 +0200] information/cli: Loading configuration file(s).
[2020-04-24 16:30:10 +0200] warning/config: Ignoring directory '/var/lib/icinga2/api/zones/lubuntu' for unknown zone 'lubuntu'.
[2020-04-24 16:30:10 +0200] information/ConfigItem: Committing config item(s).
[2020-04-24 16:30:10 +0200] information/ApiListener: My API identity: lubuntu
[2020-04-24 16:30:10 +0200] critical/config: Error: Validation failed for object 'ubuntu' of type 'Zone'; Attribute 'zone': Object 'lubuntu' of type 'Zone' does not exist.
Location: in /var/lib/icinga2/api/packages/director/d2eb21c5-cdba-4dda-9809-f4dd1023fc15/zones.d/lubuntu/agent_zones.conf: 1:0-1:19
/var/lib/icinga2/api/packages/director/d2eb21c5-cdba-4dda-9809-f4dd1023fc15/zones.d/lubuntu/agent_zones.conf(1): object Zone "ubuntu" {
^^^^^^^^^^^^^^^^^^^^
/var/lib/icinga2/api/packages/director/d2eb21c5-cdba-4dda-9809-f4dd1023fc15/zones.d/lubuntu/agent_zones.conf(2): parent = "lubuntu"
/var/lib/icinga2/api/packages/director/d2eb21c5-cdba-4dda-9809-f4dd1023fc15/zones.d/lubuntu/agent_zones.conf(3): endpoints = [ "ubuntu" ]
[2020-04-24 16:30:10 +0200] critical/config: 1 error
[2020-04-24 16:30:10 +0200] critical/cli: Config validation failed. Re-run with 'icinga2 daemon -C' after fixing the config.
root@lubuntu:~#
This is the contents of the file /var/lib/icinga2/api/packages/director/d2eb21c5-cdba-4dda-9809-f4dd1023fc15/zones.d/lubuntu/agent_zones.conf:
Hi,
for me it looks as the zone “lubuntu” is missing in your director config.
You have a zone “ubuntu” which enpoint is “ubuntu” and its parent is “lubuntu”.
In director your zone is called “master”.
So let your zone “ubuntu” point to “master” as parent and it should be fine?
Best,
M.
You post says your Icinga does not start anymore. So I’m guess it was working good at one time. Than you added client “ubuntu”. Correct? If this is correct, the command you posted show you running the node wizard on the master (lubuntu) again. You need to run the node wizard on the new agent (ubuntu) to get the agent working. If you ran the node wizard a 2nd time on the master your CA certificate will change and all agents will need to register with the master again.
Also check your zones.conf file. It may of changed after running the node wizard.
Yes, before icinga worked perfectly.
I mean that icinga (on lubuntu) and the ubuntu host (where the agent is installed) worked. Both worked.
For example I could check the hard disk on ubuntu with the command “disk.”
Icinga stopped working when I started the command “icinga2 node wizard” on the host “lubuntu”
Your zone lubuntu became invalid, I’d assume. It looks like to run icinga2 node wizard a second time and now you have a certificate failure. You would see this in the logs. You can also check icinga2 object list -n lubuntu.