Page 1 of 1

Errors in /var/log/httpd/error_log

Posted: Mon May 15, 2017 12:47 pm
by highness
We are seeing a ton of these errors (2100+ today alone) in /var/log/httpd/error_log (and this seems to have been going on for quite a while):

Code: Select all

Undefined variable: searchstring in /usr/local/nagiosxi/html/includes/utils-menu.inc.php on line 1741, referer: http://nagios.redacted.com/nagiosxi/index.php?
We're running version XI v5.4.3

Any one else seeing this?

Re: Errors in /var/log/httpd/error_log

Posted: Mon May 15, 2017 12:59 pm
by tgriep
What you are seeing are only PHP notices about a variable that is being used but it was not defined in the PHP file. The line does say that it is an error but it really is just a notice and can be ignored.
If you want to stop logging of those messages, you can edit the /etc/php.ini file on the Nagios server.
Find the error_reporting option in the file and change it to the example below.

Code: Select all

error_reporting = E_ALL & ~E_DEPRECATED & ~E_NOTICE
Save the file and and restart the Apache process to load the changes by running the following as root.

Code: Select all

service httpd restart
What that line does is to continue to log the errors except Depreciated messages and Notices.
Please post if you have any more questions.

Re: Errors in /var/log/httpd/error_log

Posted: Mon May 15, 2017 2:37 pm
by highness
Here is my original line:

Code: Select all

error_reporting = E_ALL & ~E_DEPRECATED
and after adding the new line:

Code: Select all

error_reporting = E_ALL & ~E_DEPRECATED & ~E_NOTICE
and restarting apache via:

Code: Select all

service httpd restart
Still no joy. Errors are still being logged.

Re: Errors in /var/log/httpd/error_log

Posted: Mon May 15, 2017 3:14 pm
by tgriep
Did you restart the Apache process?
Are they coming in as PHP Notices or PHP Warnings?

Re: Errors in /var/log/httpd/error_log

Posted: Tue May 16, 2017 11:44 am
by highness
tgriep wrote:Did you restart the Apache process?
Are they coming in as PHP Notices or PHP Warnings?
I restarted apache via

Code: Select all

service httpd restart
but we're still seeing this:

Code: Select all

[Tue May 16 09:41:25 2017] [error] [client 10.71.17.57] PHP Notice:  Undefined variable: searchstring in /usr/local/nagiosxi/html/includes/utils-menu.inc.php on line 1741, referer: http://nagios.redacted.com/nagiosxi/index.php?
[Tue May 16 09:41:30 2017] [error] [client 10.113.9.113] PHP Notice:  Undefined variable: searchstring in /usr/local/nagiosxi/html/includes/utils-menu.inc.php on line 1741, referer: http://nagios.redacted.com/nagiosxi/index.php?
[Tue May 16 09:41:30 2017] [error] [client 10.113.9.113] PHP Notice:  Undefined variable: searchstring in /usr/local/nagiosxi/html/includes/utils-menu.inc.php on line 1741, referer: http://nagios.redacted.com/nagiosxi/index.php?

Re: Errors in /var/log/httpd/error_log

Posted: Tue May 16, 2017 2:50 pm
by scottwilkerson
Thanks for pointing this out.. We had an undefined variable in the code, which will be resolved in the next release.