Page 1 of 1

Free variables don't stay in uppercase after save

Posted: Wed Apr 24, 2019 10:21 am
by dacaron
Since the update to Nagios XI 5.6 , I seem to be having issue with the free variables.

I use free variables in hosts config to set the value of some service checks, but since the update to Nagios XI 5.6 It no longer works.
ex:
I save them as _CURLOADCRIT & _CURLOADWARN but when I save and look at the config they appear as _curloadcrit & _curloadwarn.

Since this, the value I set in the host free variables aren't used for the service.

define host {
host_name host1
use hosttemplate1
alias host1
address 127.0.0.1
hostgroups hostgroup1
_curloadcrit 6,5,4
_curloadwarn 5,4,3
register 1
}

define service {
service_description Current Load
use servicetemplate1
hostgroup_name hostgroup1
display_name Current+Load
check_command check_nrpe_args!check_load!$_HOSTCURLOADWARN$!$_HOSTCURLOADCRIT$!!!!!
first_notification_delay 15
notification_period 24x7
register 1
}

Re: Free variables don't stay in uppercase after save

Posted: Wed Apr 24, 2019 3:35 pm
by swolf
Hi @dacaron

This issue is a little bit strange. To my knowledge, free variable names should be case-insensitive in the config (though upper-case is still required in the macro text).

Just to rule some things out, would you be able to edit your configuration manually (on the filesystem), so that your host config looks like

Code: Select all

define host {
host_name host1
use hosttemplate1
alias host1
address 127.0.0.1
hostgroups hostgroup1
_CURLOADCRIT 6,5,4
_CURLOADWARN 5,4,3
register 1
}
restart Nagios Core,

Code: Select all

service nagios restart
and verify whether your issue persists? We'll also be looking into this on our end.

EDIT:

We just checked this internally (both with the service added directly to the host and with both of them applied via a hostgroup) and didn't run into your issue. What version did you upgrade from?

Re: Free variables don't stay in uppercase after save

Posted: Thu Apr 25, 2019 10:22 am
by dacaron
Hi @swolf,

thank you for the quick answer. I forced a write config, and the config ends up looking like this

define host {
host_name host1
use hosttemplate1
alias host1
address 127.0.0.1
hostgroups hostgroup1
_CURLOADCRIT 6,5,4
_CURLOADWARN 5,4,3
register 1
}

So it seems the issue isn't related to the variables being in lowercase.

I did the update from 5.5.11 to 5.6.0.

I tested so more and it look like the value I set for the variables in the host config are not being use by the service check.

Re: Free variables don't stay in uppercase after save

Posted: Thu Apr 25, 2019 11:04 am
by dacaron
Nevermind,

You can consider this issue resolved, It was entirely on my end. The same day I did the NagiosXI, a new set of nrpe commands was pushed by ansible to all of our linux hosts and it included a new check_load command that forced warning and critical values :? .

I am really sorry for the wasted time.

Re: Free variables don't stay in uppercase after save

Posted: Fri Apr 26, 2019 1:45 pm
by ssax
Glad your issue is resolved! Locking and marking as resolved.

Thank you!