exclude hosts from some services

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
SDohmen
Posts: 240
Joined: Thu Jun 30, 2011 4:14 am

exclude hosts from some services

Post by SDohmen »

Hello,

The subject is a bit cryptic so i try to explain it as best as possible.

For our current central we decided to link the hostgroups to the host and services. This way it made it easier for us to connect lots of services to just 1 host.

The problem i am facing however is that some services aren't relevant for hosts. In the old nagios it was easy fixed by adding !host to the service but i dont see a way to do this in the nagiosxi.

My question is how can i do this, preferably without creating a new host named !host or creating multiple hostgroups for this.
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: exclude hosts from some services

Post by mguthrie »

Unfortunately this is currently a limitation of the CCM (both old and new) in that it doesn't yet support exclusions. It is on my eventual radar for the new CCM, but right now in order to use exclusions you'd have to maintain a static configuration file instead of using the CCM.
SDohmen
Posts: 240
Joined: Thu Jun 30, 2011 4:14 am

Re: exclude hosts from some services

Post by SDohmen »

So if i add those hosts and/or hostgroups to a seperate file which i place in the static dir it should work fine?

If this is the case then it is resolved.

I do hope though that this will get added to the new ccm as its a pretty much used everywhere in our case.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: exclude hosts from some services

Post by scottwilkerson »

That does sound correct, just make sure you don't have any exact matches host/service between the CCM and the static directory
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
SDohmen
Posts: 240
Joined: Thu Jun 30, 2011 4:14 am

Re: exclude hosts from some services

Post by SDohmen »

My idea was to use the regular ccm to have the service defined by hostgroup and then add a service entry in the static file with only the hostnames that should be skipped. If i am not mistaken this gives no warning since the hosts are different for each.

I will try this and let you know the result.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: exclude hosts from some services

Post by scottwilkerson »

I am definitely curious about your results.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
SDohmen
Posts: 240
Joined: Thu Jun 30, 2011 4:14 am

Re: exclude hosts from some services

Post by SDohmen »

Finally i can report back the results.

I made a file with just the service and i excluded the hosts with ! in front of it. When i checked the configuration i got a error though. From what i can see nagiosxi does not support ! in the static files unless that host is created with ! in front as well. The problem here of course is that, that host will show itself as well in the normal overviews.

I would love to get a solution for this to get it working in the webinterface (or temp in a static file).
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: exclude hosts from some services

Post by mguthrie »

Can you post a few lines of the config that your'e testing along with the config error that Nagios generated?

Config verification for Nagios XI will still follow the same rules as Nagios Core.
SDohmen
Posts: 240
Joined: Thu Jun 30, 2011 4:14 am

Re: exclude hosts from some services

Post by SDohmen »

Original service file.

Code: Select all

define service {
	service_description		avail-content
	use				xiwizard_website_http_content_service
	hostgroup_name			web_sites
	check_command			check_xi_service_http!-s "html" -f ok!!!!!!!
	max_check_attempts		5
	check_interval			5
	retry_interval			1
	notification_interval		60
	contacts			nagiosadmin
	register			1
	}	

define service {
	service_description		avail-ping
	use				generic-service
	hostgroup_name			web_sites
	check_command			check_xi_service_ping!3000.0!80%!5000.0!100%!!!!
	max_check_attempts		5
	check_interval			5
	retry_interval			1
	notification_interval		60
	contacts			nagiosadmin
	register			1
	}	

define service {
	service_description		perf-response
	use				xiwizard_website_http_service
	hostgroup_name			web_sites
	check_command			check_xi_service_http!-f ok!!!!!!!
	max_check_attempts		5
	check_interval			5
	retry_interval			1
	notification_interval		60
	contacts			nagiosadmin
	_xiwizard			website
	register			1
	}	

This was in a static file.

Code: Select all

define service {
	service_description		avail-ping
	use				generic-service
	host_name		www.website.nu
	check_command	check_dummy!0!Dummy PING OK!!!!!!
	}	

define service {
	service_description		avail-ping
	use				generic-service
	hostgroup_name	websites
        host_name                !www.website.nu
	check_command	check_xi_service_ping!3000.0!80%!5000.0!100%!!!!
	}	

When i tried to write the files it gave me an error that !www.website.nu cannot be found.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: exclude hosts from some services

Post by scottwilkerson »

To be clear the hostgroup in your original file was

Code: Select all

hostgroup_name   web_sites
In the new file, it is

Code: Select all

hostgroup_name   websites
Is that correct?
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked