rOn Thu, Feb 28, 2008 at 10:17:43AM -0700, Kimball Larsen wrote:
> but the images appear as busted images on the status page.
(With the patch :-D )
Hi !
This new patch should fix this bug. Anyway the graphs will appear
after "backuppc nightly" has run.
I've also fixed another problem, which comes from the fact that I assumed
that the CGI was index.cgi (only true for Debian users ?).
Cheers,
--
Ludovic Drolez.
http://www.palmopensource.com - The PalmOS Open Source Portal
http://www.drolez.com - Personal site - Linux, Zaurus and PalmOS stuff
--- backuppc-3.1.0.orig/bin/BackupPC
+++ backuppc-3.1.0/bin/BackupPC
@@ -1190,6 +1190,15 @@
$Info{"${p}FileRepMax"},
$Info{"${p}FileLinkMax"}, $Info{"${p}DirCnt"});
}
+ if (-x "/usr/bin/rrdtool") {
+ my $date = time() + (24*3600);
+ if (! -f "$LogDir/pool.rrd") {
+ system("/usr/bin/rrdtool create $LogDir/pool.rrd --step 86400 DS:ckb:GAUGE:172800:0:U RRA:AVERAGE:0.5:1:1400");
+ }
+ system("/usr/bin/rrdtool update $LogDir/pool.rrd --template ckb $date:".($Info{"cpoolKb"}+$Info{"poolKb"}));
+ #print(LOG $bpc->timeStamp, "RRD data\n");
+ #print(LOG $bpc->timeStamp, "RRD data: ".($Info{"cpoolKb"}+$Info{"poolKb"})."\n");
+ }
}
} else {
$CmdJob = "";
--- backuppc-3.1.0.orig/lib/BackupPC/CGI/GeneralInfo.pm
+++ backuppc-3.1.0/lib/BackupPC/CGI/GeneralInfo.pm
@@ -44,6 +44,14 @@
GetStatusInfo("info jobs hosts queueLen");
my $Privileged = CheckPermission();
+ if ($In{image} ne "") {
+ $In{image} =~ /([0-9]+)/;
+ my $weeks = $1;
+ print "Content-type: image/png\n\n";
+ print `/usr/bin/rrdtool graph - --imgformat=PNG --start=end-${weeks}w --end=-300 --title="BackupPC Pool Size" --base=1000 --height=100 --width=600 --alt-autoscale-max --lower-limit=0 --vertical-label="" --slope-mode --font TITLE:10: --font AXIS:8: --font LEGEND:8: --font UNIT:8: -c BACK#FFFFFF DEF:ao="$LogDir/pool.rrd":ckb:AVERAGE CDEF:a=ao,1024,* AREA:a#95B8DB:"CPool in bytes" GPRINT:a:LAST:"Current\\:%8.2lf %s" GPRINT:a:AVERAGE:"Average\\:%8.2lf %s" GPRINT:a:MAX:"Maximum\\:%8.2lf %s\\n"`;
+ return;
+ }
+
my($jobStr, $statusStr);
foreach my $host ( sort(keys(%Jobs)) ) {
my $startTime = timeStamp2($Jobs{$host}{startTime});
@@ -122,10 +130,15 @@
<ul>
$cpoolInfo
</ul>
+<br/>
EOF
} elsif ( $Info{cpoolFileCnt} > 0 ) {
$poolInfo = $cpoolInfo;
}
+ if (-r "$LogDir/pool.rrd") {
+ $poolInfo .= '<img src="'.$MyURL.'?image=4"><img src="'.$MyURL.'?image=52"><br/>';
+ }
+
my $generalInfo = eval("qq{$Lang->{BackupPC_Server_Status_General_Info}}")
if ( $Privileged );
my $content = eval("qq{$Lang->{BackupPC_Server_Status}}");
-------------------------------------------------------------------------
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/
_______________________________________________
BackupPC-users mailing list
BackupPC-users@lists.sourceforge.net
List: https://lists.sourceforge.net/lists/listinfo/backuppc-users
Wiki: http://backuppc.wiki.sourceforge.net
Project: http://backuppc.sourceforge.net/