Search Exchange

Search All Sites

Nagios Live Webinars

Let our experts show you how Nagios can help your organization.

Contact Us

Phone: 1-888-NAGIOS-1
Email: sales@nagios.com

Login

Remember Me

Directory Tree

check_bacula_log

Current Version
1.8
Last Release Date
2011-01-11
Compatible With
  • Nagios 2.x
  • Nagios 3.x
  • Nagios 4.x
Owner
License
GPL
Hits
97073
Files:
FileDescription
nocturnal_nagios_plugins-1.0.tar.gzinclude check_bacula
check_bacula_log.pl.txtcheck_bacula.log.pl v1.7
Nagios CSP

Meet The New Nagios Core Services Platform

Built on over 25 years of monitoring experience, the Nagios Core Services Platform provides insightful monitoring dashboards, time-saving monitoring wizards, and unmatched ease of use. Use it for free indefinitely.

Monitoring Made Magically Better

  • Nagios Core on Overdrive
  • Powerful Monitoring Dashboards
  • Time-Saving Configuration Wizards
  • Open Source Powered Monitoring On Steroids
  • And So Much More!
Nagios plugin that checks Bacula logs for last status run.
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)
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$date\E\s/) or ($job{'Start time'} =~ m/^\Q$yesterdate\E\s/);

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 !
byglen, January 21, 2010
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