Nagios_快速配置
Nagios 快速配置
1 所需软件包:
Apache
GCC compiler
GD development libraries
yum install httpd php
yum install gcc glibc glibc-common
yum install gd gd-devel
/usr/sbin/useradd -m nagios
passwd nagios
/usr/sbin/groupadd nagcmd
/usr/sbin/usermod -a -G nagcmd nagios
/usr/sbin/usermod -a -G nagcmd apache
wget http://ncu.dl.sourceforge.net/project/nagios/nagios-3.x/nagios-3.5.1/nagios-3.5.1.tar.gz
wget http://nagios-plugins.org/download/nagios-plugins-2.0.tar.gz
tar xvf nagios-3.5.1.tar.gz
cd nagios
./configure --with-command-group=nagcmd
make all
make install
make install-init
make install-config
make install-commandmode
vim/usr/local/nagios/etc/objects/contacts.cfg
#安装Nagio web 配置文件到Apacheconf.d 目录
make install-webconf
#创建用于登录的nagiosadmin账户
htpasswd -c/usr/local/nagios/etc/htpasswd.users nagiosadmin
#重启Apache使服务生效
service httpd restart
#解压
tar xvf nagios-plugins-2.0.tar.gz
cd nagios-plugins-2.0
#配置
./configure --with-nagios-user=nagios--with-nagios-group=nagios
make && make install
#添加到开机启动项
chkconfig --add nagios
#设置开机自启动
chkconfig nagios on
#检测配置文件的语法
/usr/local/nagios/bin/nagios -v/usr/local/nagios/etc/nagios.cfg
#启动
service nagios start
#在浏览器中输入
http://localhost/nagios
#由于所用服务器没有图形界面,所以在Ubuntu查看时输入
A.关闭SELinux
B.设置好防火墙规则
本文出自 “不作恶” 博客,请务必保留此出处http://vflong.blog.51cto.com/8622347/1378420
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。