Add an entropy graph.

This commit is contained in:
Michael Tremer
2014-02-02 14:26:13 +01:00
parent 1c72742bca
commit 15b023b979
14 changed files with 139 additions and 0 deletions

View File

@@ -1114,3 +1114,38 @@ sub getprocesses {
my @processesgraph = `ls -dA $mainsettings{'RRDLOG'}/collectd/localhost/processes-*/ 2>/dev/null`;
return @processesgraph;
}
sub updateentropygraph {
my $period = $_[0];
my @command = (
"-",
"--start",
"-1".$period,
"-aPNG",
"-i",
"-z",
"-W www.ipfire.org",
"--alt-y-grid",
"-w 600",
"-h 225",
"-r",
"--lower-limit","0",
"-t $Lang::tr{'entropy'}",
"-v $Lang::tr{'bit'}",
"DEF:entropy=$mainsettings{'RRDLOG'}/collectd/localhost/entropy/entropy.rrd:entropy:AVERAGE",
"CDEF:entropytrend=entropy,43200,TREND",
"LINE3:entropy#ff0000:" . sprintf("%-15s", $Lang::tr{'entropy'}),
"VDEF:entrmin=entropy,MINIMUM",
"VDEF:entrmax=entropy,MAXIMUM",
"VDEF:entravg=entropy,AVERAGE",
"GPRINT:entrmax:" . sprintf("%12s\\: %%5.0lf", $Lang::tr{'maximum'}),
"GPRINT:entrmin:" . sprintf("%12s\\: %%5.0lf", $Lang::tr{'minimum'}),
"GPRINT:entravg:" . sprintf("%12s\\: %%5.0lf", $Lang::tr{'average'}) . "\\n",
"LINE3:entropytrend#000000",
);
RRDs::graph (@command);
$ERROR = RRDs::error;
print "Error in RRD::graph for entropy: ".$ERROR."\n" if $ERROR;
}