Hi support team,
We use Nagios XI 2024R1.2.1 2024R1.2.2. On both versions we see the error "Undefined variable: strVIValues in /usr/local/nagiosxi/html/includes/components/ccm/classes/config.class.php on line 1400" after an apply configuration.
After looking at the code of config.class.php I didn't see something wrong at the given line, but I noticed some other things. I did not experience an issue with these findings. I think the code is a little bit wrong at some points, but your developers should verify this of course. It is regarding the concatenation of the variable strVIValues.
# wrong line 990, line needs "." before "="
$strVIValues = "host_notifications_enabled,service_notifications_enabled,can_submit_commands,retain_status_information,";
$strVIValues = "retain_nonstatus_information";
# wrong line 1005, line need "." before "="
$strVIValues = "host_notifications_enabled,service_notifications_enabled,can_submit_commands,retain_status_information,";
$strVIValues = "retain_nonstatus_information";
# possible wrong line 1379, first line should not have ".=" but "="
$strVIValues .= "active_checks_enabled,passive_checks_enabled,check_freshness,obsess_over_host,event_handler_enabled,";
$strVIValues .= "flap_detection_enabled,process_perf_data,retain_status_information,retain_nonstatus_information,";
$strVIValues .= "notifications_enabled";
# possible wrong line 1400, first line should not have ".=" but "=", this line gives the initial error
$strVIValues .= "is_volatile,active_checks_enabled,passive_checks_enabled,parallelize_check,obsess_over_service,";
$strVIValues .= "check_freshness,event_handler_enabled,flap_detection_enabled,process_perf_data,retain_status_information,";
$strVIValues .= "retain_nonstatus_information,notifications_enabled";
I hope you agree with what I have found, and maybe it will solve the initial error.
w.k.r.,
Humphrey
Undefined variable: strVIValues in /usr/local/nagiosxi/html/includes/components/ccm/classes/config.class.php line 1400
Re: Undefined variable: strVIValues in /usr/local/nagiosxi/html/includes/components/ccm/classes/config.class.php line 14
Hi Humphrey,
At a glance it does appear that you are correct about these lines having concatenation errors, which could cause error output like you were seeing under some conditions. I'm currently testing the fix to ensure it doesn't uncover other issues. Thank you for your efforts on this issue!
At a glance it does appear that you are correct about these lines having concatenation errors, which could cause error output like you were seeing under some conditions. I'm currently testing the fix to ensure it doesn't uncover other issues. Thank you for your efforts on this issue!
Re: Undefined variable: strVIValues in /usr/local/nagiosxi/html/includes/components/ccm/classes/config.class.php line 14
Hi,
Is there any news on this topic?
w.k.r.,
Humphrey Sloesen
Is there any news on this topic?
w.k.r.,
Humphrey Sloesen
Re: Undefined variable: strVIValues in /usr/local/nagiosxi/html/includes/components/ccm/classes/config.class.php line 14
Hey @centricrm
Good find on this issue. It is correct that there was some weirdness with over writing variables instead of concatenating. Justin above went ahead and made the changes and they will be in our next release, 2024R1.3.1. I can't give a time frame but it should be relatively soon. Here is a link to the changelog if you want to see all the changes that go in when its released.