diff --git a/docs/collectors/BindCollector.md b/docs/collectors/BindCollector.md index 377e3e943..e768e6ef2 100644 --- a/docs/collectors/BindCollector.md +++ b/docs/collectors/BindCollector.md @@ -32,6 +32,7 @@ publish | resolver, server, zonemgmt, sockets, memory, | Available stats:
| list publish_view_bind | False | | bool publish_view_meta | False | | bool +derivative | True | Report derived stats or raw (always incrementing) | bool #### Example Output diff --git a/src/collectors/bind/bind.py b/src/collectors/bind/bind.py old mode 100644 new mode 100755 index fa033ec35..0d9ef6c58 --- a/src/collectors/bind/bind.py +++ b/src/collectors/bind/bind.py @@ -13,6 +13,7 @@ import diamond.collector import sys import urllib2 +from diamond.collector import str_to_bool if sys.version_info >= (2, 5): import xml.etree.cElementTree as ElementTree @@ -35,6 +36,7 @@ def get_default_config_help(self): " - memory (Global memory usage)\n", 'publish_view_bind': "", 'publish_view_meta': "", + 'derivative': "", }) return config_help @@ -63,13 +65,15 @@ def get_default_config(self): # By default we don't publish these special views 'publish_view_bind': False, 'publish_view_meta': False, + 'derivative': True, }) return config def clean_counter(self, name, value): - value = self.derivative(name, value) - if value < 0: - value = 0 + if str_to_bool(self.config['derivative']): + value = self.derivative(name, value) + if value < 0: + value = 0 self.publish(name, value) def collect(self):