Re: [webmin-devel] Bacula-Backup module

"Clément VERET" <[email protected]>
Newsgroups gmane.comp.web.webmin.devel
Message-ID <[email protected]>
Errr... I've just seen that there was a little problem with this patch
: before applying it, the Bacula Module just displays you jobs that
have the "Error" status ; after, it displays you only jobs that have
the "OK" status (ooops...). That's particularly unuseful if you want
to know the status of all jobs done by Bacula.

I send you the correction : I was wrong on a little part of the
regular expression (jobs in OK status display the quantity of data
under the form '135.56 M', jobs in error status display '0' instead).

Sorry for the first wrong patch.

Regards.

2008/2/27, Jamie Cameron <[email protected]>:
> Thanks for the patch! I will include this in the next Webmin release ..
>
>   - Jamie
>
>  On 27/Feb/2008 03:04 Clément VERET wrote ..
>
> > 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
>
>


-- 
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_patch2.patch (application/octet-stream, 3.9 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-03-21 08:32:25.000000000 +0100
@@ -907,14 +907,14 @@
 			     '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),
-			      'status' => $5,
-			      'date' => $6,
-			      'name' => &job_name($7) });
+			      'bytes' => $4,
+			      'status' => $6,
+			      'date' => $7,
+			      'name' => &job_name($8) });
 		}
 	}
 return (\@sched, \@run, \@done);
@@ -947,14 +947,14 @@
 	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),
-			      'status' => $5,
-			      'date' => $6,
-			      'name' => &job_name($7) });
+			      'bytes' => $4,
+			      'status' => $6,
+			      'date' => $7,
+			      'name' => &job_name($8) });
 		}
 	}
 return ($msg, $msg =~ /failed|error/i ? 0 : 1, \@run, \@done);
@@ -994,14 +994,14 @@
 		$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),
-			      'status' => $5,
-			      'date' => $6,
-			      'name' => &job_name($7) });
+			      'bytes' => $4,
+			      'status' => $6,
+			      'date' => $7,
+			      'name' => &job_name($8) });
 		}
 	}
 return ($msg, $msg =~ /failed|error/i ? 0 : 1, \@run, \@done);
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-03-21 08:32:30.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-03-21 08:32: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-03-21 08:32:34.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.