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";
syntax error in statehistory.php in 2014R2.2 (fix included)
Re: syntax error in statehistory.php in 2014R2.2 (fix includ
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!
Be sure to check out our Knowledgebase for helpful articles and solutions!