Page 1 of 2
exclude hosts from some services
Posted: Tue Apr 17, 2012 5:35 am
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.
Re: exclude hosts from some services
Posted: Tue Apr 17, 2012 9:24 am
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.
Re: exclude hosts from some services
Posted: Tue Apr 17, 2012 2:39 pm
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.
Re: exclude hosts from some services
Posted: Tue Apr 17, 2012 4:36 pm
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
Re: exclude hosts from some services
Posted: Wed Apr 18, 2012 2:13 am
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.
Re: exclude hosts from some services
Posted: Wed Apr 18, 2012 12:54 pm
by scottwilkerson
I am definitely curious about your results.
Re: exclude hosts from some services
Posted: Wed Apr 25, 2012 4:10 am
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).
Re: exclude hosts from some services
Posted: Thu Apr 26, 2012 9:17 am
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.
Re: exclude hosts from some services
Posted: Wed May 02, 2012 7:01 am
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.
Re: exclude hosts from some services
Posted: Wed May 02, 2012 10:51 am
by scottwilkerson
To be clear the hostgroup in your original file was
In the new file, it is
Is that correct?