Jochen Bern contributed a nice patch to the config.cgi which is mainly called "Command expander". It is linked throughout the Classic UI (check the extinfo.cgi for service information and follow the link below "ACTIVE" e.g.).
The main intention is to resolve all passed $ARGn$ macros into their given values. Currently, all other macros such as $USERn$ or $HOSTADDRESS$ are not resolved, because the expander just doesn't know it yet (remains a todo within #1329)
There's still the possibility to translate those values with pen and paper
Host State Information - ACTIVE
View Config Selection
Own command expanded
View from the Host config list - check-mk-ping url
$ARGn$ macros are being passed by seperating them with '!'.
$USER1$ definition in resource.cfg
Associated host definition, holding address.
Now you can map the following
- $USER1$ - check resource.cfg = /usr/lib/nagios/plugins
- $HOSTADRESS$ - map host_name from service and host, and get host address = 127.0.0.1
- $ARG1$ - first argument = 500.0,20%
- $ARG2$ - second argument = 800.0,60%
Final command as Icinga would call it:
Test it as icinga user.
DO NOT run it as root, or with root environment!
If the icinga user did not get a shell, change it temporary in /etc/passwd from /bin/false (or /sbin/nologin) to /bin/bash (or /binsh).