]> git.ipfire.org Git - people/teissler/ipfire-2.x.git/blobdiff - config/cfgroot/graphs.pl
qos.cgi: Use Language string for legend in graph
[people/teissler/ipfire-2.x.git] / config / cfgroot / graphs.pl
index c51e882e20ff2267fae3c45381db6f2f4ed8b5cd..5a45ec964608cbce5a606c4a8883cd4231fb439d 100644 (file)
@@ -602,22 +602,37 @@ sub updatefwhitsgraph {
                "--color=SHADEA".$color{"color19"},
                "--color=SHADEB".$color{"color19"},
                "--color=BACK".$color{"color21"},
-               "DEF:output=".$mainsettings{'RRDLOG'}."/collectd/localhost/iptables-filter-FORWARD/ipt_bytes-DROP_OUTPUT.rrd:value:AVERAGE",
-               "DEF:input=".$mainsettings{'RRDLOG'}."/collectd/localhost/iptables-filter-INPUT/ipt_bytes-DROP_INPUT.rrd:value:AVERAGE",
+               "DEF:output=".$mainsettings{'RRDLOG'}."/collectd/localhost/iptables-filter-POLICYOUT/ipt_bytes-DROP_OUTPUT.rrd:value:AVERAGE",
+               "DEF:input=".$mainsettings{'RRDLOG'}."/collectd/localhost/iptables-filter-POLICYIN/ipt_bytes-DROP_INPUT.rrd:value:AVERAGE",
+               "DEF:forward=".$mainsettings{'RRDLOG'}."/collectd/localhost/iptables-filter-POLICYFWD/ipt_bytes-DROP_FORWARD.rrd:value:AVERAGE",
                "DEF:newnotsyn=".$mainsettings{'RRDLOG'}."/collectd/localhost/iptables-filter-NEWNOTSYN/ipt_bytes-DROP_NEWNOTSYN.rrd:value:AVERAGE",
                "DEF:portscan=".$mainsettings{'RRDLOG'}."/collectd/localhost/iptables-filter-PSCAN/ipt_bytes-DROP_PScan.rrd:value:AVERAGE",
-               "CDEF:amount=output,input,newnotsyn,+,+",
-               "COMMENT:".sprintf("%-20s",$Lang::tr{'caption'}),
+               "COMMENT:".sprintf("%-26s",$Lang::tr{'caption'}),
                "COMMENT:".sprintf("%15s",$Lang::tr{'maximal'}),
                "COMMENT:".sprintf("%15s",$Lang::tr{'average'}),
-               "COMMENT:".sprintf("%15s",$Lang::tr{'minimal'}),
+               "COMMENT:".sprintf("%14s",$Lang::tr{'minimal'}),
                "COMMENT:".sprintf("%15s",$Lang::tr{'current'})."\\j",
-               "AREA:amount".$color{"color24"}."A0:".sprintf("%-20s",$Lang::tr{'firewallhits'}),
-               "GPRINT:amount:MAX:%8.1lf %sBps",
-               "GPRINT:amount:AVERAGE:%8.1lf %sBps",
-               "GPRINT:amount:MIN:%8.1lf %sBps",
-               "GPRINT:amount:LAST:%8.1lf %sBps\\j",
-               "STACK:portscan".$color{"color25"}."A0:".sprintf("%-20s",$Lang::tr{'portscans'}),
+               "AREA:output".$color{"color25"}."A0:".sprintf("%-25s",$Lang::tr{'firewallhits'}."-OUTPUT"),
+               "GPRINT:output:MAX:%8.1lf %sBps",
+               "GPRINT:output:AVERAGE:%8.1lf %sBps",
+               "GPRINT:output:MIN:%8.1lf %sBps",
+               "GPRINT:output:LAST:%8.1lf %sBps\\j",
+               "STACK:forward".$color{"color23"}."A0:".sprintf("%-25s",$Lang::tr{'firewallhits'}."-FORWARD"),
+               "GPRINT:forward:MAX:%8.1lf %sBps",
+               "GPRINT:forward:AVERAGE:%8.1lf %sBps",
+               "GPRINT:forward:MIN:%8.1lf %sBps",
+               "GPRINT:forward:LAST:%8.1lf %sBps\\j",
+               "STACK:input".$color{"color24"}."A0:".sprintf("%-25s",$Lang::tr{'firewallhits'}."-INPUT"),
+               "GPRINT:input:MAX:%8.1lf %sBps",
+               "GPRINT:input:AVERAGE:%8.1lf %sBps",
+               "GPRINT:input:MIN:%8.1lf %sBps",
+               "GPRINT:input:LAST:%8.1lf %sBps\\j",
+               "STACK:newnotsyn".$color{"color14"}."A0:".sprintf("%-25s","NewNotSyn"),
+               "GPRINT:newnotsyn:MAX:%8.1lf %sBps",
+               "GPRINT:newnotsyn:MIN:%8.1lf %sBps",
+               "GPRINT:newnotsyn:AVERAGE:%8.1lf %sBps",
+               "GPRINT:newnotsyn:LAST:%8.1lf %sBps\\j",
+               "STACK:portscan".$color{"color16"}."A0:".sprintf("%-25s",$Lang::tr{'portscans'}),
                "GPRINT:portscan:MAX:%8.1lf %sBps",
                "GPRINT:portscan:MIN:%8.1lf %sBps",
                "GPRINT:portscan:AVERAGE:%8.1lf %sBps",
@@ -975,9 +990,9 @@ sub updateqosgraph {
                                push(@command, "DEF:$classline[1]=$mainsettings{'RRDLOG'}/class_$qossettings{'CLASSPRFX'}-$classline[1]_$qossettings{'DEV'}.rrd:bytes:AVERAGE");
 
                                if ($count eq "1") {
-                                       push(@command, "AREA:$classline[1]$color:Klasse $classline[1] -".sprintf("%15s",$classline[8]));
+                                       push(@command, "AREA:$classline[1]$color:$Lang::tr{'Class'} $classline[1] -".sprintf("%15s",$classline[8]));
                                } else {
-                                       push(@command, "STACK:$classline[1]$color:Klasse $classline[1] -".sprintf("%15s",$classline[8]));
+                                       push(@command, "STACK:$classline[1]$color:$Lang::tr{'Class'} $classline[1] -".sprintf("%15s",$classline[8]));
 
                                }
 
@@ -1099,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;
+}