From: lgz Date: Sun, 1 Jan 2017 16:07:30 +0000 (+0900) Subject: resync/check/recovery rate charts added, add mdstat to Makefiles X-Git-Tag: v1.5.0~65^2 X-Git-Url: https://arthur.barton.de/gitweb/?p=netdata.git;a=commitdiff_plain;h=f748fc73015e9d89ef5222ca070ab7b2a5c3089f resync/check/recovery rate charts added, add mdstat to Makefiles --- diff --git a/conf.d/Makefile.am b/conf.d/Makefile.am index 3fa19909..9404124e 100644 --- a/conf.d/Makefile.am +++ b/conf.d/Makefile.am @@ -34,6 +34,7 @@ dist_pythonconfig_DATA = \ python.d/hddtemp.conf \ python.d/ipfs.conf \ python.d/isc_dhcpd.conf \ + python.d/mdstat.conf \ python.d/memcached.conf \ python.d/mysql.conf \ python.d/nginx.conf \ @@ -57,6 +58,7 @@ dist_healthconfig_DATA = \ health.d/disks.conf \ health.d/entropy.conf \ health.d/ipc.conf \ + health.d/mdstat.conf \ health.d/memcached.conf \ health.d/mysql.conf \ health.d/named.conf \ diff --git a/python.d/Makefile.am b/python.d/Makefile.am index be41dde3..2cf7d2ef 100644 --- a/python.d/Makefile.am +++ b/python.d/Makefile.am @@ -19,6 +19,7 @@ dist_python_SCRIPTS = \ hddtemp.chart.py \ ipfs.chart.py \ isc_dhcpd.chart.py \ + mdstat.chart.py \ memcached.chart.py \ mysql.chart.py \ nginx.chart.py \ diff --git a/python.d/mdstat.chart.py b/python.d/mdstat.chart.py index 5198dbd8..f2c7ab58 100644 --- a/python.d/mdstat.chart.py +++ b/python.d/mdstat.chart.py @@ -19,7 +19,7 @@ class Service(SimpleService): 'lines': []}} self.proc_mdstat = '/proc/mdstat' self.regex_disks = compile(r'((?<=\ )[a-zA-Z_0-9]+(?= : active)).*?((?<= \[)[0-9]+)/([0-9]+(?=\] ))') - self.regex_status = compile(r'([a-zA-Z_0-9]+)( : active)[^:]*?([a-z]+) = ([0-9.]+(?=%))') + self.regex_status = compile(r'([a-zA-Z_0-9]+)( : active)[^:]*?([a-z]+) = ([0-9.]+(?=%)).*?((?<=finish=)[0-9.]+)min speed=([0-9]+)') def check(self): raw_data = self._get_raw_data() @@ -31,6 +31,7 @@ class Service(SimpleService): for md in md_list: self.order.append(md) self.order.append(''.join([md, '_status'])) + self.order.append(''.join([md, '_rate'])) self.definitions['agr_health']['lines'].append([''.join([md, '_health']), md, 'absolute']) self.definitions[md] = {'options': [None, 'MD disks stats', 'disks', md, 'md.disks', 'stacked'], @@ -41,6 +42,10 @@ class Service(SimpleService): 'lines': [[''.join([md, '_resync']), 'resync', 'absolute', 1, 100], [''.join([md, '_recovery']), 'recovery', 'absolute', 1, 100], [''.join([md, '_check']), 'check', 'absolute', 1, 100]]} + self.definitions[''.join([md, '_rate'])] = {'options': + [None, 'MD operation status', 'rate', md, 'md.rate', 'line'], + 'lines': [[''.join([md, '_finishin']), 'finish min', 'absolute', 1, 100], + [''.join([md, '_rate']), 'megabyte/s', 'absolute', -1, 100]]} self.info('Plugin was started successfully. MDs to monitor %s' % (md_list)) to_netdata = {} @@ -77,8 +82,12 @@ class Service(SimpleService): to_netdata[''.join([md[0], '_check'])] = 0 to_netdata[''.join([md[0], '_resync'])] = 0 to_netdata[''.join([md[0], '_recovery'])] = 0 + to_netdata[''.join([md[0], '_finishin'])] = 0 + to_netdata[''.join([md[0], '_rate'])] = 0 for md in mdstat_status: to_netdata[''.join([md[0], '_' + md[2]])] = round(float(md[3]) * 100) + to_netdata[''.join([md[0], '_finishin'])] = round(float(md[4]) * 100) + to_netdata[''.join([md[0], '_rate'])] = round(float(md[5]) / 1000 * 100) return to_netdata