Host Group Monitors

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Host Group Monitors

Post by slansing »

Lets try to get a better picture of this. So you have 700 hosts imported with their services, you then sorted them into host groups. The services will still be under each respective host even if they are sorted into host groups. Are you trying to remove hosts and their services from hostgroups?
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Host Group Monitors

Post by abrist »

asmgiadmin wrote:Also, this document mentions each individual host should have services defined in .cfg file and advises against applying service checks to host groups - http://assets.nagios.com/downloads/nagi ... gement.pdf
This suggestion only applies to those using the automated features. In such situations, templates are probably the best solution.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
asmgiadmin
Posts: 125
Joined: Tue Feb 12, 2013 5:00 pm

Re: Host Group Monitors

Post by asmgiadmin »

slansing wrote:Lets try to get a better picture of this. So you have 700 hosts imported with their services, you then sorted them into host groups. The services will still be under each respective host even if they are sorted into host groups. Are you trying to remove hosts and their services from hostgroups?
700 hosts imported and sorted, without services. Service checks were applied to host groups. I'm rethinking the decision to apply service checks to host groups to maximize ability to scale and customize.

My current question is, if service checks are applied to host groups, how can check be disabled for server1 in host-group-a, without disabling service check for the entire host group?
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Host Group Monitors

Post by abrist »

You would have to turn off "active checks" and "notifications" for each individual service in the service details screen (not efficient or desirable). You may want to make templates instead and apply them to hosts. You may also want to rethink your hostgroups - if you have a large number of hosts that need services a,b, and c while another number of hosts that only need services b and c, you may be better off making 2 hostgroups, one for a, and another for b and c. Alternatively, you could attach the services to templates and apply them on a per host or hostgroup basis.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Host Group Monitors

Post by scottwilkerson »

asmgiadmin wrote: Consider host group with SSH service check applied and user calls to have SSH check for server1 in host-group. In this case, is it possible to only disable SSH check on server1, while leaving enabled for remainder of host-group?
Actually this is possible in the CCM with a little trickery IF you are only adding the service to a hostgroup and not individual hosts...

You can exclude a host by doing the following:

In the CCM Service Management page for this service, click on the misc settings tab -> Manage Variable Definitions
Variable name = host_name
Variable value = !YOUR_HOSTNAME
Insert

The "Variable value" is a comma delimited list so if you want to exclude more than 1 it would be !YOUR_HOSTNAME,!YOUR_HOSTNAME2
Last edited by scottwilkerson on Thu Mar 14, 2013 8:57 am, edited 1 time in total.
Reason: edited to fix typo
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
asmgiadmin
Posts: 125
Joined: Tue Feb 12, 2013 5:00 pm

Re: Host Group Monitors

Post by asmgiadmin »

didn't work following directives above:

Code: Select all

Error: Invalid service object directive 'hostname'.
Error: Could not add object property in file '/usr/local/nagios/etc/services/svc-check-ssh.cfg' on line 20.
   Error processing object config files!


***> One or more problems was encountered while processing the config files...

     Check your configuration file(s) to ensure that they contain valid
     directives and data defintions.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Host Group Monitors

Post by abrist »

Could you post the output of:

Code: Select all

cat /usr/local/nagios/etc/services/svc-check-ssh.cfg
(feel free to obfuscate sensitive information)
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
asmgiadmin
Posts: 125
Joined: Tue Feb 12, 2013 5:00 pm

Re: Host Group Monitors

Post by asmgiadmin »

Code: Select all

###############################################################################
#
# Service configuration file
#
# Created by: Nagios QL Version 3.0.3
# Date:       2013-02-25 12:47:20
# Version:    Nagios 3.x config file
#
# --- DO NOT EDIT THIS FILE BY HAND ---
# Nagios QL will overwite all manual settings during the next update
#
###############################################################################

define service {
        service_description             Checks SSH Availability
        use                             generic-service
        hostgroup_name                  hostgroup-linux
        display_name                    svc-check-ssh
        check_command                   check_ssh!!!!!!!!
        register                        1
        }

###############################################################################
#
# Service configuration file
#
# END OF FILE
#
###############################################################################
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Host Group Monitors

Post by scottwilkerson »

Actually, can you go to CCM -> Services -> svc-check-ssh and click the disk icon and port that.

This will give us what it is trying to write.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
asmgiadmin
Posts: 125
Joined: Tue Feb 12, 2013 5:00 pm

Re: Host Group Monitors

Post by asmgiadmin »

^^ cool trick - same as the cat output.
Locked