exclude hosts from some services
exclude hosts from some services
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.
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
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
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.
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
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
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.
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
I am definitely curious about your results.
Re: exclude hosts from some services
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).
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
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.
Config verification for Nagios XI will still follow the same rules as Nagios Core.
Re: exclude hosts from some services
Original service file.
This was in a static file.
When i tried to write the files it gave me an error that !www.website.nu cannot be found.
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%!!!!
}
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: exclude hosts from some services
To be clear the hostgroup in your original file was
In the new file, it is
Is that correct?
Code: Select all
hostgroup_name web_sitesCode: Select all
hostgroup_name websites