Page 1 of 1

/usr/local/nagios/var uses alot of space

Posted: Wed Oct 06, 2021 1:27 pm
by rnjie
can i clear out the archives folder? its taking up about 33G of space, want to verify if its okay to be cleared out or if there are any effects

[root@dximonp1 var]# du -sh * | sort -n
0 nagios.tmpjE4WpY
0 rw
1.2M spool
3.1M ndomod.tmp
4.0K host-perfdata
4.0K npcd.log.old
4.0K service-perfdata
4.0K stats
5.3M npcd.log
5.6M perfdata.log
6.1M nagios.tmpSajDNl
8.0M objects.cache
8.2G nagios.log
12K graphapi.log
13M retention.dat
13M status.dat
33G archives
[root@dximonp1 var]# pwd
/usr/local/nagios/var

Re: /usr/local/nagios/var uses alot of space

Posted: Wed Oct 06, 2021 3:32 pm
by dchurch
You can delete /usr/local/nagios/var/archives/* without impacting anything. It's just a log archive (sourced from /usr/local/nagios/var/nagios.log).

I'm not sure why Nagios XI does this, but logs get rotated into there and never get deleted. After an undetermined amount of time your hard drive will fill up from this.

Anyway, like I said, you can delete them safely.

Re: /usr/local/nagios/var uses alot of space

Posted: Mon Nov 29, 2021 3:46 pm
by rnjie
is there a way to avoid the logs from writing to this file? it fills up really fast and its like we have to clear it everyday.

Re: /usr/local/nagios/var uses alot of space

Posted: Tue Nov 30, 2021 12:24 pm
by ssax
The Availability, SLA, and Legacy reports are directly read from the /usr/local/nagios/var/nagios.log file and the files in /usr/local/nagios/var/archives. Please note that removing the files in that directory impacts your ability to run availability/SLA/legacy reports on the data. The recommendation would be to only keep what you really need access to base on your business data policy requirements.

So if you delete all files in /usr/local/nagios/var/archives older than X, you will not be able to run those reports to get data older than X.

They also cannot be compressed otherwise Nagios won't be able to read them.

Generally, I see people using logrotate to setup a cleanup job to retain them per their business data policy requirements and using the XI backups (those will contain them) to access the files if needed.