Hello!
I am new to Icinga2 and have a problem configuring a custom plugin/check command.
I downloaded and added the check_systemd_service file and added it on my master to /usr/lib/nagios/plugins. Then i configured the command in Icingaweb2.
The problem now is, that this file is not deployed from the master to the agents, so i get “Check command ‘systemd_service’ does not exist.” as check result.
On one agent i manually added the check_systemd_service file manually to the same path like on the master and the check works fine now. But i expectet, that the file ist distributed automatically to the agents.
Would be great if someone could help me to get this working oder if someone could tell me what would be the best practice to deploy command files automatically.
Thanks in advance!
Give as much information as you can, e.g.
- Version used (
icinga2 --version
): r2.13.0-1 - Operating System and version: Debian 10
- Enabled features (
icinga2 feature list
): api checker command ido-mysql influxdb2 livestatus mainlog notification perfdata - Icinga Web 2 version and modules (System - About): 2.9.2
- Config validation (
icinga2 daemon -C
)
[2021-08-22 20:32:55 +0200] information/cli: Icinga application loader (version: r2.13.0-1)
[2021-08-22 20:32:55 +0200] information/cli: Loading configuration file(s).
[2021-08-22 20:32:56 +0200] information/ConfigItem: Committing config item(s).
[2021-08-22 20:32:56 +0200] information/ApiListener: My API identity: icinga2.home.domain.de
[2021-08-22 20:32:56 +0200] warning/ApplyRule: Apply rule 'notification_host_down' (in /var/lib/icinga2/api/packages/director/68cbdd02-1e4d-4963-be97-6ddde60b8db2/zones.d/master/notification_apply.conf: 1:0-1:50) for type 'Notification' does not match anywhere!
[2021-08-22 20:32:56 +0200] information/ConfigItem: Instantiated 1 IcingaApplication.
[2021-08-22 20:32:56 +0200] information/ConfigItem: Instantiated 10 Hosts.
[2021-08-22 20:32:56 +0200] information/ConfigItem: Instantiated 1 FileLogger.
[2021-08-22 20:32:56 +0200] information/ConfigItem: Instantiated 1 CheckerComponent.
[2021-08-22 20:32:56 +0200] information/ConfigItem: Instantiated 1 Influxdb2Writer.
[2021-08-22 20:32:56 +0200] information/ConfigItem: Instantiated 1 ApiListener.
[2021-08-22 20:32:56 +0200] information/ConfigItem: Instantiated 1 IdoMysqlConnection.
[2021-08-22 20:32:56 +0200] information/ConfigItem: Instantiated 10 Zones.
[2021-08-22 20:32:56 +0200] information/ConfigItem: Instantiated 1 ExternalCommandListener.
[2021-08-22 20:32:56 +0200] information/ConfigItem: Instantiated 8 Endpoints.
[2021-08-22 20:32:56 +0200] information/ConfigItem: Instantiated 1 ApiUser.
[2021-08-22 20:32:56 +0200] information/ConfigItem: Instantiated 245 CheckCommands.
[2021-08-22 20:32:56 +0200] information/ConfigItem: Instantiated 1 LivestatusListener.
[2021-08-22 20:32:56 +0200] information/ConfigItem: Instantiated 1 NotificationComponent.
[2021-08-22 20:32:56 +0200] information/ConfigItem: Instantiated 1 UserGroup.
[2021-08-22 20:32:56 +0200] information/ConfigItem: Instantiated 1 User.
[2021-08-22 20:32:56 +0200] information/ConfigItem: Instantiated 53 Services.
[2021-08-22 20:32:56 +0200] information/ConfigItem: Instantiated 1 PerfdataWriter.
[2021-08-22 20:32:56 +0200] information/ScriptGlobal: Dumping variables to file '/var/cache/icinga2/icinga2.vars'
[2021-08-22 20:32:56 +0200] information/cli: Finished validating the configuration file(s).
- If you run multiple Icinga 2 instances, the
zones.conf
file (oricinga2 object list --type Endpoint
andicinga2 object list --type Zone
) from all affected nodes:
Master:
/*
* Generated by Icinga 2 node setup commands
* on 2021-07-27 12:16:22 +0200
*/
object Endpoint "icinga2.home.domain.de" {
}
object Zone "master" {
endpoints = [ "icinga2.home.domain.de" ]
}
object Zone "global-templates" {
global = true
}
object Zone "director-global" {
global = true
}
Agent:
/*
* Generated by Icinga 2 node setup commands
* on 2021-08-20 21:10:16 +0200
*/
object Endpoint "icinga2.home.domain.de" {
host = "icinga2.home.domain.de"
port = "5665"
}
object Zone "master" {
endpoints = [ "icinga2.home.domain.de" ]
}
object Endpoint NodeName {
}
object Zone ZoneName {
endpoints = [ NodeName ]
parent = "master"
}
object Zone "global-templates" {
global = true
}
object Zone "director-global" {
global = true
}