Re: [BackupPC-users] Small patch to graph the pool size (v2 patch)
On Tue, Mar 11, 2008 at 07:41:37PM +0100, Knaupp, Thomas wrote: Hello Ludovic, maybe a stupid question: can I patch backuppc (3.1.0) that is already patched with your first version? No, Nicholas' patch is not compatible with mine. You have to undo the 1st patch (patch -r) and apply Nicholas' one. BTW, I've uploaded a Debian BackupPC package which already includes the 1st patch. I don't know if I'll add Nicholas patch because I find graphs with a log scale, hard to read. If you have any suggestions (2 graphs?), let me know ! Cheers, -- Ludovic Drolez. http://www.palmopensource.com - The PalmOS Open Source Portal http://www.drolez.com - Personal site - Linux, Zaurus and PalmOS stuff - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/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/
Re: [BackupPC-users] Small patch to graph the pool size (v2 patch)
On Fri, Feb 29, 2008 at 2:51 AM, Ludovic Drolez [EMAIL PROTECTED] wrote: 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. I've updated the patch with a new DS to hold and graph the value of the pool size prior to pooling and compression. Attached is the patch and a sample image. You will need to delete the existing RRD file ($LogDir/pool.rrd) as the script creates a new one with an additional datasource. -- Nicholas Hall [EMAIL PROTECTED] backuppc-rrdtool.patch Description: Binary data attachment: BackupPC-rrdtool.png- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/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/
Re: [BackupPC-users] Small patch to graph the pool size (v2 patch)
Hello Ludovic, I've updated the patch with a new DS to hold and graph the value of the pool size prior to pooling and compression. Attached is the patch and a sample image. You will need to delete the existing RRD file ($LogDir/pool.rrd) as the script creates a new one with an additional datasource. maybe a stupid question: can I patch backuppc (3.1.0) that is already patched with your first version? Regards, Tom - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/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/
Re: [BackupPC-users] Small patch to graph the pool size (v2 patch)
Hi Nicholas, sorry .. that one should go to you :) I've updated the patch with a new DS to hold and graph the value of the pool size prior to pooling and compression. Attached is the patch and a sample image. You will need to delete the existing RRD file ($LogDir/pool.rrd) as the script creates a new one with an additional datasource. maybe a stupid question: can I patch backuppc (3.1.0) that is already patched with your first version? Regards, Tom - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/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/
Re: [BackupPC-users] Small patch to graph the pool size (v2 patch)
On Tue, Mar 11, 2008 at 12:41 PM, Knaupp, Thomas [EMAIL PROTECTED] wrote: Hello Ludovic, I've updated the patch with a new DS to hold and graph the value of the pool size prior to pooling and compression. Attached is the patch and a sample image. You will need to delete the existing RRD file ($LogDir/pool.rrd) as the script creates a new one with an additional datasource. maybe a stupid question: can I patch backuppc (3.1.0) that is already patched with your first version? Regards, Tom No, I don't think so. You'll have to merge the changes manually... there are only minor changes made. Maybe someone can create a new patch to do just this. -- Nicholas Hall [EMAIL PROTECTED] - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/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/
Re: [BackupPC-users] Small patch to graph the pool size (v2 patch)
Hi all can this patch be modified for showing the percentage of cpool space sorted by host in some kind of stacked graph? I thing that cound be usefull to know how much of the pool storage is used by host A and how much by host B and so on. I'm not interested in the size of the backup for each host, but in the percentage of the cpool used by each host. thanks a lot! On Fri, 2008-02-29 at 09:51 +0100, Ludovic Drolez wrote: 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, - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/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/ - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/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/
Re: [BackupPC-users] Small patch to graph the pool size (v2 patch)
Simone Marzona wrote: can this patch be modified for showing the percentage of cpool space sorted by host in some kind of stacked graph? I thing that cound be usefull to know how much of the pool storage is used by host A and how much by host B and so on. I'm not interested in the size of the backup for each host, but in the percentage of the cpool used by each host. You can't really determine what you want to know. That is, both host A and B will have links to a single pooled copy for any file they have in common so it doesn't exactly belong to one or the other. Also, it isn't very practical to locate the 'other' links to a file so it would not even be easy to determine which files have links only from multiple runs on the same host and which are linked across hosts. -- Les Mikesell [EMAIL PROTECTED] - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/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/
Re: [BackupPC-users] Small patch to graph the pool size (v2 patch)
Thanks that fixed the display for me on Centos 5 John Rouillard wrote: On Fri, Feb 29, 2008 at 09:51:46AM +0100, Ludovic Drolez wrote: On 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 ?). Even with the newest patch, I still got broken images. There are two ways to run BackupPC_Admin. If you choose to run with BackupPC_Admin as a suid script rather than under a separate apache instance, you need the three lines below marked ### SUID added to the patch to Generalinfo.pm. This runs the rrdtool command as the user BackupPC runs as rather than as the apache user: diff -ur BackupPC-3.1.0/lib/BackupPC/CGI/GeneralInfo.pm BackupPC-3.1.0.working/lib/BackupPC/CGI/GeneralInfo.pm --- BackupPC-3.1.0/lib/BackupPC/CGI/GeneralInfo.pm 2007-11-26 03:00:07.0 + +++ BackupPC-3.1.0.working/lib/BackupPC/CGI/GeneralInfo.pm 2008-03-02 01:35:33.0 + @@ -43,6 +43,16 @@ { GetStatusInfo(info jobs hosts queueLen); my $Privileged = CheckPermission(); +if ($In{image} ne ) { + $In{image} =~ /([0-9]+)/; + my $weeks = $1; + my $real = $; ### SUID + $ = $;### SUID + print Content-type: image/png\n\n; + print `/tools/rrdtool/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#FF 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`; + $ = $real; ### SUID + return; +} my($jobStr, $statusStr); foreach my $host ( sort(keys(%Jobs)) ) { Note this patch includes a change in the path to rrdtool for my local site, so I would manually apply the three lines and not attempt to use patch(1). The other rrdtool calls are all called as the real BackupPC and not an effective user so it all works fine. -- Unencumbered by the thought process. -- Click and Clack the Tappet brothers - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/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/
Re: [BackupPC-users] Small patch to graph the pool size (v2 patch)
On Fri, Feb 29, 2008 at 09:51:46AM +0100, Ludovic Drolez wrote: On 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 ?). Even with the newest patch, I still got broken images. There are two ways to run BackupPC_Admin. If you choose to run with BackupPC_Admin as a suid script rather than under a separate apache instance, you need the three lines below marked ### SUID added to the patch to Generalinfo.pm. This runs the rrdtool command as the user BackupPC runs as rather than as the apache user: diff -ur BackupPC-3.1.0/lib/BackupPC/CGI/GeneralInfo.pm BackupPC-3.1.0.working/lib/BackupPC/CGI/GeneralInfo.pm --- BackupPC-3.1.0/lib/BackupPC/CGI/GeneralInfo.pm 2007-11-26 03:00:07.0 + +++ BackupPC-3.1.0.working/lib/BackupPC/CGI/GeneralInfo.pm 2008-03-02 01:35:33.0 + @@ -43,6 +43,16 @@ { GetStatusInfo(info jobs hosts queueLen); my $Privileged = CheckPermission(); +if ($In{image} ne ) { + $In{image} =~ /([0-9]+)/; + my $weeks = $1; + my $real = $; ### SUID + $ = $;### SUID + print Content-type: image/png\n\n; + print `/tools/rrdtool/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#FF 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`; + $ = $real; ### SUID + return; +} my($jobStr, $statusStr); foreach my $host ( sort(keys(%Jobs)) ) { Note this patch includes a change in the path to rrdtool for my local site, so I would manually apply the three lines and not attempt to use patch(1). The other rrdtool calls are all called as the real BackupPC and not an effective user so it all works fine. -- -- rouilj John Rouillard System Administrator Renesys Corporation 603-244-9084 (cell) 603-643-9300 x 111 - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/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/
Re: [BackupPC-users] Small patch to graph the pool size (v2 patch)
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#FF 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=4img src='.$MyURL.'?image=52br/'; +} + 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/vse012070mrt/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/
Re: [BackupPC-users] Small patch to graph the pool size (v2 patch)
On Thu, Feb 28, 2008 at 10:17:43AM -0700, Kimball Larsen wrote: but the images appear as busted images on the status page. 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 - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/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/
Re: [BackupPC-users] Small patch to graph the pool size (v2 patch)
Ludovic Drolez wrote: 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 ?). It's called BackupPC_Admin in the official distribution. Nils Breunese. - This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse012070mrt/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/