Checking configuration with restarting?

Carroll, Jim P [Contractor] jcarro10 at sprintspectrum.com
Mon Nov 4 22:14:45 CET 2002


To comment on your first question/comment, what about keeping an editable
copy of your configs in a 'work' directory?  Of course, your nagios.cfg
would need to reflect the modified paths, so this would possibly mean
maintaining 2 versions of nagios.cfg (the live version and the version for
the work directory).

To comment on your second question/comment, this is something I'm currently
working on.  I've added the following line to my nagios.cfg:

  cfg_dir=/usr/local/nagios/etc/configs

Within this directory, I'm creating unique config files (based on hostname)
which contain both the snippet from hosts.cfg and the snippet(s) from
services.cfg, specific to that host.  (Anything which is more
hostgroup-oriented, I've put into a file called HOSTGROUPS.cfg, but with
this new approach, I think I'll shy away from hostgroups for the most part,
even though hostgroups do add value in my setup.)  I'm stripping out
hosts.cfg and services.cfg, putting the templates into a TEMPLATES.cfg file.

Right now I'm the only one who's making any changes, but I've already
implemented RCS, with the future goal of warning anyone who happens to try
to edit the same file at the same time as anyone else.  (You may prefer to
use CVS.)

I figure that with the smaller (although more plentiful) config files,
there's a lower probability of messing up the config for any other host, and
certainly the much lower probability of admins stepping on each others'
toes.  It also facilitates a 'boilerplate' approach to rolling out the
config for a new host.

Hope this gives you some food for thought.

jc

> -----Original Message-----
> From: Rob King [mailto:rob.king at wholefoods.com]
> Sent: Monday, November 04, 2002 1:47 PM
> To: Shawn Rose
> Cc: nagios-users at lists.sourceforge.net
> Subject: Re: [Nagios-users] Checking configuration with restarting?
> 
> 
> Actually, I think I may have figured it out:
> 
> The CGIs, of course, re-read the configuration every time the page is 
> loaded. This I knew. However, I thought that they got their status 
> information from some sort of internal database maintained by 
> the Nagios 
> daemon. However, if they relied on the configuration to 
> determine what 
> status to get, they would come up with the weird "no status, 
> no hosts, 
> no anything" page if the config were fscked up...
> 
> That's probably it. Thanks for all the help. :) So, on a 
> lighter note, 
> anyone have any experience with having multiple people administer a 
> Nagios setup simulataneously?
> 
> Thanks all,
> Rob
> 
> Shawn Rose wrote:
> 
> >Yours restarts when you do that eh?  Mine doesn't.  That is odd.
> >
> >No idea from me :)
> >
> >Shawn
> >
> >-----Original Message-----
> >From: Rob King [mailto:rob.king at wholefoods.com] 
> >Sent: Monday, November 04, 2002 11:07 AM
> >To: Shawn Rose; nagios-users at lists.sourceforge.net
> >Subject: Re: [Nagios-users] Checking configuration with restarting?
> >
> >Hey everyone,
> >    Right, I knew about that. The issue is that when I do 
> that, Nagios 
> >still restarts - and if there's an error in the 
> configuration files, the
> >
> >CGI's all show inaccurate information.
> >
> >    Is there any way to test the configuration without restarting?
> >
> >    Thanks,
> >    Rob
> >
> >Shawn Rose wrote:
> >
> >  
> >
> >>Go to your bin directory and type 
> >>./nagios -v /path/to/nagios.cfg
> >>
> >>
> >>Shawn
> >>
> >>-----Original Message-----
> >>From: nagios-users-admin at lists.sourceforge.net
> >>[mailto:nagios-users-admin at lists.sourceforge.net] On Behalf 
> Of Rob King
> >>Sent: Monday, November 04, 2002 10:35 AM
> >>To: nagios-users at lists.sourceforge.net
> >>Subject: [Nagios-users] Checking configuration with restarting?
> >>
> >>Hey everyone,
> >>   I know that you can verify the Nagios configuration files by
> >>    
> >>
> >calling
> >  
> >
> >>Nagios with the "-v" flag. However, if there is an error in the 
> >>configuration files, while the config check catches it, 
> Nagios still 
> >>restarts!
> >>
> >>   Well, at least I think it restarts. The "Network Health Bars" all
> >>    
> >>
> >go
> >  
> >
> >>to 0%, and I get "0 Hosts 0 Services", etc, etc.
> >>
> >>   Is there any way to verify the configuration without restarting?
> >>    
> >>
> >I'd
> >  
> >
> >>like to know because very soon we're going to have multiple people 
> >>administering one Nagios setup, and I'd like for them to be 
> forced to 
> >>verify their configuration before restarting.
> >>
> >>   Thanks all!
> >>
> >>   Rob
> >>
> >>
> >>
> >>
> >>-------------------------------------------------------
> >>This SF.net email is sponsored by: ApacheCon, November 18-21 in
> >>Las Vegas (supported by COMDEX), the only Apache event to be
> >>fully supported by the ASF. http://www.apachecon.com
> >>_______________________________________________
> >>Nagios-users mailing list
> >>Nagios-users at lists.sourceforge.net
> >>https://lists.sourceforge.net/lists/listinfo/nagios-users
> >>
> >>
> >> 
> >>
> >>    
> >>
> >
> >
> >
> >
> >
> >-------------------------------------------------------
> >This SF.net email is sponsored by: ApacheCon, November 18-21 in
> >Las Vegas (supported by COMDEX), the only Apache event to be
> >fully supported by the ASF. http://www.apachecon.com
> >_______________________________________________
> >Nagios-users mailing list
> >Nagios-users at lists.sourceforge.net
> >https://lists.sourceforge.net/lists/listinfo/nagios-users
> >
> >
> >  
> >
> 
> 
> 
> 
> -------------------------------------------------------
> This SF.net email is sponsored by: ApacheCon, November 18-21 in
> Las Vegas (supported by COMDEX), the only Apache event to be
> fully supported by the ASF. http://www.apachecon.com
> _______________________________________________
> Nagios-users mailing list
> Nagios-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagios-users
> 


-------------------------------------------------------
This SF.net email is sponsored by: ApacheCon, November 18-21 in
Las Vegas (supported by COMDEX), the only Apache event to be
fully supported by the ASF. http://www.apachecon.com




More information about the Users mailing list