different Contact groups

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
bsudhakar81
Posts: 7
Joined: Tue May 28, 2019 10:24 am

different Contact groups

Post by bsudhakar81 »

i have configured Nagios core 4.4.3 and configured for host down alerts. I have 20 servers which belongs to two different groups. I want email alerts to send first 10 servers to one email address and remaining 10 to another (2nd email address ) as alert. At this time I am receiving email alerts for all 20 servers to single contact email address. Is there anyway this requirement can be achieved ?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: different Contact groups

Post by scottwilkerson »

Setup 2 different contacts and add the contact you want to get email for to each server as a contact to the host.

10 host configurations would have

Code: Select all

contacts     contactA
the other 10 would have

Code: Select all

contacts     contactB
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
bsudhakar81
Posts: 7
Joined: Tue May 28, 2019 10:24 am

Re: different Contact groups

Post by bsudhakar81 »

Can you share sample file ?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: different Contact groups

Post by scottwilkerson »

Code: Select all

define host {
    host_name                   192.168.15.10
    use                         xiwizard_dnsquery_host
    alias                       testing
    display_name                display name
    address                     192.168.15.10
    check_command               check_dummy!2!CRITICAL!!!!!!
    max_check_attempts          5
    check_interval              5
    retry_interval              1
    contacts                    contactA
    notification_interval       60
    notification_options        d,u,r,
    notifications_enabled       1
    register                    1
}
and for other hosts

Code: Select all

define host {
    host_name                   192.168.15.11
    use                         xiwizard_dnsquery_host
    alias                       testing
    display_name                display name
    address                     192.168.15.11
    check_command               check_dummy!2!CRITICAL!!!!!!
    max_check_attempts          5
    check_interval              5
    retry_interval              1
    contacts                    contactB
    notification_interval       60
    notification_options        d,u,r,
    notifications_enabled       1
    register                    1
}
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
bsudhakar81
Posts: 7
Joined: Tue May 28, 2019 10:24 am

Re: different Contact groups

Post by bsudhakar81 »

it worked by adding multiple usernames and email addresses. Thanks for the help
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: different Contact groups

Post by scottwilkerson »

bsudhakar81 wrote:it worked by adding multiple usernames and email addresses. Thanks for the help
Great,

Locking thread
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked