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