Errors in /var/log/httpd/error_log

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
highness
Posts: 192
Joined: Thu May 01, 2014 4:25 pm

Errors in /var/log/httpd/error_log

Post 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?
User avatar
tgriep
Madmin
Posts: 9179
Joined: Thu Oct 30, 2014 9:02 am

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

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
highness
Posts: 192
Joined: Thu May 01, 2014 4:25 pm

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

Post 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.
User avatar
tgriep
Madmin
Posts: 9179
Joined: Thu Oct 30, 2014 9:02 am

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

Post by tgriep »

Did you restart the Apache process?
Are they coming in as PHP Notices or PHP Warnings?
Be sure to check out our Knowledgebase for helpful articles and solutions!
highness
Posts: 192
Joined: Thu May 01, 2014 4:25 pm

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

Post 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?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

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

Post by scottwilkerson »

Thanks for pointing this out.. We had an undefined variable in the code, which will be resolved in the next release.
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
Locked