Code

Merge remote-tracking branch 'github/pr/387'
[collectd.git] / contrib / collection.cgi
index eeda241df00c18682ccd27a41268c2178a003485..af64fb1c2749143463c51ac797db6c239c2f3803 100755 (executable)
@@ -13,6 +13,7 @@ use Data::Dumper ();
 
 our $Config = "/etc/collection.conf";
 our @DataDirs = ();
+our @DontShowTypes = ();
 our $LibDir;
 
 our $ValidTimespan =
@@ -78,6 +79,10 @@ sub read_config
                        $value =~ s#/*$##;
                        $LibDir = $value;
                }
+               elsif ($key eq 'dontshowtype')
+               {
+                 push (@DontShowTypes, $value);
+               }
                else
                {
                        print STDERR "Unknown key: $key\n";
@@ -239,6 +244,7 @@ sub _find_types
       my $name = "$_";
       $name =~ s/\.rrd$//i;
       my ($type, $instance) = split (m/-/, $name, 2);
+      if (grep { $_ eq $type } @DontShowTypes) { next; }
       $types{$type} = [] if (!$types{$type});
       push (@{$types{$type}}, $instance) if (defined ($instance));
     }
@@ -970,6 +976,28 @@ sub load_graph_definitions
     'GPRINT:avg:LAST:%5.1lf%s Last',
     'GPRINT:avg_sum:LAST:(ca. %5.1lf%sB Total)\l'
     ],
+   apache_connections => ['DEF:min={file}:count:MIN',
+    'DEF:avg={file}:count:AVERAGE',
+    'DEF:max={file}:count:MAX',
+    "AREA:max#$HalfBlue",
+    "AREA:min#$Canvas",
+    "LINE1:avg#$FullBlue:Connections",
+    'GPRINT:min:MIN:%6.2lf Min,',
+    'GPRINT:avg:AVERAGE:%6.2lf Avg,',
+    'GPRINT:max:MAX:%6.2lf Max,',
+    'GPRINT:avg:LAST:%6.2lf Last'
+    ],
+    apache_idle_workers => ['DEF:min={file}:count:MIN',
+    'DEF:avg={file}:count:AVERAGE',
+    'DEF:max={file}:count:MAX',
+    "AREA:max#$HalfBlue",
+    "AREA:min#$Canvas",
+    "LINE1:avg#$FullBlue:Idle Workers",
+    'GPRINT:min:MIN:%6.2lf Min,',
+    'GPRINT:avg:AVERAGE:%6.2lf Avg,',
+    'GPRINT:max:MAX:%6.2lf Max,',
+    'GPRINT:avg:LAST:%6.2lf Last'
+    ],
     apache_requests => ['DEF:min={file}:count:MIN',
     'DEF:avg={file}:count:AVERAGE',
     'DEF:max={file}:count:MAX',
@@ -1290,9 +1318,9 @@ sub load_graph_definitions
     'GPRINT:avg:LAST:%4.1lf Last\l'
     ],
     spam_check => [
-    'DEF:avg={file}:hits:AVERAGE',
-    'DEF:min={file}:hits:MIN',
-    'DEF:max={file}:hits:MAX',
+    'DEF:avg={file}:value:AVERAGE',
+    'DEF:min={file}:value:MIN',
+    'DEF:max={file}:value:MAX',
     "AREA:max#$HalfMagenta",
     "AREA:min#$Canvas",
     "LINE1:avg#$FullMagenta:Count ",