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.
Use LSI storcli command line to check status of disk
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.
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.
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.
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.
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.
Sample output of storcli command for use when testing on a machine without an appropriate RAID card or without root access.
Sample UNIX cron entry that runs hourly.