Hosts Show as Pending

Hi, I’ve just set up my first Icinga installation but when I add new hosts for monitoring (using the agent) they just show as pending in the web interface, I have two Windows and one Oracle Enterprise Linux server and they seem to be in a permanent state of pending. In the icinga2 log I see no errors. I have added an ubuntu host without issue but these other 3 are stuck pending.Any ideas anyone?

Hi,

please share additional details about your environment as listed in the FAQ. Especially:

  • icinga2 --version
  • Configuration snippets for such a host/service
  • Web interface screenshot/output
  • What happens if you force a re-check?

Cheers,
Michael

Hi Michael,

System information:
Platform: Ubuntu
Platform version: 16.04.5 LTS (Xenial Xerus)
Kernel: Linux
Kernel version: 4.4.0-131-generic
Architecture: x86_64

Build information:
Compiler: GNU 5.3.1

Each host has its own folder under zones.d, in each folder is a file hostname.conf, in the conf file the object zone, object endpoint and object host are all specified.

A recheck from the web interface doesn’t appear to make any difference

Cheers

Stephen

Pick one and show them here via icinga2 object list --type Service --name <pattern>. Also, an excerpt from its runtime state would be interesting via the REST API, from /v1/objects/services for example.

Also, please add the full output of icinga2 --version which includes the package version.

Cheers,
Michael

Here’s the --version output

icinga2 - The Icinga 2 network monitoring daemon (version: r2.10.2-1)

Copyright © 2012-2018 Icinga Development Team (https://icinga.com/)
License GPLv2+: GNU GPL version 2 or later http://gnu.org/licenses/gpl2.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

System information:
Platform: Ubuntu
Platform version: 16.04.5 LTS (Xenial Xerus)
Kernel: Linux
Kernel version: 4.4.0-131-generic
Architecture: x86_64

Build information:
Compiler: GNU 5.3.1
Build host: 409e1113863b

Application information:

General paths:
Config directory: /etc/icinga2
Data directory: /var/lib/icinga2
Log directory: /var/log/icinga2
Cache directory: /var/cache/icinga2
Spool directory: /var/spool/icinga2
Run directory: /run/icinga2

Old paths (deprecated):
Installation root: /usr
Sysconf directory: /etc
Run directory (base): /run
Local state directory: /var

Internal paths:
Package data directory: /usr/share/icinga2
State path: /var/lib/icinga2/icinga2.state
Modified attributes path: /var/lib/icinga2/modified-attributes.conf
Objects path: /var/cache/icinga2/icinga2.debug
Vars path: /var/cache/icinga2/icinga2.vars
PID path: /run/icinga2/icinga2.pid

Here’s an output of a host

root@namaste:/var/log/icinga2# icinga2 object list --type Host --name Zygo01
Object ‘zygo01’ of type ‘Host’:
% declared in ‘/etc/icinga2/zones.d/zygo01/zygo01.conf’, lines 10:1-10:20

  • __name = “zygo01”
  • action_url = “”
  • address = “192.168.200.9”
    % = modified in ‘/etc/icinga2/zones.d/zygo01/zygo01.conf’, lines 12:3-12:27
  • address6 = “”
  • check_command = “hostalive”
    % = modified in ‘/etc/icinga2/conf.d/templates.conf’, lines 19:3-19:29
  • check_interval = 60
    % = modified in ‘/etc/icinga2/conf.d/templates.conf’, lines 16:3-16:21
  • check_period = “”
  • check_timeout = null
  • command_endpoint = “”
  • display_name = “zygo01”
  • enable_active_checks = true
  • enable_event_handler = true
  • enable_flapping = false
  • enable_notifications = true
  • enable_passive_checks = true
  • enable_perfdata = true
  • event_command = “”
  • flapping_threshold = 0
  • flapping_threshold_high = 30
  • flapping_threshold_low = 25
  • groups = [ ]
  • icon_image = “”
  • icon_image_alt = “”
  • max_check_attempts = 3
    % = modified in ‘/etc/icinga2/conf.d/templates.conf’, lines 15:3-15:24
  • name = “zygo01”
  • notes = “”
  • notes_url = “”
  • package = “_etc”
  • retry_interval = 30
    % = modified in ‘/etc/icinga2/conf.d/templates.conf’, lines 17:3-17:22
  • source_location
    • first_column = 1
    • first_line = 10
    • last_column = 20
    • last_line = 10
    • path = “/etc/icinga2/zones.d/zygo01/zygo01.conf”
  • templates = [ “zygo01”, “generic-host” ]
    % = modified in ‘/etc/icinga2/zones.d/zygo01/zygo01.conf’, lines 10:1-10:20
    % = modified in ‘/etc/icinga2/conf.d/templates.conf’, lines 14:1-14:28
  • type = “Host”
  • vars
    • client_endpoint = “zygo01”
      % = modified in ‘/etc/icinga2/zones.d/zygo01/zygo01.conf’, lines 17:3-17:29
    • notification
      • mail
        % = modified in ‘/etc/icinga2/zones.d/zygo01/zygo01.conf’, lines 14:3-16:3
        • groups = [ “icingaadmins” ]
    • os = “Linux”
      % = modified in ‘/etc/icinga2/zones.d/zygo01/zygo01.conf’, lines 13:3-13:19
  • volatile = false
  • zone = “zygo01”

I see, thanks. Is there a specific reason you’d use the zone config sync from zones.d/zygo01 instead of the command endpoint method? That may be the culprit here, as the master does not feel authoritative for the host/service objects and as such, it won’t execute any checks - it believes the agent’s zone will do so.

Look into your zones.conf, and pick the zone where the master is a member of. Move the host objects from zones.d/HOSTNAME into zones.d/MASTERZONE, and the service apply rules either there, or into a global zone. Reload and try again.

Cheers,
Michael

Thanks Michael, appreciate your help with this. So at present my zones.conf is in /etc/icinga2 and contains the following

object Endpoint “namaste” {
}

object Zone “master” {
endpoints = [ “namaste” ]
}

object Zone “global-templates” {
global = true
}

object Zone “director-global” {
global = true
}

Should I add the objects for zones and endpoints to this file?

No, just ensure that the configuration is organised under zones.d, but not synced to the agent actually. Therefore put it into the master zone - only the current master (and maybe a secondary in the future) knows about it.

mkdir -p /etc/icinga2/zones.d/master

mv /etc/icinga2/zones.d/zygo01/zygo01.conf /etc/icinga2/zones.d/master/

systemctl reload icinga2

Cheers,
Michael

Yeah! Thats done the trick, thanks very much for your help

2 Likes