stop sending mail after x messages
stop sending mail after x messages
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
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
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!
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
Tryed but doesn't work, it continue to flood mail !
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: stop sending mail after x messages
What is the setting for is_volitile ?
If is_volitile is 1
then it always starts over at 1st notification
If is_volitile is 1
then it always starts over at 1st notification
Re: stop sending mail after x messages
Ehmmmmm sorry where I have tu put or search is_volatile 1 ?
-
- Posts: 7698
- Joined: Mon Apr 23, 2012 4:28 pm
- Location: Travelling through time and space...
Re: stop sending mail after x messages
The volatile switch is set in a services config file. something to the tune of this:
Volatile is turned off by default so it is not going to be present in your service's CFG unless you add it.
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
}
Re: stop sending mail after x messages
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
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
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
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
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
Hi raven,
Just to confirm my last post.
You would edit /usr/local/nagios/etc/nagios.cfg and add the following:
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
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
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