I added a single service using Director (entire system built with Director) to a host. The check executes on the master instead of the host. If I go into the master icinga2 directory structure and find the latest modified directory, i.e.:
sudo vi /var/lib/icinga2/api/packages/director/25682ce4-f50b-4ab8-b7e7-ce7e86b6cdf1/zones.d/director-global/service_templates.conf
I find the incorrectly executing host service template is missing the last 2 lines which are included in all the other templates, i.e.:
enable_notifications = true
command_endpoint = host_name
service_templates.conf
template Service “check-rpi-temp” {
check_command = “rpi-temp”
command_endpoint = host_name
}template Service “check-mdstat” {
check_command = “check-mdstat”
enable_notifications = true
command_endpoint = host_name
}template Service “check-shutdown-button-service” {
check_command = “shutdown-button-service”
enable_notifications = true
command_endpoint = host_name
}template Service “check-spa-temp” {
check_command = “check-spa-temp”
enable_notifications = true
command_endpoint = host_name
}template Service “check-hostalive” {
check_command = “hostalive”
command_endpoint = host_name
}template Service “check-fail2ban” {
check_command = “fail2ban”
enable_notifications = true
command_endpoint = host_name
}template Service “check-apt” {
check_command = “apt”
enable_notifications = true
command_endpoint = host_name
}template Service “check-disk” {
check_command = “disk”
enable_notifications = true
command_endpoint = host_name
vars.disk_ereg_path = “/media/backup”
}template Service “check-load” {
template Service “check-rpi-temp” {
check_command = “rpi-temp”
command_endpoint = host_name
}template Service “check-mdstat” {
check_command = “check-mdstat”
enable_notifications = true
command_endpoint = host_name
}template Service “check-shutdown-button-service” {
check_command = “shutdown-button-service”
enable_notifications = true
command_endpoint = host_name
}template Service “check-spa-temp” {
check_command = “check-spa-temp”
enable_notifications = true
command_endpoint = host_name
} check_command = “load”
enable_notifications = true
command_endpoint = host_name
vars.load_cload1 = “15”
vars.load_cload15 = “6”
vars.load_cload5 = “9”
vars.load_wload1 = “7.5”
vars.load_wload15 = “4.5”
vars.load_wload5 = “6”
}template Service “check-ssh” {
check_command = “ssh”
enable_notifications = true
command_endpoint = host_name
}template Service “check-swap” {
check_command = “swap”
enable_notifications = true
command_endpoint = host_name
}template Service “check-rpi-firmware” {
check_command = “rpi-firmware”
enable_notifications = true
command_endpoint = host_name
}template Service “check-pi-sd-card” {
check_command = “disk”
enable_notifications = true
command_endpoint = host_name
}template Service “check-rpi-temp” {
check_command = “rpi-temp”
command_endpoint = host_name
}template Service “check-mdstat” {
check_command = “check-mdstat”
enable_notifications = true
command_endpoint = host_name
}template Service “check-shutdown-button-service” {
check_command = “shutdown-button-service”
enable_notifications = true
command_endpoint = host_name
}template Service “check-spa-temp” {
check_command = “check-spa-temp”
enable_notifications = true
command_endpoint = host_name
}
If I add these lines to the file, it works correctly, for a while. I can see the host change in the “Dashboard>Service>Check Execution>Check Source” line.
Perhaps a new directory structure is generated during a refresh, and the new structure reverts to the same error.
As I am using Director for all changes and additions, I consider this a bug. I previously added an different single service to another host and this consistently works correctly. I’m happy to supply whatever information is needed.
On the Master:
icinga@master-bldr:~ $ icinga2 --version
[2020-06-07 17:42:21 -0600] warning/Application: Failed adjust resource limit for number of processes (RLIMIT_NPROC) with error “Operation not permitted”
[2020-06-07 17:42:21 -0600] warning/Application: Failed adjust resource limit for number of processes (RLIMIT_NPROC) with error “Operation not permitted”
icinga2 - The Icinga 2 network monitoring daemon (version: r2.11.2-1)Copyright (c) 2012-2020 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: Raspbian GNU/Linux
Platform version: 10 (buster)
Kernel: Linux
Kernel version: 4.19.97-v7+
Architecture: armv7lBuild information:
Compiler: GNU 8.3.0
Build host: runner-LTrJQZ9N-project-297-concurrent-0Application 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/icinga2Old paths (deprecated):
Installation root: /usr
Sysconf directory: /etc
Run directory (base): /run
Local state directory: /varInternal 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
On the host:
spa@spatemp:~ $ icinga2 --version
[2020-06-07 17:43:55 -0600] warning/Application: Failed adjust resource limit for number of processes (RLIMIT_NPROC) with error “Operation not permitted”
[2020-06-07 17:43:55 -0600] warning/Application: Failed adjust resource limit for number of processes (RLIMIT_NPROC) with error “Operation not permitted”
icinga2 - The Icinga 2 network monitoring daemon (version: r2.11.2-1)Copyright (c) 2012-2020 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: Raspbian GNU/Linux
Platform version: 10 (buster)
Kernel: Linux
Kernel version: 4.19.118+
Architecture: armv6lBuild information:
Compiler: GNU 8.3.0
Build host: runner-LTrJQZ9N-project-297-concurrent-0Application 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/icinga2Old paths (deprecated):
Installation root: /usr
Sysconf directory: /etc
Run directory (base): /run
Local state directory: /varInternal 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