Package: collectd
Version: 4.8.2-1
Severity: normal
Tags: patch

I've added ability to hide specified types.

It is useful when you don't want to see many graphs. How to use the patch: 
apply it to collection.cgi and add lines with keyword ,,dontshowtype'' 
to /etc/collectd/collection.conf :

dontshowtype: "if_errors"
dontshowtype: "if_packets"

Then you will see only if_packets types in "interface" plugin page. 

--- /usr/share/doc/collectd/examples/collection.cgi	2008-12-07 17:26:19.000000000 +0200
+++ ./collection.cgi	2010-01-22 00:45:29.000000000 +0200
@@ -13,6 +13,7 @@
 
 our $Config = "/etc/collectd/collection.conf";
 our @DataDirs = ();
+our @dontshowtype = ();
 our $LibDir;
 
 our $ValidTimespan =
@@ -78,6 +79,10 @@
 			$value =~ s#/*$##;
 			$LibDir = $value;
 		}
+		elsif ($key eq 'dontshowtype')
+                {
+			push (@dontshowtype, $value);
+                }
 		else
 		{
 			print STDERR "Unknown key: $key\n";
@@ -239,6 +244,7 @@
       my $name = "$_";
       $name =~ s/\.rrd$//i;
       my ($type, $instance) = split (m/-/, $name, 2);
+      if ( grep (/^$type$/, @dontshowtype) )  {next}
       $types{$type} = [] if (!$types{$type});
       push (@{$types{$type}}, $instance) if (defined ($instance));
     }

Attachment: signature.asc
Description: This is a digitally signed message part.

Reply via email to