User Tools

Site Tools


  Main   About   Help   Download

Sidebar

nconf:help:documentation:modules:deployment:main

Deployment

This module provides you with some deployment possibilities.

We hope its usefully and will also help you, to bring the nagios configuration easy to its location.


About

example GUI feedback of some modules

To bring the configuration to your Nagios, you first have to generate the configuration.

Until 1.2.6 you had to move the files by yourself.
Now, since NConf version 1.3, we provide the “deployment” module which can help you doing deployment right from the NConf GUI.

  • Simple configuration
  • Direct feedback in the GUI
  • Separate modules (community can create new ones)
  • Modules can be integrated easily

Until now we support following deployment modules:

  • local
  • scp
  • rsync
  • HTTPS/HTTP





setup / configure deployment

The configuration for the deployment is done in the config/deployment.ini

Some examples are included in the config.orig/deployment.ini file.

Copy this to config/deployment.ini and remove the semicolons ”;” of the section you want to activate.
Be sure to use correct path's with appropriate permissions (for webserver)

For more details read the whole documentation.

update from 1.2.6

If you have updated from a previous NConf version, you can read this part to migrate/setup your basic deployment.
If you made a more complex deployment, or want to know more about which type of deployment are available, please refer to the section below : Types.

  1. copy example configuration from config.orig/deployment.ini to config/deployment.ini
  2. migrate following variables from config/nconf.php to config/deployment.ini
    • CONF_DEPLOY_URL → host
    • CONF_DEPLOY_USER → user
    • CONF_DEPLOY_PWD → password
  3. delete or comment out the existing CONF_DEPLOY values in config/nconf.php

example

an example from the old config to the new one:

old config in config/nconf.php

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

new config in config/deployment.ini

[webserver mydomain.com]
type        = https
source_file = "/var/www/nconf/output/NagiosConfig.tgz"
host        = "https://webserver.mydomain.com/incoming_config.php"
user        = "deployUser"
password    = "deployPass"


Types

This is the overview of all deployment types.
It can help you understand how to read the information given in the types documentation

How to read the information

YOUR_SPECIFIC_INPUT

  • UPPERCASE and CODE-text in double quotes means you have to enter your specific text / path / command or what else it refers.

option1/option2

  • lowercase are options, the ”/” (slash) splits the options, so you have to choose ether option1 OR option2

title

  • for each configuration, you have to create a section which starts with a text in brackets: [some text]
  • this will also be used as title of the output in the deployment-GUI
  • if you want to define an other text as the one in brackets, you can use the option title

[bracket text will be the title]
...
[some bracket text]
title = "this will be the title"
...

Deployment types

Detailed documentation about the different types including examples:



restarting nagios

We have implemented the possibility to set a command for restarting nagios.

Nevertheless you have to configure your system that its possible to do this.
That means you have to grant permissions for the webserver user(mostly apache) to execute your specified command like restarting nagios.

Most system administrators (you) should know how to configure that for their systems. We will show you a possible way here:

sudo

sudo allows a permitted user to execute a command as the superuser or another user.
So we could add the apache user to the sudoers list with the appropriate command.
Here we also set the NOPASSWD option

  • visudo (edit the sudoers file)
  • apache  ALL=NOPASSWD: /etc/rc.d/init.d/nagios reload

Now it is possible for the user apache to restart nagios right in the deployment.

Additional information

For security reason, you could also limit the access for apache (not using root):

Allow apache to run things as user “nagios”:

apache ALL = (nagios) NOPASSWD: /your/comand...

Then you can set the reload_command to something like this:

reload_command = "/usr/bin/sudo -u nagios /your/comand..."

Tip: If you have troubles, check if permissions are set correct for the /var/nagios/spool/checkresults.

permissions

you could also set permissions on the nagios binary which can restart it.

example:

  • give apache execute rights on /etc/rc.d/init.d/nagios




Configuration examples

Here we show you some configurations which could be useful for you.

deploy extracted config files to different server

first extract files to local existing directory:

[local deploy extract]
type        = local
source_file = "/var/www/nconf/output/NagiosConfig.tgz"
target_file = "/tmp/nagios_config/"
action      = extract

now copy all these files with scp to other server

[scp dummy-host]
type        = scp
host        = "dummy-host"
source_file = "/tmp/nagios_config/"
target_file = "~"
user        = dummy-user
identity_file = "id_dsa"
ssh_options   = " -o 'StrictHostKeyChecking no' -o 'ConnectTimeout 15'"

Now the files should be copied to your server.

for developers

If you want to make other deployment modules, contact us. You could also just try it out with an existing one.

the HTTPS module, seems to be the easiest to look how the basic structure looks like

Send us your deployment module if you want to share it with other peoples!

nconf/help/documentation/modules/deployment/main.txt · Last modified: 09.12.2011 01:48 (external edit)