This is just an idea.
In my current nagios installation I have define the following command:
define command{
command_name check-host-alive
command_line $USER1$/check_ping -H $HOSTADDRESS$ -w 3000.0,80% -c 5000.0,100% -p 10
}
Suddenly i have to check host using a different IP that the $HOSTADDRESS$
So I have to define a different command replacing
$HOSTADDRESS$ with
$ARG1$
# 'check-host-alive' command definition
define command{
command_name check-host-alive-ip
command_line $USER1$/check_ping -H $ARG1$ -w 3000.0,80% -c 5000.0,100% -p 10
}
Wouldn't it be great if I could merge the above in a single definition as following:
define command{
command_name check-host-alive
command_line $USER1$/check_ping -H $HOSTADDRESS$ | $ARG1$ -w 3000.0,80% -c 5000.0,100% -p 10
}
The null one should be ignored.
If both have value, the $ARG1$ should be preferred.