Agent service stuck in pending

I cannot see any info about global zone updates e.g. information/ApiListener: Received configuration for zone '...'

It looks like your agent does not know about global zones. You could verify with icinga2.exe object list -t zone.

Hi @rsx. Thanks again for your kind help. Following are the output of “icinga object list -t zone”. It knows the global zones. The new agent services still pending. Any ideas?

root@agent1:~# icinga2 object list -t zone
Object 'director-global' of type 'Zone':
  % declared in '/etc/icinga2/zones.conf', lines 32:1-32:29
  * __name = "director-global"
  * endpoints = null
  * global = true
    % = modified in '/etc/icinga2/zones.conf', lines 33:2-33:14
  * name = "director-global"
  * package = "_etc"
  * parent = ""
  * source_location
    * first_column = 1
    * first_line = 32
    * last_column = 29
    * last_line = 32
    * path = "/etc/icinga2/zones.conf"
  * templates = [ "director-global" ]
    % = modified in '/etc/icinga2/zones.conf', lines 32:1-32:29
  * type = "Zone"
  * zone = ""

Object 'satellite' of type 'Zone':
  % declared in '/etc/icinga2/zones.conf', lines 15:1-15:20
  * __name = "satellite"
  * endpoints = [ "icinga-sattelite.***" ]
    % = modified in '/etc/icinga2/zones.conf', lines 16:5-16:52
  * global = false
  * name = "satellite"
  * package = "_etc"
  * parent = "master"
    % = modified in '/etc/icinga2/zones.conf', lines 17:5-17:21
  * source_location
    * first_column = 1
    * first_line = 15
    * last_column = 20
    * last_line = 15
    * path = "/etc/icinga2/zones.conf"
  * templates = [ "satellite" ]
    % = modified in '/etc/icinga2/zones.conf', lines 15:1-15:20
  * type = "Zone"
  * zone = ""

Object 'agent1' of type 'Zone':
  % declared in '/etc/icinga2/zones.conf', lines 23:1-23:31
  * __name = "agent1"
  * endpoints = [ "agent1" ]
    % = modified in '/etc/icinga2/zones.conf', lines 24:2-24:36
  * global = false
  * name = "agent1"
  * package = "_etc"
  * parent = "satellite"
    % = modified in '/etc/icinga2/zones.conf', lines 25:2-25:18
  * source_location
    * first_column = 1
    * first_line = 23
    * last_column = 31
    * last_line = 23
    * path = "/etc/icinga2/zones.conf"
  * templates = [ "agent1" ]
    % = modified in '/etc/icinga2/zones.conf', lines 23:1-23:31
  * type = "Zone"
  * zone = ""

Object 'master' of type 'Zone':
  % declared in '/etc/icinga2/zones.conf', lines 11:1-11:20
  * __name = "master"
  * endpoints = [ "icinga-master.***" ]
    % = modified in '/etc/icinga2/zones.conf', lines 12:2-12:49
  * global = false
  * name = "master"
  * package = "_etc"
  * parent = ""
  * source_location
    * first_column = 1
    * first_line = 11
    * last_column = 20
    * last_line = 11
    * path = "/etc/icinga2/zones.conf"
  * templates = [ "master" ]
    % = modified in '/etc/icinga2/zones.conf', lines 11:1-11:20
  * type = "Zone"
  * zone = ""

Object 'global-templates' of type 'Zone':
  % declared in '/etc/icinga2/zones.conf', lines 28:1-28:30
  * __name = "global-templates"
  * endpoints = null
  * global = true
    % = modified in '/etc/icinga2/zones.conf', lines 29:2-29:14
  * name = "global-templates"
  * package = "_etc"
  * parent = ""
  * source_location
    * first_column = 1
    * first_line = 28
    * last_column = 30
    * last_line = 28
    * path = "/etc/icinga2/zones.conf"
  * templates = [ "global-templates" ]
    % = modified in '/etc/icinga2/zones.conf', lines 28:1-28:30
  * type = "Zone"
  * zone = ""

Hi @rsx Thanks again. After upgrade icinga2 to r2.11.4-1,I tried in agent1
systemctl stop icinga2
rm -rf /var/lib/icinga2/api/{packages,zones,zones-stage}/
systemctl start icinga2

The config files in /var/lib/icinga2/api/{packages,zones,zones-stage}/ are still empty. The agent1 does not sync with satellite and get the new conf file. Both old and new services do not work.

@dnsmichi could you also help me check my issue and give me some advices. I stuck in this issue for a long time.
Thanks all for the kind help.

hi @rsx, thanks again. I checked the endpoint of the satellite. After upgrade, it only has two endponts. And it does not include the agent endpoint. It is weird. Do you know how to solve that??
Following is the satellite endpoint.

  root@icinga-sattelite:~# icinga2 object list -t Endpoint
  Object 'icinga-master.***' of type 'Endpoint':
    % declared in '/etc/icinga2/zones.conf', lines 6:1-6:48
    * __name = "icinga-master.***"
    * host = "icinga-master.***"
      % = modified in '/etc/icinga2/zones.conf', lines 7:2-7:40
    * log_duration = 86400
    * name = "icinga-master.***"
    * package = "_etc"
    * port = "5665"
      % = modified in '/etc/icinga2/zones.conf', lines 8:2-8:14
    * source_location
      * first_column = 1
      * first_line = 6
      * last_column = 48
      * last_line = 6
      * path = "/etc/icinga2/zones.conf"
    * templates = [ "icinga-master.***" ]
      % = modified in '/etc/icinga2/zones.conf', lines 6:1-6:48
    * type = "Endpoint"
    * zone = ""

  Object 'icinga-sattelite' of type 'Endpoint':
    % declared in '/etc/icinga2/zones.conf', lines 15:1-15:48
    * __name = "icinga-sattelite"
    * host = "icinga-sattelite"
      % = modified in '/etc/icinga2/zones.conf', lines 16:2-16:40
    * log_duration = 86400
    * name = "icinga-sattelite"
    * package = "_etc"
    * port = "5665"
      % = modified in '/etc/icinga2/zones.conf', lines 17:2-17:14
    * source_location
      * first_column = 1
      * first_line = 15
      * last_column = 48
      * last_line = 15
      * path = "/etc/icinga2/zones.conf"
    * templates = [ "icinga-sattelite" ]
      % = modified in '/etc/icinga2/zones.conf', lines 15:1-15:48
    * type = "Endpoint"
    * zone = ""

I’d recommend to:

  • check the logs on master and satellites
  • implement a service check to monitor zone connectivity e.g. as described here
  • remove object definitions for master at your agents

BTW: Please format your posts as described here as it makes them better readable.

@rsx Thanks again for your kind help.
how to remove the object definitions for master at the agents??

Just modify their zones.conf.

@rsx Sure. Thanks so much. The object list output of agent1(icinga2 object list -t Endpoint) contains the satellite endpoint. But object list output of satellite does not have the agent1 endpoint after the upgrade. Do you know how to add it back? But the object list output of master still includes the agent1 endpoint.

It looks like the satellite does not get updates from your master. The logs most properly have hints of what is wrong.