bind_rndc_plugin: python 2.6 compatibility fix
Ilya committed
Feb 28, 2017 at 13:08 UTC
eb727d779131945489e8df3f75bad81d1d39f313
1 file changed
+6
-6
python.d/bind_rndc.chart.py
+6
-6
@@ -116,8 +116,8 @@ class Service(SimpleService):
116
# {Incoming Queries': [('RESERVED0', 8), ('A', 4557317680), ...],
117
# ......
118
for regex in self.regex_options:
119
- rndc_stats.update({topic: [(desc, int(value)) for value, desc in self.regex_values.findall(body)]
120
- for topic, body in findall(regex, raw_data)})
119
+ rndc_stats.update(dict([(topic, [(desc, int(value)) for value, desc in self.regex_values.findall(body)])
120
+ for topic, body in findall(regex, raw_data)]))
121
122
nms = dict(rndc_stats.get('Name Server Statistics', []))
123
@@ -148,20 +148,20 @@ class Service(SimpleService):
148
self.order = ['stats_size', 'bind_stats', 'incoming_q', 'outgoing_q']
149
self.definitions = {
150
'bind_stats': {
151
- 'options': [None, 'Name Server Statistics', 'stats', 'Name Server Statistics', 'bind_rndc.stats', 'line'],
151
+ 'options': [None, 'Name Server Statistics', 'stats', 'name server statistics', 'bind_rndc.stats', 'line'],
152
'lines': [
153
]},
154
'incoming_q': {
155
- 'options': [None, 'Incoming queries', 'queries','Incoming queries', 'bind_rndc.incq', 'line'],
155
+ 'options': [None, 'Incoming queries', 'queries','incoming queries', 'bind_rndc.incq', 'line'],
156
'lines': [
157
]},
158
'outgoing_q': {
159
- 'options': [None, 'Outgoing queries', 'queries','Outgoing queries', 'bind_rndc.outq', 'line'],
159
+ 'options': [None, 'Outgoing queries', 'queries','outgoing queries', 'bind_rndc.outq', 'line'],
160
'lines': [
161
]},
162
'stats_size': {
163
'options': [None, '%s file size' % split(self.named_stats_path)[1].capitalize(), 'megabytes',
164
- '%s size' % split(self.named_stats_path)[1].capitalize(), 'bind_rndc.size', 'line'],
164
+ '%s size' % split(self.named_stats_path)[1], 'bind_rndc.size', 'line'],
165
'lines': [
166
["stats_size", None, "absolute", 1, 1048576]
167
]}