您好,登錄后才能下訂單哦!
- 安裝apache,采用yum方式安裝,安裝的命令是yum install –y httpd
- 安裝完apache后,啟動(dòng)apache命令/etc/init.d/httpd restart 即可!
- Nagios是基于php語(yǔ)音編寫(xiě)的程序,所以需要安裝php,也采用yum方式安裝
- Yum install php php-devel -y即可
- 現(xiàn)在nagios版本和客戶端插件地址如下:
- wget http://sourceforge.net/projects/nagios/files/nagios-3.x/nagios-3.2.1/nagios-3.2.1.tar.gz/download
- wget http://sourceforge.net/projects/nagiosplug/files/nagiosplug/1.4.15/nagios-plugins-1.4.15.tar.gz/download
- wget http://jaist.dl.sourceforge.net/project/nagios/nrpe-2.x/nrpe-2.13/nrpe-2.13.tar.gz
- 創(chuàng)建用戶維護(hù)Nagios的用戶和組
- useradd nagios
- passwd nagios
- 安裝Nagios
- tar zxvf nagios-3.2.1.tar.gz
- cd nagios-3.2.1
- ./configure --prefix=/usr/local/nagios --with-nagios-user=nagios --with-nagios-group=nagios
- make all
- make install //來(lái)安裝主程序,CGI和HTML文件
- make install-init //在/etc/rc.d/init.d安裝啟動(dòng)腳本
- make install-config //來(lái)安裝示例配置文件,安裝的路徑是/usr/local/nagios/etc
- make install-commandmode//來(lái)配置目錄權(quán)限
- make install-webconf 寫(xiě)入配置文件
- 安裝Nagios-plugins
- tar zxvf nagios-plugins-1.4.15.tar.gz
- cd nagios-plugins-1.4.15
- ./configure --prefix=/usr/local/nagios --with-nagios-user=nagios --with-nagios-group=nagios
- make && make install
- 安裝nrpe
- tar -xzf nrpe-2.13.tar.gz && cd nrpe-2.13 &&./configure --enable-ssl --with-ssl-lib &&make all && make install-plugin && make install-daemon && make install-daemon-config
- chown -R nagios:nagios /usr/local/nagios/
- /usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d 啟動(dòng)nrpe服務(wù)
- 增加訪問(wèn)控制驗(yàn)證用戶:(第一次創(chuàng)建時(shí)要加參數(shù)c)
- htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
- nagios安裝完畢,然后重啟apache,重啟nagios,/etc/init.d/nagios restart
- 訪問(wèn):http://localhost/nagios/ 即可! 即可訪問(wèn)到nagios最初安裝界面
- 首先下載nagios-plugins-1.4.15.tar.gz和nrpe-2.13.tar.gz,
- 執(zhí)行如下腳本即可:
- #!/bin/sh
- ###auto make install nagios_plugin and nrpe
- useradd nagios
- tar -xzf nagios-plugins-1.4.15.tar.gz &&cd nagios-plugins-1.4.15 &&./configure --prefix=/usr/local/nagios &&make &&make install
- sleep 2
- echo "This is make install nrpe ,please waiting .................."
- cd ../ ; tar -xzf nrpe-2.13.tar.gz && cd nrpe-2.13 &&./configure --enable-ssl --with-ssl-lib &&make all && make install-plugin && make install-daemon && make install-daemon-config
- chown -R nagios:nagios /usr/local/nagios/
- cd .. ;cp nrpe.cfg /usr/local/nagios/etc/nrpe.cfg
- /usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d
- ###Add auto start
- grep "nrpe" /etc/rc.local
- if [ $? -ne 0 ];then
- echo "/usr/local/nagios/bin/nrpe -c /usr/local/nagios/etc/nrpe.cfg -d" >>/etc/rc.local
- else
- echo "nrpe is exist"
- fi
- 保存即可!
免責(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)容。