Cents下Nagios的安裝-Nagios主程序的安裝
Nagios主程序的安裝:
1.解壓縮Nagios主程序源代碼包
- [root@KCentOS5C ~]# tar -zxvf nagios-2.9.tar.gz
2.進(jìn)入Nagios主程序包的解壓目錄
- [root@KCentOS5C ~]# cd nagios-2.9
3.預(yù)配置Nagios主程序的環(huán)境以及指定安裝路徑
- [root@KCentOS5C nagios-2.9]# ./configure --prefix=/usr/local/nagios
預(yù)配置成功后將返回配置環(huán)境信息
----------------------------------------------------
- *** Configuration summary for nagios 2.9 04-10-2007 ***:
- General Options:
-------------------------
- Nagios executable: nagios
- Nagios user/group: nagios,nagios
- Command user/group: nagios,nagios
- Embedded Perl: no
- Event Broker: yes
- Install ${prefix}: /usr/local/nagios
- Lock file: ${prefix}/var/nagios.lock
- Init directory: /etc/rc.d/init.d
- Host OS: linux-gnu
- Web Interface Options:
------------------------
- HTML URL: http://localhost/nagios/
- CGI URL: http://localhost/nagios/cgi-bin/
- Traceroute (used by WAP): /bin/traceroute
- Review the options above for accuracy. If they look okay,
- type 'make all' to compile the main program and CGIs.
請注意看最后的提示,如果對以上反饋信息接受的話,則需要繼續(xù)執(zhí)行“make all”命令來編譯主程序以及CGI。
-----------------------------------------------------
4.編譯Nagios主程序
- [root@KCentOS5C nagios-2.9]# make all
Nagios主程序編譯成功后OK
如果在編譯當(dāng)中沒有發(fā)生錯誤的話,那么可以照以下這些命令繼續(xù)操作。
- make install
- - This installs the main program, CGIs, and HTML files
執(zhí)行“make install”命令來對主程序,CGI以及HTML網(wǎng)頁進(jìn)行安裝。
- make install-init
- - This installs the init script in /etc/rc.d/init.d
執(zhí)行“install-init”命令來在/etc/rc.d/init.d/目錄中安裝啟動腳本。
- make install-commandmode
- - This installs and configures permissions on the
- directory for holding the external command file
執(zhí)行“install-commandmode”命令來安裝和配置外部命令對Nagios主路徑操作的權(quán)限。(這里所謂的外部命令主要是指Apache服務(wù)通過CGI來對Nagios的進(jìn)行的操作。用戶將通過Web以執(zhí)行CGI程序腳本的方式來對Nagios的檢測結(jié)果進(jìn)行讀取和調(diào)用。)
- make install-config
- - This installs *SAMPLE* config files in /usr/local/nagios/etc
- You'll have to modify these sample files before you can
- use Nagios. Read the HTML documentation for more info
- on doing this. Pay particular attention to the docs on
- object configuration files, as they determine what/how
- things get monitored!
執(zhí)行“make install-config”命令將會在/usr/local/etc/這個Nagios編譯安裝的主配置路徑下安裝示例配置模板,這將對于之后的配置制定幫助很大。
-----------------------------------------------------
5.安裝Nagios主程序、CGI以及網(wǎng)頁
- [root@KCentOS5C nagios-2.9]# make install
安裝完Nagios主程序、CGI和網(wǎng)頁的之后將提示安裝成功信息以及剩余可操作的步驟
-----------------------------------------------------
6.安裝Nagios的系統(tǒng)啟動腳本
- [root@KCentOS5C nagios-2.9]# make install-init
安裝完Nagios的系統(tǒng)啟動腳本之后將提示腳本安裝成功信息以及剩余可操作的步驟
-----------------------------------------------------
7.將Nagios的啟動腳本添加到系統(tǒng)服務(wù)當(dāng)中去
- [root@KCentOS5C ~]# chkconfig --add nagios
8.將Nagios服務(wù)加入到系統(tǒng)啟動服務(wù)當(dāng)中去
- [root@KCentOS5C ~]# chkconfig nagios on
9.安裝和配置外部命令對Nagios主路徑的操作權(quán)限
- [root@KCentOS5C nagios-2.9]# make install-commandmode
安裝配置外操作權(quán)限后將提示配置成功信息以及剩余可操作步驟
-----------------------------------------------------
10.將Apache服務(wù)宿主用戶加到nagios組里面
這樣做是為了讓Apache有適當(dāng)?shù)臋?quán)限能夠通過CGI腳本程序?qū)agios進(jìn)行調(diào)用,否則Apache將沒有權(quán)限調(diào)用Nagios,用戶通過Web將無法訪問Nagios處理的所有信息。
- [root@KCentOS5C nagios-2.9]# usermod -G nagios apache
11.安裝Nagios的配置模板
- [root@KCentOS5C nagios-2.9]# make install-config
安裝完畢Nagios主程序的配置模板后將反饋安裝成功的提示信息。
上一節(jié):Apache服務(wù)的安裝 下一節(jié):plugins插件程序
【編輯推薦】