Building Hostgroups using Host Config Files

Zac spdrmonkey at gmail.com
Fri Dec 23 19:14:14 CET 2005


I am sorry for opening an old issue, but I have a question in regard to this
style of config, and this is the closest thread I have found to my issue.  I
am using Nagios 2.0b6, and want to completely do away with the hostgroup
definitions in favor of defining it in the host definition, but am having
problems.  I am using the object inheritance templates like you, but when I
run nagios -v I get

Error: Could not find hostgroup 'Core_Monitors' specified in host 'cacti'
definition (config file '/opt/nagios/etc/core/core_hosts.cfg', starting on
line 83)

Am I allow to do this?  According to the documentation I can use just the
hostgroups line in the host definition as an alternative to a hostgroups
definition.  As a fix I tried making a hostgroup definition, but without the
members line, since all my members will be defined in the host definition,
this just changed the error to

Error: Hostgroup has no members (config file
'/opt/nagios/etc/corenap/corenap_hostgroups.cfg', starting on line 1)

which I expected.  So, to sum up my question.  Is nagios at a point where I
don't have to define a hostgroup and can just use the hostgroup line in the
hosts definition.  Thanks for your response.

-Zac Israel

On 8/12/05, Todd Barbera <todd_barbera at wgbh.org> wrote:
>
> Thanks Marc,
>
> This did the trick. I was able to clean up my config files considerably
> using the templates.
>
> Todd
>
> -----Original Message-----
> From: nagios-users-admin at lists.sourceforge.net
> [mailto:nagios-users-admin at lists.sourceforge.net] On Behalf Of Marc Powell
> Sent: Friday, August 12, 2005 3:32 PM
> To: nagios-users at lists.sourceforge.net
> Subject: RE: [Nagios-users] Building Hostgroups using Host Config Files
>
>
>
> > -----Original Message-----
> > From: nagios-users-admin at lists.sourceforge.net [mailto:nagios-users-
> > admin at lists.sourceforge.net] On Behalf Of Todd Barbera
> > Sent: Friday, August 12, 2005 2:06 PM
> > To: nagios-users at lists.sourceforge.net
> > Subject: [Nagios-users] Building Hostgroups using Host Config Files
> >
> > Hi,
> >
> > I just installed Nagios 2.0 using Apache in an SSL setup. In my
> > configuration, I decided not to use a single hosts.cfg file, but
> instead
> > break down my host entries via directories (i.e.,
> > etc/servers/sunservers.cfg, etc/servers/windows.cfg). My question is
> can I
> > create a hostgroup entry that references an individual config file as
> it's
> > input as opposed to having a "members" entry line that contains 50
> hosts
> > or more? Thanks for the feedback.
>
> No you can't. A suitable alternative for you might be using the
> "hostgroups" directive in each of your host definitions.
>
> http://nagios.sourceforge.net/docs/2_0/xodtemplate.html#host
>
>
> You could even simplify that further by using a per-file template.
> Presuming you already have a generic global host template defined you
> could do the following in etc/servers/sunservers.cfg -
>
> define host {
>         use generic-host
>         name sunservers
>         hostgroups sunservers
>         register 0
> }
>
> define host{
>         use                     sunservers
>         host_name               Sun_Host_1
>         alias                   This is my Sun Host.
>         address                 127.0.0.1
>         }
>
> define host{
>         use                     sunservers
>         host_name               Sun_Host_2
>         alias                   This is my Second Sun Host.
>         address                 127.0.0.2
>         }
>
> I haven't actually done this myself but I expect the template
> inheritance to allow it.
>
> --
> Marc
>
>
> -------------------------------------------------------
> SF.Net email is Sponsored by the Better Software Conference & EXPO
> September 19-22, 2005 * San Francisco, CA * Development Lifecycle
> Practices
> Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
> Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
> _______________________________________________
> 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
>
>
>
> -------------------------------------------------------
> SF.Net email is Sponsored by the Better Software Conference & EXPO
> September 19-22, 2005 * San Francisco, CA * Development Lifecycle
> Practices
> Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
> Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
> _______________________________________________
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/users/attachments/20051223/20dbe282/attachment.html>


More information about the Users mailing list