加入收藏 | 设为首页 | 会员中心 | 我要投稿 应用网_丽江站长网 (http://www.0888zz.com/)- 科技、建站、数据工具、云上网络、机器学习!
当前位置: 首页 > 服务器 > 搭建环境 > Linux > 正文

Cacti+Nagios应用详解(二)整合cacti与nagios安装部署

发布时间:2016-05-19 08:39:53 所属栏目:Linux 来源:网络整理
导读:Nagios简介 Nagios是一个用来监视系统和网络的开源应用软件,它通常运行于一个主服务器上,这个服务器运行 Liunx 或 Unix 操作系统。Nagios 利用其众多的插件实

使用make install-commandmode来配置目录权限

make install-config

- This installs *SAMPLE* config files in /usr/local/nagios/etc

You'll have to modify these sample files before you can

use Nagios. Read the HTML documentation for more info

on doing this. Pay particular attention to the docs on

object configuration files, as they determine what/how

things get monitored!

使用make install-commandmode来安装示例配置文件,安装的路径是/usr/local/nagios/etc

make install-webconf

- This installs the Apache config file for the Nagios

web interface

使用make install-webconf来安装apache的配置文件

=================================================================

make install在安装这个动作之前要增加一个nagios用户,并修改它的权限,不然会出现以下错误:

=================================================================

cd ./base && make install

make[1]: Entering directory `/home/yahoon/nagios/nagios-2.9/base'

make install-basic

make[2]: Entering directory `/home/yahoon/nagios/nagios-2.9/base'

/usr/bin/install -c -m 775 -o nagios -g nagios -d /usr/local/nagios/bin

/usr/bin/install: invalid user `nagios' 非法用户nagios

make[2]: *** [install-basic] Error 1

make[2]: Leaving directory `/home/yahoon/nagios/nagios-2.9/base'

make[1]: *** [install] Error 2

make[1]: Leaving directory `/home/yahoon/nagios/nagios-2.9/base'

make: *** [install] Error 2

=====================================================================

[root@cacti-qmail nagios-3.2.1]# useradd nagios

[root@cacti-qmail nagios-3.2.1]#mkdir /usr/local/nagios

[root@cacti-qmail nagios-3.2.1]#chown nagios.nagios /usr/local/nagios

[root@cacti-qmail nagios-3.2.1]#make all

[root@cacti-qmail nagios-3.2.1]#make install; make install-init;make install-commandmode;make install-config;make install-webconf

验证程序是否被正确安装

切换目录到安装路径(这里是/usr/local/nagios),看是否存在 etc、bin、 sbin、 share、 var这五个目录,如果存在则可以表明程序被正确的安装到系统了。后表是五个目录功能的简要说明:

bin Nagios执行程序所在目录,nagios文件即为主程序

etc Nagios配置文件位置,初始安装完后,只有几个*.cfg-sample文件

sbin Nagios Cgi文件所在目录,也就是执行外部命令所需文件所在的目录

Share Nagios网页文件所在的目录

Var Nagios日志文件、spid 等文件所在的目录

修改nagios页面文件

[root@cacti-qmail nagios-3.2.1]# more /etc/httpd/conf/nagios.conf

# SAMPLE CONFIG SNIPPETS FOR APACHE WEB SERVER

# Last Modified: 11-26-2005

#

# This file contains examples of entries that need

# to be incorporated into your Apache web server

# configuration file. Customize the paths, etc. as

# needed to fit your system.

ScriptAlias /nagios/cgi-bin "/usr/local/nagios/sbin"

<Directory "/usr/local/nagios/sbin">

# SSLRequireSSL

Options ExecCGI

AllowOverride None

Order allow,deny

Allow from all

# Order deny,allow

# Deny from all

# Allow from 127.0.0.1

AuthName "Nagios Access"

AuthType Basic

AuthUserFile /usr/local/nagios/etc/htpasswd.users

Require valid-user

</Directory>

Alias /nagios "/usr/local/nagios/share"

<Directory "/usr/local/nagios/share">

# SSLRequireSSL

Options None

AllowOverride None

Order allow,deny

Allow from all

# Order deny,allow

# Deny from all

# Allow from 127.0.0.1

AuthName "Nagios Access"

AuthType Basic

AuthUserFile /usr/local/nagios/etc/htpasswd.users

Require valid-user

</Directory>

基本上这个文件可以直接使用,所以直接复制过去

[root@cacti-qmail nagios-3.2.1]# cp /etc/httpd/conf/nagios.conf  /var/www/html/

URL:http://www.bianceng.cn/OS/Linux/201410/46045.htm

(编辑:应用网_丽江站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

热点阅读