using contacts causing double email alert

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.
hata_ph
Posts: 31
Joined: Wed Aug 20, 2014 9:41 pm

Re: using contacts causing double email alert

Post by hata_ph »

abrist,

the same event send notification to root and itnetworksupport when i use contacts

Code: Select all

contacts root
but if i use contact_groups, notification will only send to itnetworksupport which is my intention.

Code: Select all

contact_groups admins
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: using contacts causing double email alert

Post by abrist »

Is this not working as intended? If you specify the contact "root" on the object, and that object alerts, it will send to "root". Am I missing something?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
hata_ph
Posts: 31
Joined: Wed Aug 20, 2014 9:41 pm

Re: using contacts causing double email alert

Post by hata_ph »

abrist wrote:Is this not working as intended? If you specify the contact "root" on the object, and that object alerts, it will send to "root". Am I missing something?
if i use contacts root, i will get duplicate alert send to root and itnetworksupport while both root and itnetworksupport use different email address.
If i use contact_groups admins, i will get 1 alert to itnetworksupport which is what i want.
If contact root will only send 1 alert, i will gladly use it.
I only can make it send 1 alert using contact_groups admins

For reference, this is my contact config

Code: Select all

###############################################################################
# contacts.cfg
###############################################################################



###############################################################################
###############################################################################
#
# CONTACTS
#
###############################################################################
###############################################################################

# In this simple config file, a single contact will receive all alerts.

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

define contact{
        contact_name                    root
        alias                           Root
        use   contact-template
        email            xxx1
   }

define contact{
        contact_name                    itnetworksupport
        alias                           IT Network Support
        use                     contact-template
   email            xxxx2
   }


###############################################################################
###############################################################################
#
# CONTACT GROUPS
#
###############################################################################
###############################################################################

# We only have one contact in this simple configuration file, so there is
# no need to create more than one contact group.

define contactgroup{
        contactgroup_name       admins
        alias                   Nagios Administrators
        members                 itnetworksupport
        }
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: using contacts causing double email alert

Post by sreinhardt »

For a moment you had me thinking that using contact instead of contacts was something you had tried and made to work. The term contacts is used both in singular contact and contacts when applied to an object. At this point, I think we really need to see the entirity of your configs. If they do not have sensitive information aside from email, feel free to tar and upload them. If you are worried, which is perfectly reasonable, please pm them to myself or another support member.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
hata_ph
Posts: 31
Joined: Wed Aug 20, 2014 9:41 pm

Re: using contacts causing double email alert

Post by hata_ph »

thanks all for your help...i already attached my full config on post 7...pls let me know if you all have any question...
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: using contacts causing double email alert

Post by sreinhardt »

Cool, I must have missed it before. I'll take a look and see if anything sticks out.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
User avatar
millisa
Posts: 69
Joined: Thu Jan 16, 2014 11:13 pm
Location: Austin, TX
Contact:

Re: using contacts causing double email alert

Post by millisa »

The missing 'register 0' in the contact-template jumps out at me:

Code: Select all

define contact{
        name                            contact-template
        service_notification_period     24x7
        host_notification_period        24x7
        service_notification_options    w,u,c,r
        host_notification_options       d,r
        service_notification_commands   notify-service-by-email
        host_notification_commands      notify-host-by-email
   }
Change to:

Code: Select all

define contact{
        name                            contact-template
        service_notification_period     24x7
        host_notification_period        24x7
        service_notification_options    w,u,c,r
        host_notification_options       d,r
        service_notification_commands   notify-service-by-email
        host_notification_commands      notify-host-by-email
        register                        0
   }
hata_ph
Posts: 31
Joined: Wed Aug 20, 2014 9:41 pm

Re: using contacts causing double email alert

Post by hata_ph »

hi milisa,

try using register 0 on my contacts template but not work... :(
any more idea?
Last edited by hata_ph on Mon Sep 08, 2014 11:48 am, edited 1 time in total.
User avatar
millisa
Posts: 69
Joined: Thu Jan 16, 2014 11:13 pm
Location: Austin, TX
Contact:

Re: using contacts causing double email alert

Post by millisa »

For a template, you want to use register 0 like posted above.
hata_ph
Posts: 31
Joined: Wed Aug 20, 2014 9:41 pm

Re: using contacts causing double email alert

Post by hata_ph »

millisa wrote:For a template, you want to use register 0 like posted above.
sorry... i mean using register 0 not work
Locked