@cryptotaxi247 / netdata-1 / commits / 74af65d19

smartd_log plugin: convert chart family to lower case

Ilya committed Mar 26, 2017 at 12:06 UTC 74af65d19c10816ff3741f26518789261ee791e9
2 files changed +5 -5
python.d/ovpn_status_log.chart.py
+2 -2
@@ -11,12 +11,12 @@ update_every = 10
11 ORDER = ['users', 'traffic']
12 CHARTS = {
13 'users': {
14 - 'options': [None, 'OpenVPN Active Users', 'active users', 'Users', 'openvpn_status.users', 'line'],
14 + 'options': [None, 'OpenVPN Active Users', 'active users', 'users', 'openvpn_status.users', 'line'],
15 'lines': [
16 ["users", None, "absolute"],
17 ]},
18 'traffic': {
19 - 'options': [None, 'OpenVPN Traffic', 'Kb/s', 'Traffic', 'openvpn_status.traffic', 'area'],
19 + 'options': [None, 'OpenVPN Traffic', 'Kb/s', 'traffic', 'openvpn_status.traffic', 'area'],
20 'lines': [
21 ["in", None, "incremental", 8, 1000], ["out", None, "incremental", 8, -1000]
22 ]},
python.d/smartd_log.chart.py
+3 -3
@@ -2,7 +2,7 @@
2 # Description: smart netdata python.d module
3 # Author: l2isbad, vorph1
4
5 -from re import compile
5 +from re import compile as r_compile
6 from os import listdir, access, R_OK
7 from os.path import isfile, join, getsize, basename, isdir
8 try:
@@ -101,7 +101,7 @@ NAMED_DISKS = namedtuple('disks', ['name', 'size', 'number'])
101 class Service(SimpleService):
102 def __init__(self, configuration=None, name=None):
103 SimpleService.__init__(self, configuration=configuration, name=name)
104 - self.regex = compile(r'(\d+);(\d+);(\d+)')
104 + self.regex = r_compile(r'(\d+);(\d+);(\d+)')
105 self.log_path = self.configuration.get('log_path', '/var/log/smartd')
106 self.raw_values = self.configuration.get('raw_values')
107 self.attr = self.configuration.get('smart_attributes', [])
@@ -208,7 +208,7 @@ class Service(SimpleService):
208
209 for k, v in dict([(k, v) for k, v in SMART_ATTR.items() if k in ORDER]).items():
210 self.definitions.update({''.join(['attrid', k]): {
211 - 'options': [None, v, units, v, 'smartd.attrid' + k, 'line'],
211 + 'options': [None, v, units, v.lower(), 'smartd.attrid' + k, 'line'],
212 'lines': create_lines(k)}})
213
214 def find_disks_in_log_path(log_path):