Building Hostgroups using Host Config Files

Todd Barbera todd_barbera at wgbh.org
Fri Aug 12 22:26:45 CEST 2005


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





More information about the Users mailing list