changing the email message notification content
Justin Pryzby
justinp at norchemlab.com
Wed Sep 25 02:51:22 CEST 2013
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
------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60133471&iu=/4140/ostg.clktrk
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue.
::: Messages without supporting info will risk being sent to /dev/null
More information about the Users
mailing list