I have set up the following checks and I’m getting either the status PENDING or the error message:
Check command ‘powershell-icinga-check-updates’ does not exist.
The client is running and the connection to the server is established. The script itself can be executed manually in PowerShell on the client.
I don’t know where the problem is
I use icinga 2 V r2.15.2-1)
my features
Disabled features: command compatlog debuglog elasticsearch gelf graphite icingadb influxdb influxdb2 journald livestatus opentsdb perfdata syslog
Enabled features: api checker ido-mysql mainlog notification
web version
2.12.65
object Endpoint “ubuntu” {
host = “192.168.99.132”
}
object Zone “master” {
endpoints = [ “ubuntu” ]
}
object Endpoint “desktop-3fjbnle” {
host = “192.168.99.101”
}
object Zone “desktop-3fjbnle” {
endpoints = [ “desktop-3fjbnle” ]
parent = “master”
}
object Host “desktop-3fjbnle” {
import “generic-host”
address = “192.168.99.101”
vars.os = “Windows”
vars.agent_endpoint = “desktop-3fjbnle”
zone = “desktop-3fjbnle”
}
object CheckCommand “powershell-icinga-check-updates” {
import “plugin-check-command”
command = [ “powershell.exe” ]
arguments = {
“-Command” = {
value = “Invoke-IcingaCheckUpdates”
description = “Run Icinga PowerShell Updates check”
required = true
}
}
}
object CheckCommand “check_network_traffic_windows” {
import “plugin-check-command”
command = [ “powershell.exe”, “-ExecutionPolicy”, “Bypass”, “-File”, “C:\Nagios\check_network_traffic.ps1” ]
arguments = {
“-NIC” = {
value = “$nic$”
required = true
}
“-Warning” = {
value = “$traffic_warning$”
}
“-Critical” = {
value = “$traffic_critical$”
}
}
vars.nic = “Ethernet”
vars.traffic_warning = “80”
vars.traffic_critical = “100”
}
apply Service “Windows Updates” {
import “generic-service”
check_command = “powershell-icinga-check-updates”
command_endpoint = host.vars.agent_endpoint
check_interval = 24h
retry_interval = 1h
// Beispiel: Warnung bei 1 verfügbaren Update, Critical bei 5
vars.powershell_icinga_check_updates_warning = 1
vars.powershell_icinga_check_updates_critical = 5
assign where host.vars.os == “Windows”
}
apply Service “network_traffic” {
check_command = “check_network_traffic_windows”
vars.nic = “Ethernet”
vars.traffic_warning = “50”
vars.traffic_critical = “80”
assign where host.name == “desktop-3fjbnle”
command_endpoint = “desktop-3fjbnle”
/* host.vars.agent_endpoint # wichtig: Check wird vom Windows-Agent ausgeführt */
}