Project

General

Profile

« Previous | Next » 

Revision d7fc31b1

Added by David Sorber over 9 years ago

Minor updates to the checker script to include full paths for the utilities that it calls.

View differences:

software/misc/checker.py
for device in devices:
# Get information about this device and SMART health check; prune the
# smartmontools banner from the output
cmd = 'smartctl -iH /dev/{:s}'.format(device)
cmd = '/usr/sbin/smartctl -iH /dev/{:s}'.format(device)
cmd_out = subprocess.check_output(cmd, shell=True)
raw_out = cmd_out.decode('utf-8').strip().split('\n')[4:]
......
for device in devices:
# Get information about this device
cmd = 'mdadm --detail /dev/{:s}'.format(device)
cmd = '/sbin/mdadm --detail /dev/{:s}'.format(device)
cmd_out = subprocess.check_output(cmd, shell=True)
raw_out = cmd_out.decode('utf-8').strip().split('\n')
......
if not errors:
output.insert(2, 'All OKAY.\n')
# Send an email every Thursday even if status is okay
if timestamp.weekday() == 3:
# Send an email every Thursday at 3 AM even if status is okay
if timestamp.weekday() == 3 and timestamp.hour == 3:
should_send = True
else:
# Send email if there were any errors

Also available in: Unified diff