Monitoring Backups
Once you have configured multiple backups, you will probably start looking for a way to monitor all these log files. Although, LBackup includes some basic email reporting features, you may require more advanced reporting options so that you are more easily able to customize the reporting of these backup issue and how notification of these issues will occur. There are also other reporting options availibe from the reporting page
That is where the scripts listed below will save you from writing custom scripts from scratch :
| Monitoring Multiple Backup Log Script Information Links | Download Links |
|---|---|
| updateloglist.rb | download |
| backupscan.rb | download |
| scan_server.rb | download |
There are plans to publish these scripts on-line with installers and documentation. In the mean time you are welcome to contact us and we will send you a copy of the latest development versions.
Please also feel free to contact us if you are interested in being involved with the development of the LBackup monitoring system, which is currently under development and will most likely leverage these scripts.
Monitoring Multiple Backup Script Details
This section outlines the use of the scripts which may be downloaded from the links listed above. This is the first iteration of documentation relating to the use of these scripts. Your contributions to the improvement of the LBackup project are welcome. To discuss development and use of these scripts please sign up on the discussion mailing list.
List of backup monitoring scripts currently available on-line :
updateloglist.rb
The updateloglist.rb script will generate a file containing list of backups which are scheduled in the crontab. This script must be executed as the backup user so that it will be able to see the backups listed in the crontab. This file may be used by the backupscan.rb script to check the status of the backups which have been loaded into the crontab of the backup server. To schedule this process on your backup server, copy the script to your backup server and then add it to your backup users crontab at the desired interval.
Example of the output from this script if you have backups scheduled with cron :
/Users/backup/backup_configurations/svnserver/svnserver_backup.log /Users/backup/backup_configurations/mailserver/mailserver_backup.log /Users/backup/backup_configurations/fileserver/fileserver_backup.log
backupscan.rb
The backupscan.rb script is used to check multiple log files on a single backup server. By default it will parse a file called backuploglist.txt. Each line of this file must contain a single backup log which will be checked for current errors.
Example of calling the script :
./backupscan.rb -l backup_file_list.txt
scan_server.rb
The scan_server.rb script will allow you to scan multiple backup servers from a single system. By default the script will parse a file called host_list.txt for backup servers and the command which should be executed on that backup server. This command will most likely be to execute the backupscan.rb script which will already be installed on the backup server.
The format of this input file is as follows :
server_to_connect_to_via_ssh <tab> command_to_execute_on_the_server
Example of the host_list.txt file :
your_lbackup_server_hostname cd /path/to/backupscan/directory; ./backupscan.rb -l backuploglist.txt lbackup.your.company.com cd /var/lbackup/backupscan; ./backupscan.rb -l backuploglist.txt
Example script to scan multiple servers :
#!/bin/bash # # Version 1.0 # (C)2008 Lucid Information Systems # Licenced under the GNU GPL # www.lucidsystems.org # # This script is using SSHKeychain as the Authentication Agent # This script assumes that you have placed the scan_server.rb script into the direcotry # ~/bin/scanbackupservers # Load SSH Keychain as the SSH Key Agent SSH_AUTH_SOCK=/tmp/`id -u`/SSHKeychain.socket # Move into the scan backup servers directory cd ~/bin/scanbackupservers/ # Scan Some Servers ./scan_server.rb
Example
Summary Log File Update
The example below assumes you have downloaded the 'backupscan.rb' script to the directory '/Users/Shared/backupscan/', this script is executable and that a file called 'backuploglist.txt' generated by the 'updateloglist.rb' also exists in this directory.
cd /Users/Shared/backupscan/; ./backupscan.rb -l ./backuploglist.txt > ./backupsummary.log
As an example the command above could be added as a cron job on your system so that a log file summary is regularly updated.