您好,登錄后才能下訂單哦!
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
設置登陸web界面時HTTP驗證的賬號密碼
[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、其他設置
檢查nagios的配置:
[root@nagios ~]# /usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
添加自動動項:
[root@nagios ~]# chkconfig --add nagios [root@nagios ~]# chkconfig nagios on [root@nagios ~]# service nagios start
登陸頁面:
http://localhost/nagios
賬號nagiosadmin密碼123456
5、遇到的問題
點擊頁面左側的MAP和History報錯:
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.
原因一:因為gd-devel php-gd沒有安裝的問題,造成NAGIOS在編譯時不生成這statusmap.cgi
原因二:nagios編譯在前, gd-devel安裝在后,造成不生成這statusmap.cgi
解決方法:yum安裝gd-devel php-gd,再重新編譯安裝nagios
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。