CentOS 6.5下安装Nagios 3.2

首先安装需要的环境基础,像apache、php、gd、gcc之类的

yum install httpd php gd gd-devel gcc* -y

安装需要的nagios和其插件

建立nagios用户和目录

useradd nagios

mkdir /usr/local/nagios

chown nagios.nagios /usr/local/nagios/

在下载的目录下进行进行一下命令

tar zxvf nagios-3.2.0.tar.gz

cd nagios-3.2.0

./configure –prefix=/usr/local/nagios/ –with-gd-lib=/usr/lib –with-gd-inc=/usr/include/

make all

make install

make install-init

make install-config

make install-commandmode

make install-config

 

tar zxvf nagios-plugins-2.0.3.tar.gz

 

cd nagios-plugins-2.0.3

./configure –prefix=/usr/local/nagios/

make

make install

建立nagios验证用户test

/usr/bin/htpasswd -c /usr/local/nagios/etc/htpasswd test

在apache的配置文件内加上nagios的内容

vi /etc/httpd/conf/httpd.conf

使用Shift+g的组合键到最后一行,单击o键,在下一列加如

#setting for nagios 20070707

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

<Directory “/usr/local/nagios/sbin”>

Options ExecCGI

AllowOverride None

Order allow,deny

Allow from all

AuthName “Nagios Access”

AuthType Basic

AuthUserFile /usr/local/nagios/etc/htpasswd

Require valid-user

</Directory>

Alias /nagios /usr/local/nagios/share

<Directory “/usr/local/nagios/share”>

Options None

AllowOverride None

Order allow,deny

Allow from all

AuthName “Nagios Access”

AuthType Basic

AuthUserFile /usr/local/nagios/etc/htpasswd

Require valid-user

</Directory>

修改完了重启服务

service httpd restart

chkconfig httpd on

打开游览器输入http://部署Nagios服务器的IP/nagios/

安装完成

 

成为第一个发表评论的人

发表评论

您的电子邮件地址不会被公开.


*