Page 1 of 2
stop sending mail after x messages
Posted: Thu Dec 06, 2012 10:41 am
by raven
Hi
I'm a new starter with Nagios Core, I installed it on a Centos 6 server, all is working fine.....but I would like that Nagios stop to send mail after 5 messages sent.
I found on Google the service escalation config
define serviceescalation{
host_name webserver
service_description HTTP
last_notification 10
}
but where I have to put it ? I tried first on windows.cfg, then on a file named escalationservice.cfg under /usr/local/nagios/etc and then under /usr/local/nagios/etc/objects/
But doesn't work
Thanks
Raven
Re: stop sending mail after x messages
Posted: Thu Dec 06, 2012 7:12 pm
by jsmurphy
I think you also need to put a first_notification otherwise it doesn't know when to trigger the escalation start... so I think if you did:
define serviceescalation{
host_name webserver
service_description HTTP
first_notification 1
last_notification 5
}
That should work, but my experience with escalations is a bit limited

.
Edit: You can put the escalation literally anywhere, Nagios doesn't actually care what definitions you put in what files... put it where it makes sense to you!
Re: stop sending mail after x messages
Posted: Tue Dec 11, 2012 11:10 am
by raven
Tryed but doesn't work, it continue to flood mail !

Re: stop sending mail after x messages
Posted: Tue Dec 11, 2012 4:34 pm
by scottwilkerson
What is the setting for is_volitile ?
If is_volitile is 1
then it always starts over at 1st notification
Re: stop sending mail after x messages
Posted: Wed Dec 12, 2012 9:31 am
by raven
Ehmmmmm sorry where I have tu put or search is_volatile 1 ?
Re: stop sending mail after x messages
Posted: Wed Dec 12, 2012 3:26 pm
by slansing
The volatile switch is set in a services config file. something to the tune of this:
Code: Select all
define service {
host_name xxx.xxx.x.xx
service_description EventLog Agent
use xiwizard_windowseventlog_service
max_check_attempts 1
check_interval 1
retry_interval 1
check_period xi_timeperiod_24x7
notification_period xi_timeperiod_24x7
contacts nagiosadmin
stalking_options n
_xiwizard windowseventlog
register 1
is_volatile 1
}
Volatile is turned off by default so it is not going to be present in your service's CFG unless you add it.
Re: stop sending mail after x messages
Posted: Thu Dec 13, 2012 5:20 am
by raven
I added the line is_volatile, but nothing changed
Sorry but I read too many how to around internet and now I'm a bit confused.....
So I installed nagios on a Centos 6, I have the folder /usr/local/nagios/etc where the general config file are stored cgi.cfg, htpasswd.user, nagios.cfg, resource.cfg
Then there is the folder /usr/local/nagios/etc/objects where the object related config file are stored
commands.cfg, localhost.cfg, switch.cfg, windows.cfg, contacts.cfg, printer.cfg, templates.cfg, timeperiods.cfg
here I added the file service_escalation.cfg with the definition
define serviceescalation{
host_name xxxxxxxx
service_description C:\ Drive Space
first_notification 1
last_notification 3
}
but it doesn't works I continue to receive warning mail. May be that I have to put the serviceescalation inside the windows.cfg where I define the hosts and services ?
Thanks
Raven
Re: stop sending mail after x messages
Posted: Thu Dec 13, 2012 5:56 am
by gshergill
Hi raven,
Small tip when creating new config files would be to make sure you add the location of the new config file in nagios.cfg, otherwise it won't be used.
Hope this helps.
Kind Regards,
Gary Shergill
Re: stop sending mail after x messages
Posted: Thu Dec 13, 2012 6:02 am
by raven
Yes I added under config.cfg the serve_escalation.cfg location but it seems that for some reason it ignore the file
Re: stop sending mail after x messages
Posted: Thu Dec 13, 2012 7:13 am
by gshergill
Hi raven,
Just to confirm my last post.
You would edit /usr/local/nagios/etc/nagios.cfg and add the following:
Code: Select all
cfg_file=/usr/local/nagios/etc/objects/service_escalation.cfg
Assuming that the service escalation config file is called "service_escalation.cfg".
Sorry if that's what you said in the last post, just wanted to confirm.
Assuming you have added this already, I'll step out, just thought I'd make sure of this because I had a similar issue at one point.
Kind Regards,
Gary Shergill