Centos系统下载大全 | Redhat系统下载大全 | Windows2012系统下载大全 | Windows2008系统下载大全| CMS教程 | 网站地图 51运维网-专注Linux/Unix系统安全运维!
当前位置:51运维网 > 监控 > Nagios > 正文

nagios 安装 三

时间:2014-08-26 21:45 来源:未知 作者:www.51ou.com 阅读:

1  yum 安装需要的软件包:

1
yum install -y httpd httpd-manual httpd-devel gd gd-devel perl-GD mysql-server mysql-devel php php-mysql php-gd php-pear perl-DBI perl-Digest-SHA1 perl-Digest-HMAC net-snmp-utils  perl-Socket6 perl-IO-Socket-INET6 net-snmp-devel php-snmp dmidecode net-snmp-perl  perl-Crypt-DES fping perl-Config-IniFiles graphviz gcc-c++ glib2-devel php-gd php-pdo php-ldap  php-mbstring php-xml lib

2 创建用户

1
2
3
4
5
[51ou.com]# useradd  nagios
[51ou.com]# passwd nagios
[51ou.com]# usermod -G nagios apache
[51ou.com]# mkdir /usr/local/nagios
[51ou.com]# chown -R nagios:nagios /usr/local/nagios

3  安装nagios-4.0.7.tar.gz

1
2
3
4
5
6
7
8
[51ou.com]#cd nagios-4.0.7
[51ou.com]#./configure --prefix=/usr/local/nagios --with-gd-lib=/usr/lib --with-gd-inc=/usr/include
[51ou.com]#make all
[51ou.com]#make install
[51ou.com]#make install-init
[51ou.com]#make install-commandmode
[51ou.com]#make install-config
[51ou.com]#make install-webconfig

4  安装nagios-plugins-2.0.3.tar.gz插件

1
2
3
4
[51ou.com]#cd  nagios-plugins-2.0.3
[51ou.com]# ./configure --prefix=/usr/local/nagios
[51ou.com]#make
[51ou.com]# make install

5 安装nrpe-2.15.tar.gz

1
2
3
4
5
6
7
[51ou.com]# tar zxvf nrpe-2.15.tar.gz
[51ou.com]#cd nrpe-2.15
[51ou.com]#./configure
[51ou.com]#make all
[51ou.com]#make install-plugin
[51ou.com]#chown nagios.nagios /usr/local/nagios
[51ou.com]#chown -R nagios.nagios /usr/local/nagios/libexec

6  配置apache(添加)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
[51ou.com]#setting for nagios
<Directory "/usr/local/nagios/sbin">
AuthType Basic
Options ExecCGI
AllowOverride None
Order allow,deny
Allow from all
AuthName "Nagios Access"
AuthUserFile /usr/local/nagios/etc/htpasswd
Require valid-user
</Directory>
 
<Directory "/usr/local/nagios/share">
AuthType Basic
Options None
AllowOverride None
Order allow,deny
Allow from all
AuthName "nagios Access"
AuthUserFile /usr/local/nagios/etc/htpasswd
Require valid-user
</Directory>

7  重启下apache

1
[51ou.com]# service httpd restart

8 添加认证文件

1
[51ou.com]#/usr/local/apache/bin/htpasswd -c /usr/local/nagios/etc/htpasswd admin

9   修改/usr/local/nagios/etc/cgi.cfg 赋权给admin用户

1
2
3
4
5
6
7
authorized_for_system_information=admin
authorized_for_configuration_information=admin
authorized_for_system_commands=admin
authorized_for_all_services=admin
authorized_for_all_hosts=admin
authorized_for_all_service_commands=admin
authorized_for_all_host_commands=admin

10 测试下nagios是否正常

1
[51ou.com]#/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg

正常情况会出现:

Total Warnings: 0
Total Errors: 0

 

11   启动nagios

1
2
3
4
[51ou.com]# service nagios restart
Running configuration check...
Stopping nagios: done.
Starting nagios: done.

12  访问 http://ip/nagios

 

感谢您对【51运维网 http://www.51ou.com/】的支持,我们为您免费提供《nagios 安装 三》技术文章,《nagios 安装 三》详细使用和说明,有时《nagios 安装 三》可能不完善、敬请谅解!如果《nagios 安装 三》有错误请给我们留言,我们将尽快修复文章错误,如果您觉得本站不错,请分享给周围的朋友!谢谢!

顶一下
(0)
0%
踩一下
(0)
0%
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
验证码:点击我更换图片