Hi,
We have a problem with size of the following log files:
• /var/log/messages (~700 MB each and we have at least 5 )
• /var/log/mysqld.log (3.5 GB)
Is there any way to control the size of these files, set a data retention policy?
Thanks,
Efi
Controlling space used by Nagios
-
tonyyarusso
- Posts: 1128
- Joined: Wed Mar 03, 2010 12:38 pm
- Location: St. Paul, MN, USA
- Contact:
Re: Controlling space used by Nagios
There is a way of doing this, however I don't believe we have a graphical way of configuring it in the XI user interface at this time.
The way to do this is through the logrotate utility, which is installed already in the virtual machine image we ship. This tool allows you to "rotate" logs into storage when they reach a certain age and/or size, and delete old ones as desired. Optionally, you can also chose to compress archived logs with gzip (note also the zless/zcat/zgrep utilities if you do). So for instance, you may say "each week archive and compress the log, and delete any archives older than 5 weeks". Details on the syntax for configuring this can be found in the logrotate man page, and you can see some already defined in the /etc/logrotate.d/ directory.
Having some sane default pre-configured and/or providing a GUI way of setting this up is a good idea to consider for future releases.
The way to do this is through the logrotate utility, which is installed already in the virtual machine image we ship. This tool allows you to "rotate" logs into storage when they reach a certain age and/or size, and delete old ones as desired. Optionally, you can also chose to compress archived logs with gzip (note also the zless/zcat/zgrep utilities if you do). So for instance, you may say "each week archive and compress the log, and delete any archives older than 5 weeks". Details on the syntax for configuring this can be found in the logrotate man page, and you can see some already defined in the /etc/logrotate.d/ directory.
Having some sane default pre-configured and/or providing a GUI way of setting this up is a good idea to consider for future releases.