summaryrefslogtreecommitdiffstats
path: root/collectors/python.d.plugin/smartd_log
diff options
context:
space:
mode:
Diffstat (limited to 'collectors/python.d.plugin/smartd_log')
-rw-r--r--collectors/python.d.plugin/smartd_log/README.md2
-rw-r--r--collectors/python.d.plugin/smartd_log/smartd_log.chart.py22
-rw-r--r--collectors/python.d.plugin/smartd_log/smartd_log.conf10
3 files changed, 19 insertions, 15 deletions
diff --git a/collectors/python.d.plugin/smartd_log/README.md b/collectors/python.d.plugin/smartd_log/README.md
index a31ad0c7a..3b0816fb8 100644
--- a/collectors/python.d.plugin/smartd_log/README.md
+++ b/collectors/python.d.plugin/smartd_log/README.md
@@ -99,3 +99,5 @@ local:
If no configuration is given, module will attempt to read log files in `/var/log/smartd/` directory.
---
+
+[![analytics](https://www.google-analytics.com/collect?v=1&aip=1&t=pageview&_s=1&ds=github&dr=https%3A%2F%2Fgithub.com%2Fnetdata%2Fnetdata&dl=https%3A%2F%2Fmy-netdata.io%2Fgithub%2Fcollectors%2Fpython.d.plugin%2Fsmartd_log%2FREADME&_u=MAC~&cid=5792dfd7-8dc4-476b-af31-da2fdb9f93d2&tid=UA-64295674-3)]()
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 13762fabe..871025a47 100644
--- a/collectors/python.d.plugin/smartd_log/smartd_log.chart.py
+++ b/collectors/python.d.plugin/smartd_log/smartd_log.chart.py
@@ -268,7 +268,7 @@ CHARTS = {
'algo': INCREMENTAL,
},
'reserved_block_count': {
- 'options': [None, 'Reserved Block Count', '%', 'wear', 'smartd_log.reserved_block_count', 'line'],
+ 'options': [None, 'Reserved Block Count', 'percentage', 'wear', 'smartd_log.reserved_block_count', 'line'],
'lines': [],
'attrs': [ATTR170],
'algo': ABSOLUTE,
@@ -321,7 +321,7 @@ CHARTS = {
},
'percent_lifetime_used': {
- 'options': [None, 'Percent Lifetime Used', '%', 'wear', 'smartd_log.percent_lifetime_used', 'line'],
+ 'options': [None, 'Percent Lifetime Used', 'percentage', 'wear', 'smartd_log.percent_lifetime_used', 'line'],
'lines': [],
'attrs': [ATTR202],
'algo': ABSOLUTE,
@@ -453,6 +453,11 @@ class Ata190(BaseAtaSmartAttribute):
return 100 - int(self.normalized_value)
+class Ata194(BaseAtaSmartAttribute):
+ def value(self):
+ return min(int(self.normalized_value), int(self.raw_value))
+
+
class BaseSCSISmartAttribute:
def __init__(self, name, raw_value):
self.name = name
@@ -474,10 +479,11 @@ def ata_attribute_factory(value):
return Ata9(*value)
elif name == ATTR190:
return Ata190(*value)
+ elif name == ATTR194:
+ return Ata194(*value)
elif name in [
ATTR1,
ATTR7,
- ATTR194,
ATTR202,
ATTR206,
]:
@@ -580,11 +586,9 @@ class Service(SimpleService):
SimpleService.__init__(self, configuration=configuration, name=name)
self.order = ORDER
self.definitions = deepcopy(CHARTS)
-
self.log_path = configuration.get('log_path', DEF_PATH)
self.age = configuration.get('age', DEF_AGE)
self.exclude = configuration.get('exclude_disks', str()).split()
-
self.disks = list()
self.runs = 0
@@ -646,6 +650,10 @@ class Service(SimpleService):
return len(self.disks)
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
+
name = os.path.basename(full_name).split('.')[-3]
path = os.path.join(self.log_path, full_name)
@@ -655,10 +663,6 @@ class Service(SimpleService):
if [p for p in self.exclude if p in name]:
return None
- if not full_name.endswith(CSV):
- self.debug('skipping {0}: not a csv file'.format(full_name))
- return None
-
if not os.access(path, os.R_OK):
self.debug('skipping {0}: not readable'.format(full_name))
return None
diff --git a/collectors/python.d.plugin/smartd_log/smartd_log.conf b/collectors/python.d.plugin/smartd_log/smartd_log.conf
index ab7f45b0f..4f138d17a 100644
--- a/collectors/python.d.plugin/smartd_log/smartd_log.conf
+++ b/collectors/python.d.plugin/smartd_log/smartd_log.conf
@@ -27,11 +27,9 @@
# If unset, the default for python.d.plugin is used.
# priority: 60000
-# retries sets the number of retries to be made in case of failures.
-# If unset, the default for python.d.plugin is used.
-# Attempts to restore the service are made once every update_every
-# and only if the module has collected values in the past.
-# retries: 60
+# penalty indicates whether to apply penalty to update_every in case of failures.
+# Penalty will increase every 5 failed updates in a row. Maximum penalty is 10 minutes.
+# penalty: yes
# autodetection_retry sets the job re-check interval in seconds.
# The job is not deleted if check fails.
@@ -58,7 +56,7 @@
# # JOBs sharing a name are mutually exclusive
# update_every: 1 # the JOB's data collection frequency
# priority: 60000 # the JOB's order on the dashboard
-# retries: 60 # the JOB's number of restoration attempts
+# penalty: yes # the JOB's penalty
# autodetection_retry: 0 # the JOB's re-check interval in seconds
#
# Additionally to the above, smartd_log also supports the following: