The output from subprocess.run() is a single string which now has to be split into multiple strings at the newline character. Also add newline character when writing string to file. |
||
---|---|---|
README.md | ||
compare.py | ||
config_storcli.py | ||
crontab.txt | ||
generate-master.py | ||
raid.master.txt | ||
send-notice.sh | ||
transform.py |
README.md
storcli-check
Use LSI storcli command line to check status of disk
generate-master.py
This script is called manually and generates a "master" file to compare later runs of storcli against. It calls transform.py to ignore some data that can change between storcli runs.
compare.py
This script is intended to be called by send-notice.sh. It compares a file generated by generate-master.py against the output of a current run of the storcli command. It calls transform.py to ignore some data that can change between storcli runs.
transform.py
This is a helper script called by generate-master.py and compare.py to change some data that can change between runs but the changes themselves are not considered important, i.e. a background task is active on one or more of the RAID groups.
send-notice.sh
This script is called directly from cron (can be called manually as well). It is responsible for sending the output of the compare.py command to the e-mail addresses specified in the script. If no problems are encountered, the script will only send one message per day; it will send an alert message each time invoked if a problem is detected.
Please change the default settings to match your environment.
config_storcli.py
This configuration file defines the full path to the storcli command as well as the necessary command-line arguments.
You can substitute other commands, i.e. "/bin/cat /dev/null" for testing purposes.
raid.master.txt
Sample output of storcli command for use when testing on a machine without an appropriate RAID card or without root access.
crontab.txt
Sample UNIX cron entry that runs hourly.