]> arthur.barton.de Git - netdata.git/commitdiff
resync/check/recovery rate charts added, add mdstat to Makefiles
authorlgz <lgz@loled2>
Sun, 1 Jan 2017 16:07:30 +0000 (01:07 +0900)
committerlgz <lgz@loled2>
Sun, 1 Jan 2017 16:07:30 +0000 (01:07 +0900)
conf.d/Makefile.am
python.d/Makefile.am
python.d/mdstat.chart.py

index 3fa1990933acf9b357766ddc873eb82c8f56f11c..9404124e99b369da3909f002b72b5872d2ef7976 100644 (file)
@@ -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 \
index be41dde381f577b7746e050acecfcee1f683cf06..2cf7d2ef01d2eb0919aa40dc3fa2b565f6e6ff96 100644 (file)
@@ -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 \
index 5198dbd83536839a6d1030289188fe62b277b3b2..f2c7ab584c531a4e065a522500f1232a83546120 100644 (file)
@@ -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