error_log.1 grows abnormally

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Frédéric GRANAT
Posts: 445
Joined: Mon Nov 19, 2012 11:36 am

error_log.1 grows abnormally

Post 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
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: error_log.1 grows abnormally

Post by slansing »

What version of XI are you using, have you made any modifications on the backend which are non standard, like upgrading mysql?
Frédéric GRANAT
Posts: 445
Joined: Mon Nov 19, 2012 11:36 am

Re: error_log.1 grows abnormally

Post 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
cmerchant
Posts: 546
Joined: Wed Sep 24, 2014 11:19 am

Re: error_log.1 grows abnormally

Post 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
Frédéric GRANAT
Posts: 445
Joined: Mon Nov 19, 2012 11:36 am

Re: error_log.1 grows abnormally

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

Re: error_log.1 grows abnormally

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
Frédéric GRANAT
Posts: 445
Joined: Mon Nov 19, 2012 11:36 am

Re: error_log.1 grows abnormally

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

Re: error_log.1 grows abnormally

Post 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.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Frédéric GRANAT
Posts: 445
Joined: Mon Nov 19, 2012 11:36 am

Re: error_log.1 grows abnormally

Post by Frédéric GRANAT »

Hi,
Thanks, I modified the file.
I will see if it works.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: error_log.1 grows abnormally

Post by abrist »

Did it work for you?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked