Hello:
We are running Nagios XI 5.2.7 and had to run a backup and then run a repair after noting the following log entry in "/var/log/mysqld.log":
"... [ERROR] /usr/libexec/mysqld: Table './nagios/nagios_logentries' is marked as crashed and last (automatic?) repair failed"
The repair appears to have worked.
I noted that "/var/log/mysqld.log" is a little larger than what I would like:
463467556 Jul 25 13:29 mysqld.log
Also, the disk space directory culprit is "/var/log/httpd":
342896 /var/log/httpd/ssl_request_log.1
318992 /var/log/httpd/ssl_access_log.1
What is the "safe" way to clear the mysqld log that is in use, and where do we set a cap on the logs?
Thank you in advance for your assistance.
Safe way to clear a couple of logs
Safe way to clear a couple of logs
Newbie '14
Re: Safe way to clear a couple of logs
I stand corrected regarding that the repair worked. I noted that "Notifications are disabled for this host" for ALL Hosts and that the Host appears in the Service Status window with a grey background (Host check is pending...", and stays the same even after forcing an immediate check.
Newbie '14
Re: Safe way to clear a couple of logs
UPDATE: Nevermind. I did a server restart and the problem does not appear anymore.
PhilG wrote:I stand corrected regarding that the repair worked. I noted that "Notifications are disabled for this host" for ALL Hosts and that the Host appears in the Service Status window with a grey background (Host check is pending...", and stays the same even after forcing an immediate check.
Newbie '14
Re: Safe way to clear a couple of logs
You can clear /var/log/mysqld.log with this command:
But you may want to setup logrotate to handle it automatically, I think you can uncomment this section in your /etc/logrotate.d/mysqld:
So that it looks like this:
That should take care of it.
Code: Select all
> /var/log/mysqld.logCode: Select all
#/var/log/mysqld.log {
# create 640 mysql mysql
# notifempty
# daily
# rotate 3
# missingok
# compress
# postrotate
# # just if mysqld is really running
# if test -x /usr/bin/mysqladmin && \
# /usr/bin/mysqladmin ping &>/dev/null
# then
# /usr/bin/mysqladmin flush-logs
# fi
# endscript
#}Code: Select all
/var/log/mysqld.log {
create 640 mysql mysql
notifempty
daily
rotate 3
missingok
compress
postrotate
# just if mysqld is really running
if test -x /usr/bin/mysqladmin && \
/usr/bin/mysqladmin ping &>/dev/null
then
/usr/bin/mysqladmin flush-logs
fi
endscript
}Re: Safe way to clear a couple of logs
Which command, please, since only the log file and path appear in the code section?
ssax wrote:You can clear /var/log/mysqld.log with this command:
....Code: Select all
> /var/log/mysqld.log
Newbie '14
-
bolson
Re: Safe way to clear a couple of logs
It isn't a command... It's the right arrow key (greater than sign) as shown.
-
bolson
Re: Safe way to clear a couple of logs
Closing topic as resolved.
Thank you for using the Nagios Support Forum!
Thank you for using the Nagios Support Forum!