From 3c315f0fff93aa072472abc10815963ac0035268 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 12 Aug 2022 09:26:11 +0200 Subject: Adding upstream version 1.36.0. Signed-off-by: Daniel Baumann --- collectors/python.d.plugin/smartd_log/smartd_log.chart.py | 6 +++++- collectors/python.d.plugin/smartd_log/smartd_log.conf | 8 ++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) (limited to 'collectors/python.d.plugin/smartd_log') 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/' -- cgit v1.2.3