I'm using monit
to monitor some services. However, I want to get an email which includes the output from top
when this happens. Is there some way to get this information?
Don't know if you can get it from the mail-format (which would be pretty nice) but they have the following example in the monit wiki:
check file myfile with path /tmp/foo.bar if changed timestamp then
exec "/bin/bash -c 'top -bn1 | mail -s top admin@foo.bar'"