Browse Source

feat(python.d/smartd_log): add 2nd job that tries to read from '/var/lib/smartmontools/' (#13188)

Ilya Mashchenko 2 years ago
parent
commit
7b48097e0d

+ 3 - 2
collectors/python.d.plugin/python_modules/bases/FrameworkServices/SimpleService.py

@@ -95,8 +95,9 @@ class SimpleService(PythonDLimitedLogger, object):
 
     @property
     def name(self):
-        if self.job_name and self.job_name != self.module_name:
-            return '_'.join([self.module_name, self.override_name or self.job_name])
+        name = self.override_name or self.job_name
+        if name and name != self.module_name:
+            return '_'.join([self.module_name, name])
         return self.module_name
 
     def actual_name(self):

+ 8 - 0
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/'