There currently isn't support for PID in the "mail-format" statement.
Monit provides the environment variable MONIT_PROCESS_PID to the
start/stop/exec action script - see "Environment" section in monit manual:
http://www.tildeslash.com/monit/doc/manual.php#environment
You can prepare wrapper for the kill script that will either use the
environment variable or grab the information about the process to be
killed itself and send the message.
Another option could be to add support for new macros to mail-format.
Existing macros are described here:
http://www.tildeslash.com/monit/doc/manual.php#alert_message_layout
The addition of new macros should be very easy. The implementation is in
alert.c in the function substitute(). The event has reference to the
source service, where you can read both PID, UID and another informations.
Patches are welcomed ;)
Martin
Bill Benedetto wrote:
Good day.
I use monit kind of backwards from most users, I suspect. I use
monit to kill runaway processes. Obviously, these are processes
that are known to me to become runaway (so I know what to
monitor).
This actually works pretty well for me.
However, my developers got wind of this and now would like to
know WHOSE process it was that was killed.
So, my question is this: is there some way that I can include in
the alert email the PID that was killed and/or the USERID that
owned the process that was killed?
Thanks!
--
To unsubscribe:
http://lists.nongnu.org/mailman/listinfo/monit-general