From: Justin P. <ju...@no...> - 2013-09-25 00:51:29
|
On Tue, Sep 24, 2013 at 04:06:28PM -0400, Jonathan Murray wrote: > I have a user that's asked that when the check_proc notification emails > get sent, that they include the output of ps (or something) > > Can someone give me an example of how they've solved this, or an idea on > how you might solve it? I have a wrapper around check_procs on some machines, which uses multi-line output (actually, mine is currently using peformance output, which is probably wrong). Something like: ret=0 check_procs || ret=$?; ps -eo comm |sort |uniq -c |sort -nr exit $ret You can put that in nrpe directly or with a wrapper script. That shows up in the cgi and in logs, which is nice on its own. I think you'll likely have to modify your notify command to use $LONGSERVICEOUTPUT$, and perhaps upgrade NRPE to support long output. I wouldn't recommend using long output in any command that also sends text messages. Another way to implement it is with event handlers; that would send a separate email (in addition to the notification). Justin |