您好,登錄后才能下訂單哦!
首先說下自己的搭建環境。RedHat6.4系統 nagios-4.0.7。關閉selinux和iptables服務
1,準備工作,安裝好nagios所需要的軟件
Apache
PHP
GCC compiler
GD development libraries
yum install httpd php gcc glibc glibc-common gd gd-devel
2,創建nagios使用的賬號和組,首先要切換成管理員賬號
[root@localhost ~]useradd -m nagios
[root@localhost ~]echo nagios |passwd --stdin nagios
[root@localhost ~]# groupadd nagcmd
[root@localhost ~]# usermod -aG nagcmd nagios
[root@localhost ~]# usermod -aG nagcmd apache
3,下載nagios和nagio-plugin
[root@localhost ~]#wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-3.2.3.tar.gz
[root@localhost ~]#wget http://prdownloads.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.11.tar.gz
4,編譯安裝(Install binaries, init script, sample config files and set permissions on the external command directory.)
[root@localhost ~]#./configure --with-command-group=nagcmd
[root@localhost ~]#make all
[root@localhost ~]#make install
[root@localhost ~]#make install-init
[root@localhost ~]#make install-config
[root@localhost ~]#make install-commandmodes
[root@localhost ~]#make install-commandmode
5,自定義配置文件
[root@localhost ~]#vim /usr/local/nagios/etc/objects/contacts.cfg
配置管理員的郵箱地址,當監控到有問題時會發送郵件到管理員郵箱 6,配置web界面管理接口,并創建登陸到nagios管理界面的賬號密碼,然后重啟Apache服務,使配置文件生效 [root@localhost ~]#make install-webconf [root@localhost ~]#htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin //htpasswd.users的文件名稱一定要寫正確 [root@localhost ~]#service httpd restart 7,編譯安裝nagios-plugin [root@localhost ~]#tar -zxvf nagios-plugins-2.0.3.tar.gz -C /usr/src/ [root@localhost ~]#cd /usr/src/nagios-plugins-2.0.3/ [root@localhost ~]#ls [root@localhost ~]#./configure --with-nagios-user=nagios --with-nagios-group=nagios [root@localhost ~]#make [root@localhost ~]#make install [root@localhost ~]#cd [root@localhost ~]#chkconfig --add nagios [root@localhost ~]#chkconfig nagios on [root@localhost ~]#service nagios start [root@localhost ~]#service nagios restart [root@localhost ~]#/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg //檢查配置文件是否有錯誤或者警告,如果沒有的話啟動nagios服務 [root@localhost ~]#service nagios start 7,現在我們就可以測試nagios監控本機localhost的情況了,登陸 server ip/nagios 進去之后會讓你輸入方才htpasswd創建的用戶名和密碼(藍色邊框) 我擦,圖片怎么上傳不了呀?上傳不了圖片就算了。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。