Page 1 of 1

syntax error in statehistory.php in 2014R2.2 (fix included)

Posted: Fri Dec 26, 2014 9:09 pm
by jwelch
After the update to Nagios XI 2014R2.2 (from 2.1), the frame for State History for a service was blank.
/var/log/httpd/error_log showed:
PHP Parse error: syntax error, unexpected ')', expecting ',' or ';' in /usr/local/nagiosxi/html/reports/statehistory.php on line 909

Editing line 909 of statehistory.php and removing one of the three right parentheses fixed the symptoms.

Original:
909 echo $se->state_time . ",\"" . $host_name . "\",\"" . $service_description . "\"," . $state_chan ge . ",\"" . $state . "\",\"" . $state_type . "\"," . $current_check_attempt . "," . $max_check_attempts . " ," . $last_state . "," . $last_hard_state . ",\"" . str_replace(''', "'", html_entity_decode($output))) . "\"\n";

Fixed:
909 echo $se->state_time . ",\"" . $host_name . "\",\"" . $service_description . "\"," . $state_chan ge . ",\"" . $state . "\",\"" . $state_type . "\"," . $current_check_attempt . "," . $max_check_attempts . " ," . $last_state . "," . $last_hard_state . ",\"" . str_replace(''', "'", html_entity_decode($output)) . "\"\n";

Re: syntax error in statehistory.php in 2014R2.2 (fix includ

Posted: Mon Dec 29, 2014 9:21 am
by lmiltchev
I was able to recreate the issue and posted an internal bug report (TASK ID 4759). Thank you for bringing our attention to it and for the fix!