stop sending mail after x messages

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
raven
Posts: 7
Joined: Thu Dec 06, 2012 10:07 am

stop sending mail after x messages

Post 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
User avatar
jsmurphy
Posts: 989
Joined: Wed Aug 18, 2010 9:46 pm

Re: stop sending mail after x messages

Post 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!
raven
Posts: 7
Joined: Thu Dec 06, 2012 10:07 am

Re: stop sending mail after x messages

Post by raven »

Tryed but doesn't work, it continue to flood mail ! :cry:
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: stop sending mail after x messages

Post by scottwilkerson »

What is the setting for is_volitile ?

If is_volitile is 1

then it always starts over at 1st notification
Former Nagios employee
Creator:
ahumandesign.com
enneagrams.com
raven
Posts: 7
Joined: Thu Dec 06, 2012 10:07 am

Re: stop sending mail after x messages

Post by raven »

Ehmmmmm sorry where I have tu put or search is_volatile 1 ?
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: stop sending mail after x messages

Post 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.
raven
Posts: 7
Joined: Thu Dec 06, 2012 10:07 am

Re: stop sending mail after x messages

Post by raven »

I added the line is_volatile, but nothing changed :cry:
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
User avatar
gshergill
Posts: 231
Joined: Tue Aug 07, 2012 5:08 am

Re: stop sending mail after x messages

Post 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
raven
Posts: 7
Joined: Thu Dec 06, 2012 10:07 am

Re: stop sending mail after x messages

Post by raven »

Yes I added under config.cfg the serve_escalation.cfg location but it seems that for some reason it ignore the file
User avatar
gshergill
Posts: 231
Joined: Tue Aug 07, 2012 5:08 am

Re: stop sending mail after x messages

Post 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
Locked