nagios的搭建及配置----(上)
首先说下自己的搭建环境。RedHat6.4系统 nagios-4.0.7。关闭selinux和iptables服务1,准备工作,安装好nagios所需要的软件
Apache
PHP
GCC compiler
GD development libraries
yum install httpd php gcc glibc glibc-commongd gd-devel
2,创建nagios使用的账号和组,首先要切换成管理员账号
useradd -m nagios
echo nagios |passwd --stdin nagios
# groupadd nagcmd
# usermod -aG nagcmd nagios
# usermod -aG nagcmd apache
3,下载nagios和nagio-plugin
#wget http://prdownloads.sourceforge.n ... nagios-3.2.3.tar.gz
#wget http://prdownloads.sourceforge.n ... ugins-1.4.11.tar.gz
4,编译安装(Install binaries, init script, sample config files and set permissions on the external command directory.)
#./configure --with-command-group=nagcmd
#make all
#make install
#make install-init
#make install-config
#make install-commandmodes
#make install-commandmode
5,自定义配置文件
#vim /usr/local/nagios/etc/objects/contacts.cfg
配置管理员的邮箱地址,当监控到有问题时会发送邮件到管理员邮箱
6,配置web界面管理接口,并创建登陆到nagios管理界面的账号密码,然后重启Apache服务,使配置文件生效
#make install-webconf
#htpasswd -c /usr/local/nagios/etc/htpasswd.usersnagiosadmin
//htpasswd.users的文件名称一定要写正确
#service httpd restart
7,编译安装nagios-plugin
#tar -zxvf nagios-plugins-2.0.3.tar.gz -C /usr/src/
#cd /usr/src/nagios-plugins-2.0.3/
#ls
#./configure --with-nagios-user=nagios --with-nagios-group=nagios
#make
#make install
#cd
#chkconfig --add nagios
#chkconfig nagios on
#service nagios start
#service nagios restart
#/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
//检查配置文件是否有错误或者警告,如果没有的话启动nagios服务
#service nagios start
7,现在我们就可以测试nagios监控本机localhost的情况了,登陆 server ip/nagios
进去之后会让你输入方才htpasswd创建的用户名和密码(蓝色边框)
我擦,图片怎么上传不了呀?上传不了图片就算了。
页:
[1]