RHEL安装nagios具体步骤如下:
nagios是Linux下强大的主机监控软件,现在我们就来见识下.本次系统为RHEL5.4,nagios版本号为3.21.废话不多说,马上行动.
1.需要apache、php、gd等环境支持
yum install httpd gcc glibc glibc-common gd gd-devel php -y
2.Create Account Information(创建用户信息)
#useradd -m nagios
#groupadd nagcmd
#usermod -a -G nagcmd nagios
#usermod -a -G nagcmd apache
3.Download Nagios and the Plugins(这些都是当前***版本了)
#wget http://cdnetworks-kr-2.dl.sourceforge.net/project/nagios/nagios-3.x/nagios-3.2.1/nagios-3.2.1.tar.gz
#wget http://cdnetworks-kr-2.dl.sourceforge.net/project/nagiosplug/nagiosplug/1.4.14/nagios-plugins-1.4.14.tar.gz
4. Compile and Install Nagios(编译安装nagios,带*的行故意贴上来,可以让你了解源码安装的原理)
#tar xzf nagios-3.2.1.tar.gz
**Run the Nagios configure script, passing the name of the group you created earlier like so:
#./configure --with-command-group=nagcmd
**Compile the Nagios source code.
#make all
**Install binaries, init script, sample config files and set permissions on the external command directory.
#make install
#make install-init
#make install-config
#make install-commandmode
5.Customize Configuration(修改下参数)
vi /usr/local/nagios/etc/objects/contacts.cfg
比如你可以修改这个文件中的email地址的接受者.
#p#
6.Configure the Web Interface (配置下Web接口)
#make install-webconf
#htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin (nagios web后台用户名和密码就在这里生成)
#service httpd restart
7.Compile and Install the Nagios Plugins (没有插件的nagios似乎没有什么用,怎么感觉和WordPress很相似呀)
#tar xzf nagios-plugins-1.4.14.tar.gz
#./configure --with-nagios-user=nagios --with-nagios-group=nagios
#make
#make install
8.Start Nagios
#chkconfig --add nagios
#chkconfig nagios on
#/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg (仅仅是个测试)
#service nagios start
9.Modify SELinux Settings (如果你开启了selinux,那么你可能需要修改相关安全上下文)
chcon -R -t httpd_sys_content_t /usr/local/nagios/sbin/
chcon -R -t httpd_sys_content_t /usr/local/nagios/share/
10.Login to the Web Interface
http://localhost/nagios/
通过文章的介绍,我们清楚的知道了RHEL安装nagios的全过程!
【编辑推荐】