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

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
[email protected]
Posts: 8
Joined: Mon Jan 12, 2015 8:20 am

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

Post by [email protected] »

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
jdalrymple
Skynet Drone
Posts: 2620
Joined: Wed Feb 11, 2015 1:56 pm

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

Post 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.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

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

Post 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:"
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked