Page 1 of 1

Email Content Elaboration

Posted: Wed Jun 24, 2015 4:14 pm
by joe1871
Hi,

I need to provide more data to support personnel than the standard Core 4.x email output provides. As with most users, I use a Postfix front end to process Nagios email. Is there any way I can use any of the on board Macros in Core to add data to the email content? In other words, are there any generic buckets I can put data into that can then be added to an alert email to tell things like machine location, machine credentials, methods of fixing typical problems, etc? All of this is really valuable information that I would really like to include in the alert message. Is there any way to use macro slots as buckets, or if not, reach out to a database that I would build and link the alert with the DB entry? Is this a pipe dream?

Thanks in advance!

Joe

Re: Email Content Elaboration

Posted: Wed Jun 24, 2015 7:15 pm
by Box293

Re: Email Content Elaboration

Posted: Thu Jun 25, 2015 6:47 pm
by joe1871
Hey Guy

I had seen the second page but really couldn't make hide nor hair. I am guessing that the first page is going to make things a little clearer. I very much appreciate the help. Lets see what this sad tired brain can come up with. Hope things are well down under. I am in California, would love to see your country some day. Would you see what you can do about moving it closer? Its too long a plane ride. Thanks man...

Joe

Re: Email Content Elaboration

Posted: Fri Jun 26, 2015 8:43 am
by tgriep
Here is a quick example for if you want to add the Host Notes to your notify-host-by-email command.
All you would have to do is edit that command and add the $HOSTNOTES$ macro to the message. If the host has the notes field filled in, it will be sent on the next notification.

Code: Select all

/usr/bin/printf "%b" "***** Nagios Monitor XI Alert *****\n\nNotification Type: $NOTIFICATIONTYPE$\nHost: $HOSTNAME$\nState: $HOSTSTATE$\nAddress: $HOSTADDRESS$\nInfo: $HOSTOUTPUT$\n\nDate/Time: $LONGDATETIME$\nNotes: $HOSTNOTES$" | /bin/mail -s "** $NOTIFICATIONTYPE$ Host Alert: $HOSTNAME$ is $HOSTSTATE$ **" $CONTACTEMAIL$
Does that help you?

Re: Email Content Elaboration

Posted: Sun Jun 28, 2015 7:18 pm
by Box293
Thanks tgriep, good example.

I've been to California a few times, very similar climate to Australia :) I can't help with moving it closer ... I'm very familiar with the 14 hour plane flight :lol:

Does tgriep's example help you?