is it possible to access service states from a command, to pass it as an argument?
I want to use the state from two different services and pass it to a self-written script.
This script is defined as a command in the director.
The script should then define if a host is okay/critical/warning, dependend on the results from the two checks (both okay → okay, one is critical → warning, both critical → ciritical).
The script is working fine so far, only the service states are missing.
Many thanks in advance.
Director version (System - About): 1.8.1
Icinga Web 2 version and modules (System - About): 2.9.5
Thank you for your answer.
But how do i use it?
I´ve tried it here: Director → Commands → “My Command” → Arguments and then in the “Value” Field.
But this doesn´t work. I get the Error Message “Non-optional Macro […] used in argument ‘-a’ is missing.”