How can I add additional email addressess

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
ecarrasq
Posts: 244
Joined: Tue Feb 22, 2011 5:58 pm

How can I add additional email addressess

Post 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?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: How can I add additional email addressess

Post 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
You do not have the required permissions to view the files attached to this post.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
ecarrasq
Posts: 244
Joined: Tue Feb 22, 2011 5:58 pm

Re: How can I add additional email addressess

Post 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?
You do not have the required permissions to view the files attached to this post.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: How can I add additional email addressess

Post 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
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
ecarrasq
Posts: 244
Joined: Tue Feb 22, 2011 5:58 pm

Re: How can I add additional email addressess

Post 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.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: How can I add additional email addressess

Post 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$
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
ecarrasq
Posts: 244
Joined: Tue Feb 22, 2011 5:58 pm

Re: How can I add additional email addressess

Post by ecarrasq »

SUCCESS!

Thank you,
Eddie
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: How can I add additional email addressess

Post by scottwilkerson »

Awesome...
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked