The Pegasus R6 is an incredible storage device, but it lacks the reasonable ability to send email alerts. Following Angel's blog post here here, I modified the scripts so they could run from launchd. Firstly, I had to use the PTY public class in order to communicate with the promiseutil
command. This is because promiseutil
is an interactive program that assumes that it is a run through TTY. Secondly, I added in system logging in case the email feature fails for some reason.
While these scripts work fine from the terminal's cli, running them through launchd can cause you problems because of the spawning subprocesses (mail
and promiseutil
). In order to get those to work properly, you must also use the AbandonProcessGroup
directive. Below is the example:
<key>AbandonProcessGroup</key>
<true/>
You may also need to run the plist files from a user's LaunchAgents
directory instead of the system's, but YMMV.
A lot of isolated testing went into these scripts. We ran these scripts from our machines attached to our Pegasus units, making those unit's fail multiple times in order trigger the events. That being said, we make no guarantee that the scripts will work for you in your environment. In fact, they probably won't. You are encouraged to run the tests yourself and modify the scripts as you see fit.