Email Content Elaboration

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
joe1871
Posts: 28
Joined: Tue Feb 01, 2011 3:36 pm

Email Content Elaboration

Post 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
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Email Content Elaboration

Post by Box293 »

As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
joe1871
Posts: 28
Joined: Tue Feb 01, 2011 3:36 pm

Re: Email Content Elaboration

Post 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
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Email Content Elaboration

Post 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?
Be sure to check out our Knowledgebase for helpful articles and solutions!
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Email Content Elaboration

Post 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?
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Locked