Restoring MySQL databases...

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Restoring MySQL databases...

Post by mguthrie »

You can safely truncate anything in the nagios database, as that contains status and historical information, but no configuration information. You can get an idea as to how big the database is by running:

Code: Select all

du -h /var/lib/mysql/nagios/
The two tables that can get pretty big are the logentries and the notifications tables. If you don't need all of that data for the migration then truncating them could save a lot of time and disk space.

If you just plain need more disk space, you can also try removing:
/var/spool/mail/root
and older log files under: /var/log/
jbennett
Posts: 522
Joined: Mon Apr 16, 2012 3:00 pm

Re: Restoring MySQL databases...

Post by jbennett »

mguthrie wrote:You can safely truncate anything in the nagios database, as that contains status and historical information, but no configuration information. You can get an idea as to how big the database is by running:

Code: Select all

du -h /var/lib/mysql/nagios/
I have cleared out all tables in the nagios db. When I run the above command, it only shows 660k in use. When I run it for the other tables, I don't see anything that would be taking up this much space:

nagios - 660K
nagiosql - 1.7M
mysql - 828K
test - 4.0K

Yet, /dev/mapper/os_vg-root_lv still shows all 16GB in use??
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Restoring MySQL databases...

Post by scottwilkerson »

This could be logs or something. You can run the following to find all files over 50M

Code: Select all

find /var -type f -size +50000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
jbennett
Posts: 522
Joined: Mon Apr 16, 2012 3:00 pm

Re: Restoring MySQL databases...

Post by jbennett »

scottwilkerson wrote:This could be logs or something. You can run the following to find all files over 50M

Code: Select all

find /var -type f -size +50000k -exec ls -lh {} \; | awk '{ print $9 ": " $5 }'
Found one file that was 50M. Search again for anything over 20M, and I'm only seeing two other files.

This is a different file structure from what I've worked with in the past. Since I had to hand over the VM creation to a different group, I'm not really sure what the problem is here.
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: Restoring MySQL databases...

Post by mguthrie »

I'm wondering if there's some out-of-control process using swap space until the disk is full. You could try firing that same find command at some different directories and see what turns up.
Locked