XI Scheduled Backups
-
Fred Kroeger
- Posts: 588
- Joined: Wed Oct 19, 2011 11:36 pm
- Location: Perth, Western Australia
- Contact:
XI Scheduled Backups
I've configured a Local Backup which saves to /store/backups/nagiosxi - Backup limit is set to 3.
I recently discovered that the backup limit is not being applied when the server disk filled up.
All the directory permissions are OK as the backup data is written OK.
I then looked at Local Backup Archives and there are no entries in the table - it is pointing to /store/backups/nagiosxi as the default.
So I then clicked on Create Backup and the backup ran OK - but still nothing displayed in the table.
Interestingly - the backup folder name is different if you run it manually compared to the auto backup
The foldername for Manual just has the timestamp - eg: 1425345786
whereas the auto backup prefixes it with nagiosxi - eg: nagiosxi.1425373202
Any ideas why the old copies ( >3) are not being removed and why I can't see the backups in the Archives. I had this issue with NagiosXI 2014R2.4 and recently upgraded to 2.6 - however I still have the same problems.
regards... Fred
I recently discovered that the backup limit is not being applied when the server disk filled up.
All the directory permissions are OK as the backup data is written OK.
I then looked at Local Backup Archives and there are no entries in the table - it is pointing to /store/backups/nagiosxi as the default.
So I then clicked on Create Backup and the backup ran OK - but still nothing displayed in the table.
Interestingly - the backup folder name is different if you run it manually compared to the auto backup
The foldername for Manual just has the timestamp - eg: 1425345786
whereas the auto backup prefixes it with nagiosxi - eg: nagiosxi.1425373202
Any ideas why the old copies ( >3) are not being removed and why I can't see the backups in the Archives. I had this issue with NagiosXI 2014R2.4 and recently upgraded to 2.6 - however I still have the same problems.
regards... Fred
Re: XI Scheduled Backups
The scheduled backups will only delete the scheduled backups and not the manual backups. Also, if you had the scheduled backups set to 10 and then change it to 3, it will not delete the 7 oldest backups, it will only delete the 3rd oldest backup going forward from there.
When you said that "backup folder name is different" what is that folder set too?
Can you show how the permissions for that folder?
Can you run this command and set a scheduled backup to happen 5 minutes in the future and them post back the output?
When you said that "backup folder name is different" what is that folder set too?
Can you show how the permissions for that folder?
Can you run this command and set a scheduled backup to happen 5 minutes in the future and them post back the output?
Code: Select all
tail -f /usr/local/nagiosxi/var/cmdsubsys.logBe sure to check out our Knowledgebase for helpful articles and solutions!
-
Fred Kroeger
- Posts: 588
- Joined: Wed Oct 19, 2011 11:36 pm
- Location: Perth, Western Australia
- Contact:
Re: XI Scheduled Backups
Aha.... it appears that the backup is failing because of a DB problem
I have repaired the database & it now seems to complete and the filename looks like what I expect.
The cmdsys.log excerpt however still displays that it is exiting with a failure status near the start? Is this something I need to fix?
The critical issue that needs to be addressed now is that it appears that I don't receive any notifications that the backup has failed!
regards.... Fred
The cmdsys.log excerpt however still displays that it is exiting with a failure status near the start? Is this something I need to fix?
The critical issue that needs to be addressed now is that it appears that I don't receive any notifications that the backup has failed!
regards.... Fred
You do not have the required permissions to view the files attached to this post.
Re: XI Scheduled Backups
What is this script - "/usr/local/nagios/local/Scripts/merged-rrd.py"? It seems like there are some permission issues with it.
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
Fred Kroeger
- Posts: 588
- Joined: Wed Oct 19, 2011 11:36 pm
- Location: Perth, Western Australia
- Contact:
Re: XI Scheduled Backups
Had a closer look and you can ignore that script - it isn't actually required anymore. Not even sure why it's there or who added it.
My last question remains however - why don't I receive a notification that the backup has failed?
Fred
My last question remains however - why don't I receive a notification that the backup has failed?
Fred
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: XI Scheduled Backups
Fred,
I can give a solution here.
I submitted a feature request to add extra services to detect if there are crashed tables in mysql.
I created a plugin which makes this possible:
http://tracker.nagios.com/view.php?id=670
I don't have an answer as to why you don't receive notifications about failed backups, however at least this way we can be alerted to the crashed tables as soon as they happen.
I can give a solution here.
I submitted a feature request to add extra services to detect if there are crashed tables in mysql.
I created a plugin which makes this possible:
http://tracker.nagios.com/view.php?id=670
I don't have an answer as to why you don't receive notifications about failed backups, however at least this way we can be alerted to the crashed tables as soon as they happen.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
-
Fred Kroeger
- Posts: 588
- Joined: Wed Oct 19, 2011 11:36 pm
- Location: Perth, Western Australia
- Contact:
Re: XI Scheduled Backups
Thanks Troy - Yes it's much better to know about any crashed tables beforehand instead of by surprise when a backup fails.
Do you know what script is run for the scheduled local backup. I'm trying to track down where /usr/local/nagios/local/Scripts/merged-rrd.pl gets called.
I assumed that the backup script was backup_xi.sh however that line doesn't exist in the file.
regards... Fred
Do you know what script is run for the scheduled local backup. I'm trying to track down where /usr/local/nagios/local/Scripts/merged-rrd.pl gets called.
I assumed that the backup script was backup_xi.sh however that line doesn't exist in the file.
regards... Fred
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: XI Scheduled Backups
I believe they are initiated from a cron:
Code: Select all
/etc/cron.d/nagiosxi
# Backup MySQL & PostgreSQL Databases
0 7 * * * root /root/scripts/automysqlbackup
0 8 * * * root /root/scripts/autopostgresqlbackupAs of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
-
Fred Kroeger
- Posts: 588
- Joined: Wed Oct 19, 2011 11:36 pm
- Location: Perth, Western Australia
- Contact:
Re: XI Scheduled Backups
No this is not the DB backup - this is the Local Backup under <Admin><Scheduled Backups>
- Box293
- Too Basu
- Posts: 5126
- Joined: Sun Feb 07, 2010 10:55 pm
- Location: Deniliquin, Australia
- Contact:
Re: XI Scheduled Backups
Ahh yes this gets a little more complicated.
Scheduled backups in XI are part of the cron job defined in /etc/cron.d/nagiosxi:
cleaner.php runs and checks to see if there are any scheduled jobs that need to be run. If there are then it executes the backup through the /usr/local/nagiosxi/cron/cmdsubsys.php script.
To perform a test backup just as the cron job did, perform the following:
Where testbackup is the name that the backup is given.
Scheduled backups in XI are part of the cron job defined in /etc/cron.d/nagiosxi:
Code: Select all
/usr/bin/php -q /usr/local/nagiosxi/cron/cleaner.php > /usr/local/nagiosxi/var/cleaner.log 2>&1To perform a test backup just as the cron job did, perform the following:
Code: Select all
su nagios
/usr/local/nagiosxi/scripts/backup_xi.sh testbackup -d /store/backups/nagiosxi/As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.