User Tools

Site Tools


  Main   About   Help   Download
nconf:help:how_tos:configuration_deployment

Outdated
This page is outdated.
This guide here is related to NConf 1.2.6 and earlier.
With NConf 1.3 we introduced the new Deployment-Module which should make deployment easier.
Please have a look here : Deployment

Configuration deployment

NConf stores its data in a database and will generate fresh config files for Nagios every time you hit the “Generate Nagios config” button. The output consists of a single .tgz archive which is written to the 'nconf/output/' folder.

Once the config has been generated, users are responsible for deploying the config themselves. This is not done by NConf, because deployment has to be adapted according to your setup and can vary from case to case.

For small Nagios installations, where Nagios and NConf run on the same machine, or where there is only one collector and one monitor server, we provide certain deployment helpers for you to unpack and move the generated files to the right location.

For larger installations (large-scale, distributed setups), you must decide how to deploy the correct files to your servers on your own. For most sysadmins this is not a problem (mostly done with scp).

Deployment for "small" Nagios installations

NConf + Nagios on same machine

Simply unpack the 'output/NagiosConfig.tgz' archive, move the files to the '/etc/nagios/' directory and restart Nagios. You can easily do this with a little shell script.

We provide a little script for this:
ADD-ONS/deploy_local.sh

The script should be pretty straight forward, just configure it for your own setup:

Most important:

  • OUTPUT_DIR: set the path to 'output/NagiosConfig.tgz'
  • NAGIOS_DIR: set the path to your Nagios config directory

Additionally, you can add the script to /etc/crontab and done is your automatic deployment.

Example for /etc/crontab:

* * * * * root /path/to/nconf/ADD-ONS/deploy_local.sh

NConf + Nagios on different machines

NConf also offers the possibility to upload the generated config to a remote webserver. Technically, this is done by submitting a HTTP(s)-POST-request and attaching the config as form-data. A script is needed to process the data on the destination webserver. In the interest of security, it is recommended to password-protect access to that script.

If Nagios is running on a different server than NConf, you can configure and activate the deployment by following this guide:

Instructions Example
  • upload the provided script
    ADD-ONS/incoming_config.php to your Nagios server
  • make the script accessible for your webserver. We recommend you password-protect the script (.htaccess)


/var/www/html/incoming_config.php

  • create a directory on your webserver for the incoming config files
  • be sure that this directory is writable for your webserver
  • edit the incoming_config script, configure the $targetdir variable (path to the folder you created)

mkdir /var/www/html/nconf_incoming
chown root:apache /var/www/html/nconf_incoming
chmod 770 /var/www/html/nconf_incoming
$targetdir = "/var/www/html/nconf_incoming";

  • on your NConf server, configure the deployment section in config/nconf.php
  • set ALLOW_DEPLOYMENT to 1
  • for more detailed information see the documentation Configuration: Config deployment

define('ALLOW_DEPLOYMENT', 1);
define('CONF_DEPLOY_URL',
"https://webserver.mydomain.com/incoming_config.php");
define('CONF_DEPLOY_USER', "deployUser");
define('CONF_DEPLOY_PWD',  "deployPass");

  • Once the config is uploaded to your webserver, follow the steps from above ”NConf & Nagios on same machine” to deploy the files locally
  • Remember the directory you created. That is now your OUTPUT_DIR in your deploy_local.sh

After successfully generating the configuration in NConf you will now see a Deploy button. This will now upload the generated config to your remote webserver.

nconf/help/how_tos/configuration_deployment.txt · Last modified: 10.12.2011 12:45 by agargiulo