Host not monitored

Hello guys
once again I am new to Icinga
i installed Icinga2 and added some hosts in the host.conf file. they were being monitored proper. then I set up a remote host, and now the server is monitoring only this remote host. (actually the host is in the same network as the server. I just wanted to try the Icinga 2 agent).

best regards

Hi,

please share the configuration files and the output of icinga2 object list --type hosts so that we get a better understanding of the current configuration and the potential issue.

And how did you verify that only the new host is monitored?

icinga2 object list --type hosts returns nothing.
icinga web displays only one host. it does not even display the localhost

As far as I understood:

  1. You have a single Icinga2 master
  2. One agent

First, where is this host.conf located? On the master or the agent and in which location, conf.d or zones.d. While at it, what does the masters and agents zones.conf say, how were they configured.

This sounds a lot like a mixup with zones, but to be sure we need to know better what your setup looks like and what you changed where.

Sorry, I meant icinga2 object list --type host.

And crunsher came up with the correct questions. This sounds like you moved the host configuration to the remote host. Let’s figure it out step by step.

yesI have a single Icinga2 master.
one agent and 2 others host without agents.
the hosts.conf is located on the master. on the conf.d directory.
/etc/icinga2/conf.d/hosts.conf see pictures
/etc/icinga2/zones.d/master/es-monitoring-client1-dev.vlan.conf ist the file

agenthost services where the host with agent ist configured and also the services. see pictures
I know i ve misconfigured something. as far as I unterstood the hosts.conf ist the file where all the hosts should be defined, isn´t ist? but my config doesn´t look like that.

hi Marcel
here is the output

Hi Fat,

do you have a line like include_recursive conf.d in /etc/icinga2/icinga2.conf? It looks like the directory and therefore the containing configuration files are not loaded. This should be enabled if you want to include all configurations in that file.
Another option would be to move the hosts.conf into the zones/-directory with the name of the master instances zone.

In your case, only the /etc/icinga2/zones.d/master/es-monitoring-client1-dev.vlan.conf is used by icinga2.

And is es-monitoring-client1-dev.vlan the node name of your master? I would recommend to maintain all the hosts in dedicated hosts files in the respective zone and zones and endpoints just in the zones.conf to keep it structured.

es-monitoring-client1-dev.vlan is the node name of my client not the master.
i checked the /etc/icinga2/icinga2.conf file, there is no include_recursive conf.d line.
so you mean i should add this line?

or can please explain a litle bit your second idea?

Hi,

since you’re using a command endpoint for the agent hosts, their host object and corresponding apply rules for services should be put into the master zone. You’re mentioning a hosts.conf file, please move this into /etc/icinga2/zones.d/master and validate the configuration again - then it will generate service objects visible via icinga2 object list --type Service as well.

You can verify the loaded and included configuration files with enabling the more verbose log level on config validation like this:

icinga2 daemon -C -x notice 

Grep for the specific file name in there to see whether it is loaded.

Cheers,
Michael

PS: Don’t use conf.d in distributed setups, this is discouraged and as such, disabled with the setup wizards by default.

1 Like

Hello,
Why don’t you use Director module? It is much easier to configure every host, service and a lot of other things :slight_smile: