I have an icinga2 server as listed below; I’ve set it up with mostly passive checks, reporting through the REST API, which works fine.
Our setup consists of a number of servers, which are supposed to always be online, and a number of ‘workstations’ - powerful PCs that are mostly on, but may be taken down from time to time. When they are up, they will send in passive checks, and then when they are down, they clutter the web page with ‘UNKNOWN’ status messages.
I found Delete Hosts automatically, but I don’t use Director, and the situation is different, I think. Is there a mechanism in Icinga2 that can purge hosts after a set time, 1 day, for example?
I can of course implement something with a cron job or a systemd timer, but I don’t want to reinvent the wheel.
root@vogon:~# icinga2 --version
icinga2 - The Icinga 2 network monitoring daemon (version: r2.14.0-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-25-amd64
Architecture: x86_64
Build information:
Compiler: GNU 10.2.1
Build host: runner-hh8q3bz2-project-575-concurrent-0
OpenSSL version: OpenSSL 1.1.1w 11 Sep 2023
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
- Operating System and version
root@vogon:~# cat /etc/*release*
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
- Enabled features (
icinga2 feature list
)
root@vogon:~# icinga2 feature list
Disabled features: compatlog debuglog elasticsearch gelf graphite influxdb influxdb2 journald livestatus opentsdb perfdata statusdata syslog
Enabled features: api checker command icingadb mainlog notification
- Icinga Web 2 version and modules (System - About)
Icinga Web 2 Version 2.12.0
Git commit 7cd79a5c7ff66a6a67ecd55875c214ba4b2c7db4
PHP Version 7.4.33
Git commit date 2023-09-21
Get Icinga Support
Icinga Community
Report a bug
Icinga Documentation
Pending Migrations
Icinga Web 1
Show all
Loaded Libraries
icinga/icinga-php-library 0.13.0
icinga/icinga-php-thirdparty 0.12.0
Loaded Modules
doc 2.12.0 Configure
icingadb 1.1.0 Configure
pdfexport 0.10.2 Configure
reporting 0.10.0 Configure
- Config validation (
icinga2 daemon -C
)
root@vogon:~# icinga2 daemon -C
[2023-10-16 11:41:00 +0000] information/cli: Icinga application loader (version: r2.14.0-1)
[2023-10-16 11:41:00 +0000] information/cli: Loading configuration file(s).
[2023-10-16 11:41:00 +0000] information/ConfigItem: Committing config item(s).
[2023-10-16 11:41:00 +0000] information/ApiListener: My API identity: vogon.comind.io
[2023-10-16 11:41:00 +0000] information/ConfigItem: Instantiated 2 NotificationCommands.
[2023-10-16 11:41:00 +0000] information/ConfigItem: Instantiated 16 Notifications.
[2023-10-16 11:41:00 +0000] information/ConfigItem: Instantiated 1 IcingaApplication.
[2023-10-16 11:41:00 +0000] information/ConfigItem: Instantiated 21 Hosts.
[2023-10-16 11:41:00 +0000] information/ConfigItem: Instantiated 2 HostGroups.
[2023-10-16 11:41:00 +0000] information/ConfigItem: Instantiated 1 Downtime.
[2023-10-16 11:41:00 +0000] information/ConfigItem: Instantiated 1 IcingaDB.
[2023-10-16 11:41:00 +0000] information/ConfigItem: Instantiated 1 FileLogger.
[2023-10-16 11:41:00 +0000] information/ConfigItem: Instantiated 3 Zones.
[2023-10-16 11:41:00 +0000] information/ConfigItem: Instantiated 1 CheckerComponent.
[2023-10-16 11:41:00 +0000] information/ConfigItem: Instantiated 1 ExternalCommandListener.
[2023-10-16 11:41:00 +0000] information/ConfigItem: Instantiated 1 Endpoint.
[2023-10-16 11:41:00 +0000] information/ConfigItem: Instantiated 1 ApiUser.
[2023-10-16 11:41:00 +0000] information/ConfigItem: Instantiated 1 NotificationComponent.
[2023-10-16 11:41:00 +0000] information/ConfigItem: Instantiated 1 ApiListener.
[2023-10-16 11:41:00 +0000] information/ConfigItem: Instantiated 249 CheckCommands.
[2023-10-16 11:41:00 +0000] information/ConfigItem: Instantiated 3 TimePeriods.
[2023-10-16 11:41:00 +0000] information/ConfigItem: Instantiated 1 UserGroup.
[2023-10-16 11:41:00 +0000] information/ConfigItem: Instantiated 1 User.
[2023-10-16 11:41:00 +0000] information/ConfigItem: Instantiated 155 Services.
[2023-10-16 11:41:00 +0000] information/ConfigItem: Instantiated 3 ServiceGroups.
[2023-10-16 11:41:00 +0000] information/ConfigItem: Instantiated 1 ScheduledDowntime.
[2023-10-16 11:41:00 +0000] information/ScriptGlobal: Dumping variables to file '/var/cache/icinga2/icinga2.vars'
[2023-10-16 11:41:01 +0000] information/cli: Finished validating the configuration file(s).