Multipath Monitor will compare the output of the “multipath -ll” command and send an email if a difference is found. This can be used to run on OES clusters or any Linux server that you attach to a SAN and use multipath. This can help you monitor for “failed” or “disabled” or any other unexpected changes in the pathing of your devices.
In some cases you may get false positives. Some examples, if a server gets rebooted the device IDs or names may change. Also, on one server, for a day or two, an extra space was put between the device ID and the device Name. Otherwise this has been very useful to let us know of changes as multipath itself does not send any notifications of failures or missing devices.
Attached you will find a tar file that contains 4 files.
The installer should be run as root.
The “install-multipath-check.sh” file will create a directory “/etc/multipath/” and then copy the files there.
The installer will add an entry to /etc/crontab to run the script once per hour.
Then it will execute the script to check that everything is correct.
The actual script is multipath_check.sh. You will need to edit the email
address “firstname.lastname@example.org” in the script to have the output sent to
your desired address.
The script will execute a “multipath -ll” command and overwrite the existing
multipaths.diff file, then compare it to the static multipaths file. If they’re the same,
it will exit, if they’re different then an email will be sent. The script will send 5 emails, one per hour, and then stop sending. To reset the multipath files you can execute:
cat /etc/multipath/multipaths > /etc/multipath/multipaths.diff
The script will send the reset instructions in the email, as well as the output of the “multipath -ll” command.