Excluding Hosts from service checks
Excluding Hosts from service checks
Is there a way to excluding hosts from a service check through nagios xi
I have created identical services on numerous hostgroups, but would like to exclude some hosts. I am aware in the backend this can be accomplished by preceding the host or hostgroup with a ! symbol, but does nagiosxi have a way of doing this through the web interface. If not could a feature request be put in for this? Having to manage web and backend configs is a painful process. If there is no way through the web please let me know the best practice for identical services on numerous hostgroups.
I have created identical services on numerous hostgroups, but would like to exclude some hosts. I am aware in the backend this can be accomplished by preceding the host or hostgroup with a ! symbol, but does nagiosxi have a way of doing this through the web interface. If not could a feature request be put in for this? Having to manage web and backend configs is a painful process. If there is no way through the web please let me know the best practice for identical services on numerous hostgroups.
-
jdalrymple
- Skynet Drone
- Posts: 2620
- Joined: Wed Feb 11, 2015 1:56 pm
Re: Excluding Hosts from service checks
questrad - The feature does not exist in XI - I wouldn't be surprised to have it turned away by a developer because this isn't the proper way to configure a hostgroup.
A hostgroup should be a logical grouping of similar hosts. If you're excluding some machines, then you should have 2 or more hostgroups to represent the different types of machines. If they later need to be grouped together nested hostgroups work just fine. The only other alternative is to go back to the core way of doing things and define your services in the static directory.
If you want the feature request put in I'll be happy to - I wouldn't expect it to get much traction though. Using excludes in hostgroups is like clicking deny in NTFS permissions which is of course a no-no.
A hostgroup should be a logical grouping of similar hosts. If you're excluding some machines, then you should have 2 or more hostgroups to represent the different types of machines. If they later need to be grouped together nested hostgroups work just fine. The only other alternative is to go back to the core way of doing things and define your services in the static directory.
If you want the feature request put in I'll be happy to - I wouldn't expect it to get much traction though. Using excludes in hostgroups is like clicking deny in NTFS permissions which is of course a no-no.
Re: Excluding Hosts from service checks
Parent_hostgroup <--I have added core checks here like disk c,d ,cpu,memory, various services you get the idea...
child_hostgroup1 <-- Added to Parent_hostgroup from Parent_hostgroup and contains checks related to hostgroup
child_hostgroup2 <-- Added to Parent_hostgroup from Parent_hostgroup and contains checks related to hostgroup
child_hostgroup3 <-- Added to Parent_hostgroup from Parent_hostgroup and contains checks related to hostgroup
child_hostgroup4 <-- Added to Parent_hostgroup from Parent_hostgroup and contains checks related to hostgroup <-- also have one server out of 200 that is missing the d disk and would like to exclude the core check that comes from the Parent.
How would you exclude the d disk?
child_hostgroup1 <-- Added to Parent_hostgroup from Parent_hostgroup and contains checks related to hostgroup
child_hostgroup2 <-- Added to Parent_hostgroup from Parent_hostgroup and contains checks related to hostgroup
child_hostgroup3 <-- Added to Parent_hostgroup from Parent_hostgroup and contains checks related to hostgroup
child_hostgroup4 <-- Added to Parent_hostgroup from Parent_hostgroup and contains checks related to hostgroup <-- also have one server out of 200 that is missing the d disk and would like to exclude the core check that comes from the Parent.
How would you exclude the d disk?
-
jdalrymple
- Skynet Drone
- Posts: 2620
- Joined: Wed Feb 11, 2015 1:56 pm
Re: Excluding Hosts from service checks
a) Remove the host from that hostgroupquestrad wrote: How would you exclude the d disk?
or
b) Use a static config file for the d disk service
Re: Excluding Hosts from service checks
So refresh my memory on static files.
so I have /usr/local/nagios/etc/services/Linux.cfg and all core service checks are here. How would I exclude example - memory for HostA . do I cp /usr/local/nagios/etc/services/Linux.cfg to /usr/local/nagios/etc/static and remove all services except keep only the one service like below or all services?
define service {
service_description Memory_Usage
host_name !HostA
use linuxserver_service
hostgroup_name ParentGroup
display_name Memory_Usage
check_command ncpa ....
event_handler_enabled 0
notification_period timeperiod_24x7
contact_groups group1,group2
_xiwizard ncpa
register 1
}
so I have /usr/local/nagios/etc/services/Linux.cfg and all core service checks are here. How would I exclude example - memory for HostA . do I cp /usr/local/nagios/etc/services/Linux.cfg to /usr/local/nagios/etc/static and remove all services except keep only the one service like below or all services?
define service {
service_description Memory_Usage
host_name !HostA
use linuxserver_service
hostgroup_name ParentGroup
display_name Memory_Usage
check_command ncpa ....
event_handler_enabled 0
notification_period timeperiod_24x7
contact_groups group1,group2
_xiwizard ncpa
register 1
}
-
jdalrymple
- Skynet Drone
- Posts: 2620
- Joined: Wed Feb 11, 2015 1:56 pm
Re: Excluding Hosts from service checks
I do believe that should be the ticket for you.questrad wrote:So refresh my memory on static files.
so I have /usr/local/nagios/etc/services/Linux.cfg and all core service checks are here. How would I exclude example - memory for HostA . do I cp /usr/local/nagios/etc/services/Linux.cfg to /usr/local/nagios/etc/static and remove all services except keep only the one service like below or all services?
Code: Select all
define service { service_description Memory_Usage [b][u]host_name !HostA[/u][/b] use linuxserver_service hostgroup_name ParentGroup display_name Memory_Usage check_command ncpa .... event_handler_enabled 0 notification_period timeperiod_24x7 contact_groups group1,group2 _xiwizard ncpa register 1 }
Re: Excluding Hosts from service checks
So I cp /usr/local/nagios/etc/services/Linux.cfg to /usr/local/nagios/etc/static and remove all services except keep only the one service I would like to play with. What about the orig /usr/local/nagios/etc/services/Linux.cfg, is it necessary to remove the one service "Memory_Usage"
Do I remove the following from /usr/local/nagios/etc/services/Linux.cfg after I copy to /usr/local/nagios/etc/static/Linux.cfg
define service {
service_description Memory_Usage
use linuxserver_service
hostgroup_name ParentGroup
display_name Memory_Usage
check_command ncpa ....
event_handler_enabled 0
notification_period timeperiod_24x7
contact_groups group1,group2
_xiwizard ncpa
register 1
}
Do I remove the following from /usr/local/nagios/etc/services/Linux.cfg after I copy to /usr/local/nagios/etc/static/Linux.cfg
define service {
service_description Memory_Usage
use linuxserver_service
hostgroup_name ParentGroup
display_name Memory_Usage
check_command ncpa ....
event_handler_enabled 0
notification_period timeperiod_24x7
contact_groups group1,group2
_xiwizard ncpa
register 1
}
-
jdalrymple
- Skynet Drone
- Posts: 2620
- Joined: Wed Feb 11, 2015 1:56 pm
Re: Excluding Hosts from service checks
I would expect an error if you don't. It would be duplicate services which aren't allowed and are caught by the pre-flight check.
Re: Excluding Hosts from service checks
Thank you for the clarity
You have been very helpful
You have been very helpful
-
jdalrymple
- Skynet Drone
- Posts: 2620
- Joined: Wed Feb 11, 2015 1:56 pm
Re: Excluding Hosts from service checks
Glad to help - I'm going to leave this topic open because I haven't actually tested what you're trying to do in a lab so I'm not certain of your outcome. If it doesn't work for you please shout out and we'll try to dig in deeper. I'll keep my fingers crossed and hope it *just works* though 