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/smartd_log.chart.py6
-rw-r--r--collectors/python.d.plugin/smartd_log/smartd_log.conf8
2 files changed, 13 insertions, 1 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 75b8c8c40..dc4e95dec 100644
--- a/collectors/python.d.plugin/smartd_log/smartd_log.chart.py
+++ b/collectors/python.d.plugin/smartd_log/smartd_log.chart.py
@@ -630,6 +630,7 @@ class Service(SimpleService):
self.exclude = configuration.get('exclude_disks', str()).split()
self.disks = list()
self.runs = 0
+ self.do_force_rescan = False
def check(self):
return self.scan() > 0
@@ -637,9 +638,10 @@ class Service(SimpleService):
def get_data(self):
self.runs += 1
- if self.runs % DEF_RESCAN_INTERVAL == 0:
+ if self.do_force_rescan or self.runs % DEF_RESCAN_INTERVAL == 0:
self.cleanup()
self.scan()
+ self.do_force_rescan = False
data = dict()
@@ -654,10 +656,12 @@ class Service(SimpleService):
if changed is None:
disk.alive = False
+ self.do_force_rescan = True
continue
if changed and disk.populate_attrs() is None:
disk.alive = False
+ self.do_force_rescan = True
continue
data.update(disk.data())
diff --git a/collectors/python.d.plugin/smartd_log/smartd_log.conf b/collectors/python.d.plugin/smartd_log/smartd_log.conf
index 4f138d17a..6c01d953b 100644
--- a/collectors/python.d.plugin/smartd_log/smartd_log.conf
+++ b/collectors/python.d.plugin/smartd_log/smartd_log.conf
@@ -65,3 +65,11 @@
# exclude_disks: 'PATTERN1 PATTERN2' # space separated patterns. If the pattern is in the drive name, the module will not collect data for it.
#
# ----------------------------------------------------------------------
+
+custom:
+ name: smartd_log
+ log_path: '/var/log/smartd/'
+
+debian:
+ name: smartd_log
+ log_path: '/var/lib/smartmontools/'