• 
    

      <address id="upfr9"><pre id="upfr9"><strike id="upfr9"></strike></pre></address>
      1. <address id="upfr9"><tr id="upfr9"></tr></address><dl id="upfr9"></dl>

        nagios安裝教程-創(chuàng)新互聯(lián)

        該教程是在生產(chǎn)環(huán)境中配置過的實例,僅供參考使用!

        在南皮等地區(qū),都構(gòu)建了全面的區(qū)域性戰(zhàn)略布局,加強發(fā)展的系統(tǒng)性、市場前瞻性、產(chǎn)品創(chuàng)新能力,以專注、極致的服務(wù)理念,為客戶提供成都做網(wǎng)站、成都網(wǎng)站設(shè)計 網(wǎng)站設(shè)計制作定制網(wǎng)站開發(fā),公司網(wǎng)站建設(shè),企業(yè)網(wǎng)站建設(shè),品牌網(wǎng)站制作,網(wǎng)絡(luò)營銷推廣,外貿(mào)網(wǎng)站制作,南皮網(wǎng)站建設(shè)費用合理。

        本服務(wù)器使用RHEL5.4環(huán)境。

        一、安裝Nagios

        1、安裝nagios部署過程中需要相關(guān)的文件和庫文件

        1.1 如果想快速并減少操作的話可以直接用yum安裝所有庫文件,可以在本地搭建yum源

        [root@study ~]$ yum groupinstall -y 'Development Libraries' 'Development Tools" 'Legacy Software Development' 'X Software Development'

        [root@study ~]$ yum -y install httpd gcc glibc glibc-common *gd* php php-mysql mysql mysql-server mysql-devel openssl-devel

        建議只安裝這幾種基礎(chǔ)包,其余的httpd,mysql等可以選擇性的用編譯來安裝

        [root@study ~]$ yum -y install gcc glibc glibc-common gd gd-develpcre-develapr-util-devel

        1.2 如果想要按需安裝的話,可以用rpm安裝,直接將光驅(qū)掛載到磁盤使用即可,不過有軟件包的依賴性問題,安裝起來比較麻煩,不建議使用。

        2、添加一個nagios用戶并設(shè)置密碼

        [root@study ~]# useradd nagios

        [root@study ~]# passwd nagios

        Changing password for user nagios.

        New UNIX password:

        BAD PASSWORD: it is based on a dictionary word

        Retype new UNIX password:

        passwd: all authentication tokens updated successfully.

        [root@study ~]#

        [root@study ~]# su - nagios

        [nagios@study ~]$

        下載nagios安裝包(3.5.0穩(wěn)定版)

        http://www.nagios.org/download/core/thanks?t=1373979063

        nagios安裝教程

        [nagios@study ~]$ mkdir pkgs

        [nagios@study ~]$ mkdir build

        [nagios@study ~]$ ls

        build  pkgs

        [nagios@study ~]$cd pkgs

        [nagios@studypkgs]$

        wget'http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-3.5.0.tar.gz'

        [nagios@studypkgs]$cd ../build/

        [nagios@study build]$

        [nagios@study build]$ tar zxvf ../pkgs/nagios-3.5.0.tar.gz

        [nagios@study build]$ cd nagios/

        [nagios@study nagios]$

        [nagios@study nagios]$ ./configure --prefix=/home/nagios/nagios --enable-embedded-perl

        [nagios@study nagios]$ make all

        [nagios@study nagios]$ make install

        [nagios@study nagios]$ make install-config

        二、安裝HTTP

        到官網(wǎng)上下載apache http的2.4.6穩(wěn)定版本

        http://httpd.apache.org/download.cgi#apache24

        nagios安裝教程

        由于apache的版本比較新,而RHEL5.4上所用的軟件包比較舊,在yum本地源安裝的時候自然安裝了很多舊的軟件包,所以RHEL5.4的apr安裝包也需要更新才能使用,需要更新4個apr的相關(guān)文件,如果是用yum直接安裝的話,可以直接升級以下4個rpm軟件包即可,如下操作:

        在root下安裝

        [root@study pkgs]# rpm -Uvh --force --nodeps apr-1.4.5-1.jason.1.i386.rpm  ##如果在安裝的時候出錯,比如需要依賴包什么的,請用強制操作

        apr-util-devel-1.3.9-1.jason.2.i386.rpm

        apr-devel-1.4.5-1.jason.1.i386.rpm

        apr-util-1.3.9-1.jason.2.i386.rpm

        切換到nagios用戶

        [nagios@study pkgs]$ wget 'http://mirror.esocc.com/apache//httpd/httpd-2.4.6.tar.gz'

        [nagios@studypkgs]$ cd ../build/

        [nagios@study build]$tar zxvf ../pkgs/httpd-2.4.6.tar.gz

        [nagios@study build]$ cd httpd-2.4.6/

        [nagios@study httpd-2.4.6]$ ./configure --prefix=/home/nagios/httpd

        [nagios@study httpd-2.4.6]$ make

        [nagios@study httpd-2.4.6]$ make install

        三、安裝PHP

        到官網(wǎng)上下載PHP的最新版本,

        http://www.php.net/get/php-5.5.0.tar.gz/from/a/mirror

        nagios安裝教程

        [nagios@study pkgs]$ wget 'http://www.php.net/get/php-5.5.0.tar.gz/from/us1.php.net/mirror'

        [nagios@studypkgs]$ cd ../build/

        [nagios@study build]$ tar zxvf ../pkgs/php-5.5.0.tar.gz

        [nagios@study build]$ cd php-5.5.0/

        [nagios@study php-5.5.0]$ ./configure --with-apxs2=/home/nagios/httpd/bin/apxs --prefix=/home/nagios/php

        [nagios@study php-5.5.0]$ make

        [nagios@study php-5.5.0]$ make install

        四、修改配置及錯誤排查

        安裝后好下面就是最重要也是關(guān)系到能不能進入nagios的時候了,由于我們是使用nagios賬號運行nagios和apache的,所以需要修改httpd.conf里面的內(nèi)容,首先切換到root用戶下打開httpd.conf文件

        [nagios@study conf]$ su - root

        口令:

        [root@study ~]# vim ~nagios/httpd/conf/httpd.conf

        內(nèi)容修改:

        User nagios     #使用nagios運行apache

        Group nagios    #使用nagios的組

        Listen 8080     #由于80端口默認(rèn)是root使用,這里修改為8080端口,便可以讓nagios用戶啟動apache

        增加以下條目

        在DirectoryIndex中增加一個index.php的頁面

        <IfModule dir_module>

          DirectoryIndex index.php index.html

        </IfModule>

        AddType application/x-httpd-php .php##添加能夠執(zhí)行php的文件類型

        AddDefaultCharset utf-8##添加utf-8的字符編碼(登陸nagios后有中文亂碼的話請?zhí)砑舆@條進去)

        添加nagios的登陸目錄

        #setting for nagios

        ScriptAlias /nagios/cgi-bin /home/nagios/nagios/sbin

        <Directory "/home/nagios/nagios/sbin">

        Options ExecCGI

        AllowOverride None

        Order allow,deny

        Allow from all

        AuthName "Nagios Access"

        AuthType Basic

        AuthUserFile /home/nagios/nagios/etc/htpasswd.users

        #用于此目錄訪問身份驗證的文件

        Require valid-user

        </Directory>

        Alias /nagios /home/nagios/nagios/share

        <Directory "/home/nagios/nagios/share">

        Options None

        AllowOverride None

        Order allow,deny

        Allow from all

        AuthName "Nagios Access"

        AuthType Basic

        AuthUserFile /home/nagios/nagios/etc/htpasswd.users

        #用于此目錄訪問身份驗證的文件

        Require valid-user

        </Directory>

        開啟以下條目(默認(rèn)為注釋狀態(tài))

        ServerName www.example.com:80           ##啟動apache后報域名錯誤的話啟用該條目

        LoadModule cgid_module modules/mod_cgid.so     ##登陸nagios右邊界面全是亂碼的話啟用改條目

        LoadModule actions_module modules/mod_actions.so   ##登陸nagios右邊界面全是亂碼的話啟用改條目

        [root@study ~]$ ~nagios/httpd/bin/apachectl start   #啟動apachect

        [root@study ~]$ ~nagios/httpd/bin/apachectl stop   #然后關(guān)閉

        添加nagios頁面登陸的用戶名和密碼,需要對應(yīng)httpd.conf中nagios的AuthUserFile路徑,也就是要創(chuàng)建一個名為htpasswd.users的文件來放置登陸賬號和密碼,切換到nagios用戶

        [nagios@study ~]$ ~nagios/httpd/bin/htpasswd -c /home/nagios/nagios/etc/htpasswd.users nagiosadmin

        New password:

        Re-type new password:

        Adding password for user nagiosadmin

        [nagios@study ~]$

        啟動nagios和apache

        [nagios@study ~]$ ~/nagios/bin/nagios -d ~/nagios/etc/nagios.cfg

        [nagios@study ~]$ ~nagios/httpd/bin/apachectl start

        查看以下文件如果不存在的話,請手動創(chuàng)建一個,否則就無法正常登陸nagios的web頁面

        [nagios@study var]$ pwd

        /home/nagios/nagios/var

        [nagios@study var]$ mkdir rw

        插件安裝是

        [nagios@study pkgs]$ wget 'http://prdownloads.sourceforge.net/sourceforge/nagiosplug/nagios-plugins-1.4.16.tar.gz'

        [nagios@study build]$ tar zxvf ../pkgs nagios-plugins-1.4.16.tar.gz

        [nagios@study build]$ cd nagios-plugins-1.4.16/

        [nagios@study nagios-plugins-1.4.16]$ ./configure --prefix=/home/nagios/nagios

        [nagios@study nagios-plugins-1.4.16]$ make

        [nagios@study nagios-plugins-1.4.16]$ make install

        另外有需要云服務(wù)器可以了解下創(chuàng)新互聯(lián)scvps.cn,海內(nèi)外云服務(wù)器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務(wù)器、裸金屬服務(wù)器、高防服務(wù)器、香港服務(wù)器、美國服務(wù)器、虛擬主機、免備案服務(wù)器”等云主機租用服務(wù)以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務(wù)可用性高、性價比高”等特點與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應(yīng)用場景需求。

        當(dāng)前文章:nagios安裝教程-創(chuàng)新互聯(lián)
        當(dāng)前路徑:http://www.jbt999.com/article14/dhccge.html

        成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供外貿(mào)網(wǎng)站建設(shè)網(wǎng)站營銷、定制開發(fā)網(wǎng)站改版、商城網(wǎng)站、響應(yīng)式網(wǎng)站

        廣告

        聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:[email protected]。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

        成都網(wǎng)站建設(shè)公司

      2. 
        

          <address id="upfr9"><pre id="upfr9"><strike id="upfr9"></strike></pre></address>
          1. <address id="upfr9"><tr id="upfr9"></tr></address><dl id="upfr9"></dl>
            亚洲欧洲日本在线 | 人妻人妇精品一级毛片 | 开心激情站 | av字幕网站 | 国产色亭亭视频 | 一级黄色毛片播放 | 麻豆porn| 亚洲免费在线视 | 成人精品人妻 | 大香蕉网在线视频 |