Can't receive alert mail

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
kshaoye
Posts: 3
Joined: Thu Dec 18, 2014 10:49 pm

Can't receive alert mail

Post by kshaoye »

I have set both A and B as the default contacts of host X.
A and B are both in group "admins",as well as admins is the default contacts group of host X.
But only A can receive the alert mail from Nagios.
Now I am watching for some suggestion from someone here.

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

Re: Can't receive alert mail

Post by scottwilkerson »

Do both contacts have the exact same notification handlers setup?

Could you post the applicable contact configuration files (obfuscating email addresses of course)?
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
kshaoye
Posts: 3
Joined: Thu Dec 18, 2014 10:49 pm

Re: Can't receive alert mail

Post by kshaoye »

scottwilkerson wrote:Do both contacts have the exact same notification handlers setup?

Could you post the applicable contact configuration files (obfuscating email addresses of course)?
Thanks for reply

Here is my configuration files
define host {
host_name switch3
alias Switch 3
display_name Switch 3
address 10.255.1.3
hostgroups Switch
use generic-switch
max_check_attempts 1
active_checks_enabled 1
check_period 24x7
contacts +kevin
contact_groups +admins
notification_interval 5
notification_period 24x7
notification_options d,u,r,f,s
register 1
}




define contact {
contact_name nagiosadmin
alias Nagios Admin
email nagios@localhost
use generic-contact
register 1
}

define contact {
contact_name kevin
alias Kevin
contactgroups admins
host_notifications_enabled 1
service_notifications_enabled 1
host_notification_period 24x7
service_notification_period 24x7
host_notification_options d,u,r,f,s
service_notification_options w,u,c,r,f,s
host_notification_commands notify-host-by-email,notify-service-by-email
service_notification_commands +notify-host-by-email,notify-service-by-email
email [email protected]
register 1
}



define contactgroup {
contactgroup_name admins
alias Nagios Administrators
members kevin,nagiosadmin
register 1
}
as refered before,nagiosadmin can recieve alert mail but kevin can't
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Can't receive alert mail

Post by scottwilkerson »

This definition looks wrong...Specifically in the host_notification_commands and service_notification_commands

Code: Select all

define contact {
contact_name kevin
alias Kevin
contactgroups admins
host_notifications_enabled 1
service_notifications_enabled 1
host_notification_period 24x7
service_notification_period 24x7
host_notification_options d,u,r,f,s
service_notification_options w,u,c,r,f,s
host_notification_commands notify-host-by-email,notify-service-by-email
service_notification_commands +notify-host-by-email,notify-service-by-email
email [email protected]
register 1
}
Lets update to

Code: Select all

define contact {
contact_name kevin
alias Kevin
contactgroups admins
email [email protected]
use generic-contact
register 1
}
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
kshaoye
Posts: 3
Joined: Thu Dec 18, 2014 10:49 pm

Re: Can't receive alert mail

Post by kshaoye »

I updated “contacts.cfg” as
define contact {
contact_name kevin
alias Kevin
contactgroups admins
host_notification_period 24x7
service_notification_period 24x7
host_notification_options d,u,r,f,s
service_notification_options w,u,c,r,f,s
host_notification_commands notify-host-by-email
service_notification_commands notify-service-by-email
email [email protected]
register 1
}
the alert mails can receive now,thank you
cmerchant
Posts: 546
Joined: Wed Sep 24, 2014 11:19 am

Re: Can't receive alert mail

Post by cmerchant »

Glad that resolved your issue. We'll go ahead and close this thread.
Locked