issue with custom variables

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
mon-team
Posts: 171
Joined: Thu Jun 28, 2012 9:22 am

issue with custom variables

Post by mon-team »

Hi,
I'm using a custom variable to store a value relative to a service. I've defined the CV using the Nagios XI graphical interface.
Using the command 'CHANGE_CUSTOM_SVC_VAR' I'm able to change the value and to recover it with the macro $_SERVICENAMEOFCV$ correctly.

However if from the graphical interface I perform an 'Apply Configuration' action the CV values is overwritten to the default value.
I didn't expect this behavior and I'd like to maintain the new value set using the 'CHANGE_CUSTOM_SVC_VAR' command.
Is it a bug?


P.S.: I've tried both defining the CV at a service level and defining the CV in a service template inherited by the service, with the same result described before.

Regards,
Francesco
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: issue with custom variables

Post by tmcdonald »

The data that is stored in the CCM is in a database, and when you click Apply Config this gets written out to disk and the nagios process is restarted. The CHANGE_CUSTOM_SVC_VAR command changes things in-memory, so a restart is going to revert back to whatever is in the file, and therefor the CCM. Try issuing that command and then run a service nagios restart - the variable should revert.
Former Nagios employee
Locked