How can i use the command:
check_netatmo -d 00:11:22:33:44:55 -M Regenmesser -a {battery_percent} -w12: -c6: -p 12:6:0:100
in Icinga2? In Nagios check_netatmo!00:11:22:33:44:55!-M ‘Regenmesser’ -a ‘{battery_percent}’ -w12: -c6: -p ‘12:6:0:100’ works fine.
Sincelery Uwe
I have do this:
object CheckCommand “netatmo” {
import “plugin-check-command”
command = [ PluginDir + “/check_netatmo” ]
timeout = 1m
arguments += {
“-M” = {
description = “Module of the Weatherstaion”
order = 2
required = true
value = “$module$”
}
“-a” = {
description = “Check Device Option”
order = 3
required = true
value = “$argument$”
}
“-c” = {
description = “Critical”
order = 5
skip_key = true
value = “6”
}
“-d” = {
description = “host to check”
order = 1
required = true
value = “$mac_address$”
}
“-w” = {
description = “Warn”
order = 4
skip_key = true
value = “12”
}
}
vars.ping_address = “$address$”
vars.ping_cpl = 15
vars.ping_crta = 200
vars.ping_wpl = 5
vars.ping_wrta = 100
}
rivad
(Dominik)
December 13, 2022, 4:37pm
2
Please format your code examples.
As far as I can read it, you are good and can now use netatmo
in a service.
Icinga uses:
host ← service ← check
Yes, i have create a plug in check command with 7 arguments. The Attribute -d $device-id$ cant show in field to select. I can only see 5 arguments. The required 2 arguments are not show to select in fields.
zones.d/director-global/commands.conf
object CheckCommand "netatmo" {
import "plugin-check-command"
command = [ PluginDir + "/check_netatmo" ]
arguments += {
"-M" = {
description = "Module of the Weatherstaion to check"
order = 2
required = true
value = "$module$"
}
"-a" = {
description = "attribute to check in {brackets}"
order = 3
required = true
value = "$attr$"
}
"-c" = {
description = "Critical"
order = 5
required = true
value = "$critical$"
}
"-d" = {
description = "mac-address of host to check"
order = 1
required = true
value = "$device-id$"
}
"-p" = {
description = "perfdata"
order = 7
required = true
value = "$perfdata$"
}
"-w" = {
description = "Warn"
order = 4
required = true
value = "$warn$"
}
}
}
OK, i have found a Solution:
The “value” field cannot be named “device-id”. It is better to name another value for it. In my case I just named it “device”. Now the field is also displayed in the selection.
Now I have another problem:
The message for battery and voltage stays at “Warning”. Since I’m still at the puzzle
rivad
(Dominik)
December 14, 2022, 11:31am
5
Check the inspect action link in the service to see how the command is executed.