Changing email to when starting downtime
-
vivithemage
- Posts: 102
- Joined: Tue May 21, 2013 2:52 pm
Changing email to when starting downtime
Is it possible to change the email addrss nagios emails when starting downtime, and recovering from downtime?
-
sreinhardt
- -fno-stack-protector
- Posts: 4366
- Joined: Mon Nov 19, 2012 12:10 pm
Re: Changing email to when starting downtime
That is not currently a feature of nagios core. You could certainly request it at tracker.nagios.org!
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.
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: Changing email to when starting downtime
You could also create another contact that would receive emails when downtime occurs for a host/service, and then disable downtime alerts for your other contacts.
-
vivithemage
- Posts: 102
- Joined: Tue May 21, 2013 2:52 pm
Re: Changing email to when starting downtime
We are hoping to have alerts go to one email, and downtime go to another.slansing wrote:You could also create another contact that would receive emails when downtime occurs for a host/service, and then disable downtime alerts for your other contacts.
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: Changing email to when starting downtime
Sure, then you could edit the contacts configuration file and remove the "s" from notification options, this is the scheduled downtime flag. Then, you could create a new contact, and name them something along the lines of "Downtime Contact," and with them, only add the "s" options, then make sure both contacts are added to the services/hosts that you expect this behavior on. This way, both contact addresses will be notified for their respective notification options.
-
vivithemage
- Posts: 102
- Joined: Tue May 21, 2013 2:52 pm
Re: Changing email to when starting downtime
That sounds REALLY simple! Where is the contacts configuration file? I did not set this instance of nagios up, so I am unsure.slansing wrote:Sure, then you could edit the contacts configuration file and remove the "s" from notification options, this is the scheduled downtime flag. Then, you could create a new contact, and name them something along the lines of "Downtime Contact," and with them, only add the "s" options, then make sure both contacts are added to the services/hosts that you expect this behavior on. This way, both contact addresses will be notified for their respective notification options.
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: Changing email to when starting downtime
You can find all of the main configuration files in the following directory:
/usr/local/nagios/etc
In this case look for contacts.cfg
It should be quite simple! Simply add/change your contact(s) information there, then assign their contact name to hosts/services in their respective files, of course after these changes are all made verify that the config files are formatted correctly with:
http://nagios.sourceforge.net/docs/3_0/ ... onfig.html
Let us know if you have questions.
/usr/local/nagios/etc
In this case look for contacts.cfg
It should be quite simple! Simply add/change your contact(s) information there, then assign their contact name to hosts/services in their respective files, of course after these changes are all made verify that the config files are formatted correctly with:
http://nagios.sourceforge.net/docs/3_0/ ... onfig.html
-
vivithemage
- Posts: 102
- Joined: Tue May 21, 2013 2:52 pm
Re: Changing email to when starting downtime
This is my current contact.cfg:
define contact{
contact_name nagiosadmin ; Short name of user
use generic-contact ; Inherit default values from generic-contact template (defined above)
alias Nagios Admin ; Full name of user
email [email protected] ; <<***** CHANGE THIS TO YOUR EMAIL ADDRESS ******
}
define contact {
contact_name boss
alias Da Boss
host_notification_options d,u,r,f
service_notification_options w,u,c,r,f
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
}
The nagiosadmin is the one where we receive emails as a contact. I don't see any host_notifcation_options, should I just add the line, similar to our boss contact? Is there a definition to all of the notification options?
Also, where would I add them to the services/hosts cfg files exactly?
define contact{
contact_name nagiosadmin ; Short name of user
use generic-contact ; Inherit default values from generic-contact template (defined above)
alias Nagios Admin ; Full name of user
email [email protected] ; <<***** CHANGE THIS TO YOUR EMAIL ADDRESS ******
}
define contact {
contact_name boss
alias Da Boss
host_notification_options d,u,r,f
service_notification_options w,u,c,r,f
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
}
The nagiosadmin is the one where we receive emails as a contact. I don't see any host_notifcation_options, should I just add the line, similar to our boss contact? Is there a definition to all of the notification options?
Also, where would I add them to the services/hosts cfg files exactly?
-
slansing
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: Changing email to when starting downtime
It looks like it is in the definition you linked, as it should be, each contact can control what types of state changes they are notified for on a Host and/or Service level.I don't see any host_notifcation_options, should I just add the line, similar to our boss contact?
To assign a contact to a host/service by adding the "contacts" line:
http://nagios.sourceforge.net/docs/3_0/ ... ml#service
Like so:
Code: Select all
contacts nagiosadmin,boss-
vivithemage
- Posts: 102
- Joined: Tue May 21, 2013 2:52 pm
Re: Changing email to when starting downtime
nagiosadmin does not have:
host_notification_options d,u,r,f
service_notification_options w,u,c,r,f
like da boss does though ... or am I missing something?
host_notification_options d,u,r,f
service_notification_options w,u,c,r,f
like da boss does though ... or am I missing something?