Closed giner closed 9 years ago
This looks like a pynag problem rather than adagios problem, but it seems like this is a mixture of:
a) using service checks with hostgroups b) Using a custom variable that is injected as $ARG1$
2 quick questions: a) Does Nagios interpret this ok, which variant or version ? b) Does it work if you command line looks like this:
define command {
command_name check_ifstatus_exclude_unused
command_line $USER1$/check_ifstatus -t 30 -H $HOSTADDRESS$ -C COMMUNITY -u $_HOSTIFSTATUS_EXCLUDE_UNUSED$
}
a) Does Nagios interpret this ok, which variant or version ?
Yes, It works in both Nagios 3.2.3 (Ubuntu 12.04) and 3.5.1 (Ubuntu 14.04).
b) Does it work if you command line looks like this
I'll check this tomorrow.
Adagios produces the same result for check_ipmi_sensor (command config comes with a package from the official Ubuntu repo):
define command{
command_name check_ipmi_sensor
command_line /usr/lib/nagios/plugins/check_ipmi_sensor -H $_HOSTIPMI_IP$ -f $ARG1$
}
define service {
use generic-service
service_description check_ipmi_sensor
check_command check_ipmi_sensor!/etc/nagios3/custom/plugins-auth/check_ipmi.auth
hostgroup_name IPMI
}
define host{
use Server
host_name server1
address 10.0.0.1
hostgroups IPMI,...
_ipmi_ip 10.0.0.2
}
Yeah looks like command arguments ($ARG1$) are not being processed correctly when its a service check applied to a hostgroup. I will take a look at it, but the patch will be in pynag, not adagios.
In the latest example $ARG1$ is not used and $_HOSTIPMI_IP$ is used instead however it doesn't work either.
I will take a look at it, although it could be because in your host definition the _ipmi_ip macro is lowercase, but in the command definition it is uppercase.
This is by design http://nagios.sourceforge.net/docs/3_0/customobjectvars.html
Ok, there are 2 patches in pynag that are waiting to be merged:
Once these are merged I think we can close this bug.
Ok both pull requests have been merged, so I believe finally we are good and the bugs raised in this issue have been fixed.
Can you please download latest pynag (from github if using pip, if using rpm, then ok-testing packages should be ready in 1 hour or so).
I am marking this issue as closed, if there are any further questions or concerns, dont hesitate to reopen it.
ps: Thank you for taking the time to help troubleshoot this.
It works perfect now! Thank you.
Adagios does not understand custom variables. For example for this:
Adagios shows this on the information page:
where it should be: