
Bacula
check_bacula_log
Description:
Nagios plugin that checks Bacula logs for last status run.
Current Version
1.8
Last Release Date
2011-01-11
Compatible With
- Nagios 2.x
- Nagios 3.x
- Nagios 4.x
Owner
License
GPL
Project Files
File | Description |
---|---|
nocturnal_nagios_plugins-1.0.tar.gz | include check_bacula |
check_bacula_log.pl.txt | check_bacula.log.pl v1.7 |
Project Notes
check_bacula_log is a Nagios plugin that checks whether the backups made for today with the Bacula backup system were succesful.
This requires the Nagios user to have read access to the bacula log file.
Make sure that the user that runs Nagios has read access to the Bacula logs, make sure it also has the right to enter the directory where the log is stored.
Requirements:
- Nagios
- Perl
Reviews
(4)
Add a Review
Since I run backups late night I needed also yesterday's backups checked, and did: after #my $date = strftime("%d-%b-%Y", localtime); I added:
#Yesterday :)
#http://stackoverflow.com/questions/3506475/how-do-i-get-yesterdays-date-using-localtime
my $date = strftime("%d-%b-%Y", localtime);
my ($sec, $min, $hour, $mday, $mon, $year) = localtime();
my $yesterday_midday=timelocal(0,0,12,$mday,$mon,$year) - 24*60*60;
($sec, $min, $hour, $mday, $mon, $year) = localtime($yesterday_midday);
my $yesterdate = strftime("%d-%b-%Y", localtime($yesterday_midday));
and added an OR to the date check further down:
# want only todays and yesterdays jobs
next unless ($job{'Start time'} =~ m/^Q$dateEs/) or ($job{'Start time'} =~ m/^Q$yesterdateEs/);
thanks !
hello,
nice plugin. my backup runs at night an finishes before midnight so i changed the date:
my $date = strftime("%d-%b-%Y", localtime(time-86400));
regards
alfred
Sorry to put it out here but I cannot find a support email
Status always returns as follows:
Check of service '24 Hour Bacula Status' on host 'localhost' did not exit properly!
debug shows the following
[1276483758.016594] [016.1] [pid=13917] HOST: localhost, SERVICE: 24 Hour Bacula Status, CHECK TYPE: Active, OPTIONS: 0, SCHEDULED: Yes, RESCHEDULE: Yes, EXITED OK: No, RETURN CODE: 3, OUTPUT: **ePN failed to compile /usr/lib/nagios/plugins/check_bacula_log: "Variable "$PROGNAME" will not stay shared at (eval 1) line 181," at /usr/lib/nagios3/p1.pl line 250.n
I can provide more information if needed ... I would love this script as it does exactly what I need !
hi.
i've improved the code to report names of failed jobs, also made code more extensible if you want to fill other info to the job, such change can be accomplised with little effort.
also i renamed the plugin to check_backula_log, not to conflict with check_bacula that is in bacula contrib sources.
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/nagios-plugin-check_bacula_log/check_bacula_log.pl
Page Sections
Project Stats
Rating
4.3 (4)
Favorites
0
Views
97,121