您好,登錄后才能下訂單哦!
- 安裝apache,采用yum方式安裝,安裝的命令是yum install –y httpd
- 安裝完apache后,啟動apache命令/etc/init.d/httpd restart 即可!
- Nagios是基于php語音編寫的程序,所以需要安裝php,也采用yum方式安裝
- Yum install php php-devel -y即可
- 現在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
- 創建用戶維護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 //來安裝主程序,CGI和HTML文件
- make install-init //在/etc/rc.d/init.d安裝啟動腳本
- make install-config //來安裝示例配置文件,安裝的路徑是/usr/local/nagios/etc
- make install-commandmode//來配置目錄權限
- make install-webconf 寫入配置文件
- 安裝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 啟動nrpe服務
- 增加訪問控制驗證用戶:(第一次創建時要加參數c)
- htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
- nagios安裝完畢,然后重啟apache,重啟nagios,/etc/init.d/nagios restart
- 訪問:http://localhost/nagios/ 即可! 即可訪問到nagios最初安裝界面
- 首先下載nagios-plugins-1.4.15.tar.gz和nrpe-2.13.tar.gz,
- 執行如下腳本即可:
- #!/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
- 保存即可!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。