I need to call a PowerShell-Script on a Windows-Server to perform same checks.
The script need as parameter a string, but no “key” (e.g., it must be script blah and not script --blah).
Any particular reason why you are not using the NSClient, which seems to be installed, to run the script?
For the “powershell way” keep in mind that the check will exit with an OK state if the script is not present.
At least that is what I experienced with a similar check:
See my other topic Timeout exceeded with nscp-local the reason I tried to rewrite the check directly in Icinga…
BTW: I think, if I already have Icinga working on the server, another check program is waste, so I’m trying to rewrite all remaining checks that currently use NSClient++.
I did try the suggested solution and it doesn’t work at all.
The solution isn’t obvious from Icinga documentations but is relatively simple.
If you have a command which uses arguments directly from the command line you first need parameters to transform in local config group variables, and then you are able to use it in command attribute without using arguments attribute.
Just a “FYI”:
You can also use the skip_key and order values for each argument.
With these Icinga will ignore what you put in as a parameter and set your values in your specified order.
See command-arguments-skip-key
arguments = {
"--process" = {
value = "$icingacli_businessprocess_process$"
description = "Business process to monitor"
skip_key = true
required = true
order = -1
}
}