Page 1 of 1

Need help to print free variables in custom component

Posted: Fri Oct 29, 2021 4:27 am
by alira
Hello,

I am trying to print the value of a free variable into a custom column in the service status view. I am using the custom column component available here:

https://exchange.nagios.org/directory/A ... nt/details

I installed the custom column and have no problem to print text inside the cell in the service row but i have no success trying to print the free variable of the service.

Suppose the var is called: _FREEVAR1

I have used:

$_SERVICEFREEVAR1$
NAGIOS__SERVICEFREEVAR1

to print it using the php script but no value is being printed.
freevar_custom_column.png
Please, can you give me any tips about how to get it printed?

Thank you!

Re: Need help to print free variables in custom component

Posted: Fri Oct 29, 2021 11:55 am
by benjaminsmith
Hi,

That component is pulling status data which contains the notes field but not the free variable. However, there is already an option for this in Nagiso XI.

Go to Admin > System Extensions > Manage Components and make sure to enable the Free Variables component if it isn't already.
enable-free-variable-tab.png
Then go to the tab on Host and Service Detail screens. Let me know if that works for you.
free-variables-tab.png
--Benjamin

Re: Need help to print free variables in custom component

Posted: Tue Nov 02, 2021 4:45 am
by alira
Hello Benjamin,

I have the Free Variables enabled and i see them in its tab under Host and Service Detail screen. I would like to print a specific Free Variable in a column under Service Status screen as we have this in our previous Nagios Core installation.

Would it be possible to use Free Variables instead of notes modifying this component? Or the use of free variables is restricted.

Thank you!

Re: Need help to print free variables in custom component

Posted: Wed Nov 03, 2021 9:45 am
by benjaminsmith
Hi,
Would it be possible to use Free Variables instead of notes modifying this component? Or the use of free variables is restricted.
Both those components are available. Go to Admin > System Extensions > Manage Components >... and under the Actions Tab select the download link.

Take a look at the code you may be able to use the functions in free variable to output the same data in the Columns component.

We don't provide customer development in support but you can reach out to our sales team for options as well.

Regards,
Benjamin