On Wed, Jan 25, 2012 at 1:45 PM, Davide Giunchi
<davide.giun...@soasi.com> wrote:
>
> http://www.soasi.com/send-bacula-backup-report/
>
> I've released "Send Bacula Backup Report" version 0.4, this is the ChangeLog:
>
>        * added support for PostgreSQL catalog
>        * tested with Bacula Enterprise

Hi Davide,

I made a changes in your script !!!
the idea is that the administrator can get a general status of backup
only reading the mail subject (like tripiwire report).

thanks.


-- 
--
Victor Hugo dos Santos
Linux Counter #224399
--- send_bacula_backup_report.pl-old	2012-02-02 14:16:42.000000000 -0300
+++ send_bacula_backup_report.pl	2012-02-02 14:42:57.000000000 -0300
@@ -26,6 +26,12 @@
 ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
 $year += 1900;
 $mon += 1;
+$status_ok=0; 
+$status_warn=0;
+$status_run=0;
+$status_wait=0;
+$status_error=0;
+
 # acquire the conf
 require '/etc/bacula/send_bacula_backup_report.conf';
 
@@ -67,14 +73,19 @@
 	# color list for various job status
 	if  ( ($ref->{'jobstatus'} =~ 'T') && ($ref->{'joberrors'} == 0)  ) {
 		$status = '<font color="green">OK</font>';
+		$status_ok++;
 	} elsif ( ($ref->{'jobstatus'} =~ 'T') && ($ref->{'joberrors'} != 0) ) {
 		$status = '<font color="purple">WARNING</font>';
+		$status_warn++;
 	} elsif ( ($ref->{'jobstatus'} =~ 'R') ) {
 		$status = '<font color="blue">RUNNING</font>';
+		$status_run++;
 	} elsif ( ($ref->{'jobstatus'} =~ 'C') ) {
 		$status = '<font color="blue">WAITING</font>';
+		$status_wait++;
 	} else  {
 		$status = '<font color="red">ERROR</font>';
+		$status_error++;
 	}
 
 
@@ -110,7 +121,7 @@
 
 my $msg = MIME::Lite->new
 (
-Subject => $email_subject,
+Subject => "$email_subject - OK:$status_ok WARN:$status_warn ERROR:$status_error RUN:$status_run WAIT:$status_wait",
 From    => $email_from,
 To      => $email_to,
 Type    => 'text/html',
------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
Bacula-users mailing list
Bacula-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bacula-users

Reply via email to