nagios是一款開源的免費網路監視工具,能有效監控windows、linux和unix的主機狀態,交換機路由器等網路設定,印表機等。
一、首先安裝apache:
安裝apache,採用yum方式安裝,安裝的命令是yum install –y httpd安裝完apache後,啟動apache命令/etc/init.d/httpd restart 即可!
二、安裝php:
nagios是基於php語音編寫的程式,所以需要安裝php,也採用yum方式安裝yum install php php-devel -y即可
現在nagios版本和客戶端外掛程式位址如下:wget
wget
wget
建立使用者維護nagios的使用者和組
useradd nagios
passwd nagios
四、在伺服器端,安裝nagios和nrpe、nagios外掛程式:
安裝nagiostar 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服務
五、建立web 訪問使用者:
增加訪問控制驗證使用者:(第一次建立時要加引數c)htpasswd -c /usr/local/nagios/etc/htpasswd.users nagiosadmin
nagios安裝完畢,然後重啟apache,重啟nagios,/etc/init.d/nagios restart
訪問:http://localhost/nagios/ 即可! 即可訪問到nagios最初安裝介面
六、在客戶端安裝nrpe、nagios-plugin:
執行如下指令碼即可:
#!/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
儲存即可!
在ubuntu下安裝nagios監控平台
問題1 nagios是什麼?答 是乙個監視系統執行狀態和網路資訊的監視系統。問題2 ubuntu下搭建nagios?答 依賴的軟體包 sudo apt get install apache2 sudo apt get install build essential sudo apt get inst...
Nagios 監控軟體安裝
一,軟體安裝 ll rwxrwxr x 1 root root 9097591 2009 12 31 nagios 20091231.tar.bz2 1 解壓軟體包 tar jxvf nagios 20091231.tar.bz2 2.安裝 soft monitoring nagios nagios...
監控軟體nagios之安裝
1.安裝軟體依賴包和建立nagios使用者 root tong1 yum install gcc gcc c make y root tong1 groupadd g 500 nagios root tong1 useradd r u 500 s sbin nologin g nagios nagi...