資源描述:
《centos5.5下安裝nagios詳細安裝介紹》由會員上傳分享,免費在線閱讀,更多相關內(nèi)容在工程資料-天天文庫。
1、為了穩(wěn)定起見,用的比較成熟的老版本程序,主程序:nagios3.0.6yum?-y?install?httpd?gcc?glibc?glibc-common?gd?gd-develyum-yinstallopenssl-devel(不做這步,安裝nrpe會出現(xiàn)checkingforSSLheaders...configure:error:Cannotfindsslheaders錯誤)先安裝好hhtpdgccgd庫等依賴程序。以下操作均在nagios主程序所在機器進行。安裝前準備:1.新建nagios用戶及用戶組useraddnagiospas
2、swordnagios(設置密碼)2.修改安裝文件夾權限chownnagios.nagios/usr/local/nagios一、安裝nagios主程序tar-zxvfnagios-3.0.6.tar.gzcdnagios-3.0.6./configure–prefix=/usr/local/nagios–with-command-group=nagiosmakeallmakeinstallmakeinstall-initmakeinstall-configmakeinstall-commandmodels/usr/local/nagios(
3、查看是否有etc、bin、sbin、share、var、libexec這六個目錄,如果有,表示安裝成功)cd..二、安裝nagios-plugins插件1、tar-zxvfnagios-plugins-1.4.9.tar.gzcdnagios-plugins-1.4.9./configure--prefix=/usr/local/nagios--with-nagios-user-nagios--with-nagios-group=nagiosmakemakeinstallls/usr/local/nagios/libexec(會顯示很多插件)
4、2、將apache的運行用戶加到nagios組里面從httpd.conf中過濾出當前的apache運行用戶:grep^User/etc/httpd/conf/httpd.confUserapache(返回值)我的是apache,下面將這個用戶加入nagios組usermod-Gnagiosapache3、修改apache配置文件vi/etc/httpd/conf/httpd.confshift+g跳至文件最后,并加入如下內(nèi)容:#settingfornagios20090325#settingbybbs.linuxtone.orgScriptA
5、lias/nagios/cgi-bin/usr/local/nagios/sbinOptionsExecCGIAllowOverrideNoneOrderallow,denyAllowfromallAuthName"NagiosAccess"AuthTypeBasicAuthUserFile/usr/local/nagios/etc/htpasswdRequirevalid-userAlias/nagios/usr/local/nagios/shar
6、eOptionsNoneAllowOverrideNoneOrderallow,denyAllowfromallAuthName"NagiosAccess"AuthTypeBasicAuthUserFile/usr/local/nagios/etc/htpasswdRequirevalid-user保存后,/etc/init/httpdrestart重啟apache服務。4、增加web訪問賬號/usr/bin/htpasswd-c/usr/loca
7、l/nagios/etc/htpasswdmchNewpassword:(輸入monitorapp)Re-typenewpassword:(再輸入一次monitorapp)Addingpasswordforusermch查看訪問賬號文件的內(nèi)容:less/usr/local/nagios/etc/htpasswdmch:1fP3yU3wSwRH6前面是用戶名mch,后面是加密后的密碼ctrl+z退出5、修改cgi.cfg文件編輯cgi.cfg文件,將開始建立的用戶名mch添加到里面,允許該賬戶通過web登陸(如果有多個登陸賬號,在后面用,號隔開
8、)。vi/usr/local/nagios/etc/cgi.cfgauthorized_for_system_information=nagiosadmin,mch