Page 1 of 2
Huge files in /var.
Posted: Mon Dec 15, 2014 5:39 am
by prateekagr1988
2903.2MB 2014-12-15 mysql /var/lib/mysql/nagios/nagios_commenthistory.MYD
2896.2MB 2014-12-15 mysql /var/lib/mysql/nagios/nagios_commenthistory.TMD
548.3MB 2014-12-15 mysql /var/lib/mysql/nagios/nagios_statehistory.MYD
468.0MB 2014-12-08 nagios /var/spool/mail/nagios
344.1MB 2014-12-15 mysql /var/lib/mysql/nagios/nagios_commenthistory.MYI
Please suggest on how to housekeep those, and re-direct to a different file system from /var.
Re: Huge files in /var.
Posted: Mon Dec 15, 2014 11:56 am
by abrist
Files located in the directory: /var/lib/mysql/nagios are tables. You could truncate those tables, or decrease their retention window through Admin --> Performance --> Databases.
prateekagr1988 wrote:Please suggest on how to housekeep those, and re-direct to a different file system from /var.
Well, you would need to move the default location for the database files. Have you considered creating a new mount for /var? Nagios XI systems will make heavy use of /usr and /var.
prateekagr1988 wrote:468.0MB 2014-12-08 nagios /var/spool/mail/nagios
Empty the mail file . . .
Re: Huge files in /var.
Posted: Mon Dec 15, 2014 12:32 pm
by prateekagr1988
Thanks for the inputs !
Could you suggest what all can be moved from /usr and /var to different file systems ?
We have been asked to move all the application specific data to different mounts (and not use / or /var or /usr).
Re: Huge files in /var.
Posted: Mon Dec 15, 2014 12:39 pm
by abrist
This is possible with symlinks.
Data in /usr/local:
Code: Select all
/nagios
/nagiosxi
/nagiosmobile
/nagvis
/nrdp
Data in /var:
Code: Select all
/lib/mrtg
/lib/mysql
/lib/pgsql
Various logs in /var/log.
Re: Huge files in /var.
Posted: Mon Dec 15, 2014 12:44 pm
by prateekagr1988
Yes.. that's a good suggestion
So I should stop Nagios, and create the entire file structure in a different location ? or how does it work ?
Re: Huge files in /var.
Posted: Mon Dec 15, 2014 12:56 pm
by abrist
Symbolic Links:
http://en.wikipedia.org/wiki/Symbolic_link
http://www.cyberciti.biz/tips/understan ... links.html
prateekagr1988 wrote:So I should stop Nagios, and create the entire file structure in a different location ? or how does it work ?
This is something your linux admins should be able to help you with. It can be different in different environments.
Usually you create the folders somewhere else in your filesystem (on a different mount usually). Stop all relevant services, and then move/copy all the data from each folder to the new respective folder in the mount directory. You then create a symbolic links to the new directories and restart services.
Just an FYI: Doing this is technically unsupported though we will do what we can to help. Just beware that if you are new to linux, you may want to do some reading before going about creating mounts, moving XI files, and setting up symlinks.
Re: Huge files in /var.
Posted: Mon Dec 15, 2014 12:59 pm
by prateekagr1988
Creating of new FS is managed by our unix admins here, and I am fairly aware of unix.. so should not be an issue.. I would like to understand, what all should be stopped ideally.. when I move those files in /usr and /var (including the backups generated in /store)..
Re: Huge files in /var.
Posted: Mon Dec 15, 2014 1:10 pm
by abrist
prateekagr1988 wrote:and I am fairly aware of unix
Gotchya, my apologies.
prateekagr1988 wrote:what all should be stopped ideally
Code: Select all
nagios
ndo2db
mysqld
postgresql
npcd
httpd
crond
xinetd
I think that should be all of the services . . .
Re: Huge files in /var.
Posted: Mon Dec 15, 2014 1:20 pm
by prateekagr1988
No worries.
Do we have any reference document which gives a fair idea of such kind of tweaks and suggestions to improve the performance of Nagios ?
Re: Huge files in /var.
Posted: Mon Dec 15, 2014 2:25 pm
by sreinhardt
Here's one good example document we have. Other things you can look into are ramdisks, rrdcached, offloading mysql and ndo2db, possibly addition of mod_gearman for distributing checks. Take your time and assess what you really need to implement before jumping on all of these though.
http://assets.nagios.com/downloads/nagi ... ios-XI.pdf