Fix issues using manual list of drives in hddtemp * Replaces print(disks) with an info log, otherwise netdata tries to interpret this as a command and breaks all scripts. * Remove checking for the existence of drives, this makes it useful for monitoring remote hosts or from within a docker.
Fix issues using manual list of drives in hddtemp * Replaces print(disks) with an info log, otherwise netdata tries to interpret this as a command and breaks all scripts. * Remove checking for the existence of drives, this makes it useful for monitoring remote hosts or from within a docker.
Richard Sanger committed
Sep 4, 2016 at 20:06 UTC
197b1f01ad7373841219a489ae26de9caf017c6f
1 file changed
+2
-3
python.d/hddtemp.chart.py
+2
-3
@@ -44,7 +44,7 @@ class Service(SocketService):
44
def _get_disks(self):
45
try:
46
disks = self.configuration['devices']
47
- print(disks)
47
+ self.info("Using configured disks" + str(disks))
48
except (KeyError, TypeError) as e:
49
self.info("Autodetecting disks")
50
return ["/dev/" + f for f in os.listdir("/dev") if len(f) == 3 and f.startswith("sd")]
@@ -53,8 +53,7 @@ class Service(SocketService):
53
for disk in disks:
54
if not disk.startswith('/dev/'):
55
disk = "/dev/" + disk
56
- if os.path.exists(disk):
57
- ret.append(disk)
56
+ ret.append(disk)
57
if len(ret) == 0:
58
self.error("Provided disks cannot be found in /dev directory.")
59
return ret