User Tools

Site Tools


  Main   About   Help   Download
nconf:help:documentation:start:start_guide

Start guide

Take some time to learn how NConf works, what it does exactly and then how you install it. It's not an instant guide, but also not that difficult. Take take some time and study it carefully.

This guide will help you get started with NConf. It begins with an overview of NConf & Nagios, how to install NConf and shows you how to setup. Last but not least, there is some information about how to continue once you completed the first steps.

What are Nagios & NConf

To understand NConf and Nagios, please read this:

NConf is a stand-alone tool with its own database. It is not in any way part of Nagios or a Nagios plug-in. It does not communicate with Nagios in any way or process your existing Nagios configuration by default. NConf only uses Nagios binaries for syntax checking of the generated configuration files. If you wish to manage an existing Nagios configuration with NConf, you must first import your config files and then make all future changes within NConf. You cannot edit Nagios config files manually and expect the changes to be reflected within NConf.

Installation

Refer to the following link for detailed

After installation continue reading here :

First steps with NConf

What you get with NConf

Once you have successfully installed NConf, you will find that the tool contains some example data: a couple of hosts, a switch, a printer, some hostgroups, contacts and contactgroups, and some checkcommands. This content corresponds to what you would get by installing the Nagios RPM provided by rpmforge.

There is a pre-defined host called 'localhost'. This will allow you to monitor the Nagios server itself. If you are running a freshly installed version of Nagios, there is no need to make any changes in NConf to be able to start monitoring.

For a simple, single-server Nagios setup, simply configure one “collector” and no “monitor” server.

Generating Nagios configuration

Generate config and syntax check

For starters, just hit the “Generate Nagios config” button. This will trigger a process that will export the database content to the Nagios config format.

Once the config has been generated, NConf will do a mandatory syntax check of the files. This is done by running the Nagios binary with the -v option. For this reason it's imparative that you have specified the correct NAGIOS_BIN path during installation.

Make sure your webserver user has access to your Nagios binary, or copy the binary to you 'nconf/bin/' folder. NConf will only create the final output file, if the syntax test was completed with '0 Errors'.


Start using generated configuration

If NConf was able to successfully generate the the Nagios configuration, and if all the generated files passed the syntax check, you will now find a .tgz package file under:

./output/NagiosConfig.tgz

The NagiosConfig.tgz file contains the following:

Folder 'Default_collector':

Default_collector/
  extended_host_info.cfg
  extended_service_info.cfg
  hostgroups.cfg
  hosts.cfg
  servicegroups.cfg
  services.cfg

Folder 'global':

global/
  checkcommands.cfg
  contactgroups.cfg
  contacts.cfg
  host_templates.cfg
  misccommands.cfg
  service_templates.cfg
  timeperiods.cfg</code>

Manual deployment

To get started right away, simply do the following:

  • copy the two folders to your Nagios config directory (e.g. /etc/nagios/)
  • do not forget to check the nagios.cfg part, you have to configure it to use NConf generated configuration files.
  • restart nagios
Automatic deployment
Example output with all deployment types

(Uses the deployment module)

With NConf 1.3 will be bringing you a modular deployment.
There you can easily configure where to put your configuration files and automatically restart nagios. (if permissions are set correct)

Following type of deployments are possible rigth now:

  • local (extract on local server, copy files to nagios, restart nagios)
  • scp (copy files to remote servers and also restart nagios there)
  • http (with help of a fetching script on remote server, send configuration over http/https to remote maschine and also reload nagios)

This will then deploy your configuration after each config generation, if you press “deploy”.

Deployment documentation
Please read the documentation for more details: Deployment

nagios.cfg

Read this!
Please read carefully this part, otherwise Nagios will not take the configuration files made by NConf!

Edit your main nagios.cfg file:

  • Add the following two lines:
    cfg_dir=/etc/nagios/global
    cfg_dir=/etc/nagios/Default_collector
  • Comment out any previously existing cfg_dir and cfg_file lines
    (make sure Nagios only uses the files generated by NConf)
  • Then save the file and restart Nagios.

deployment module
You could also configure the deployment module to push the nagios.cfg to remote servers.

Result on Nagios

Now Nagios should show you the configuration made by NConf:

You should see something like this under Service Detail.

The Nagios Service Detail view

Next steps

nconf/help/documentation/start/start_guide.txt · Last modified: 10.12.2011 14:10 by agargiulo