Think before you speak, read before you think.

CentOS6.4安装nagios

by

in

参考:http://www.howtoforge.com/installing-nagios-3.4.4-on-centos-6.3

Nagios是基于GPL协议的监控工具,可以监控服务器,网络,路由器,交换机以及其他应用。健壮的社区使nagios有N多的插件可以用。接下来是完整的在干净的系统上安装nagios.

准备工作:

首先需要禁用selinux,编辑/etc/selinux/config,将SELINUX禁用,否则nagios的cgi程序无法运行

SELINUX=disabled

重启服务器

接下来安装一些编译环境和信赖包

yum groupinstall 'Development Tools'
yum install openssl-devel
yum install gd gd-devel httpd php gcc glibc glibc-common

接下来安装nagios

创建目录并进入

mkdir /root/nagios
cd /root/nagios

下载nagios-core & plugin:

wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-3.4.4.tar.gz
 wget http://prdownloads.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.16.tar.gz

解压安装nagios-core:

tar xvzf nagios-3.4.4.tar.gz
cd nagios
./configure

Make all 所需要的文件并安装:

make all
make install
make install-init
make install-commandmode
make install-config
make install-webconf

创建用户nagiosadmin

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

启动服务并设置开机启动:

chkconfig nagios on
 service nagios start

接下来安装插件:

cd ..
 tar xvzf nagios-plugins-1.4.15.tar.gz
 cd nagios-plugins-1.4.15
 ./configure
 make
 make install

启动apache并设置开机启动:

service httpd start
chkconfig httpd on

接下来可以打开浏览器连接nagios,用之前创建的nagiosadmin来登陆

http://Your-Nagios-IP/nagios

安装完成之后需要在nagios配置文件中设置需要监控的服务器和服务,这里的操作复杂且需要在命令行下操作。接下来可以安装前端工具Centreon完成添加和管理。


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *