最近搭建了兩次nagios,第一次工作忙碌沒有記錄下過程;這次抽了時間簡單的記錄了搭建過程。

系統(tǒng)版本:centos 6.3 64位
軟件版本:nagios-3.4.3.tar.gz
nagios-plugins-1.4.16.tar.gz
nrpe.tar.gz
httpd-2.2.23.tar.gz
php-5.4.10.tar.gz
這次嘗試了利用yum安裝的http,php;可惜到最后沒有成功,鑒于老大那里急著要只有編譯安裝了httpd和php(nagios3.0版本需要php的支持)。
開始:
1:檢查依賴安裝
rpm -q gcc glibc glibc-common gd gd-devel xinetd openssl-devel 如果沒有安裝請執(zhí)行: yum -y install gcc glibc glibc-common gd gd-devel xinetd openssl-devel
2:安裝httpd和php
HHTPD: cd /opt tar zxvf httpd-2.2.23.tar.gz cd httpd-2.2.23 ./configure --prefix=/usr/local/services/apache2 make make install PHP: cd ../ tar zxvf php-5.4.10.tar.gz cd php-5.4.10 ./configure --prefix=/usr/local/services/php --with-apxs2=/usr/local/services/apache2/bin/apxs make make install
3:安裝 nagios-plugins和nrpe
cd /opt 創(chuàng)建nagios賬號 groupadd nagios useradd nagios -s /sbin/nologin -g nagios cat /etc/passwd | grep "nagios" nrpe的啟動腳本: mv nrpe /etc/init.d/ chmod 755 /etc/init.d/nrpe 安裝nagios-plugins tar xf nagios-plugins-1.4.16.tar.gz cd ./nagios-plugins ./configure --prefix=/usr/local/services/nagios --with-nagios-group=nagios --with-nagios-user=nagios make && make install 安裝nrpe cd /opt tar xf nrpe.tar.gz cd ./nrpe ./configure --prefix=/usr/local/services/nagios make all make install && make install-plugin && make install-daemon && make install-daemon-config
4:安裝nagios
cd /opt/ tar zxvf nagios-3.4.3.tar.gz cd nagios ./configure --prefix=/usr/local/services/nagios

make all

make install

make install-init

make install-commandmode make install-config

chkconfig --add nagios chkconfig --level 35 nagios on chkconfig --list nagios
5:設(shè)置登陸web控制臺賬號密碼
/usr/local/services/apache2/bin/htpasswd -c /usr/local/services/nagios/etc/htpasswd user
5:配置httpd.conf
修改1: Listen 80 (不是必須要修改) User nagios Group nagios 修改2: ServerName 1.1.1.1:80 (端口不是必須要修改) 修改3: <IfModule dir_module> DirectoryIndex index.html index.php AddType application/x-httpd-php .php </IfModule> 在httpd.conf最后添加: ScriptAlias /nagios/cgi-bin "/usr/local/services/nagios/sbin" <Directory "/usr/local/services/nagios/sbin"> AuthType Basic Options ExecCGI AllowOverride None Order allow,deny Allow from all AuthName "Nagios Access" AuthUserFile /usr/local/services/nagios/etc/htpasswd Require valid-user </Directory> Alias /nagios "/usr/local/services/nagios/share" <Directory "/usr/local/services/nagios/share"> AuthType Basic Options None AllowOverride None Order allow,deny Allow from all AuthName "nagios Access" AuthUserFile /usr/local/services/nagios/etc/htpasswd Require valid-user </Directory> 啟動httpd /usr/local/services/apache2/bin/apachectl start
6:訪問配置好的URL

所有軟件都可以在我的百度云盤下載:
鏈接:http://pan.baidu.com/s/1ntogYIP 密碼:m5dq
另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機(jī)、免備案服務(wù)器”等云主機(jī)租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務(wù)可用性高、性價比高”等特點(diǎn)與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場景需求。
分享標(biāo)題:nagios筆記【搭建】-創(chuàng)新互聯(lián)
路徑分享:http://chinadenli.net/article22/diigjc.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供小程序開發(fā)、品牌網(wǎng)站制作、網(wǎng)站營銷、建站公司、網(wǎng)站設(shè)計(jì)公司、App設(shè)計(jì)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)
猜你還喜歡下面的內(nèi)容