Page 2 of 2
Re: User receiving unwanted email alerts
Posted: Tue Dec 05, 2017 2:53 pm
by markmerchant
I PMed the file(s). Had to split them.
Re: User receiving unwanted email alerts
Posted: Tue Dec 05, 2017 3:38 pm
by markmerchant
I PMed the file(s), had to split them.
Re: User receiving unwanted email alerts
Posted: Wed Dec 06, 2017 10:42 am
by kyang
As
@dwhitfield mentioned,
You could create another contact template for that user or users so they don't receive those unwanted email notifications.
From the profile, I see you do have every host/service notification option for all of your contact templates.
Code: Select all
host_notification_options d,u,r,f,s
service_notification_options w,u,c,r,f,s
Back to your first question, If you didn't want the user to receive
recovery service alerts.
Code: Select all
r = notify on service recoveries (OK states)
You could take out the
r in the service_notifation_options in your contact template.
Code: Select all
service_notification_options w,u,c,f,s
A link to the object definitions.
https://assets.nagios.com/downloads/nag ... ml#contact
Is that a possible solution for you?
Re: User receiving unwanted email alerts
Posted: Wed Dec 06, 2017 3:09 pm
by markmerchant
I don't think I am explaining this correctly. Given the example I started with,
I have a user rosterg who is receiving emails for the server below. Why is this
user receiving any alerts at all? Shouldn't the only one receiving an alert be
shall?
/app/nagios/etc/hosts/afgpl13.cfg
define host {
host_name afgpl13
use generic-network-host
alias Bristol,UK
address afgpl13.xxx.xxx
parents afgga01
check_command check-wan-alive
register 1
}
/app/nagios/etc/hosttemplates.cfg
define host {
name generic-network-host
max_check_attempts 3
event_handler_enabled 0
flap_detection_enabled 1
process_perf_data 1
retain_status_information 1
retain_nonstatus_information 1
contact_groups FOO
notification_interval 0
notification_period 24x7
notification_options u,d,r
notifications_enabled 1
register 0
}
/app/nagios/etc/contactgroups.cfg
define contactgroup {
contactgroup_name FOO
alias FOO
members shall
}
/app/nagios/etc/contacts.cfg
define contact {
contact_name shall
alias shall
email
[email protected]
use standard-contact
}
Re: User receiving unwanted email alerts
Posted: Wed Dec 06, 2017 4:41 pm
by lmiltchev
I have a user rosterg who is receiving emails for the server below. Why is this user receiving any alerts at all? Shouldn't the only one receiving an alert be shall?
I believe you have a typo. The username is "
rostertag", correct?
Also, the notification you showed us is a service notificaiton, NOT a host one.
Looking at the "ICMP" service on the "afgpl13" host, we can see that there are three contact groups added to it:
Code: Select all
define service {
host_name afgpl13
service_description ICMP
...
contact_groups UNIX,REPORTING,OPERATIONS
...
}
The "fostertag" user is a member of the OPERATIONS contactgroup, that's why he/she is receiving notifications about this service.
Code: Select all
define contactgroup {
contactgroup_name OPERATIONS
alias OPERATIONS
members ...,rostertag,...
}
Note: I am omitting parts of the config on purpose.
Let us know if this answers your question.
Re: User receiving unwanted email alerts
Posted: Thu Dec 07, 2017 8:32 am
by markmerchant
That's the key, Thx. I thought it was coming from the host.
Re: User receiving unwanted email alerts
Posted: Thu Dec 07, 2017 9:59 am
by lmiltchev
I am glad I could help!
