首先說下自己的搭建環(huán)境。RedHat6.4系統(tǒng) 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,創(chuàng)建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
配置管理員的郵箱地址,當監(jiān)控到有問題時會發(fā)送郵件到管理員郵箱 6,配置web界面管理接口,并創(chuàng)建登陸到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,現(xiàn)在我們就可以測試nagios監(jiān)控本機localhost的情況了,登陸 server ip/nagios 進去之后會讓你輸入方才htpasswd創(chuàng)建的用戶名和密碼(藍色邊框) 我擦,圖片怎么上傳不了呀?上傳不了圖片就算了。
另外有需要云服務器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內(nèi)外云服務器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務器、裸金屬服務器、高防服務器、香港服務器、美國服務器、虛擬主機、免備案服務器”等云主機租用服務以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務可用性高、性價比高”等特點與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應用場景需求。
網(wǎng)站欄目:nagios的搭建及配置----(上)-創(chuàng)新互聯(lián)
文章位置:http://www.yijiale78.com/article32/pgspc.html
成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站營銷、Google、網(wǎng)站設計、用戶體驗、動態(tài)網(wǎng)站、小程序開發(fā)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉載內(nèi)容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉載,或轉載時需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容