/store/backups usage too high

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
mon-team
Posts: 171
Joined: Thu Jun 28, 2012 9:22 am

/store/backups usage too high

Post 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
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: /store/backups usage too high

Post 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
mon-team
Posts: 171
Joined: Thu Jun 28, 2012 9:22 am

Re: /store/backups usage too high

Post 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
You do not have the required permissions to view the files attached to this post.
Last edited by slansing on Tue Dec 09, 2014 10:57 am, edited 1 time in total.
Reason: Merged posts.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: /store/backups usage too high

Post 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.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
mon-team
Posts: 171
Joined: Thu Jun 28, 2012 9:22 am

Re: /store/backups usage too high

Post 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
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: /store/backups usage too high

Post by lmiltchev »

Thanks for the feedback! I am forwarding your mods to our developers. Locking this topic as resolved.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked