Page 2 of 2
Re: Changing email to when starting downtime
Posted: Tue May 28, 2013 3:46 pm
by sreinhardt
There is a key difference in the Use definition. This is inheriting those settings from a template, in the case of nagiosadmin generic-contact. These settings should already be applied, however if you do choose to define them for nagiosadmin it will overwrite anything for that same setting applied via the template.
Re: Changing email to when starting downtime
Posted: Tue May 28, 2013 3:54 pm
by vivithemage
Ah, and where is the template? Is that:
Code: Select all
/usr/local/nagios/etc/objects/templates.cfg
which is default:
Code: Select all
define contact{
name generic-contact ; The name of this contact template
service_notification_period 24x7 ; service notifications can be sent anytime
host_notification_period 24x7 ; host notifications can be sent anytime
service_notification_options w,u,c,r,f,s ; send notifications for all service states, flapping events, and scheduled downtime events
host_notification_options d,u,r,f,s ; send notifications for all host states, flapping events, and scheduled downtime events
service_notification_commands notify-service-by-email ; send service notifications via email
host_notification_commands notify-host-by-email ; send host notifications via email
register 0 ; DONT REGISTER THIS DEFINITION - ITS NOT A REAL CONTACT, JUST A TEMPLATE!
}
so I could just add this to my contact file:
Code: Select all
/usr/local/nagios/etc/objects/contacts.cfg
Code: Select all
service_notification_options w,u,c,r,f ; send notifications for all service states, flapping events, and scheduled downtime events
host_notification_options d,u,r,f ; send notifications for all host states, flapping events, and scheduled downtime events
and then create my new contact with only:
Code: Select all
define contact {
contact_name downtimealerts
alias downtimealerts
service_notification_options s ; send notifications for all service states, flapping events, and scheduled downtime events
host_notification_options s ; send notifications for all host states, flapping events, and scheduled downtime events
email [email protected]
host_notification_period none
service_notification_period none
host_notification_commands notify-host-by-email
service_notification_commands notify-service-by-email
}
Where are the services/monitored sites configuration I should add these to? Assuming this setup is accurate in my ocntacts.cfg?
Re: Changing email to when starting downtime
Posted: Tue May 28, 2013 4:31 pm
by slansing
Lets just clear up one point, are you running Nagios Core or Nagios XI? Your other thread refers to NDO2DB and MySql. Just want to make sure you are not trying to edit the flat .cfg files if you are using XI, rather than the interface.
Re: Changing email to when starting downtime
Posted: Tue May 28, 2013 4:57 pm
by vivithemage
It loos like we are running core...
Nagios® Core⢠3.4.1 I found the ndo2db service, it was stopped, and installed in a non standard folder, and thus had no /etc/init.d/ startup script.
Re: Changing email to when starting downtime
Posted: Wed May 29, 2013 9:42 am
by slansing
You could add:
Code: Select all
service_notification_options w,u,c,r,f
host_notification_options d,u,r,f
To contacts in your contacts.cfg file, it will do as sreinhardt pointed out above. You do not need to use the template's options if you do not choose. Contact's will use their notification options, but you should set the same options for your services/hosts in their .cfg files. These files are typically in /usr/local/nagios/etc/hosts and /services.
Re: Changing email to when starting downtime
Posted: Wed May 29, 2013 10:13 am
by vivithemage
slansing wrote:You could add:
Code: Select all
service_notification_options w,u,c,r,f
host_notification_options d,u,r,f
To contacts in your contacts.cfg file, it will do as sreinhardt pointed out above. You do not need to use the template's options if you do not choose. Contact's will use their notification options, but you should set the same options for your services/hosts in their .cfg files. These files are typically in /usr/local/nagios/etc/hosts and /services.
Yeah, that is what I posted...just add those lines to my nagios contact currently. Then add the one I listed above, and add it to the cfg files for the services/hosts and it should be good.
Re: Changing email to when starting downtime
Posted: Wed May 29, 2013 10:33 am
by slansing
Yes...you were asking if you could do that.. let us know if you need further help.