I am trying to get passive checks (in python3) to work, but I’m getting the following error:
Max retries exceeded with url: /v1/objects/hosts/enlil (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self-signed certificate in certificate chain (_ssl.c:997)')))
I have seen the other questions about this type of error, but I’d like to understand in some depth what the problem is - like, how does icinga match the certificates, keys etc. I set this up some years ago, but now that I try to do it again, it somehow eludes me, even when I follow the instructions in painstaking detail.
On the master:
root@vogon:~# icinga2 --version
icinga2 - The Icinga 2 network monitoring daemon (version: r2.13.6-1)
Copyright (c) 2012-2023 Icinga GmbH (https://icinga.com/)
License GPLv2+: GNU GPL version 2 or later <https://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: Debian GNU/Linux
Platform version: 11 (bullseye)
Kernel: Linux
Kernel version: 5.10.0-13-amd64
Architecture: x86_64
Build information:
Compiler: GNU 10.2.1
Build host: runner-hh8q3bz2-project-575-concurrent-0
OpenSSL version: OpenSSL 1.1.1n 15 Mar 2022
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
root@vogon:~# icinga2 feature list
Disabled features: compatlog debuglog elasticsearch gelf graphite influxdb influxdb2 livestatus opentsdb perfdata statusdata syslog
Enabled features: api checker command icingadb mainlog notification
root@vogon:~# icinga2 daemon -C
[2023-03-15 12:42:29 +0000] information/cli: Icinga application loader (version: r2.13.6-1)
[2023-03-15 12:42:29 +0000] information/cli: Loading configuration file(s).
[2023-03-15 12:42:29 +0000] information/ConfigItem: Committing config item(s).
[2023-03-15 12:42:29 +0000] information/ApiListener: My API identity: vogon.comind.io
[2023-03-15 12:42:29 +0000] information/ConfigItem: Instantiated 1 IcingaApplication.
[2023-03-15 12:42:29 +0000] information/ConfigItem: Instantiated 3 Hosts.
[2023-03-15 12:42:29 +0000] information/ConfigItem: Instantiated 1 FileLogger.
[2023-03-15 12:42:29 +0000] information/ConfigItem: Instantiated 1 CheckerComponent.
[2023-03-15 12:42:29 +0000] information/ConfigItem: Instantiated 1 IcingaDB.
[2023-03-15 12:42:29 +0000] information/ConfigItem: Instantiated 6 Zones.
[2023-03-15 12:42:29 +0000] information/ConfigItem: Instantiated 1 ExternalCommandListener.
[2023-03-15 12:42:29 +0000] information/ConfigItem: Instantiated 4 Endpoints.
[2023-03-15 12:42:29 +0000] information/ConfigItem: Instantiated 1 ApiUser.
[2023-03-15 12:42:29 +0000] information/ConfigItem: Instantiated 1 ApiListener.
[2023-03-15 12:42:29 +0000] information/ConfigItem: Instantiated 1 NotificationComponent.
[2023-03-15 12:42:29 +0000] information/ConfigItem: Instantiated 245 CheckCommands.
[2023-03-15 12:42:29 +0000] information/ConfigItem: Instantiated 4 Services.
[2023-03-15 12:42:29 +0000] information/ScriptGlobal: Dumping variables to file '/var/cache/icinga2/icinga2.vars'
[2023-03-15 12:42:29 +0000] information/cli: Finished validating the configuration file(s).
root@vogon:~# icinga2 object list --type Endpoint
Object 'vogon.comind.io' of type 'Endpoint':
% declared in '/etc/icinga2/zones.conf', lines 6:1-6:33
* __name = "vogon.comind.io"
* host = ""
* log_duration = 86400
* name = "vogon.comind.io"
* package = "_etc"
* port = "5665"
* source_location
* first_column = 1
* first_line = 6
* last_column = 33
* last_line = 6
* path = "/etc/icinga2/zones.conf"
* templates = [ "vogon.comind.io" ]
% = modified in '/etc/icinga2/zones.conf', lines 6:1-6:33
* type = "Endpoint"
* zone = ""
Object 'Vogon' of type 'Endpoint':
% declared in '/var/lib/icinga2/api/packages/director/78e4ba30-b15e-435a-ae16-dabb327db8bb/zones.d/vogon/agent_endpoints.conf', lines 6:1-6:23
* __name = "Vogon"
* host = "vogon.comind.io"
% = modified in '/var/lib/icinga2/api/packages/director/78e4ba30-b15e-435a-ae16-dabb327db8bb/zones.d/vogon/agent_endpoints.conf', lines 7:5-7:28
* log_duration = 0
% = modified in '/var/lib/icinga2/api/packages/director/78e4ba30-b15e-435a-ae16-dabb327db8bb/zones.d/vogon/agent_endpoints.conf', lines 8:5-8:21
* name = "Vogon"
* package = "director"
* port = "5665"
* source_location
* first_column = 1
* first_line = 6
* last_column = 23
* last_line = 6
* path = "/var/lib/icinga2/api/packages/director/78e4ba30-b15e-435a-ae16-dabb327db8bb/zones.d/vogon/agent_endpoints.conf"
* templates = [ "Vogon" ]
% = modified in '/var/lib/icinga2/api/packages/director/78e4ba30-b15e-435a-ae16-dabb327db8bb/zones.d/vogon/agent_endpoints.conf', lines 6:1-6:23
* type = "Endpoint"
* zone = "vogon"
Object 'wap1' of type 'Endpoint':
% declared in '/var/lib/icinga2/api/packages/director/78e4ba30-b15e-435a-ae16-dabb327db8bb/zones.d/vogon/agent_endpoints.conf', lines 11:1-11:22
* __name = "wap1"
* host = "wap.comind.io"
% = modified in '/var/lib/icinga2/api/packages/director/78e4ba30-b15e-435a-ae16-dabb327db8bb/zones.d/vogon/agent_endpoints.conf', lines 12:5-12:26
* log_duration = 0
% = modified in '/var/lib/icinga2/api/packages/director/78e4ba30-b15e-435a-ae16-dabb327db8bb/zones.d/vogon/agent_endpoints.conf', lines 13:5-13:21
* name = "wap1"
* package = "director"
* port = "5665"
* source_location
* first_column = 1
* first_line = 11
* last_column = 22
* last_line = 11
* path = "/var/lib/icinga2/api/packages/director/78e4ba30-b15e-435a-ae16-dabb327db8bb/zones.d/vogon/agent_endpoints.conf"
* templates = [ "wap1" ]
% = modified in '/var/lib/icinga2/api/packages/director/78e4ba30-b15e-435a-ae16-dabb327db8bb/zones.d/vogon/agent_endpoints.conf', lines 11:1-11:22
* type = "Endpoint"
* zone = "vogon"
Object 'Enlil' of type 'Endpoint':
% declared in '/var/lib/icinga2/api/packages/director/78e4ba30-b15e-435a-ae16-dabb327db8bb/zones.d/vogon/agent_endpoints.conf', lines 1:0-1:22
* __name = "Enlil"
* host = "enlil.comind.io"
% = modified in '/var/lib/icinga2/api/packages/director/78e4ba30-b15e-435a-ae16-dabb327db8bb/zones.d/vogon/agent_endpoints.conf', lines 2:5-2:28
* log_duration = 0
% = modified in '/var/lib/icinga2/api/packages/director/78e4ba30-b15e-435a-ae16-dabb327db8bb/zones.d/vogon/agent_endpoints.conf', lines 3:5-3:21
* name = "Enlil"
* package = "director"
* port = "5665"
* source_location
* first_column = 0
* first_line = 1
* last_column = 22
* last_line = 1
* path = "/var/lib/icinga2/api/packages/director/78e4ba30-b15e-435a-ae16-dabb327db8bb/zones.d/vogon/agent_endpoints.conf"
* templates = [ "Enlil" ]
% = modified in '/var/lib/icinga2/api/packages/director/78e4ba30-b15e-435a-ae16-dabb327db8bb/zones.d/vogon/agent_endpoints.conf', lines 1:0-1:22
* type = "Endpoint"
* zone = "vogon"
root@vogon:~# icinga2 object list --type Zone
Object 'Enlil' of type 'Zone':
% declared in '/var/lib/icinga2/api/packages/director/78e4ba30-b15e-435a-ae16-dabb327db8bb/zones.d/vogon/agent_zones.conf', lines 1:0-1:18
* __name = "Enlil"
* endpoints = [ "Enlil" ]
% = modified in '/var/lib/icinga2/api/packages/director/78e4ba30-b15e-435a-ae16-dabb327db8bb/zones.d/vogon/agent_zones.conf', lines 3:5-3:27
* global = false
* name = "Enlil"
* package = "director"
* parent = "vogon"
% = modified in '/var/lib/icinga2/api/packages/director/78e4ba30-b15e-435a-ae16-dabb327db8bb/zones.d/vogon/agent_zones.conf', lines 2:5-2:20
* source_location
* first_column = 0
* first_line = 1
* last_column = 18
* last_line = 1
* path = "/var/lib/icinga2/api/packages/director/78e4ba30-b15e-435a-ae16-dabb327db8bb/zones.d/vogon/agent_zones.conf"
* templates = [ "Enlil" ]
% = modified in '/var/lib/icinga2/api/packages/director/78e4ba30-b15e-435a-ae16-dabb327db8bb/zones.d/vogon/agent_zones.conf', lines 1:0-1:18
* type = "Zone"
* zone = "vogon"
Object 'director-global' of type 'Zone':
% declared in '/etc/icinga2/zones.conf', lines 17:1-17:29
* __name = "director-global"
* endpoints = null
* global = true
% = modified in '/etc/icinga2/zones.conf', lines 18:2-18:14
* name = "director-global"
* package = "_etc"
* parent = ""
* source_location
* first_column = 1
* first_line = 17
* last_column = 29
* last_line = 17
* path = "/etc/icinga2/zones.conf"
* templates = [ "director-global" ]
% = modified in '/etc/icinga2/zones.conf', lines 17:1-17:29
* type = "Zone"
* zone = ""
Object 'Vogon' of type 'Zone':
% declared in '/var/lib/icinga2/api/packages/director/78e4ba30-b15e-435a-ae16-dabb327db8bb/zones.d/vogon/agent_zones.conf', lines 6:1-6:19
* __name = "Vogon"
* endpoints = [ "Vogon" ]
% = modified in '/var/lib/icinga2/api/packages/director/78e4ba30-b15e-435a-ae16-dabb327db8bb/zones.d/vogon/agent_zones.conf', lines 8:5-8:27
* global = false
* name = "Vogon"
* package = "director"
* parent = "vogon"
% = modified in '/var/lib/icinga2/api/packages/director/78e4ba30-b15e-435a-ae16-dabb327db8bb/zones.d/vogon/agent_zones.conf', lines 7:5-7:20
* source_location
* first_column = 1
* first_line = 6
* last_column = 19
* last_line = 6
* path = "/var/lib/icinga2/api/packages/director/78e4ba30-b15e-435a-ae16-dabb327db8bb/zones.d/vogon/agent_zones.conf"
* templates = [ "Vogon" ]
% = modified in '/var/lib/icinga2/api/packages/director/78e4ba30-b15e-435a-ae16-dabb327db8bb/zones.d/vogon/agent_zones.conf', lines 6:1-6:19
* type = "Zone"
* zone = "vogon"
Object 'vogon' of type 'Zone':
% declared in '/etc/icinga2/zones.conf', lines 9:1-9:19
* __name = "vogon"
* endpoints = [ "vogon.comind.io" ]
% = modified in '/etc/icinga2/zones.conf', lines 10:2-10:34
* global = false
* name = "vogon"
* package = "_etc"
* parent = ""
* source_location
* first_column = 1
* first_line = 9
* last_column = 19
* last_line = 9
* path = "/etc/icinga2/zones.conf"
* templates = [ "vogon" ]
% = modified in '/etc/icinga2/zones.conf', lines 9:1-9:19
* type = "Zone"
* zone = ""
Object 'wap1' of type 'Zone':
% declared in '/var/lib/icinga2/api/packages/director/78e4ba30-b15e-435a-ae16-dabb327db8bb/zones.d/vogon/agent_zones.conf', lines 11:1-11:18
* __name = "wap1"
* endpoints = [ "wap1" ]
% = modified in '/var/lib/icinga2/api/packages/director/78e4ba30-b15e-435a-ae16-dabb327db8bb/zones.d/vogon/agent_zones.conf', lines 13:5-13:26
* global = false
* name = "wap1"
* package = "director"
* parent = "vogon"
% = modified in '/var/lib/icinga2/api/packages/director/78e4ba30-b15e-435a-ae16-dabb327db8bb/zones.d/vogon/agent_zones.conf', lines 12:5-12:20
* source_location
* first_column = 1
* first_line = 11
* last_column = 18
* last_line = 11
* path = "/var/lib/icinga2/api/packages/director/78e4ba30-b15e-435a-ae16-dabb327db8bb/zones.d/vogon/agent_zones.conf"
* templates = [ "wap1" ]
% = modified in '/var/lib/icinga2/api/packages/director/78e4ba30-b15e-435a-ae16-dabb327db8bb/zones.d/vogon/agent_zones.conf', lines 11:1-11:18
* type = "Zone"
* zone = "vogon"
Object 'global-templates' of type 'Zone':
% declared in '/etc/icinga2/zones.conf', lines 13:1-13:30
* __name = "global-templates"
* endpoints = null
* global = true
% = modified in '/etc/icinga2/zones.conf', lines 14:2-14:14
* name = "global-templates"
* package = "_etc"
* parent = ""
* source_location
* first_column = 1
* first_line = 13
* last_column = 30
* last_line = 13
* path = "/etc/icinga2/zones.conf"
* templates = [ "global-templates" ]
% = modified in '/etc/icinga2/zones.conf', lines 13:1-13:30
* type = "Zone"
* zone = ""
On the client:
root@enlil:~/jan/tools# icinga2 --version
icinga2 - The Icinga 2 network monitoring daemon (version: r2.13.2-1)
Copyright (c) 2012-2023 Icinga GmbH (https://icinga.com/)
License GPLv2+: GNU GPL version 2 or later <https://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: 22.04.1 LTS (Jammy Jellyfish)
Kernel: Linux
Kernel version: 5.15.0-58-generic
Architecture: x86_64
Build information:
Compiler: GNU 11.2.0
Build host: lcy02-amd64-054
OpenSSL version: OpenSSL 3.0.2 15 Mar 2022
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
root@enlil:~/jan/tools# icinga2 feature list
Disabled features: command compatlog debuglog elasticsearch gelf graphite icingadb influxdb influxdb2 livestatus notification opentsdb perfdata statusdata syslog
Enabled features: api checker mainlog
root@enlil:~/jan/tools# icinga2 daemon -C
[2023-03-15 12:47:13 +0000] information/cli: Icinga application loader (version: r2.13.2-1)
[2023-03-15 12:47:13 +0000] information/cli: Loading configuration file(s).
[2023-03-15 12:47:13 +0000] information/ConfigItem: Committing config item(s).
[2023-03-15 12:47:13 +0000] information/ApiListener: My API identity: enlil.comind.io
[2023-03-15 12:47:13 +0000] information/ConfigItem: Instantiated 1 IcingaApplication.
[2023-03-15 12:47:13 +0000] information/ConfigItem: Instantiated 1 FileLogger.
[2023-03-15 12:47:13 +0000] information/ConfigItem: Instantiated 1 CheckerComponent.
[2023-03-15 12:47:13 +0000] information/ConfigItem: Instantiated 1 ApiListener.
[2023-03-15 12:47:13 +0000] information/ConfigItem: Instantiated 4 Zones.
[2023-03-15 12:47:13 +0000] information/ConfigItem: Instantiated 2 Endpoints.
[2023-03-15 12:47:13 +0000] information/ConfigItem: Instantiated 244 CheckCommands.
[2023-03-15 12:47:13 +0000] information/ScriptGlobal: Dumping variables to file '/var/cache/icinga2/icinga2.vars'
[2023-03-15 12:47:13 +0000] information/cli: Finished validating the configuration file(s).
root@enlil:~/jan/tools# icinga2 object list --type Endpoint
Object 'enlil.comind.io' of type 'Endpoint':
% declared in '/etc/icinga2/zones.conf', lines 15:1-15:33
* __name = "enlil.comind.io"
* host = ""
* log_duration = 86400
* name = "enlil.comind.io"
* package = "_etc"
* port = "5665"
* source_location
* first_column = 1
* first_line = 15
* last_column = 33
* last_line = 15
* path = "/etc/icinga2/zones.conf"
* templates = [ "enlil.comind.io" ]
% = modified in '/etc/icinga2/zones.conf', lines 15:1-15:33
* type = "Endpoint"
* zone = ""
Object 'vogon.comind.io' of type 'Endpoint':
% declared in '/etc/icinga2/zones.conf', lines 6:1-6:33
* __name = "vogon.comind.io"
* host = "vogon.comind.io"
% = modified in '/etc/icinga2/zones.conf', lines 7:2-7:25
* log_duration = 86400
* name = "vogon.comind.io"
* 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 = 33
* last_line = 6
* path = "/etc/icinga2/zones.conf"
* templates = [ "vogon.comind.io" ]
% = modified in '/etc/icinga2/zones.conf', lines 6:1-6:33
* type = "Endpoint"
* zone = ""
root@enlil:~/jan/tools# icinga2 object list --type Zone
Object 'global-templates' of type 'Zone':
% declared in '/etc/icinga2/zones.conf', lines 23:1-23:30
* __name = "global-templates"
* endpoints = null
* global = true
% = modified in '/etc/icinga2/zones.conf', lines 24:2-24:14
* name = "global-templates"
* package = "_etc"
* parent = ""
* source_location
* first_column = 1
* first_line = 23
* last_column = 30
* last_line = 23
* path = "/etc/icinga2/zones.conf"
* templates = [ "global-templates" ]
% = modified in '/etc/icinga2/zones.conf', lines 23:1-23:30
* type = "Zone"
* zone = ""
Object 'director-global' of type 'Zone':
% declared in '/etc/icinga2/zones.conf', lines 27:1-27:29
* __name = "director-global"
* endpoints = null
* global = true
% = modified in '/etc/icinga2/zones.conf', lines 28:2-28:14
* name = "director-global"
* package = "_etc"
* parent = ""
* source_location
* first_column = 1
* first_line = 27
* last_column = 29
* last_line = 27
* path = "/etc/icinga2/zones.conf"
* templates = [ "director-global" ]
% = modified in '/etc/icinga2/zones.conf', lines 27:1-27:29
* type = "Zone"
* zone = ""
Object 'vogon' of type 'Zone':
% declared in '/etc/icinga2/zones.conf', lines 11:1-11:19
* __name = "vogon"
* endpoints = [ "vogon.comind.io" ]
% = modified in '/etc/icinga2/zones.conf', lines 12:2-12:34
* global = false
* name = "vogon"
* package = "_etc"
* parent = ""
* source_location
* first_column = 1
* first_line = 11
* last_column = 19
* last_line = 11
* path = "/etc/icinga2/zones.conf"
* templates = [ "vogon" ]
% = modified in '/etc/icinga2/zones.conf', lines 11:1-11:19
* type = "Zone"
* zone = ""
Object 'enlil.comind.io' of type 'Zone':
% declared in '/etc/icinga2/zones.conf', lines 18:1-18:29
* __name = "enlil.comind.io"
* endpoints = [ "enlil.comind.io" ]
% = modified in '/etc/icinga2/zones.conf', lines 19:2-19:34
* global = false
* name = "enlil.comind.io"
* package = "_etc"
* parent = "vogon"
% = modified in '/etc/icinga2/zones.conf', lines 20:2-20:17
* source_location
* first_column = 1
* first_line = 18
* last_column = 29
* last_line = 18
* path = "/etc/icinga2/zones.conf"
* templates = [ "enlil.comind.io" ]
% = modified in '/etc/icinga2/zones.conf', lines 18:1-18:29
* type = "Zone"
* zone = ""