Page 1 of 1

/var is filling up. how do you verify Nagios is cleaning

Posted: Fri May 15, 2015 9:37 am
I see my file system is filling up. Checking Nagios /var/log/mysqld.log I see this error
"[ERROR] /usr/libexec/mysqld: Table './nagios/nagios_logentries' is marked as crashed and last (automatic?) repair failed"

Checking file system I see.
ls -lha /var/lib/mysql/nagios/nagios_logentries.*
-rw-rw---- 1 mysql mysql 8.8K Jan 7 11:34 /var/lib/mysql/nagios/nagios_logentries.frm
-rw-rw---- 1 mysql mysql 21G Apr 8 14:02 /var/lib/mysql/nagios/nagios_logentries.MYD
-rw-rw---- 1 mysql mysql 9.7G Apr 8 16:09 /var/lib/mysql/nagios/nagios_logentries.MYI


I am currently doing a check for more information.
[root@LNTTAVMNAG2 /]# mysqlcheck -r -f -u root -pnagiosxi --databases nagios nagiosql

Can you supply a reference on how to identify the cause and how to clean and fine tune Nagios logs?

Thanks

Re: /var is filling up. how do you verify Nagios is cleaning

Posted: Fri May 15, 2015 9:50 am
by jdalrymple
What do your TABLE TRIMMING OPTIONS look like in /usr/local/nagios/etc/ndo2db.cfg?

defaults:

Code: Select all

## TABLE TRIMMING OPTIONS
# Several database tables containing Nagios event data can become quite large
# over time.  Most admins will want to trim these tables and keep only a
# certain amount of data in them.  The options below are used to specify the
# age (in MINUTES) that data should be allowd to remain in various tables
# before it is deleted.  Using a value of zero (0) for any value means that
# that particular table should NOT be automatically trimmed.

# Keep timed events for 24 hours
max_timedevents_age=1440

# Keep system commands for 1 week
max_systemcommands_age=10080

# Keep service checks for 1 week
max_servicechecks_age=10080

# Keep host checks for 1 week
max_hostchecks_age=10080

# Keep event handlers for 31 days
max_eventhandlers_age=44640
You may want to run the database repair script too...

https://assets.nagios.com/downloads/nag ... tabase.pdf

On a db that size though it could take awhile.

Re: /var is filling up. how do you verify Nagios is cleaning

Posted: Fri May 15, 2015 10:07 am
by scottwilkerson
Also you can set the auto trim level for that table here in the web UI

Admin -> Performance Settings -> Databases Tab -> NDOUtils Database section
Reduce "Max Log Entries Age:"