Page 2 of 3

Re: Host Group Monitors

Posted: Mon Feb 25, 2013 11:22 am
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?

Re: Host Group Monitors

Posted: Mon Feb 25, 2013 11:25 am
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.

Re: Host Group Monitors

Posted: Mon Feb 25, 2013 11:40 am
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?

Re: Host Group Monitors

Posted: Mon Feb 25, 2013 12:06 pm
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.

Re: Host Group Monitors

Posted: Mon Feb 25, 2013 12:07 pm
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

Re: Host Group Monitors

Posted: Mon Feb 25, 2013 12:44 pm
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.

Re: Host Group Monitors

Posted: Mon Feb 25, 2013 12:56 pm
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)

Re: Host Group Monitors

Posted: Mon Feb 25, 2013 1:13 pm
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
#
###############################################################################

Re: Host Group Monitors

Posted: Mon Feb 25, 2013 3:21 pm
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.

Re: Host Group Monitors

Posted: Mon Feb 25, 2013 3:24 pm
by asmgiadmin
^^ cool trick - same as the cat output.