[webmin-devel] Bacula-Backup module

"Clément VERET" <[email protected]>
Newsgroups gmane.comp.web.webmin.devel
Message-ID <[email protected]>
Hi everyone,

I was playing with the bacula-backup module (and bacule by the way)
and I found what's look like a bug.

Actually, it was impossible to see the completed jobs in the "Director
Status", "Storage Status" and "Client Status" pages.

So I took a little bit of patience, and I corrected the regexp of this
modules concerning completed jobs.

Unfortunatly, I wasn't able to test it on something else than a CentOS
5.1/Webmin 1.40/Bacula 2.03 (EPEL Version actually).

Hope this can help...

P.S. : excuse my eventual typo, I'm learning Dvorak french keyboard
since last week :)
-- 
Clément Véret

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

-
Forwarded by the Webmin development list at [email protected]
To remove yourself from this list, go to
http://lists.sourceforge.net/lists/listinfo/webadmin-devel
webmin_bacula.patch (application/octet-stream, 3.4 KB)
diff -aburN webmin-1.400.ori/bacula-backup/bacula-backup-lib.pl webmin-1.400/bacula-backup/bacula-backup-lib.pl
--- webmin-1.400.ori/bacula-backup/bacula-backup-lib.pl	2008-02-09 00:26:02.000000000 +0100
+++ webmin-1.400/bacula-backup/bacula-backup-lib.pl	2008-02-27 09:50:12.000000000 +0100
@@ -907,11 +907,11 @@
 			     'name' => &job_name($2),
 			     'status' => $4 });
 		}
-	elsif ($sect == 3 && $l =~ /^\s*(\d+)\s+(\S+)\s+([0-9,]+)\s+([0-9,]+)\s+(\S+)\s+(\S+\s+\S+)\s+(\S+)\s*$/) {
+	elsif ($sect == 3 && $l =~ /^\s*(\d+)\s+(\S+)\s+([0-9,]+)\s+([0-9,]+\.[0-9,]+\s+\S+)\s+(\S+)\s+(\S+\s+\S+)\s+(\S+)\s*$/){
 		push(@done, { 'id' => $1,
 			      'level' => &full_level($2),
 			      'files' => &remove_comma($3),
-			      'bytes' => &remove_comma($4),
+			      'bytes' => $4,
 			      'status' => $5,
 			      'date' => $6,
 			      'name' => &job_name($7) });
@@ -947,11 +947,11 @@
 	elsif ($sect == 2 && $l =~ /^\s*Backup\s+Job\s+started:\s+(\S+\s+\S+)/) {
 		$run[$#run]->{'date'} = $1;
 		}
-	elsif ($sect == 3 && $l =~ /^\s*(\d+)\s+(\S+)\s+([0-9,]+)\s+([0-9,]+)\s+(\S+)\s+(\S+\s+\S+)\s+(\S+)\s*$/) {
+	elsif ($sect == 3 && $l =~ /^\s*(\d+)\s+(\S+)\s+([0-9,]+)\s+([0-9,]+\.[0-9,]+\s+\S+)\s+(\S+)\s+(\S+\s+\S+)\s+(\S+)\s*$/) {
 		push(@done, { 'id' => $1,
 			      'level' => &full_level($2),
 			      'files' => &remove_comma($3),
-			      'bytes' => &remove_comma($4),
+			      'bytes' => $4,
 			      'status' => $5,
 			      'date' => $6,
 			      'name' => &job_name($7) });
@@ -994,11 +994,11 @@
 		$run[$#run]->{'volume'} = $4;
 		$run[$#run]->{'device'} = $6;
 		}
-	elsif ($sect == 3 && $l =~ /^\s*(\d+)\s+(\S+)\s+([0-9,]+)\s+([0-9,]+)\s+(\S+)\s+(\S+\s+\S+)\s+(\S+)\s*$/) {
+	elsif ($sect == 3 && $l =~ /^\s*(\d+)\s+(\S+)\s+([0-9,]+)\s+([0-9,]+\.[0-9,]+\s+\S+)\s+(\S+)\s+(\S+\s+\S+)\s+(\S+)\s*$/) {
 		push(@done, { 'id' => $1,
 			      'level' => &full_level($2),
 			      'files' => &remove_comma($3),
-			      'bytes' => &remove_comma($4),
+			      'bytes' => $4,
 			      'status' => $5,
 			      'date' => $6,
 			      'name' => &job_name($7) });
diff -aburN webmin-1.400.ori/bacula-backup/clientstatus_form.cgi webmin-1.400/bacula-backup/clientstatus_form.cgi
--- webmin-1.400.ori/bacula-backup/clientstatus_form.cgi	2008-02-09 00:26:02.000000000 +0100
+++ webmin-1.400/bacula-backup/clientstatus_form.cgi	2008-02-27 09:49:49.000000000 +0100
@@ -71,7 +71,7 @@
 					$j->{'id'},
 					$j->{'level'},
 					$j->{'date'},
-					&nice_size($j->{'bytes'}),
+					$j->{'bytes'}."bytes",
 					$j->{'files'},
 					$j->{'status'} ]);
 				}
diff -aburN webmin-1.400.ori/bacula-backup/dirstatus_form.cgi webmin-1.400/bacula-backup/dirstatus_form.cgi
--- webmin-1.400.ori/bacula-backup/dirstatus_form.cgi	2008-02-09 00:26:02.000000000 +0100
+++ webmin-1.400/bacula-backup/dirstatus_form.cgi	2008-02-27 09:49:32.000000000 +0100
@@ -54,7 +54,7 @@
 			$j->{'id'},
 			$j->{'level'},
 			$j->{'date'},
-			&nice_size($j->{'bytes'}),
+			$j->{'bytes'}."bytes",
 			$j->{'files'},
 			$j->{'status'} ]);
 		}
diff -aburN webmin-1.400.ori/bacula-backup/storagestatus_form.cgi webmin-1.400/bacula-backup/storagestatus_form.cgi
--- webmin-1.400.ori/bacula-backup/storagestatus_form.cgi	2008-02-09 00:26:02.000000000 +0100
+++ webmin-1.400/bacula-backup/storagestatus_form.cgi	2008-02-27 09:49:41.000000000 +0100
@@ -74,7 +74,7 @@
 					$j->{'id'},
 					$j->{'level'},
 					$j->{'date'},
-					&nice_size($j->{'bytes'}),
+					$j->{'bytes'}."bytes",
 					$j->{'files'},
 					$j->{'status'} ]);
 				}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.