5c2da02b91
- Added rrdtool pool statistic graphs option. - Switch to sysutils/p5-File-Listing from www/p5-libwww dependency. - Convert to new options framework. - Trim Makefile header. PR: 178047 Submitted by: Alexander Moisseev <moiseev@mezonplus.ru> (maintainer)
50 lines
1.3 KiB
Text
50 lines
1.3 KiB
Text
--- bin/BackupPC.orig 2011-04-25 07:31:54.000000000 +0400
|
|
+++ bin/BackupPC 2013-02-17 16:51:18.000000000 +0400
|
|
@@ -1198,6 +1198,47 @@
|
|
$Info{"${p}FileRepMax"},
|
|
$Info{"${p}FileLinkMax"}, $Info{"${p}DirCnt"});
|
|
}
|
|
+
|
|
+ #
|
|
+ # RRDTool Graphing stuff
|
|
+ #
|
|
+ if ( -x "$BinDir/rrdtool" ) {
|
|
+ my $date = time() + (24 * 3600);
|
|
+ if ( ! -f "$LogDir/pool.rrd" ) {
|
|
+ system("$BinDir/rrdtool create $LogDir/pool.rrd"
|
|
+ . " --step 86400"
|
|
+ . " DS:ckb:GAUGE:172800:0:U"
|
|
+ . " DS:tps:GAUGE:172800:0:U"
|
|
+ . " RRA:AVERAGE:0.5:1:1400"
|
|
+ );
|
|
+ }
|
|
+
|
|
+ #
|
|
+ # Generate size totals prior to poolng and compression
|
|
+ #
|
|
+ my $sizeTot;
|
|
+ foreach my $host ( sort(keys(%{$bpc->HostInfoRead()})) ) {
|
|
+ my @Backups = $bpc->BackupInfoRead($host);
|
|
+ for ( my $i = 0 ; $i < @Backups ; $i++ ) {
|
|
+ $sizeTot += $Backups[$i]{size};
|
|
+ }
|
|
+ }
|
|
+
|
|
+ $sizeTot = $sizeTot / 1024;
|
|
+
|
|
+ system("$BinDir/rrdtool update $LogDir/pool.rrd"
|
|
+ . " $date:"
|
|
+ . ( $Info{"cpoolKb"} + $Info{"poolKb"} )
|
|
+ . ":$sizeTot"
|
|
+ );
|
|
+
|
|
+ printf(LOG "%sRRD Data: %s:%f:%f\n",
|
|
+ $bpc->timeStamp,
|
|
+ $date,
|
|
+ $Info{"cpoolKb"} + $Info{"poolKb"},
|
|
+ $sizeTot);
|
|
+ }
|
|
+
|
|
}
|
|
} else {
|
|
$CmdJob = "";
|