您好,登錄后才能下訂單哦!
1、添加用戶
[root@nagios ~]# groupadd nagcmd [root@nagios ~]# useradd -G nagcmd nagios [root@nagios ~]# usermod -a -G nagcmd apache
2、安裝nagios
官方下載地址:http://www.nagios.org/download/
[root@nagios ~]# cd /home/nagios [root@nagios nagios]# wget http://jaist.dl.sourceforge.net/project/nagios/nagios-4.x/nagios-4.0.7/nagios-4.0.7.tar.gz [root@nagios nagios]# tar xzvf nagios-4.0.7.tar.gz [root@nagios nagios]# cd nagios-4.0.7 [root@nagios nagios-4.0.7]# ./configure --with-command-group=nagcmd --enable-event-broker [root@nagios nagios-4.0.7]#make all [root@nagios nagios-4.0.7]#make install [root@nagios nagios-4.0.7]#make install-init [root@nagios nagios-4.0.7]#make install-config [root@nagios nagios-4.0.7]#make install-commandmode [root@nagios nagios-4.0.7]#make install-webconf
設(shè)置登陸web界面時(shí)HTTP驗(yàn)證的賬號(hào)密碼
[root@nagios nagios-4.0.7]#htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin [root@nagios nagios-4.0.7]#service httpd restart
3、安裝nagios-plugins
[root@nagios nagios-4.0.7]#cd /home/nagios [root@nagios nagios]# wget http://nagios-plugins.org/download/nagios-plugins-2.0.2.tar.gz [root@nagios nagios]# tar xzvf nagios-plugins-2.0.2.tar.gz [root@nagios nagios]# cd nagios-plugins-2.0.2 [root@nagios nagios-plugins-2.0.2]# ./configure --with-nagios-user=nagios --with-nagios-group=nagios --with-mysql [root@nagios nagios-plugins-2.0.2]# make [root@nagios nagios-plugins-2.0.2]# make install
所有插件命令將被安裝到/usr/local/nagios/libexec 目錄下
4、其他設(shè)置
檢查nagios的配置:
[root@nagios ~]# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
添加自動(dòng)動(dòng)項(xiàng):
[root@nagios ~]# chkconfig --add nagios [root@nagios ~]# chkconfig nagios on [root@nagios ~]# service nagios start
登陸頁(yè)面:
http://localhost/nagios
賬號(hào)nagiosadmin密碼123456
5、遇到的問(wèn)題
點(diǎn)擊頁(yè)面左側(cè)的MAP和History報(bào)錯(cuò):
The requested URL /nagios/sbin/statusmap.cgi was not found on this server. The requested URL /nagios/sbin/histogram.cgi was not found on this server.
原因一:因?yàn)間d-devel php-gd沒(méi)有安裝的問(wèn)題,造成NAGIOS在編譯時(shí)不生成這statusmap.cgi
原因二:nagios編譯在前, gd-devel安裝在后,造成不生成這statusmap.cgi
解決方法:yum安裝gd-devel php-gd,再重新編譯安裝nagios
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。