samba plugin: "sudo -v" check added
Ilya committed
May 6, 2017 at 20:34 UTC
bc6254a24eb265f94be168b7bd32f085107080ff
1 file changed
+6
python.d/samba.chart.py
+6
@@ -100,6 +100,12 @@ class Service(ExecutableService):
100
self.error('Can\'t locate \'sudo\' or \'smbstatus\' binary')
101
return False
102
103
+ self.command = [sudo_binary, '-v']
104
+ err = self._get_raw_data(stderr=True)
105
+ if err:
106
+ self.error(''.join(err))
107
+ return False
108
+
109
self.command = ' '.join([sudo_binary, '-n', smbstatus_binary, '-P'])
110
111
return ExecutableService.check(self)