Page 1 of 1

Help! Globally Filter out specific services Win Servers

Posted: Mon Aug 26, 2013 10:13 am
by jtfindlay
Hi All,

I don't know a great deal about administrating Nagios Core. I inherited it from a previous co-worker who set it all up. I only know the basic tasks like adding/removing hosts from the config files. Please bear this in mind when reading my post. :)

Recently an application was installed across all of our windows servers (mix of 2003/2008 R2). With this new application came a service which automatically stops itself when not in use. It is in the "Stopped" state more often than not. As a result of this my Nagios Web interface, has became clutered with "Critical" error messages from all servers because this service is in a "stopped" state.

I wondered if its possible to globally (system wide) filter out notifications for this particular service for all servers? and if it is, how can it be achieved? I have tried to research this but due to my lack of knowledge on the system I am not having much luck.

I know how to exclude the service indivdually at host level, but wondered if there is more time efficient method.

Nagios Core: version 3.2.0

Any help will be greatly appreciated,

Thanks,
John

Re: Help! Globally Filter out specific services Win Servers

Posted: Mon Aug 26, 2013 10:47 am
by slansing
Are you wondering how to stop any of these checks against that service from notifying you? Or are you trying to create some sort of event handling to dynamically do this?

Re: Help! Globally Filter out specific services Win Servers

Posted: Mon Aug 26, 2013 11:01 am
by jtfindlay
HI Slansing,

The easiest way I can put it is, I am looking for a way to stop any notifications for this one particular service, which when I configure will apply to all servers monited by Nagios.

Re: Help! Globally Filter out specific services Win Servers

Posted: Mon Aug 26, 2013 3:30 pm
by jtfindlay
Hi slangsing,

Sorry my reply didn't post for some reason.

I am looking for the ability to stop any notification from this service from any server present and future, but hoping to do it centrally from the nagios server instead of having to manually exclude the service on each individual server via the NSC.ini file.

Hope that makes sense.

Thanks,
John

Re: Help! Globally Filter out specific services Win Servers

Posted: Mon Aug 26, 2013 3:50 pm
by slansing
One way to do this, would be to create a Service Template, and apply your notification settings there. Then, you can use that template in all of your services which you would like this applied to and they will obey what you have defined there. For more information on object definitions see this page:

http://nagios.sourceforge.net/docs/3_0/ ... tions.html

Re: Help! Globally Filter out specific services Win Servers

Posted: Tue Aug 27, 2013 2:55 am
by jtfindlay
Many Thanks for that, I'll have a look into this.

John

Re: Help! Globally Filter out specific services Win Servers

Posted: Tue Aug 27, 2013 10:49 am
by slansing
Great let us know how it works out for you.

Re: Help! Globally Filter out specific services Win Servers

Posted: Wed Aug 28, 2013 5:31 am
by jtfindlay
Hi,

I've been having a look at the link you suggested. I can understand some of the syntax but there are certain commands I am not to clear on.

For example:

Say I want to filter out "Service X" from all windows servers, from the Nagios console, I would add the following to my Services.config file:

define service{

hostgroup_name windows-server
service_description exclude Service X notifications completely
check_command ?????????
notification_enabled 0

}

I am not sure if the above would even work, but what I am stuck on what check_command would be needed to identify the one specific service. I have a hostgroup already configured for all Windows-services, so this what I am guessing I would use.

Re: Help! Globally Filter out specific services Win Servers

Posted: Wed Aug 28, 2013 11:27 am
by slansing
You would want to mirror the service you do not want notifications for, into a service definition within the templates.cfg file. That way, you dont need to re-write it, and can disable notifications there. Now, in the actual service.cfg file, or anywhere the original service is defined simply add the following definition:

Code: Select all

use "place the name of the template service here without quotes"
It would look similar to this:

Code: Select all

define service{

                         use this-is-the-service-template

                         host_name winserver

                         service_description NSClient++ Version

                         check_command check_nt!CLIENTVERSION

}