]> git.ipfire.org Git - ipfire-2.x.git/blobdiff - config/cfgroot/graphs.pl
web UI: Add graph for connection tracking
[ipfire-2.x.git] / config / cfgroot / graphs.pl
index a7b82fed3f4f6c60c17a12a09044c898b17642da..4783e67f7e60f0b20e0ce4c08d31a54dc0b57ae1 100644 (file)
@@ -172,7 +172,7 @@ sub updatecpugraph {
        }
        
        for(my $i = 2; $i < $cpucount; $i++) {
-               $addstring .= "+,";
+               $addstring .= "ADDNAN,";
        }
 
        if ( $cpucount > 1){
@@ -190,7 +190,7 @@ sub updatecpugraph {
                push(@command,$nice,$interrupt,$steal,$user,$system,$idle,$iowait,$irq);
        }
 
-       push(@command,"CDEF:total=user,system,idle,iowait,irq,nice,interrupt,steal,+,+,+,+,+,+,+"
+       push(@command,"CDEF:total=user,system,idle,iowait,irq,nice,interrupt,steal,ADDNAN,ADDNAN,ADDNAN,ADDNAN,ADDNAN,ADDNAN,ADDNAN"
                        ,"CDEF:userpct=100,user,total,/,*"
                        ,"CDEF:nicepct=100,nice,total,/,*"
                        ,"CDEF:interruptpct=100,interrupt,total,/,*"
@@ -1088,7 +1088,7 @@ sub updatethermaltempgraph {
                "--start",
                "-1".$period,
                "-r",
-               "-t "."ACPI Thermal-Zone Temperature"." - ".$Lang::tr{$period."-graph"},
+               "-t ".$Lang::tr{'acpitemp'}." ".$Lang::tr{'graph per'}." ".$Lang::tr{$period."-graph"},
                "-v Grad Celsius",
                "--color=SHADEA".$color{"color19"},
                "--color=SHADEB".$color{"color19"},
@@ -1160,3 +1160,31 @@ sub updateentropygraph {
 
        print "Error in RRD::graph for entropy: ".$ERROR."\n" if $ERROR;
 }
+
+sub updateconntrackgraph {
+       my $period = $_[0];
+       my @command = (
+               @GRAPH_ARGS,
+               "-",
+               "--start",
+               "-1" . $period,
+               "-r",
+               "--lower-limit","0",
+               "-t $Lang::tr{'connection tracking'}",
+               "-v $Lang::tr{'open connections'}",
+               "DEF:conntrack=$mainsettings{'RRDLOG'}/collectd/localhost/conntrack/conntrack.rrd:entropy:AVERAGE",
+               "LINE3:conntrack#ff0000:" . sprintf("%-15s", $Lang::tr{'open connections'}),
+               "VDEF:ctmin=conntrack,MINIMUM",
+               "VDEF:ctmax=conntrack,MAXIMUM",
+               "VDEF:ctavg=conntrack,AVERAGE",
+               "GPRINT:ctmax:" . sprintf("%15s\\: %%5.0lf", $Lang::tr{'maximum'}),
+               "GPRINT:ctmin:" . sprintf("%15s\\: %%5.0lf", $Lang::tr{'minimum'}),
+               "GPRINT:ctavg:" . sprintf("%15s\\: %%5.0lf", $Lang::tr{'average'}) . "\\n",
+               "--color=BACK" . $color{"color21"},
+       );
+
+       RRDs::graph(@command);
+       $ERROR = RRDs::error;
+
+       print STDERR "Error in RRD::Graph for conntrack: " . $ERROR . "\n" if $ERROR;
+}