Page 1 of 1

Email Notification Issue

Posted: Wed Aug 01, 2018 8:22 am
by rlinux57
Hi,
I have problem regarding email notifications, Actually i have created a contactgroups in order to distribute service notification for different teams. I have attached contacts.cfg with dummy data but the hierarchy is same. The problem is that nagios sent every notification to the other groups as well.
But i have mentioned contact groups in specific services such as:

Code: Select all

define service{
        use                             local-service,srv-pnp
        hostgroup_name                  Databases
        host_name                       DB-Server
        service_description             HTTP
        check_command                   check_http
        contact_groups                  team
        notifications_enabled           1
        }
Kindly guide me in this regard to find out the problem. please find attachment.

Re: Email Notification Issue

Posted: Wed Aug 01, 2018 10:52 pm
by rlinux57
And below is my template:

Code: Select all

define contact{
       name                            team
       service_notification_period     24x7
       host_notification_period        24x7 
       service_notification_options    w,c,r
       host_notification_options       d,u,r,f,s
       service_notification_commands   notify-service-by-email
       host_notification_commands      notify-host-by-email
       register                        0
        }

Re: Email Notification Issue

Posted: Thu Aug 02, 2018 1:56 pm
by rlinux57
Could anybody help me with the mentioned issue?

Re: Email Notification Issue

Posted: Fri Aug 03, 2018 1:45 pm
by cdienger
What does the host definition look like? Per https://assets.nagios.com/downloads/nag ... tance.html, contacts and contact_groups can be inherited from the host if not defined on the service.

Re: Email Notification Issue

Posted: Mon Aug 06, 2018 12:36 am
by rlinux57
I didn't define contact_groups in my host.cfg. My host definition looks like:

Code: Select all

define host{
        use                     linux-server,host-pnp
        host_name               Server-01
        alias                   Server-01
        address                 IP-Address
        }

define host{
        use                     linux-server,host-pnp
        host_name               Server-02
        alias                   Server-02
        address                 IP-Address
        }

Re: Email Notification Issue

Posted: Mon Aug 06, 2018 8:56 am
by mcapra
It's still useful for troubleshooting to understand how exactly a particular service/host is resolving its contacts.

Can you share the following template definitions as well as any dependencies they have (to other templates, groups, etc):

Code: Select all

linux-server
host-pnp
local-service
srv-pnp

Re: Email Notification Issue

Posted: Mon Aug 06, 2018 2:22 pm
by cdienger
Thanks for the assist, @mcapra!

@rlinux57, feel free to PM me the files if they contain anything sensitive.