1、下載nagios-4.0.8、nagios-plugins-2.0.3
成都創(chuàng)新互聯(lián)專注于云浮企業(yè)網(wǎng)站建設(shè),響應(yīng)式網(wǎng)站,商城網(wǎng)站建設(shè)。云浮網(wǎng)站建設(shè)公司,為云浮等地區(qū)提供建站服務(wù)。全流程定制設(shè)計,專業(yè)設(shè)計,全程項目跟蹤,成都創(chuàng)新互聯(lián)專業(yè)和態(tài)度為您提供的服務(wù)wget http://jaist.dl.sourceforge.net/project/nagios/nagios-4.x/nagios-4.0.8/nagios-4.0.8.tar.gz
wget http://nagios-plugins.org/download/nagios-plugins-2.0.3.tar.gz
2、安裝組件
yum install -y wget httpd php gcc glibc glibc-common gd gd-devel make net-snmp
3、創(chuàng)建nagios用戶與用戶組
useradd nagios
groupadd nagcmd
usermod -a -G nagcmd nagios
4、安裝nagios-4.0.8
tar zxvf nagios-4.0.8.tar.gz
cd nagios-4.0.8
./configure --prefix=/usr/local/nagios --with-command-group=nagcmd --with-nagios-group=nagcmd
make all
make install
make install-init
make install-config
make install-commandmode
make install-webconf
cp -R contrib/eventhandlers/ /usr/local/nagios/libexec/
chown -R nagios:nagcmd /usr/local/nagios/libexec/eventhandlers
/usr/local/nagios/bin/nagios -v /usr/local/nagios/etc/nagios.cfg
service nagios start
5、配置httpd
1)配置web登陸用戶名和密碼
htpasswd -c /usr/local/nagios/etc/htpasswd nagiosadmin
vi /etc/httpd/conf/httpd.conf 加入以下內(nèi)容
2)找到
user apache
group apache
修改為
user nagios
group nagcmd
3)找到
#ServerName www.example.com:80
將前面的#刪除
6、安裝nagios-plugins
tar zxvf nagios-plugins-2.0.3.tar.gz
cd nagios-plugins-2.0.3
./configure --prefix=/usr/local/nagios --with-nagios-user=nagios --with-nagios-group=nagcmd --with-command-user=nagios --with-command-group=nagcmd
make
make install
7、設(shè)置開機啟動
chkconfig nagios on
service nagios start
chkconfig httpd on
service httpd start
8、訪問
http://IP/nagios 輸入用戶名密碼
nagiosadmin:$apr1$CZJUFBRq$TBWA4x8B6nbH0nA4ekHg7. http://tool.oschina.net/htpasswd
另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機、免備案服務(wù)器”等云主機租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務(wù)可用性高、性價比高”等特點與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場景需求。