Code

patches: Added bts566199_collection_hide_types.dpatch.
authorSebastian Harl <sh@tokkee.org>
Sat, 23 Jan 2010 22:54:07 +0000 (23:54 +0100)
committerSebastian Harl <sh@tokkee.org>
Sat, 23 Jan 2010 22:54:07 +0000 (23:54 +0100)
This patch adds the ability to hide specified types in collection.cgi.

Thanks to Pavel Piatruk for the patch!
Closes: #566199
debian/changelog
debian/patches/00list
debian/patches/bts559801_plugin_find_fix.dpatch [changed mode: 0644->0755]
debian/patches/bts566199_collection_hide_types.dpatch [new file with mode: 0755]

index 02e4e3dd3dbdc9e279440d3aa83bbdbd331972f8..201cdc843e14cab493dd9f36a9b2623385a3113b 100644 (file)
@@ -45,8 +45,12 @@ collectd (4.9.1-1) unstable; urgency=low
       vmem, vserver, wireless.
     - Simplified Java archdir mapping: removed entries "pointing" to
       themselves and let those default to DEB_BUILD_ARCH.
+  * debian/patches:
+    - Added bts566199_collection_hide_types.dpatch -- added ability to hide
+      specified types in collection.cgi; thanks to Pavel Piatruk for the patch
+      (Closes: #566199).
 
- -- Sebastian Harl <tokkee@debian.org>  Sat, 23 Jan 2010 23:42:50 +0100
+ -- Sebastian Harl <tokkee@debian.org>  Sat, 23 Jan 2010 23:52:06 +0100
 
 collectd (4.8.2-1) unstable; urgency=medium
 
index c3fbc669cff660a94d434366b72ac79e8afdbc49..9f9026b1466fbc97e1debae71c6aeb44c7e1a9a1 100644 (file)
@@ -3,4 +3,5 @@ collection_conf_path.dpatch
 bts561577_collectd2html_recursive_fix.dpatch
 bts557599_powerdns_fix.dpatch
 bts559801_plugin_find_fix.dpatch
+bts566199_collection_hide_types.dpatch
 
old mode 100644 (file)
new mode 100755 (executable)
diff --git a/debian/patches/bts566199_collection_hide_types.dpatch b/debian/patches/bts566199_collection_hide_types.dpatch
new file mode 100755 (executable)
index 0000000..5c54d9b
--- /dev/null
@@ -0,0 +1,36 @@
+#! /bin/sh /usr/share/dpatch/dpatch-run
+## bts566199_collection_hide_types.dpatch by Pavel Piatruk
+## <piatruk.p@gmail.com>
+##
+## DP: contrib/collection.cgi: Added ability to hide specified types.
+
+diff a/contrib/collection.cgi b/contrib/collection.cgi
+--- a/contrib/collection.cgi
++++ b/contrib/collection.cgi
+@@ -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));
+     }