Page 1 of 1

How can I add additional email addressess

Posted: Fri Feb 17, 2012 7:43 pm
by ecarrasq
How can I add additional email addressess, for a single contact?
Contact - addressx

Address directives are used to define additional "addresses" for the contact. These addresses can be anything - cell phone numbers, instant messaging addresses, etc. Depending on how you configure your notification commands, they can be used to send out an alert o the contact. Up to six addresses can be defined using these directives (address1 through address6). The $CONTACTADDRESSx$ macro will contain this value.

Parameter name: addressx (x as number from 1 to 6)
Required: no
How can I make the above happen? Can this be done through Core Config Manager, and if so how?

Re: How can I add additional email addressess

Posted: Mon Feb 20, 2012 11:48 am
by scottwilkerson
ecarrasq wrote:How can I make the above happen? Can this be done through Core Config Manager, and if so how?
With these.
contactaddressn.PNG

Re: How can I add additional email addressess

Posted: Mon Feb 20, 2012 1:05 pm
by ecarrasq
Thank you for the reply.

Just making sure that I don't have to do any configuration changes, as the information message next to the "Addon Address 1" stated I needed to. Unless that is for information purposes of what goes on in the back
round?

Re: How can I add additional email addressess

Posted: Mon Feb 20, 2012 1:15 pm
by scottwilkerson
Correct, as mentioned in the bubble,
"Depending on how you configure your notification commands, they can be used to send out an alert o the contact."
..
"The $CONTACTADDRESSx$ macro will contain this value."
So depending on what you are trying to accomplish, you would need to modify the command you are calling in
Host command*
Service command*

to incorporate $CONTACTADDRESSx$

These commands can be found by name in Core Config Manager -> commands

Re: How can I add additional email addressess

Posted: Mon Feb 20, 2012 1:30 pm
by ecarrasq
Ok Perfect, then this is what I have, for one of my "notify_service_by_email":
/usr/bin/printf "%b" "***** Nagios Monitor XI *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$" | /bin/mail -s "** $NOTIFICATIONTYPE$ Service: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$
Would I have to add, "$CONTACTADDRESSx$" to the above line with the x = 6 or the amount of email addresses I would like to reference, and if so where in the above line? I tried adding it at the end after "$CONTACTEMAIL$", but didn't work. Should I use commas to separate $CONTACTEMAIL$ and $CONTACTADDRESSx$?

Thank you for your time.

Re: How can I add additional email addressess

Posted: Mon Feb 20, 2012 2:07 pm
by scottwilkerson
Yes comma seperated.

You should be able to do something like

Code: Select all

/usr/bin/printf "%b" "***** Nagios Monitor XI *****\n\nNotification Type: $NOTIFICATIONTYPE$\n\nService: $SERVICEDESC$\nHost: $HOSTALIAS$\nAddress: $HOSTADDRESS$\nState: $SERVICESTATE$\n\nDate/Time: $LONGDATETIME$\n\nAdditional Info:\n\n$SERVICEOUTPUT$" | /bin/mail -c $CONTACTADDRESS1$,$CONTACTADDRESS1$,$CONTACTADDRESS2$,$CONTACTADDRESS3$,$CONTACTADDRESS4$,$CONTACTADDRESS5$,$CONTACTADDRESS6$ -s "** $NOTIFICATIONTYPE$ Service: $HOSTALIAS$/$SERVICEDESC$ is $SERVICESTATE$ **" $CONTACTEMAIL$

Re: How can I add additional email addressess

Posted: Mon Feb 20, 2012 2:58 pm
by ecarrasq
SUCCESS!

Thank you,
Eddie

Re: How can I add additional email addressess

Posted: Mon Feb 20, 2012 3:32 pm
by scottwilkerson
Awesome...