summaryrefslogtreecommitdiffstats
path: root/collectors/python.d.plugin/smartd_log/smartd_log.chart.py
diff options
context:
space:
mode:
Diffstat (limited to 'collectors/python.d.plugin/smartd_log/smartd_log.chart.py')
-rw-r--r--collectors/python.d.plugin/smartd_log/smartd_log.chart.py19
1 files changed, 9 insertions, 10 deletions
diff --git a/collectors/python.d.plugin/smartd_log/smartd_log.chart.py b/collectors/python.d.plugin/smartd_log/smartd_log.chart.py
index f121ab2e0..8f10a5351 100644
--- a/collectors/python.d.plugin/smartd_log/smartd_log.chart.py
+++ b/collectors/python.d.plugin/smartd_log/smartd_log.chart.py
@@ -5,13 +5,11 @@
import os
import re
-
from copy import deepcopy
from time import time
-from bases.collection import read_last_line
from bases.FrameworkServices.SimpleService import SimpleService
-
+from bases.collection import read_last_line
INCREMENTAL = 'incremental'
ABSOLUTE = 'absolute'
@@ -59,7 +57,6 @@ ATTR_VERIFY_ERR_COR = 'verify-total-err-corrected'
ATTR_VERIFY_ERR_UNC = 'verify-total-unc-errors'
ATTR_TEMPERATURE = 'temperature'
-
RE_ATA = re.compile(
'(\d+);' # attribute
'(\d+);' # normalized value
@@ -265,7 +262,7 @@ CHARTS = {
'line'],
'lines': [],
'attrs': [ATTR5],
- 'algo': INCREMENTAL,
+ 'algo': ABSOLUTE,
},
'reserved_block_count': {
'options': [None, 'Reserved Block Count', 'percentage', 'wear', 'smartd_log.reserved_block_count', 'line'],
@@ -533,7 +530,9 @@ def handle_error(*errors):
return method(*args)
except errors:
return None
+
return on_call
+
return on_method
@@ -653,10 +652,10 @@ class Service(SimpleService):
current_time = time()
for disk in self.disks[:]:
if any(
- [
- not disk.alive,
- not disk.log_file.is_active(current_time, self.age),
- ]
+ [
+ not disk.alive,
+ not disk.log_file.is_active(current_time, self.age),
+ ]
):
self.disks.remove(disk.raw_name)
self.remove_disk_from_charts(disk)
@@ -673,7 +672,7 @@ class Service(SimpleService):
return len(self.disks)
- def create_disk_from_file(self, full_name, current_time):
+ def create_disk_from_file(self, full_name, current_time):
if not full_name.endswith(CSV):
self.debug('skipping {0}: not a csv file'.format(full_name))
return None