Any good rsnapshot nagios plugins?
Solution 1:
i cannot really answer about rsnapshot but i use rdiff - similar tool.
there is couple of things i monitor with nagios for my backups:
- what was exit code of last rdiff run. if it's not 0 - it means that something went wrong in the process. i just have simple bash script that executes bacup and depending on result touches file ok or failed. with nagios i check freshness of OK file and alert if it's older then 25h.
- before running backup i touch file in /xyz/touched . on server that receives the backup i check freshness of that file. if it's older then 25h it means last night backup did not arrived to the receiving machine.
- rdiff has verify option. i dont know if rsnapshot has. verify takes lot of time, i run it once a day and put result to a file... then simple nagios plugin greps this log file in search for error messages.
in this way i protect myself against interrupted backups and against file system corruption on receiving server ( for files not modified for long time ).
the trick is not to let nagios plugin do heavy lifting ( eg verifying the whole backup ), but rather schedule cron job that does that and have nagios plugin just checking result of the job ( eg file created or content of log file ).
and by the way - check this out.
Solution 2:
Rory, we have just released a plugin that should work for you. See the check_rsnapshot.php
file in the nagios-tools package as well as documentation here.
This plugin will verify rsnapshot backups using a number of optional checks:
- minfiles - checks the number of files in a snapshot against a minimum expected number;
- minsize - checks the size of a snapshot against a minimum expected size; log - parses the rsnapshot log to ensure the most recent runs for each retention period completed successfully;
- timestamp - checks for files created server side containing a timestamp and thus ensuring snapshots are succeedin;
- rotation - checks that retention directories are being rotated; and
- dir-creation - checks that retention directories are being created.