RHEL安裝nagios
RHEL安裝nagios具體步驟如下:
nagios是Linux下強(qiáng)大的主機(jī)監(jiān)控軟件,現(xiàn)在我們就來見識下.本次系統(tǒng)為RHEL5.4,nagios版本號為3.21.廢話不多說,馬上行動.
1.需要apache、php、gd等環(huán)境支持
yum install httpd gcc glibc glibc-common gd gd-devel php -y
2.Create Account Information(創(chuàng)建用戶信息)
#useradd -m nagios
#groupadd nagcmd
#usermod -a -G nagcmd nagios
#usermod -a -G nagcmd apache
3.Download Nagios and the Plugins(這些都是當(dāng)前***版本了)
#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(修改下參數(shù))
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,那么你可能需要修改相關(guān)安全上下文)
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的全過程!
【編輯推薦】