Page 1 of 2

error_log.1 grows abnormally

Posted: Tue Jan 20, 2015 10:15 am
by Frédéric GRANAT
Hi,
The file below grows fast :
[root@nagiosxi /]# ls -al ./var/log/httpd/error_log.1
-rw-r--r-- 1 root root 9477423211 Jan 18 04:02 ./var/log/httpd/error_log.1

[root@nagiosxi /]# head -100 ./var/log/httpd/error_log.1
[Mon Jan 12 04:02:14 2015] [notice] Digest: generating secret for digest authentication ...
[Mon Jan 12 04:02:14 2015] [notice] Digest: done
[Mon Jan 12 04:02:14 2015] [notice] mod_python: Creating 4 session mutexes based on 256 max processes and 0 max threads.
[Mon Jan 12 04:02:14 2015] [notice] Apache/2.2.3 (CentOS) configured -- resuming normal operations
[Mon Jan 12 04:02:22 2015] [error] [client 127.0.0.1] PHP Deprecated: mysql_escape_string(): This function is deprecated; use mysql_real_escape_string() instead. in /usr/local/nagiosxi/html/includes/db.inc.php on line 376
[Mon Jan 12 04:02:22 2015] [error] [client 127.0.0.1] PHP Deprecated: mysql_escape_string(): This function is deprecated; use mysql_real_escape_string() instead. in /usr/local/nagiosxi/html/includes/db.inc.php on line 376
[Mon Jan 12 04:02:22 2015] [error] [client 127.0.0.1] PHP Deprecated: mysql_escape_string(): This function is deprecated; use mysql_real_escape_string() instead. in /usr/local/nagiosxi/html/includes/db.inc.php on line 376
[Mon Jan 12 04:02:43 2015] [error] [client 127.0.0.1] PHP Deprecated: mysql_escape_string(): This function is deprecated; use mysql_real_escape_string() instead. in /usr/local/nagiosxi/html/includes/db.inc.php on line 376
[Mon Jan 12 04:02:43 2015] [error] [client 127.0.0.1] PHP Deprecated: mysql_escape_string(): This function is deprecated; use mysql_real_escape_string() instead. in /usr/local/nagiosxi/html/includes/db.inc.php on line 376
[Mon Jan 12 04:02:43 2015] [error] [client 127.0.0.1] PHP Deprecated: mysql_escape_string(): This function is deprecated; use mysql_real_escape_string() instead. in /usr/local/nagiosxi/html/includes/db.inc.php on line 376
[Mon Jan 12 04:03:01 2015] [error] [client 127.0.0.1] PHP Deprecated: mysql_escape_string(): This function is deprecated; use mysql_real_escape_string() instead. in /usr/local/nagiosxi/html/includes/db.inc.php on line 376
[Mon Jan 12 04:03:01 2015] [error] [client 127.0.0.1] PHP Deprecated: mysql_escape_string(): This function is deprecated; use mysql_real_escape_string() instead. in /usr/local/nagiosxi/html/includes/db.inc.php on line 376
[Mon Jan 12 04:03:01 2015] [error] [client 127.0.0.1] PHP Deprecated: mysql_escape_string(): This function is deprecated; use mysql_real_escape_string() instead. in /usr/local/nagiosxi/html/includes/db.inc.php on line 376
[Mon Jan 12 04:03:22 2015] [error] [client 127.0.0.1] PHP Deprecated: mysql_escape_string(): This function is deprecated; use mysql_real_escape_string() instead. in /usr/local/nagiosxi/html/includes/db.inc.php on line 376
[Mon Jan 12 04:03:22 2015] [error] [client 127.0.0.1] PHP Deprecated: mysql_escape_string(): This function is deprecated; use mysql_real_escape_string() instead. in /usr/local/nagiosxi/html/includes/db.inc.php on line 376
[Mon Jan 12 04:03:22 2015] [error] [client 127.0.0.1] PHP Deprecated: mysql_escape_string(): This function is deprecated; use mysql_real_escape_string() instead. in /usr/local/nagiosxi/html/includes/db.inc.php on line 376
[Mon Jan 12 04:03:42 2015] [error] [client 127.0.0.1] PHP Deprecated: mysql_escape_string(): This function is deprecated; use mysql_real_escape_string() instead. in /usr/local/nagiosxi/html/includes/db.inc.php on line 376
[Mon Jan 12 04:03:42 2015] [error] [client 127.0.0.1] PHP Deprecated: mysql_escape_string(): This function is deprecated; use mysql_real_escape_string() instead. in /usr/local/nagiosxi/html/includes/db.inc.php on line 376

