[naemon-users] Naemon Sample Configuration Files

Frost, Mark {BIS} mark.frost1 at pepsico.com
Wed Dec 24 19:26:46 CET 2014


That’s actually why you’d use the “pre-flight check” option.

naemon –v <path_to_your_naemon.cfg>

It reads through all the configuration objects to ensure they’re OK without actually restarting anything.   It gives you the opportunity to say “are these changes I made OK?” before actually trying to use any of them.

I’ve found it’s helpful to use something like subversion to check in the configuration files when you make changes.   That way if you make some kind of change that completely screws things up and you can’t figure out why you can just “revert” to the previous configuration via subversion and try again some other time.

Mark

From: Naemon-users [mailto:naemon-users-bounces+mark.frost1=pepsico.com at monitoring-lists.org] On Behalf Of Justin Laughlin
Sent: Wednesday, December 24, 2014 12:24 PM
To: Naemon Users
Subject: Re: [naemon-users] Naemon Sample Configuration Files

Thank you very much Mark.  That helps a lot.  I draw the whole thing out on paper first before I start messing with the files.  I already crashed the service by putting a typo into the windows.cfg.

On Wed, Dec 24, 2014 at 11:03 AM, Frost, Mark {BIS} <mark.frost1 at pepsico.com<mailto:mark.frost1 at pepsico.com>> wrote:
Justin,

Nagios (and thus Naemon) don’t care where those live.   Essentially all that host, hostgroup, contact, service, etc stuff is a collection of object definitions.   Most of them refer to each other in some way.  Nagios/Naemon cares that those references between objects are all complete.  So if a service definition references a host, there has to be a definition for that host object for it somewhere that it can read.   So it doesn’t care where if finds the definitions as long as they represent a cohesive configuration and there are no missing bits.

I’ve seen people make things in a variety of different ways.   When I first started, I saw one big configuration file.   As things grew, that made less sense.   things got split into separate files by type (i.e. all hosts in their own definition file).  As things grew further, even that made a little less sense so we broke things up into logical directories that matched what things we were monitoring and each of those directories had their own individual files for hosts, etc.

So really, the only thing that matters is that it makes sense to you and is maintainable by you.   If you look at the naemon.cfg file you’ll see that there’s a couple of different ways to make sure it finds your config files.   You can either list them out one at a time with the cfg_file= directives, or you can point it to a whole tree of *.cfg files that Naemon will recurse into with the cfg_dir= directive.

Hope that helps.

Mark

From: Naemon-users [mailto:naemon-users-bounces+mark.frost1<mailto:naemon-users-bounces%2Bmark.frost1>=pepsico.com at monitoring-lists.org<mailto:pepsico.com at monitoring-lists.org>] On Behalf Of Justin Laughlin
Sent: Wednesday, December 24, 2014 11:55 AM
To: naemon-users at monitoring-lists.org<mailto:naemon-users at monitoring-lists.org>
Subject: [naemon-users] Naemon Sample Configuration Files

Hello Group,

I am new to Naemon/Nagios and heavily dependent on the documentation.  I am following the example in

http://www.naemon.org/documentation/usersguide/monitoring-windows.html

It shows separate config files for "hostgroups", "commands" and "services".  In the sample config files that ship with the 0.8 build these are all combined into the hosts.conf file.  Which model should I follow?  I am going to have a few dozen hosts to monitor at first along with some switches, a SAN, and some firewalls.  It seems more logical to make them separate files but maybe there is a reason they are all in one.  Is it somehow more efficient or was it done for expediency just to show a few examples?

Thank you!

Justin



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-lists.org/archive/naemon-users/attachments/20141224/dd6cb172/attachment.html>


More information about the Naemon-users mailing list