I am curious what conditions will make this fail?? I looked the script over, and do not see where it will fail, if something doesn’t come back OK, so we could trigger an alert, I feel this would be more relevant, and useful, if we could use the procedure to kick off alerts, and create tickets. Thanks.
I am curious what conditions will make this fail?? I looked the script over, and do not see where it will fail, if something doesn’t come back OK, so we could trigger an alert, I feel this would be more relevant, and useful, if we could use the procedure to kick off alerts, and create tickets. Thanks.
Please refer below procedure which fails if status changed from “OK”
import os
command = "wmic diskdrive get Status"
out=os.popen(command).readlines()
count=0
for j in out:
print j
if out[1]!='OK
':
raise Exception('Disk SMART status changed from "OK"')
I have mine set up as an auto remediation procedure, when my monitors find certain disk errors, it runs this, then I look in the logs to check the status. Works great, as I am manually looking at systems that that trip monitor alerts anyway. I do not just run it on a schedule, as I do not feel the need, unless my monitors catch a disk error, like a disk error 52. The great thing about comodo one, is that it can be customized in many ways, auto remediation really helps make my job easier, for example, when my CPU usages gets too high, it automatically runs the check last five highest running processes. Then, I look in the logs, that way I have a snapshot of when it happened, so I have an idea of where to look, instead of trying to catch it with the issue. We all know how difficult it can be to catch the system in a 5-15 minute period, while it is acting up.