Please tell me how to solve the error that cause the increasing of the file size.

Rgds,

Frederic

Re: error_log.1 grows abnormally

Posted: Tue Jan 20, 2015 10:18 am
by slansing
What version of XI are you using, have you made any modifications on the backend which are non standard, like upgrading mysql?

Re: error_log.1 grows abnormally

Posted: Wed Jan 21, 2015 2:19 am
by Frédéric GRANAT
Nagios XI 2014R2.0
have you made any modifications on the backend which are non standard, like upgrading mysql?
=> No, but upgrade my Nagiosxi one month ago

Re: error_log.1 grows abnormally

Posted: Wed Jan 21, 2015 9:57 am
by cmerchant
A quick check with the error message is just informational from the php website:
Warning This extension is deprecated as of PHP 5.5.0, and will be removed in the future.
http://php.net/manual/en/function.mysql ... string.php

What version of php do you have installed?

Code: Select all

php --version
PHP 5.3.3 (cli) (built: Oct 30 2014 20:12:53) 
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies

Re: error_log.1 grows abnormally

Posted: Thu Feb 05, 2015 2:36 am
by Frédéric GRANAT
Hi,
PHP 5.4.36 (cli) (built: Dec 19 2014 06:35:49)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.4.0, Copyright (c) 1998-2014 Zend Technologies

Re: error_log.1 grows abnormally

Posted: Thu Feb 05, 2015 11:59 am
by lmiltchev
What are the error reporting settings in the "/etc/php.ini" file?

Try using:

Code: Select all

error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
Restart apache:

Code: Select all

service httpd restart
Let us know if this helped.

BTW, do the apache error log rotate properly for you? What is the output of the following command?

Code: Select all

ll /var/log/httpd/ | grep error_log

Re: error_log.1 grows abnormally

Posted: Fri Feb 06, 2015 2:17 am
by Frédéric GRANAT
[root@nagiosxi etc]# error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
[1] 30905
[2] 30906
-bash: error_reporting: command not found
-bash: ~E_DEPRECATED: command not found
-bash: ~E_STRICT: command not found
[1]- Exit 127 error_reporting = E_ALL
[2]+ Exit 127 ~E_DEPRECATED


[root@nagiosxi etc]# ll /var/log/httpd/ | grep error_log
-rw-r--r-- 1 root root 344760 Feb 6 08:17 error_log
-rw-r--r-- 1 root root 2890517 Jan 26 04:02 error_log.2
-rw-r--r-- 1 root root 2890517 Jan 12 04:02 error_log.4
-rw-r--r-- 1 root root 2607 Feb 6 08:17 ssl_error_log
-rw-r--r-- 1 root root 474 Jan 26 04:02 ssl_error_log.1
-rw-r--r-- 1 root root 237 Jan 18 04:02 ssl_error_log.2
-rw-r--r-- 1 root root 474 Jan 12 04:02 ssl_error_log.3
-rw-r--r-- 1 root root 1185 Jan 5 09:34 ssl_error_log.4

Re: error_log.1 grows abnormally

Posted: Fri Feb 06, 2015 9:48 am
by tgriep
What lmiltchev wanted you to do was to edit the settings in the "/etc/php.ini" file and make sure the following line is in it. If it isn't add it to the file.

Code: Select all

error_reporting = E_ALL & ~E_DEPRECATED & ~E_STRICT
Then restart apache:

Code: Select all

service httpd restart
That should stop the excess messages.

Re: error_log.1 grows abnormally

Posted: Mon Feb 09, 2015 3:37 am
by Frédéric GRANAT
Hi,
Thanks, I modified the file.
I will see if it works.

Re: error_log.1 grows abnormally

Posted: Mon Feb 09, 2015 9:38 am
by abrist
Did it work for you?