centos下安装nagios

摘要Nagios是一款开源的免费网络监视工具,能有效监控Windows、Linux和Unix的主机状态,交换机路由器等网络设置,打印机等。

Nagios是一款开源的免费网络监视工具,能有效监控Windows、Linux和Unix的主机状态,交换机路由器等网络设置,打印机等。

 

Nagios官方文档提供了详细的安装步骤,只要按照步骤一步一步安装还是非常容易的:

 

1、关闭linux内核防火墙

 

setenforce 0


 

2、安装依赖包

 

yum install httpd php php-cli gcc glibc glibc-common gd gd-devel net-snmp openssl-devel wget unzip  -y

4、创建linux用户

 

 

useradd nagios
groupadd nagcmd
usermod -a -G nagcmd nagios
usermod -a -G nagcmd apache


 

5、下载nagios core

 

cd /tmp
wget https://assets.nagios.com/downloads/nagioscore/releases/nagios-4.1.1.tar.gz
wget http://www.nagios-plugins.org/download/nagios-plugins-2.1.1.tar.gz


 

7、解压nagios core

 

tar zxf nagios-4.1.1.tar.gz
tar zxf nagios-plugins-2.1.1.tar.gz
cd nagios-4.1.1


 

8、编译安装nagios core

 

./configure --with-command-group=nagcmd
make all
make install
make install-init
make install-config
make install-commandmode
make install-webconf


 

9、创建web用户

 

htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin

10、安装nagios-plugin

 

 

cd /tmp/nagios-plugins-2.1.1
./configure --with-nagios-user=nagios --with-nagios-group=nagios --with-openssl
make all
make install


 

11、启动httpd

 

service httpd start

 

 

systemctl start httpd


 

12、启动nagios

 

service nagios start

 

 

systemctl start nagios

 


12、设置防火墙

 

 

firewall-cmd --zone=public --add-port=80/tcp --permanent
firewall-cmd --reload

13、浏览器访问,输入用户名nagiosadmin和刚才输入的密码

 

b5fe695c303333b8d6a1f0e8f6060d557ad6f26d

 

14、安装成功

posted on 2016-03-25 10:54  子墨'  阅读(242)  评论(0编辑  收藏  举报

导航