taoCMS是基于php+sqlite/mysql的国内最小(100Kb左右)的功能完善的CMS管理系统

centos安装nagiosql

2012-08-22

先卸载mysql

先rpm -qa | grep mysql

查看所有与 mysql相关联的依赖

然后使用 yum remove XXXXX相应的依赖

再安装mysql,设置用户密码

然后按照这个教程来:

Requirements

  •   Webserver e.g. Apache 1.x or above
  •   PHP 4.3 or above
  •   MySQL 4.1 or above
  •   Nagios 2 or above
  •   PEAR Module: HTML_Template_IT 1.1 or above
  •   PHP Extension: gettext
  •   PHP Extension: mysql
  •   PHP Extension: ftp
  •   Javascript enabled at your Webbrowser

Installation

HTML_Template_IT

Pear modules can be installed automatically by invoking the following command (requires Internet access):

# pear install HTML_Template_IT 

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:

cfg_file=/etc/nagiosql/contacttemplates.cfg
cfg_file=/etc/nagiosql/contactgroups.cfg
cfg_file=/etc/nagiosql/contacts.cfg
cfg_file=/etc/nagiosql/timeperiods.cfg
cfg_file=/etc/nagiosql/commands.cfg
cfg_file=/etc/nagiosql/hostgroups.cfg
cfg_file=/etc/nagiosql/servicegroups.cfg

cfg_dir=/etc/nagiosql/hosts
cfg_dir=/etc/nagiosql/services
And optional:
cfg_file=/etc/nagiosql/hosttemplates.cfg
cfg_file=/etc/nagiosql/servicetemplates.cfg
cfg_file=/etc/nagiosql/servicedependencies.cfg
cfg_file=/etc/nagiosql/serviceescalations.cfg
cfg_file=/etc/nagiosql/hostdependencies.cfg
cfg_file=/etc/nagiosql/hostescalations.cfg
cfg_file=/etc/nagiosql/hostextinfo.cfg
cfg_file=/etc/nagiosql/serviceextinfo.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

If these directories already have files, amend the permissions for them, too:

# 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/index.php
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.


类别:技术文章 | 阅读:138146 | 评论:28 | 标签:nagios

想收藏或者和大家分享这篇好文章→

“centos安装nagiosql”共有0条留言

发表评论

姓名:

邮箱:

网址:

验证码:

公告

taoCMS发布taoCMS2.5Beta5(最后更新14年05月25日),请大家速速升级,欢迎大家试用和提出您宝贵的意见建议。

捐助与联系

☟请使用新浪微博联系我☟

☟在github上follow我☟

标签云

友情链接