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

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
rnjie
Posts: 157
Joined: Wed Mar 20, 2019 4:59 pm

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

Post 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
dchurch
Posts: 858
Joined: Wed Oct 07, 2020 12:46 pm
Location: Yo mama

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

Post 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.
If you didn't get an 8% raise over the course of the pandemic, you took a pay cut.

Discussion of wages is protected speech under the National Labor Relations Act, and no employer can tell you you can't disclose your pay with your fellow employees.
rnjie
Posts: 157
Joined: Wed Mar 20, 2019 4:59 pm

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

Post 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.
ssax
Dreams In Code
Posts: 7682
Joined: Wed Feb 11, 2015 12:54 pm

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

Post 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.
Locked