From 74af65d19c10816ff3741f26518789261ee791e9 Mon Sep 17 00:00:00 2001 From: Ilya Date: Sun, 26 Mar 2017 12:06:20 +0900 Subject: [PATCH] smartd_log plugin: convert chart family to lower case --- python.d/ovpn_status_log.chart.py | 4 ++-- python.d/smartd_log.chart.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/python.d/ovpn_status_log.chart.py b/python.d/ovpn_status_log.chart.py index 49ce5451..b3cc6723 100644 --- a/python.d/ovpn_status_log.chart.py +++ b/python.d/ovpn_status_log.chart.py @@ -11,12 +11,12 @@ update_every = 10 ORDER = ['users', 'traffic'] CHARTS = { 'users': { - 'options': [None, 'OpenVPN Active Users', 'active users', 'Users', 'openvpn_status.users', 'line'], + 'options': [None, 'OpenVPN Active Users', 'active users', 'users', 'openvpn_status.users', 'line'], 'lines': [ ["users", None, "absolute"], ]}, 'traffic': { - 'options': [None, 'OpenVPN Traffic', 'Kb/s', 'Traffic', 'openvpn_status.traffic', 'area'], + 'options': [None, 'OpenVPN Traffic', 'Kb/s', 'traffic', 'openvpn_status.traffic', 'area'], 'lines': [ ["in", None, "incremental", 8, 1000], ["out", None, "incremental", 8, -1000] ]}, diff --git a/python.d/smartd_log.chart.py b/python.d/smartd_log.chart.py index e8037237..f9adaf1c 100644 --- a/python.d/smartd_log.chart.py +++ b/python.d/smartd_log.chart.py @@ -2,7 +2,7 @@ # Description: smart netdata python.d module # Author: l2isbad, vorph1 -from re import compile +from re import compile as r_compile from os import listdir, access, R_OK from os.path import isfile, join, getsize, basename, isdir try: @@ -101,7 +101,7 @@ NAMED_DISKS = namedtuple('disks', ['name', 'size', 'number']) class Service(SimpleService): def __init__(self, configuration=None, name=None): SimpleService.__init__(self, configuration=configuration, name=name) - self.regex = compile(r'(\d+);(\d+);(\d+)') + self.regex = r_compile(r'(\d+);(\d+);(\d+)') self.log_path = self.configuration.get('log_path', '/var/log/smartd') self.raw_values = self.configuration.get('raw_values') self.attr = self.configuration.get('smart_attributes', []) @@ -208,7 +208,7 @@ class Service(SimpleService): for k, v in dict([(k, v) for k, v in SMART_ATTR.items() if k in ORDER]).items(): self.definitions.update({''.join(['attrid', k]): { - 'options': [None, v, units, v, 'smartd.attrid' + k, 'line'], + 'options': [None, v, units, v.lower(), 'smartd.attrid' + k, 'line'], 'lines': create_lines(k)}}) def find_disks_in_log_path(log_path): -- 2.39.2