请稍候...
  • 企业级 VPS主机
  • Windows VPS 主机
  • Unmanaged VPS 主机
  • 通配符证书,部署全网SSL证书必备神器
  • 高速稳定独立主机High quality stable server

NagiosQL 3.2 官方技术文档

发布时间:2012-03-28 10:46:31 来源: NagiosQL 3.2

NagiosQL Documentation

  1. Requirements
  2. Updates
  3. New Installation
    1. Locales
    2. NagiosQL
      1. Download and extract
  4. Configuration
    1. Directory Structure
    2. Nagios
    3. Permissions
  5. Verify Installation and Configuration
  6. Running NagiosQL
    1. Configure Nagios Environment within NagiosQL

Requirements

Updates

Note: Upgrades from NagiosQL 1.x and 2.x are not possible, you should better start at "New Installation" and after the installation is done, import Nagios configuration files with NagiosQL.

To upgrade from NagiosQL 3.x, please follow the steps below:

  1. Backup your existing database!
  2. Download and extract NagiosQL 3.2 to a NEW directory within your Apache Document Root (don't replace your old files!).
  3. Move your old config/settings.php file to the newly installed NagiosQL config/ folder
  4. Start the Installation Wizard by opening install/index.php
  5. Switch to your preferred language (see Appendix) and follow the instructions

Important information: If you just moved the new version to the same directory as the old version, please always restart your webserver to make sure sessions are really cleared.

New Installation

Locales

The NagiosQL translation depends on gnu-gettext and this framework depends on your locale system settings. Make sure you have the appropriate locale installed on your system (e.g. en-GB.utf-8). Please verify that by executing "locale -a".

NagiosQL

Download and extract

Download the latest NagiosQL Version from www.nagiosql.org and extract the nagiosql-*.tar.gz to a directory accessible by your webserver (e.g. /srv/www/htdocs). A subdirectory "nagiosql" will be created:

cd /srv/www/htdocs/
cp nagiosql-*.tar.gz /srv/www/htdocs/
tar zxvf nagiosql-*.tar.gz

Configuration

Directory Structure

It is recommend to have the following directory structure (you can change the directory names in your NagiosQL Domain Configuration):

/etc/nagiosql/ 			                -> Common configuration files
   	"            /hosts			-> Host configuration files
	"            /services			-> Service configuration files
	"            /backup/			-> Backups of the common configuration files
	"	        "      /hosts		-> Backups of the host configuration files
	"	        "      /services	-> Backups of the service configuration files

Nagios

In order to find the configuration files generated by NagiosQL your Nagios configuration must be amended, too. You are free to change the directory names, but be sure to do that in both configuration files (Nagios: nagios.cfg, NagiosQL: Domain Administration). The directory structure (e.g. backup directories below main directories) should never be changed!

The Nagios configuration file nagios.cfg should be amended to follow the above recommendation. To get it working, replace all existing cfg_dir and cfg_file definitions in your nagios.cfg by:

## Timeperiods
cfg_file=/etc/nagiosql/timeperiods.cfg
## Commands
cfg_file=/etc/nagiosql/commands.cfg
## Contacts
cfg_file=/etc/nagiosql/contacts.cfg
cfg_file=/etc/nagiosql/contactgroups.cfg
cfg_file=/etc/nagiosql/contacttemplates.cfg
## Hosts
cfg_dir=/etc/nagiosql/hosts
cfg_file=/etc/nagiosql/hosttemplates.cfg
cfg_file=/etc/nagiosql/hostgroups.cfg
cfg_file=/etc/nagiosql/hostextinfo.cfg
cfg_file=/etc/nagiosql/hostescalations.cfg
cfg_file=/etc/nagiosql/hostdependencies.cfg
## Services
cfg_dir=/etc/nagiosql/services
cfg_file=/etc/nagiosql/servicetemplates.cfg
cfg_file=/etc/nagiosql/servicegroups.cfg
cfg_file=/etc/nagiosql/serviceextinfo.cfg
cfg_file=/etc/nagiosql/serviceescalations.cfg
cfg_file=/etc/nagiosql/servicedependencies.cfg

Permissions

The following file permissions are required to let NagiosQL read and write the Nagios configuration files. In our example the Apache runs as user "www-data" and the group "www-data" as well as Nagios runs by the user "nagios" and the group "nagios". Instead of the below configuration, you could also add the Apache user to the Nagios group. The configuration files are located at /etc/nagiosql. Please amend if this differs from your installation.

## Nagios Main Configuration Files
chgrp www-data /etc/nagios
chgrp www-data /etc/nagios/nagios.cfg
chgrp www-data /etc/nagios/cgi.cfg
chmod 775 /etc/nagios
chmod 664 /etc/nagios/nagios.cfg
chmod 664 /etc/nagios/cgi.cfg

## NagiosQL Configuration
chmod 6755 /etc/nagiosql
chown www-data.nagios /etc/nagiosql
chmod 6755 /etc/nagiosql/hosts
chown www-data.nagios /etc/nagiosql/hosts
chmod 6755 /etc/nagiosql/services
chown www-data.nagios /etc/nagiosql/services   

## NagiosQL Backup Configuration 
chmod 6755 /etc/nagiosql/backup
chown www-data.nagios /etc/nagiosql/backup
chmod 6755 /etc/nagiosql/backup/hosts
chown www-data.nagios /etc/nagiosql/backup/hosts
chmod 6755 /etc/nagiosql/backup/services
chown www-data.nagios /etc/nagiosql/backup/services

## Amend already existing files
chmod 644 /etc/nagiosql/*.cfg
chown www-data.nagios /etc/nagiosql/*.cfg
chmod 644 /etc/nagiosql/hosts/*.cfg
chown www-data.nagios /etc/nagiosql/hosts/*.cfg   
chmod 644 /etc/nagiosql/services/*.cfg
chown www-data.nagios /etc/nagiosql/services/*.cfg

## The Nagios binary must be executable by the Apache user:
chown nagios.www-data /usr/sbin/nagios
chmod 750 /usr/sbin/nagios

Be sure the Apache user is able to write the Nagios commandfile. Please check your nagios.cfg for the correct path to the commandfile!

chown nagios.www.data /usr/local/nagios/var/rw/nagios.cmd
chmod 660 /usr/local/nagios/var/rw/nagios.cmd

Verify Installation and Configuration

Please execute as the webserver user "nagios -v /etc/nagios/nagios.cfg" and check for additional permissions.

Running NagiosQL

Now you should be able start NagiosQL: http://www.domain.tld/nagiosql/
The Installation Wizard will help you installing NagiosQL.

Configure Nagios Environment within NagiosQL

After the Installation Wizard succeeded, you should configure your Nagios Environment for NagiosQL. Please login to your fresh installation and navigate to "Administration" => "Domains". Setup your Nagios Environment and if you need help, try the integrated help system first.

上一页1下一页
【责任编辑:亚狐科技 (Top) 返回页面顶端