Page 1 of 1

[SOLVED] CUSTOM VARIABLE and EXTERNAL COMMAND

Posted: Tue Mar 01, 2016 10:49 am
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

[SOLVED] Re: CUSTOM VARIABLE and EXTERNAL COMMAND

Posted: Tue Mar 01, 2016 11:51 am
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