jgallen23/mongroup — pull request #5 by flexd (2012-12-07 15:37:32+00:00)
Title: Add --on-error to all launched mons, pass name of process.

Related to pull request on mon https://github.com/visionmedia/mon/pull/17

This lets us have a -on-error script for all mon processes that mongroup starts.

Mongroup passes the name of the process as the first argument here, and with my modifications to mon , mon passes the process PID.

That way you can use $1 (the first argument) as the process name and $2 (the second argument) as the PID in your --on-error script.

I also added an example that uses /usr/bin/mail to send a email using the variables, I use this to send alerts to NotifyMyAndroid (NMAMail) so I get alerts on my phone like the one in the mon pull-request :)