Open eeertel opened 3 years ago
At the first sight it sounds like #8155.
I am not sure if this is the case. The reason why I doubt this, is because I do not even need to verify if the hostgroup evaluation is correct (based on the host custom variables). A simple object list output shows that icinga2 has not updated the content of the icinga2.debug file.
The problem can be reproduced by this simple sequence:
Do you need any additional logs or information to narrow it down ?
We believe we have run into this as well on
icinga2 - The Icinga 2 network monitoring daemon (version: r2.12.3-1)
Copyright (c) 2012-2021 Icinga GmbH (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: Debian GNU/Linux
Platform version: 9 (stretch)
Kernel: Linux
Kernel version: 4.9.0-11-amd64
Architecture: x86_64
Build information:
Compiler: GNU 6.3.0
Build host: runner-hh8q3bz2-project-298-concurrent-0
OpenSSL version: OpenSSL 1.1.0l 10 Sep 2019
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
We were able to get around it on a test server by deleting the contents of /var/lib/icinga2/api/packages
and restarting icinga2, however, this doesn't really sit well as the right way to fix things in an environment where you care about the state of Icinga.
I am not sure if this is the case.
Sure or not sure – would you test that fix if I build packages for you?
yes - no problem with that (sorry for the late reply)
On which Icinga 2 version + OS shall the packages be based?
uname -a Linux icingamaster 5.4.0-1058-azure #60~18.04.1-Ubuntu SMP Tue Aug 31 20:34:46 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
icinga2 --version icinga2 - The Icinga 2 network monitoring daemon (version: r2.13.1-1)
Copyright (c) 2012-2021 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: 18.04.6 LTS (Bionic Beaver) Kernel: Linux Kernel version: 5.4.0-1058-azure Architecture: x86_64
Build information: Compiler: GNU 8.4.0 Build host: runner-hh8q3bz2-project-508-concurrent-0 OpenSSL version: OpenSSL 1.1.1 11 Sep 2018
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
https://git.icinga.com/packaging/deb-icinga2/-/jobs/127541/artifacts/download
Backup your /var/lib/icinga2/modified-attributes.conf
first!
thanks - will install it today or tomorrow and will let you know.
The fix is working !
See below a snip of the installed version and the output of the commands. Command sequence:
checked that the new variable value is reflected via the object list command
root@icingamaster-dev:/etc/icinga2# icinga2 object list --type=host --name "azrg_acs_mixed" Object 'azrg_acs_mixed' of type 'Host': % declared in '/var/lib/icinga2/api/packages/_api/d2bb9ae4-dfd4-4ebe-a4b3-154b30460bf2/conf.d/hosts/azrg_acs_mixed.conf', lines 1:0-1:27
root@icingamaster-dev:/etc/icinga2# icinga2 --version icinga2 - The Icinga 2 network monitoring daemon (version: v2.13.1-4-g7b7158833)
Copyright (c) 2012-2021 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: 18.04.6 LTS (Bionic Beaver) Kernel: Linux Kernel version: 5.4.0-1056-azure Architecture: x86_64
Build information: Compiler: GNU 8.4.0 Build host: runner-hh8q3bz2-project-298-concurrent-0 OpenSSL version: OpenSSL 1.1.1 11 Sep 2018
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@icingamaster-dev:/etc/icinga2#
@Al2Klimov Do you have an estimated release date when this bug will be fixed ?
Unfortunately no.
Changes of custom vars are not handled correctly
This issue is probably related to https://github.com/Icinga/icinga2/issues/6012, https://github.com/Icinga/icinga2/issues/6569 and https://github.com/Icinga/icinga2/issues/6576.
We create and update hosts via API. The updates of custom vars are not processed correctly (e.g. hostgroups and dependencies defined on above mentioned custom vars) even after a restart/reload of the icinga2 service
We have tried out all workarounds (e.g. UPDATE icinga_hosts SET config_hash = NULL; ...) without any luck.
To make a long story short, there is a difference between the host object retrieved via the API :
curl -k -s -u '' -H 'Accept: application/json' \
-H 'X-HTTP-Method-Override: GET' -X POST \
'https://localhost:5665/v1/objects/hosts' \
-d '{ "filter": "host.name==\"600601_IN_Salem_MithraScans(P)Ltd_12504_desktop-vice7td_rlp0\"", "pretty": true }'
and via the icinga2 object list command below:
icinga2 object list --type=host --name="600601_IN_Salem_MithraScans(P)Ltd_12504_desktop-vice7td_rlp0"
even after a restart or reload of icinga2
To Reproduce
Expected behavior
The updated custom vars should be reflected in the icinga2 object list output
Screenshots
n.a.
Your Environment
Include as many relevant details about the environment you experienced the problem in
icinga2 --version
):Copyright (c) 2012-2021 Icinga GmbH (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: 18.04.5 LTS (Bionic Beaver) Kernel: Linux Kernel version: 5.4.0-1043-azure Architecture: x86_64
Build information: Compiler: GNU 8.4.0 Build host: runner-hh8q3bz2-project-298-concurrent-0 OpenSSL version: OpenSSL 1.1.1 11 Sep 2018
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
Disabled features: command compatlog debuglog elasticsearch gelf graphite icingadb influxdb livestatus opentsdb perfdata statusdata Enabled features: api checker ido-pgsql mainlog notification syslog
[2021-03-24 11:01:48 +0000] information/cli: Icinga application loader (version: r2.12.3-1) [2021-03-24 11:01:48 +0000] information/cli: Loading configuration file(s). [2021-03-24 11:01:49 +0000] information/ConfigItem: Committing config item(s). [2021-03-24 11:01:49 +0000] information/ApiListener: My API identity: icingaconfigmaster-staging.teamplay.monitoring.net [2021-03-24 11:01:59 +0000] information/WorkQueue: #4 (DaemonUtility::LoadConfigFiles) items: 0, rate: 23.7333/s (1424/min 1424/5min 1424/15min); [2021-03-24 11:01:59 +0000] information/WorkQueue: #5 (ApiListener, RelayQueue) items: 0, rate: 0/s (0/min 0/5min 0/15min); [2021-03-24 11:01:59 +0000] information/WorkQueue: #6 (ApiListener, SyncQueue) items: 0, rate: 0/s (0/min 0/5min 0/15min); [2021-03-24 11:02:08 +0000] warning/ApplyRule: Apply rule 'teams4host-icingaadmin' (in /etc/icinga2/zones.d/global-templates/notifications.conf: 31:1-31:51) for type 'Notification' does not match anywhere! [2021-03-24 11:02:08 +0000] warning/ApplyRule: Apply rule 'teams4service-icingaadmin' (in /etc/icinga2/zones.d/global-templates/notifications.conf: 40:1-40:57) for type 'Notification' does not match anywhere! [2021-03-24 11:02:08 +0000] warning/ApplyRule: Apply rule 'ping4' (in /etc/icinga2/zones.d/global-templates/custom_services/services.conf: 2:1-2:21) for type 'Service' does not match anywhere! [2021-03-24 11:02:08 +0000] warning/ApplyRule: Apply rule '' (in /etc/icinga2/zones.d/global-templates/custom_services/services.conf: 31:1-31:65) for type 'Service' does not match anywhere! [2021-03-24 11:02:08 +0000] warning/ApplyRule: Apply rule '' (in /etc/icinga2/zones.d/global-templates/custom_services/services.conf: 39:1-39:53) for type 'Service' does not match anywhere! [2021-03-24 11:02:08 +0000] warning/ApplyRule: Apply rule 'swap' (in /etc/icinga2/zones.d/global-templates/custom_services/services.conf: 85:1-85:20) for type 'Service' does not match anywhere! [2021-03-24 11:02:08 +0000] warning/ApplyRule: Apply rule 'MalwareScanServiceIsOperableCheck' (in /etc/icinga2/zones.d/global-templates/teamplay_resources/services/malwarescanservice.conf: 1:0-1:48) for type 'Service' does not match anywhere! [2021-03-24 11:02:08 +0000] warning/ApplyRule: Apply rule 'MalwareScanServiceCertificateCheck' (in /etc/icinga2/zones.d/global-templates/teamplay_resources/services/malwarescanservice.conf: 12:1-12:50) for type 'Service' does not match anywhere! [2021-03-24 11:02:08 +0000] warning/ApplyRule: Apply rule 'child-health' (in /etc/icinga2/zones.d/teamplay.monitoring.masterzone/clusters/cluster.conf: 9:1-9:28) for type 'Service' does not match anywhere! [2021-03-24 11:02:08 +0000] information/ConfigItem: Instantiated 1 NotificationComponent. [2021-03-24 11:02:08 +0000] information/ConfigItem: Instantiated 1 SyslogLogger. [2021-03-24 11:02:08 +0000] information/ConfigItem: Instantiated 4289 Hosts. [2021-03-24 11:02:08 +0000] information/ConfigItem: Instantiated 436 Downtimes. [2021-03-24 11:02:08 +0000] information/ConfigItem: Instantiated 4 NotificationCommands. [2021-03-24 11:02:08 +0000] information/ConfigItem: Instantiated 1 FileLogger. [2021-03-24 11:02:08 +0000] information/ConfigItem: Instantiated 3827 Comments. [2021-03-24 11:02:08 +0000] information/ConfigItem: Instantiated 60767 Notifications. [2021-03-24 11:02:08 +0000] information/ConfigItem: Instantiated 1 IcingaApplication. [2021-03-24 11:02:08 +0000] information/ConfigItem: Instantiated 85 HostGroups. [2021-03-24 11:02:08 +0000] information/ConfigItem: Instantiated 57050 Dependencies. [2021-03-24 11:02:08 +0000] information/ConfigItem: Instantiated 1 CheckerComponent. [2021-03-24 11:02:08 +0000] information/ConfigItem: Instantiated 5 Zones. [2021-03-24 11:02:08 +0000] information/ConfigItem: Instantiated 8 Endpoints. [2021-03-24 11:02:08 +0000] information/ConfigItem: Instantiated 2 ApiUsers. [2021-03-24 11:02:08 +0000] information/ConfigItem: Instantiated 1 ApiListener. [2021-03-24 11:02:08 +0000] information/ConfigItem: Instantiated 301 CheckCommands. [2021-03-24 11:02:08 +0000] information/ConfigItem: Instantiated 1 IdoPgsqlConnection. [2021-03-24 11:02:08 +0000] information/ConfigItem: Instantiated 3 TimePeriods. [2021-03-24 11:02:08 +0000] information/ConfigItem: Instantiated 13 UserGroups. [2021-03-24 11:02:08 +0000] information/ConfigItem: Instantiated 16 Users. [2021-03-24 11:02:08 +0000] information/ConfigItem: Instantiated 56519 Services. [2021-03-24 11:02:08 +0000] information/ConfigItem: Instantiated 3 ServiceGroups. [2021-03-24 11:02:08 +0000] information/ConfigItem: Instantiated 9 ScheduledDowntimes.
Object 'icingaussat1-staging.teamplay.monitoring.net' of type 'Endpoint': % declared in '/etc/icinga2/zones.conf', lines 30:1-30:62
Object 'icingasecondarymaster-staging.teamplay.monitoring.net' of type 'Endpoint': % declared in '/etc/icinga2/zones.conf', lines 9:1-9:71
Object 'icingaconfigmaster-staging.teamplay.monitoring.net' of type 'Endpoint': % declared in '/etc/icinga2/zones.conf', lines 5:1-5:68
Object 'icingaeusat1-staging.teamplay.monitoring.net' of type 'Endpoint': % declared in '/etc/icinga2/zones.conf', lines 14:1-14:62
Object 'icingaussat2-staging.teamplay.monitoring.net' of type 'Endpoint': % declared in '/etc/icinga2/zones.conf', lines 34:1-34:62
Object 'icingaeusat2-staging.teamplay.monitoring.net' of type 'Endpoint': % declared in '/etc/icinga2/zones.conf', lines 18:1-18:62
Object 'icingajpsat2-staging.teamplay.monitoring.net' of type 'Endpoint': % declared in '/etc/icinga2/zones.conf', lines 26:1-26:62
Object 'icingajpsat1-staging.teamplay.monitoring.net' of type 'Endpoint': % declared in '/etc/icinga2/zones.conf', lines 22:1-22:62
object Endpoint "icingaconfigmaster-staging.teamplay.monitoring.net" { //that's us }
object Endpoint "icingasecondarymaster-staging.teamplay.monitoring.net" { host = "10.3.0.6" }
object Endpoint "icingaeusat1-staging.teamplay.monitoring.net" { host = "10.3.0.7" }
object Endpoint "icingaeusat2-staging.teamplay.monitoring.net" { host = "10.3.0.8" }
object Endpoint "icingajpsat1-staging.teamplay.monitoring.net" { host = "10.4.0.4" }
object Endpoint "icingajpsat2-staging.teamplay.monitoring.net" { host = "10.4.0.5" }
object Endpoint "icingaussat1-staging.teamplay.monitoring.net" { host = "10.5.0.4" }
object Endpoint "icingaussat2-staging.teamplay.monitoring.net" { host = "10.5.0.5" }
object Zone "teamplay.monitoring.masterzone" { endpoints = [ "icingaconfigmaster-staging.teamplay.monitoring.net" , "icingasecondarymaster-staging.teamplay.monitoring.net" ] }
object Zone "teamplay.monitoring.euclientzone" { endpoints = [ "icingaeusat1-staging.teamplay.monitoring.net", "icingaeusat2-staging.teamplay.monitoring.net" ]
parent = "teamplay.monitoring.masterzone"
}
object Zone "teamplay.monitoring.jpclientzone" { endpoints = [ "icingajpsat1-staging.teamplay.monitoring.net", "icingajpsat2-staging.teamplay.monitoring.net" ]
parent = "teamplay.monitoring.masterzone"
}
object Zone "teamplay.monitoring.usclientzone" { endpoints = [ "icingaussat1-staging.teamplay.monitoring.net", "icingaussat2-staging.teamplay.monitoring.net" ]
parent = "teamplay.monitoring.masterzone"
}
/ sync global commands / object Zone "global-templates" { global = true }