Page 1 of 1
Nagios and space
Posted: Wed Mar 24, 2021 10:24 am
by jsalsbury
Good morning,
For the first time since I took over Nagios as an application, I am having space issues. My support team is stating that I have disk space warning in /usr/local/Nagios.
When I run the following command.
du -h /usr/local/nagios -d 10 | grep '[0-9\.]\+G'
3.3G /usr/local/nagios/share/perfdata
3.3G /usr/local/nagios/share
4.9G /usr/local/nagios/var/archives
5.0G /usr/local/nagios/var
8.3G /usr/local/nagios
Is there anything I can remove without causing issues, I have noticed that I have some older logs but when I search in previous posts the commands were for NagiosXI folder structure.
Thanks in advance. I always appreciate the help here.
Re: Nagios and space
Posted: Wed Mar 24, 2021 3:51 pm
by benjaminsmith
Hi,
Most everything in that folder you'll normally want to preserve. However, you may have a bunch of older rrd files that are no longer required and taking up space.
We have KB article on how to clean those up. Be sure to take a
full backup before making any changes.
Nagios XI - Mass Delete Old RRD Files
Nagios XI backups can be really large, so make sure you check that as well. Those are normally found in the following directory (check the settings at Admin > System Backups).
Let us know if you have any questions.
Regards,
Benjamin
Re: Nagios and space
Posted: Wed Mar 24, 2021 7:42 pm
by jsalsbury
I appreciate this and did run the back up and deletion of the old files. I do find it odd that the Var/archives log is almost 5 gig and I have logs from 2018. That seems right? Perhaps I am keeping things too long?
Re: Nagios and space
Posted: Thu Mar 25, 2021 11:45 am
by benjaminsmith
Hi
@jsalsbury,
By default, Nagios XI does not ever delete the Nagios logs. If you don't need to keep logs after a certain date, you can remove them or back them up to another server. This will impact the report look back period.
Let us know if you have any other questions.
--Benjamin
Re: Nagios and space
Posted: Thu Mar 25, 2021 12:31 pm
by jsalsbury
There is no setting to keep/delete the logs, I just need to delete them manually?? Feels like perhaps a needed enhancement?
Re: Nagios and space
Posted: Fri Mar 26, 2021 10:02 am
by benjaminsmith
Hi
@jsalsbury,
Since the Nagios.logs are a historical record and many customers must retain these for auditing, the system does not remove them. However, even on a large system, they do not require large amounts of disk space since they are flat text files.
If you'd like to remove old logs, you can use logrotate for that. It's already installed on the system and we use this to clean up Nagios XI-specific logs when they become too large.
logrotate(8) - Linux man page
HowTo: The Ultimate Logrotate Command Tutorial with 10 Example
Remove older rotated log files
Regards,
Benjamin