[SOLVED] CUSTOM VARIABLE and EXTERNAL COMMAND

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
jbeaujour
Posts: 19
Joined: Mon Oct 13, 2014 9:17 am

[SOLVED] CUSTOM VARIABLE and EXTERNAL COMMAND

Post by jbeaujour »

Hello,
We use HOST CUSTOM VARIABLE in template file for all our WINDOWS servers.
We want to modify the value of those MACRO by external command

I try CHANGE_CUSTOM_HOST_VARIABLE like this :
/usr/bin/printf "[%lu] CHANGE_CUSTOM_HOST_VAR;host1;_THRES_FSYS_M;10%%\n" $now > $commandfile

By live status, we have modified attributes :
echo -e 'GET hosts\nColumns: host_name modified_attributes_list \nFilter: modified_attributes != 0' | unixcat /var/nagios/live
host1;custom_variable

But In thruk, this always the old value (5%)
How can i retrieve if the new value is apply (i don't have access on NSCLIENT)?
I Want to use to verify hourly if the custom variable is with the good value

Thanks
Last edited by jbeaujour on Tue Mar 01, 2016 11:56 am, edited 1 time in total.
jbeaujour
Posts: 19
Joined: Mon Oct 13, 2014 9:17 am

[SOLVED] Re: CUSTOM VARIABLE and EXTERNAL COMMAND

Post by jbeaujour »

It's solved !
To view the custom variable :
echo -e 'GET hosts\nColumns: custom_variable_names custom_variable_values custom_variables display_name ' | unixcat /var/lib/icinga/live

Why it seems to don't work :
i have on template definition "_THRES_FSYS_M" with underscore first
i use it with the external command, so it don't work

I do :
_THRE/usr/bin/printf "[%lu] CHANGE_CUSTOM_HOST_VAR;host1;THRES_FSYS_M;6%%\n" $now > $commandfile

without underscore !!

All it's OK

Bye
Locked