Page 1 of 1

/store/backups usage too high

Posted: Tue Dec 09, 2014 10:03 am
by mon-team
Hi guys,

I notice that the /store/backups/ space usage is growing fast. Is this normal?

At the moment we have on nagiosXI 1203 Hosts and 13401 Services.

[root@nagios]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/vg_tor1bld0421u-lv_root
20G 12G 7.3G 62% /
tmpfs 24G 0 24G 0% /dev/shm
/dev/sda1 485M 97M 363M 21% /boot
/dev/mapper/vg_tor1bld0421u-lv_var
30G 7.6G 21G 27% /var
/dev/mapper/vg_tor1bld0421u-lv_usr_local
477G 28G 426G 7% /usr/local
/dev/mapper/vg_tor1bld0421u-lv_opt
20G 505M 19G 3% /opt
tmpfs 1.0G 40M 985M 4% /var/nagiosramdisk


[root@nagios]# du -h /store/backups/
2.3G /store/backups/nagiosxi
5.7M /store/backups/postgresql/daily/nagiosxi
28K /store/backups/postgresql/daily/postgres
28K /store/backups/postgresql/daily/template1
5.8M /store/backups/postgresql/daily
6.0M /store/backups/postgresql/monthly/nagiosxi
52K /store/backups/postgresql/monthly/postgres
52K /store/backups/postgresql/monthly/template1
6.1M /store/backups/postgresql/monthly
26M /store/backups/postgresql/weekly/nagiosxi
216K /store/backups/postgresql/weekly/postgres
216K /store/backups/postgresql/weekly/template1
27M /store/backups/postgresql/weekly
39M /store/backups/postgresql
1.9M /store/backups/mysql/daily/nagiosql
848K /store/backups/mysql/daily/mysql
557M /store/backups/mysql/daily/nagios
32K /store/backups/mysql/daily/test
560M /store/backups/mysql/daily
2.9M /store/backups/mysql/monthly/nagiosql
2.0M /store/backups/mysql/monthly/mysql
916M /store/backups/mysql/monthly/nagios
60K /store/backups/mysql/monthly/test
921M /store/backups/mysql/monthly
13M /store/backups/mysql/weekly/nagiosql
8.3M /store/backups/mysql/weekly/mysql
4.1G /store/backups/mysql/weekly/nagios
248K /store/backups/mysql/weekly/test
4.2G /store/backups/mysql/weekly
5.6G /store/backups/mysql
7.9G /store/backups/


Thanks.

Best Regards

Re: /store/backups usage too high

Posted: Tue Dec 09, 2014 10:11 am
by slansing
Please attach the text output files from the following commands:

Code: Select all

ll /var/lib/mysql/nagiosql/ > /tmp/nagiosqltblsize.txt
ll /var/lib/mysql/nagios/ > /tmp/nagiosdbsize.txt

Re: /store/backups usage too high

Posted: Tue Dec 09, 2014 10:32 am
by mon-team
ll /var/lib/mysql/nagiosql/ > /tmp/nagiosqltblsize.txt
nagiosqltblsize.txt
ll /var/lib/mysql/nagios/ > /tmp/nagiosdbsize.txt
nagiosdbsize.txt

Hi support,

Is there a way to limit weekly backups to the last month (last 4 weeks) and monthly backups to the last year (last 12 months)?

Thanks

Re: /store/backups usage too high

Posted: Tue Dec 09, 2014 4:33 pm
by abrist
mon-team wrote: Is there a way to limit weekly backups to the last month (last 4 weeks) and monthly backups to the last year (last 12 months)?
Yes, though it requires editing the following scripts:

Code: Select all

/root/scripts/automysqlbackup
/root/scripts/autopostgresqlbackup
Most of them are already set to only retain 5 or so of each type.

Re: /store/backups usage too high

Posted: Wed Dec 10, 2014 11:28 am
by mon-team
Hi Support,

I found a bug in both the scripts:

line 540 in /root/scripts/automysqlbackup
change
eval rm -fv "$BACKUPDIR/weekly/$DB_week.$REMW.*"
to
eval rm -fv "$BACKUPDIR/weekly/$DB/${DB}_week.$REMW.*"

line 389 in in /root/scripts/autopostgresqlbackup
change
eval rm -fv "$BACKUPDIR/weekly/$DB/week.$REMW.*"
to
eval rm -fv "$BACKUPDIR/weekly/$DB/${DB}_week.$REMW.*"

It should be OK for us now

Re: /store/backups usage too high

Posted: Wed Dec 10, 2014 1:34 pm
by lmiltchev
Thanks for the feedback! I am forwarding your mods to our developers. Locking this topic as resolved.