nagios部署

1、安装必要包:


yuminstall gd gd-devel openssl glibc-common httpd php gcc* net-snmp-*


tar vxf nagios-4.0.2.tar.gz

useradd -g wheel -G apache nagios

cd nagios-4.0.2

2、nagios安装

./configure --with-nagios-user=nagios--with-nagios-group=apache --with-command-user=nagios--with-command-group=apache --prefix=/usr/local/nagios

Echo $?

0

make all

make install

make install-init

make install-commandmode

make install-config

make install-webconf


3、nagios-plugins安装

tar zxf nagios-plugins-1.5.tar.gz

cd nagios-plugins-1.5

./configure--prefix=/usr/local/nagios --with-nagios-user=nagios --with-nagios-group=apache--enable-openssl --enable-perl-modules

Echo $?

0

make&& make install


4、将nagios添加到开机启动中

chkconfig --add nagios

chkconfig nagios on


5、检查安装是否有问题

/usr/local/nagios/bin/nagios-v /usr/local/nagios/etc/nagios.cfg

0代表没有问题。


6、启动nagios和apache

servicenagios start

servicehttpd start


7、检查nagios进程

ps -ef| grep nagios


8、设置nagios登陆密码

htpasswd -c /usr/local/nagios/etc/htpasswd.usersnagiosadmin


9、关闭selinux

Vi /etc/sysconfig/selinux



10、开放iptables 80 端口

Vi /etc/sysconfig/iptables

黏贴下述命令至倒数第三行:

-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp--dport 80 -j ACCEPT




11、重启计算机

Init6