problem with using "hostgroup_name" in servicedefinitions: Error: Hostgroup name and/or alias is NULL

Marc Powell marc at ena.com
Fri Feb 8 17:19:05 CET 2008



> -----Original Message-----
> From: nagios-users-bounces at lists.sourceforge.net [mailto:nagios-users-
> bounces at lists.sourceforge.net] On Behalf Of Joost van Baal
> Sent: Friday, February 08, 2008 10:06 AM
> To: Nagios Users
> Subject: [Nagios-users] problem with using "hostgroup_name" in
> servicedefinitions: Error: Hostgroup name and/or alias is NULL
> 
> Hi,
> 
> Is it possible at all to _not_ have an explicit object (with it's own
> "define") in the nagios configuration for the number of hosts times
the
> number of services on each such host?
> 
> I assume it _is_ possible, using "hostgroup_name" in service
definitions
> (I've seen it documented on
> http://nagios.sourceforge.net/docs/2_0/templatetricks.html#service ).
> 
> However, when I do:
> 
>  define service {
>         hostgroup_name                  load-cat3-unix-hostgroup
>         check_command                   check_nrpe!check_load
> [...]
>  }
> 
>  define service {
>         hostgroup_name                  ssh-cat3-unix-hostgroup
>         check_command                   check_ssh
> [...]
>  }
> 
>  define host {
>         name                            cat3-unix-host
>         hostgroups                      [...],
load-cat3-unix-hostgroup,
> ssh-cat3-unix-hostgroup
> [...]
>  }
> 
>  define host {
>         host_name                       radix
> [...]
>         use                             cat3-unix-host
>  }
> 
> nagios -v gives:
> 
>  Error: Hostgroup name and/or alias is NULL
>  Error: Could not register hostgroup
> 
> How should I use the hostgroup_name-trick in a service-definition?

I don't use this particular trick but it looks like you just need to
define the hostgroups. I know that just the implication of a hostgroup
definition is not enough.

define hostgroup {
        hostgroup_name  load-cat3-unix-hostgroup
        alias           My Favorite Hostgroup
}
define hostgroup {
        hostgroup_name  ssh-cat3-unix-hostgroup
        alias           My Least Favorite Hostgroup
}

--
Marc


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list