Page 1 of 1

Disk clean-up & purpose of /usr/local/nagiosxi/tmp

Posted: Mon Apr 13, 2020 4:11 pm
by TBT
We recently experienced an issue where / was full and discovered /usr/local/nagiosxi/tmp had GBs of PDF reports, snmpwalk data, logs, etc dating back to 2017.

1. What is the purpose of /usr/local/nagiosxi/tmp?
2. Doesn't XI perform automatic housekeeping on /usr/local/nagiosxi/tmp?
3. We encounter a full drive issue at least annually, what is your recommendation for a clean-up checklist during such events?

Re: Disk clean-up & purpose of /usr/local/nagiosxi/tmp

Posted: Mon Apr 13, 2020 4:51 pm
by ssax
1. Temporary files for XI (switch/router wizard temp files, reports, logs, etc)
2. No, it doesn't currently.
3. Check these:

Code: Select all

/store/backups/*
/usr/local/nagiosxi/tmp/*
/usr/local/nagios/var/*
/var/log/*
/var/log/snmptt/*
/var/spool/mail/*
I essentially just do this every time:

Code: Select all

cd /
du -sh *
cd large directory
du -sh *
cd next directory
du -sh *
keep doing it until you find what is eating the space
cd /
du -sh *
cd large director2
du -sh *
rinse, repeat
That's the most accurate way to do it that I'm aware, you can search for large files (google linux find large files) but this method is the most accurate as it could be a million tiny files consuming the space and this will show you where they reside.

If you have questions, just post them before deleting stuff you're unsure of for the nagios specific data.

Thank you

Re: Disk clean-up & purpose of /usr/local/nagiosxi/tmp

Posted: Tue Apr 14, 2020 7:30 am
by TBT
So it would be advisable to setup a cron to delete files order than 30 days from /usr/local/nagiosxi/tmp/ ?

eg:

Code: Select all

find /usr/local/nagiosxi/tmp/ -type f -mtime +30 -delete

Re: Disk clean-up & purpose of /usr/local/nagiosxi/tmp

Posted: Tue Apr 14, 2020 11:36 am
by ssax
Yeah, that should work, I would probably exclude these files from there though:

Code: Select all

components_api_versions.xml
configwizards_api_versions.xml
phpmailer.log
upgrade.log
See here:

https://superuser.com/questions/397307/ ... using-find

Re: Disk clean-up & purpose of /usr/local/nagiosxi/tmp

Posted: Tue Apr 14, 2020 1:57 pm
by TBT
Why are those exclusion files in tmp if required?

Re: Disk clean-up & purpose of /usr/local/nagiosxi/tmp

Posted: Wed Apr 15, 2020 10:39 am
by ssax
They aren't required, I was having you save them for your (and our) benefit to help you debug if you have an issue. They should be recreated automatically.

Feel free to delete whatever you want in there.

Re: Disk clean-up & purpose of /usr/local/nagiosxi/tmp

Posted: Wed Apr 15, 2020 11:21 am
by TBT
Okay, I've excluded them anyway.

Thanks.

Re: Disk clean-up & purpose of /usr/local/nagiosxi/tmp

Posted: Wed Apr 15, 2020 2:21 pm
by ssax
Glad to hear it! Are we okay to lock this topic and mark it as resolved or do you have any related questions?

Re: Disk clean-up & purpose of /usr/local/nagiosxi/tmp

Posted: Wed Apr 15, 2020 2:55 pm
by TBT
We're good. My script is taking care of clean-up now.