Hi Team,
As checked I see the below errors been captured on the error.log file under /var/log/httpd/ path.
[Tue Apr 20 01:42:13.237109 2021] [:error] [pid 39680] [client 10.160.113.208:61211] PHP Notice: Undefined variable: allow_html in /usr/local/nagiosxi/html/includes/utils-status.inc.php on line 235, referer: http://10.x.x.x/nagiosxi/includes/compo ... l&host=abc
[Tue Apr 20 01:42:13.237145 2021] [:error] [pid 39680] [client 10.160.113.208:61211] PHP Notice: Undefined index: problem_acknowledged in /usr/local/nagiosxi/html/includes/utils-status.inc.php on line 183, referer: http://10.x.x.x/nagiosxi/includes/compo ... l&host=abc
What would be the reason and how do we mitigate it.
error.log file size is increasing
Re: error.log file size is increasing
Hi,
I have just asked development team was told that you can actually disable php notices in the php.ini file
I also got the following KB from my boss:
I changed my from:
To:
Then restart httpd:
Best Regards,
Vinh
I have just asked development team was told that you can actually disable php notices in the php.ini file
I also got the following KB from my boss:
I have tried it on "/etc/php.ini".This page has some examples for turning these off.
https://www.php.net/manual/en/function. ... orting.php
// Report all errors except E_NOTICE
error_reporting(E_ALL & ~E_NOTICE);
I changed my from:
Code: Select all
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICTCode: Select all
error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT & ~E_NOTICECode: Select all
systemctl restart httpdBest Regards,
Vinh
-
sneha.irali
- Posts: 141
- Joined: Fri Jan 15, 2021 3:56 am
Re: error.log file size is increasing
I'm little confused here as the Link you sahred me says as below:
// Reporting E_NOTICE can be good too (to report uninitialized
// variables or catch variable name misspellings ...)
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
Then what's the pointing is adding E_NOTICE, isnt its just one level of log we are adding. Correct me if my understanding is wrong.
// Reporting E_NOTICE can be good too (to report uninitialized
// variables or catch variable name misspellings ...)
error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
Then what's the pointing is adding E_NOTICE, isnt its just one level of log we are adding. Correct me if my understanding is wrong.
Re: error.log file size is increasing
Hi,
I asked our developers why they do not defined those variable before using them, so that we don't see those errors in the "error_log" file.
Here's the reply I received:
Best Regards,
Vinh
I asked our developers why they do not defined those variable before using them, so that we don't see those errors in the "error_log" file.
Here's the reply I received:
I have test by adding the "~E_NOTICE" to the "error_reporting" inside the "/etc/php.ini" file and looks like it did work.You can actually disable php notices in the php.ini file as well, we don't do it by default
will look at those though as well
Best Regards,
Vinh
-
sneha.irali
- Posts: 141
- Joined: Fri Jan 15, 2021 3:56 am
Re: error.log file size is increasing
Thanks for the info.
However I just want you to know that we have enabled a external REST API Integration to poll the information from Nagios. Can I know if there is any known impact with such kind of integrations additionally I do not find any best practices with REST API Integration, can you help me with it if we have any.
However I just want you to know that we have enabled a external REST API Integration to poll the information from Nagios. Can I know if there is any known impact with such kind of integrations additionally I do not find any best practices with REST API Integration, can you help me with it if we have any.
-
sneha.irali
- Posts: 141
- Joined: Fri Jan 15, 2021 3:56 am
Re: error.log file size is increasing
Also can you confirm if the file size grows post making the below changes:
I have test by adding the "~E_NOTICE" to the "error_reporting" inside the "/etc/php.ini" file and looks like it did work.
and explain me what E_NOTICE mean.
I have test by adding the "~E_NOTICE" to the "error_reporting" inside the "/etc/php.ini" file and looks like it did work.
and explain me what E_NOTICE mean.
Re: error.log file size is increasing
Hi,
We as support tech work on technical issues, but not programming related. We will try our best to help ...
Since we work on one issue per ticket, please open another forum ticket for API issue(s).
As to "E_NOTICE", I am NOT a PHP programmer, so I checked with development team regarding the error you have posted in the "error_log" file and was told to add E_NOTICE to the php.ini to turn that off.
I google and found:
Best Regards,
Vinh
We as support tech work on technical issues, but not programming related. We will try our best to help ...
Since we work on one issue per ticket, please open another forum ticket for API issue(s).
As to "E_NOTICE", I am NOT a PHP programmer, so I checked with development team regarding the error you have posted in the "error_log" file and was told to add E_NOTICE to the php.ini to turn that off.
I google and found:
Code: Select all
In PHP, a variable that doesn't exist will return null rather than causing an error.
Vinh