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

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
jwelch
Posts: 225
Joined: Wed Sep 05, 2012 12:49 pm

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

Post 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";
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

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

Post 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!
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked