X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=contrib%2Fcollection.cgi;h=1231ce8b2159d27017ce317e6e802cca4ee884af;hb=5d0a10f15f361c6f019b48d0619e87ee8bb936e3;hp=eeda241df00c18682ccd27a41268c2178a003485;hpb=34e095d9e7c605ded713203f21e4f00c8d6b6d44;p=collectd.git diff --git a/contrib/collection.cgi b/contrib/collection.cgi index eeda241d..1231ce8b 100755 --- a/contrib/collection.cgi +++ b/contrib/collection.cgi @@ -1,4 +1,25 @@ #!/usr/bin/perl +# Copyright (c) 2006-2010 Florian Forster +# Copyright (c) 2006-2008 Sebastian Harl +# Copyright (c) 2008 Mirko Buffoni +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to deal +# in the Software without restriction, including without limitation the rights +# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +# copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +# THE SOFTWARE. use strict; use warnings; @@ -13,6 +34,7 @@ use Data::Dumper (); our $Config = "/etc/collection.conf"; our @DataDirs = (); +our @DontShowTypes = (); our $LibDir; our $ValidTimespan = @@ -78,6 +100,10 @@ sub read_config $value =~ s#/*$##; $LibDir = $value; } + elsif ($key eq 'dontshowtype') + { + push (@DontShowTypes, $value); + } else { print STDERR "Unknown key: $key\n"; @@ -239,6 +265,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)); } @@ -951,9 +978,9 @@ sub load_graph_definitions $GraphDefs = { - apache_bytes => ['DEF:min_raw={file}:count:MIN', - 'DEF:avg_raw={file}:count:AVERAGE', - 'DEF:max_raw={file}:count:MAX', + apache_bytes => ['DEF:min_raw={file}:value:MIN', + 'DEF:avg_raw={file}:value:AVERAGE', + 'DEF:max_raw={file}:value:MAX', 'CDEF:min=min_raw,8,*', 'CDEF:avg=avg_raw,8,*', 'CDEF:max=max_raw,8,*', @@ -970,9 +997,31 @@ sub load_graph_definitions 'GPRINT:avg:LAST:%5.1lf%s Last', 'GPRINT:avg_sum:LAST:(ca. %5.1lf%sB Total)\l' ], - apache_requests => ['DEF:min={file}:count:MIN', - 'DEF:avg={file}:count:AVERAGE', - 'DEF:max={file}:count:MAX', + apache_connections => ['DEF:min={file}:value:MIN', + 'DEF:avg={file}:value:AVERAGE', + 'DEF:max={file}:value: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}:value:MIN', + 'DEF:avg={file}:value:AVERAGE', + 'DEF:max={file}:value: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}:value:MIN', + 'DEF:avg={file}:value:AVERAGE', + 'DEF:max={file}:value:MAX', "AREA:max#$HalfBlue", "AREA:min#$Canvas", "LINE1:avg#$FullBlue:Requests/s", @@ -981,9 +1030,9 @@ sub load_graph_definitions 'GPRINT:max:MAX:%6.2lf Max,', 'GPRINT:avg:LAST:%6.2lf Last' ], - apache_scoreboard => ['DEF:min={file}:count:MIN', - 'DEF:avg={file}:count:AVERAGE', - 'DEF:max={file}:count:MAX', + apache_scoreboard => ['DEF:min={file}:value:MIN', + 'DEF:avg={file}:value:AVERAGE', + 'DEF:max={file}:value:MAX', "AREA:max#$HalfBlue", "AREA:min#$Canvas", "LINE1:avg#$FullBlue:Processes", @@ -1290,9 +1339,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 ",