一、安裝nagios前的準(zhǔn)備工作
1.解決安裝Nagios的依賴關(guān)系:Nagios基本組件的運(yùn)行依賴于httpd、gcc和gd
2. 所需要安裝組件:
服務(wù)端所用的安裝包為 nagios nagios-plugins
linux客戶端 nrpe
windows客戶端 NSClient++
二.下載需求軟件
nagios主程序:wget http://prdownloads.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.13.tar.gz
nagios插件程序:wget http://down1.chinaunix.net/distfiles/nagios-plugins-1.4.13.tar.gz
apache程序:wget http://autosetup1.googlecode.com/files/httpd-2.2.11.tar.gz
php程序:wget http://museum.php.net/php5/php-5.3.0.tar.gz
三.編譯安裝nagios
1.tar zxf nagios-3.1.2.tar.gz
[root@localhost nagios-3.1.2]# cd nagios-3.1.2
[root@localhost nagios-3.1.2]#./configure --enable-event-broker--prefix=/usr/local/nagios
[root@localhost nagios-3.1.2]#make all
[root@localhost nagios-3.1.2]#make install
[root@localhost nagios-3.1.2]#make install-init
[root@localhost nagios-3.1.2]#make install-config
[root@localhost nagios-3.1.2]#make install-commandmode
在httpd的配置文件目錄(conf.d)中創(chuàng)建Nagios的Web程序配置文件:
[root@localhost nagios-3.1.2]# make install-webconf
創(chuàng)建一個(gè)登錄nagiosweb程序的用戶,這個(gè)用戶帳號在以后通過web登錄nagios認(rèn)證時(shí)所用:
# htpasswd -c/var/www/nagios/etc/htpasswd.users nagiosadmin
2.編譯安裝nagios-plugins
nagios的所有監(jiān)控工作都是通過插件完成的,因此,在啟動nagios之前還需要為其安裝官方提供的插件。
tar zxf nagios-plugins-1.4.13.tar.gz
[root@localhost nagios-plugins-1.4.13]#cd nagios-plugins-1.4.13
[root@localhost nagios-plugins-1.4.13]#./configure --with-nagios-user=nagios --with-[root@localhost nagios-plugins-1.4.13]#nagios-group=nagios -with-mysql
[root@localhost nagios-plugins-1.4.13]#make
[root@localhost nagios-plugins-1.4.13]#make install
4.配置并啟動Nagios
/etc/init.d/nagios start
注:如果啟動時(shí)會報(bào)錯(cuò)
Error: Cannot open main configuration file '/root/nagios-plugins-1.4.13/start' for reading!
Nagios 3.1.2 starting... (PID=14327)
Local time is Fri Feb 28 02:52:22 CST 2014
Bailing out due to one or more errors encountered in the configuration files. Run Nagios from the command line with the -v option to verify your config before restarting. (PID=14327)
使用: /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg檢查配置文件沒有發(fā)現(xiàn)錯(cuò)誤
可使用:/usr/local/nagios/bin/nagios -d /usr/local/nagios/etc/nagios.cfg 嘗試啟動
啟動成功之后 可以使用top命令查看是否有nagios進(jìn)程(有nagios進(jìn)程說明啟動成功)
注: service nagios restart 啟動時(shí)再次失敗
Running configuration check...done.
Stopping nagios: done.
Starting nagios:su: warning: cannot change directory to /home/nagios: No such file or directory
This account is currently not available.
done.
可以使用: mkdir /home/nagios 解決
service nagios restart 如果啟動時(shí)仍然失敗 但錯(cuò)誤提示是:
Running configuration check...done.
Stopping nagios: done.
Starting nagios:This account is currently not available.
done.
可以在:vi /etc/passwd
找到此行:nagios:x:500:500::/home/nagios:/sbin/nologin(注意紅色字體),把此行改成如下一行
nagios:x:500:500::/home/nagios:/bin/bash
修改后再次重啟 ,啟動成功
[root@localhost nagios-3.1.2]# service nagios restart
Running configuration check...done.
Stopping nagios: done.
Starting nagios: done.
另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時(shí)售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務(wù)可用性高、性價(jià)比高”等特點(diǎn)與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場景需求。
網(wǎng)頁題目:安裝配置nagios-創(chuàng)新互聯(lián)
標(biāo)題路徑:http://chinadenli.net/article44/dojgee.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站導(dǎo)航、網(wǎng)頁設(shè)計(jì)公司、Google、關(guān)鍵詞優(yōu)化、移動網(wǎng)站建設(shè)、手機(jī)網(wǎng)站建設(shè)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容