What to do with excessive log file/database file sizes?

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
KDA
Posts: 16
Joined: Wed Aug 11, 2021 1:28 am

What to do with excessive log file/database file sizes?

Post by KDA »

Hi

We are experiencing that certain logfiles seem to grow quite quickly.... these seem to be the main culprits: (in no particular order)

/var/lib/mysql/xi_auditlog.ibd 159.383.552
nagios_logentries.MYD
nagios_logentries.MYI
nagios_notifications.MYD
/usr/local/nagios/var/nagios.log

you can adjust how long information is to be retained in Performance Settings>Database, which will affect the size of the files I suppose.
But i am a little lost with regards to which parameters that affect these logs? All of these?

Max External Commands Age: Max time in DAYS to keep external commands.
Max Log Entries Age: Max time in DAYS to keep log entries.
Max Notifications Age: Max time in DAYS to keep notifications.
Max State History Age: Max time in DAYS to keep state history information.

And if the files have already grown excessive due to default settings or otherwise, what can be done about it? If I reduce the "Max DAYS" settings, the files will not be pruned/reduced in size.... what can I do?

regards,
Håkon
gsmith
Posts: 1253
Joined: Tue Mar 02, 2021 11:15 am

Re: What to do with excessive log file/database file sizes?

Post by gsmith »

Hi

Here is a good document describing the settings you refer to:
https://assets.nagios.com/downloads/nag ... 1773666937

You are correct that making changes to these settings will not affect the already created logs.
Once you decide on the what settings you want to use for your installation you can edit the existing files
so that they reflect what these settings are. This can be done using a text editor like
vi/nano/atom

Here is another document describing the logs and their locations:
https://assets.nagios.com/downloads/nag ... ptions.pdf

Please let us know if you have anymore questions.

Thanks
KDA
Posts: 16
Joined: Wed Aug 11, 2021 1:28 am

Re: What to do with excessive log file/database file sizes?

Post by KDA »

Hi

Thank you for your references to the documents... i have tried to study them but I have to concede that i still dont find any answers to my questions.

So let's take something very concrete:

I have been trying to limit the file /usr/local/nagios/var/nagios.log from growing excessively.

The document states that this file is rotated daily, which the config file indeed indicates (?) : log_rotation_method=d

A new file seems to be generated daily in the /archives folder, but the original nagios.log file just keeps growing, so this doesn't solve my problem.

Also, I have tried, somewhat randomly as I don't know which is which, to set all the DAYS settings of Admin>performance>databases down to 1, but this does not seem to have any effect ion anything.

Can you please explain how the rotation is supposed to work + which >Databases settings should affect which files?
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: What to do with excessive log file/database file sizes?

Post by benjaminsmith »

Hi,
I have been trying to limit the file /usr/local/nagios/var/nagios.log from growing excessively.
So Nagios XI, does not delete any of the nagios.log files. They are rotated daily into the archives folder but never deleted. However, they are just text files and even a larger Nagios XI installation requires less than 100 GB of disk space to run.

If you do not care about saving this data, you can manually delete the older files in that folder.
Also, I have tried, somewhat randomly as I don't know which is which, to set all the DAYS settings of Admin>performance>databases down to 1, but this does not seem to have any effect ion anything.
That should have an effect, however, it would not make a change to the database until the database maintenance script runs, every 5 minutes.

Let's get an output of the table sizes. Please post the output to the following command. Thanks, Benjamin

Code: Select all

echo "SELECT table_name AS 'Table', round(((data_length + index_length) / 1024 / 1024), 2) 'Size in MB' FROM information_schema.TABLES WHERE table_schema IN ('nagios', 'nagiosql', 'nagiosxi');" | mysql -h 127.0.0.1 -uroot -pnagiosxi --table
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked