中文字幕av专区_日韩电影在线播放_精品国产精品久久一区免费式_av在线免费观看网站

溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務條款》

httpd-2.4.18+php-5.6.18+nagios-4.1.1+ nagiosgraph-1.5.2 installation on rehl6.4

發布時間:2020-07-28 16:54:06 來源:網絡 閱讀:2137 作者:阿叁 欄目:移動開發

先展示幾張效果圖片,安裝步驟文章后面;

httpd-2.4.18+php-5.6.18+nagios-4.1.1+ nagiosgraph-1.5.2 installation on rehl6.4

httpd-2.4.18+php-5.6.18+nagios-4.1.1+ nagiosgraph-1.5.2 installation on rehl6.4

httpd-2.4.18+php-5.6.18+nagios-4.1.1+ nagiosgraph-1.5.2 installation on rehl6.4

httpd-2.4.18+php-5.6.18+nagios-4.1.1+ nagiosgraph-1.5.2 installation on rehl6.4

httpd-2.4.18+php-5.6.18+nagios-4.1.1+ nagiosgraph-1.5.2 installation on rehl6.4

一、      安裝apache php

tar -zxvfapr-1.5.2.tar.gz

cdapr-1.5.2

./configure--prefix=/usr/local/apr

make

makeinstall

tar -zxvfapr-util-1.5.4.tar.gz

cdapr-util-1.5.4

./configure--prefix=/usr/local/apr-util --with-apr=/usr/local/apr

make

makeinstall

unzippcre-8.38.zip

 

cdpcre-8.38

./configure--prefix=/usr/local/pcre

make

makeinstall

tar -zxvfhttpd-2.4.18.tar.gz

cdhttpd-2.4.18

./configure --prefix=/usr/local/apache  --enable-so --enable-ssl --enable-cgi--enable-rewrite --with-zlib --with-pcre=/usr/local/pcre--with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util/--enable-modules=most --enable-mpms-shared=all --with-mpm=event

make

 make install

 cd /etc/profile.d

 vim apache.sh

 增加# /etc/profile

 增加PATH=/usr/local/apache/bin:$PATH

 vim /etc/man.config

增加MANPATH/usr/local/apache/man

apachectlstart

tar -zxvfphp-5.6.18.tar.gz

cdphp-5.6.18

yuminstall libxml2-devel.x86_64 libxml2.x86_64 -y

./configure--prefix=/usr/local/php --with-apxs2=/usr/local/apache/bin/apxs

make

makeinstall

cpphp.ini-development /usr/local/lib/php.ini

LoadModule php5_module modules/libphp5.so #編輯 httpd.conf文件以調用 PHP 模塊

二、      安裝nagios-core

Install required packages

yuminstall gd -y

安裝gd-devel,由于在新版的系統不自帶這個組件了,我們需要單獨下載安裝

首先安裝gd-devel的依耐組件

yuminstall  fontconfig-devel.x86_64libX11-devel libXpm-devel libjpeg-devel libpng-devel zlib-devel

rpm -ivh gd-devel-2.0.35-11.el6.x86_64.rpm

yuminstall  php gcc glibc glibc-common  make net-snmp

yum install gcc-c++.x86_64 openssl-devel

yuminstall perl-CGI  perl-Time-HiResperl-CPAN perl-Module-Build rrdtool

rpm -ivhperl-GD-2.45-1.el6.rfx.x86_64.rpm

rpm -ivhrrdtool-perl-1.3.8-6.el6.x86_64.rpm

(需額外下載的包gd-devel-2.0.35-11.el6.x86_64.rpm

perl-GD-2.45-1.el6.rfx.x86_64.rpm

rrdtool-perl-1.3.8-6.el6.x86_64.rpm

rrdtool-php-1.3.8-6.el6.x86_64.rpm

 

Install nagios core

groupadd-g 3000 nagios

groupadd-g 3001 nagcmd

useradd-u 3000 -g nagios -G nagcmd -d /usr/local/nagios -c 'Nagios Admin' nagios

usermod  -a nagios nagios apache

usermod  -a -G  nagcmd apache

tar -zxvfnagios-cn-4.1.1.tar.gz

cdnagios-4.1.1

./configure --prefix=/usr/local/nagios--with-nagios-user=nagios --with-nagios-group=nagios --with-command-user=nagios--with-command-group=nagcmd --with-httpd-conf=/usr/local/apache/conf/extra 

make all

makeinstall

makeinstall-init

makeinstall-commandmode

makeinstall-config

make install-webconf

vimhttpd.conf

增加Includeconf/extra/nagios.conf

修改User apache

修改Group apache

修改 <IfModuledir_module>

    DirectoryIndex index.html index.php

  </IfModule>

末行添加 AddType application/x-httpd-php .php

開啟模塊 cgid_module cgi_module php5_module  actions_module

cp -Rcontrib/eventhandlers/ /usr/local/nagios/libexec/

chown -Rnagios:nagios /usr/local/nagios/libexec/eventhandlers

/usr/local/nagios/bin/nagios-v  /usr/local/nagios/etc/nagios.cfg

/etc/init.d/nagiosstart

apachectlstart

htpasswd-c /usr/local/nagios/etc/htpasswd.users nagiosadmin

設定密碼

chown nagios:nagcmd /usr/local/nagios/etc/htpasswd.users

三、      安裝Nagios Plugins

tar -zxvf nagios-plugins-2.1.1.tar.gz

cd nagios-plugins-2.1.1

./configure --with-nagios-user=nagios--with-nagios-group=nagios

make

make install

chown -R nagios.nagios/usr/local/nagios/libexec

四、      安裝nrpe

tar -zxvf nrpe-2.15.tar.gz

cd nrpe-2.15

./configure

make all

make install-plugin

make install-daemon

make install-daemon-config

make install-xinetd

編輯 /etc/xinetd.d/nrpe 文件,添加監控ip

only_from       = 127.0.0.1 <nagios_ip_address>

 

編輯/etc/services添加NRPE daemon  

nrpe            5666/tcp # NRPE

service xinetd restart

 

/usr/local/nagios/libexec/check_nrpe -Hlocalhost  #驗證插件,和client驗證,-H后面添加client地址

chown nagios.nagios /usr/local/nagios

chown -R nagios.nagios/usr/local/nagios/libexec

五、      客戶端安裝NRPE Nagios Plugins

客戶端:

useradd -s /sbin/nologin nagios

安裝 nagios-plugins

./configure --with-nagios-user=nagios--with-nagios-group=nagios

make

make install

….參照 三、四 兩點安裝

六、      安裝Nagios Graph

tar -zxvf nagiosgraph-1.5.2.tar.gz

cd nagiosgraph-1.5.2

 perl install.pl --check-prereq

 perl install.pl

./install.pl --layout overlay --prefix/usr/local/nagios

(配置路徑部分均選擇/usr/local/nagios

vi share/nagiosgraph.ssi

  src="/nagiosgraph/nagiosgraph.js"   to   src="/nagios/nagiosgraph.js"

cp share/nagiosgraph.ssi/usr/local/nagios/share/ssi/common-header.ssi

編輯Nagiosgraphp配置文件,確保一下參數路徑

   vi/usr/local/nagios/etc/nagiosgraph/nagiosgraph.conf

   perflog           =/usr/local/nagios/var/perfdata.log

   rrddir            = /usr/local/nagios/var/rrd

   mapfile           =/usr/local/nagios/etc/nagiosgraph/map

   nagiosgraphcgiurl = /nagios/cgi-bin

   javascript        =/nagios/nagiosgraph.js

   stylesheet        =/nagios/nagiosgraph.css

   logfile           =/usr/local/nagios/var/nagiosgraph.log

cgilogfile        =/usr/local/nagios/var/nagiosgraph-cgi.log

調整以下文件所屬用戶

   chown nagios:nagios/usr/local/nagios/etc/nagiosgraph

   chown nagios:nagios /usr/local/nagios/sbin

   chown nagios:nagios/usr/local/nagios/libexec/insert.pl

   chown nagios:nagios/usr/local/nagios/share/nagiosgraph.css /usr/local/nagios/share/nagiosgraph.js

   chown nagios:nagios/usr/local/nagios/share/ssi/common-header.ssi

創建RRD目錄,并設置以下權限

   mkdir /usr/local/nagios/var/rrd

   chmod nagios:apache/usr/local/nagios/var/rrd

   chmod 755 /usr/local/nagios/var/rrd

 

創建nagiosgraph.log nagiosgraph-cgi.log文件(有就不必創建),并調整權限

   touch /usr/local/nagios/var/nagiosgraph.log

   chown nagios/usr/local/nagios/var/nagiosgraph.log

   chmod 644/usr/local/nagios/var/nagiosgraph.log

 

 

   touch/usr/local/nagios/var/nagiosgraph-cgi.log

   chown apache/usr/local/nagios/var/nagiosgraph-cgi.log

   chmod 644/usr/local/nagios/var/nagiosgraph-cgi.log

 

編輯/usr/local/nagios/share/side.php ‘Trends’ heading下添加:

 

<li><ahref="<?php echo $cfg["cgi_base_url"];?>/trends.cgi"target="<?php echo $link_target;?>">Trends</a>

<ul>

<li><ahref="<?php echo $cfg["cgi_base_url"];?>/show.cgi"target="<?php echo$link_target;?>">Graphs</a></li>

 

<li><ahref="<?php echo$cfg["cgi_base_url"];?>/showhost.cgi" target="<?phpecho $link_target;?>">Graphs by Host</a></li>

<li><ahref="<?php echo$cfg["cgi_base_url"];?>/showservice.cgi"target="<?php echo $link_target;?>">Graphs byService</a></li>

 

<li><ahref="<?php echo$cfg["cgi_base_url"];?>/showgroup.cgi" target="<?phpecho $link_target;?>">Graphs by Group</a></li>

</ul>

</li>

 

驗證配置并重啟nagios

 

   /usr/local/nagios/bin/nagios -v/usr/local/nagios/etc/nagios.cfg

   /etc/init.d/nagios restart

驗證nagiosgraphconfiguration

  http://localhost/nagios/cgi-bin/showconfig.cgi

 或者

http://Server-IP-Address/nagios/cgi-bin/showconfig.cgi

驗證ok ,抓取一些數據,看看圖形效果

   http://localhost/nagios/cgi-bin/show.cgi

    或者

http://Server-IP-Address/nagios/cgi-bin/show.cgi

Now we need to definean action URL for the services that we want to graph, so that you can click togo directly to the graphs for that service from the Nagios Core web interface.

編輯/usr/local/nagios/etc/objects/templates.cfg,添加graph URL  service,以便直接在 web上點擊鏈接。

   define service {

      name             graphed-service

      action_url    /nagiosgraph/cgi-bin/show.cgi?host=$HOSTNAME$&service=$SERVICEDESC$'onMouseOver='showGraphPopup(this)' onMouseOut='hideGraphPopup()'rel='/nagiosgraph/cgi-bin/showgraph.cgi?host=$HOSTNAME$&service=$SERVICEDESC$&period=week&rrdopts=-w+450+-j

register 0

    }

服務用法示范

 

   define service {

         use generic-service,graphed-service

         host_name web001

         service_description PING

         check_commandcheck_ping!100,10%!200,20%

}

 

   /usr/local/nagios/bin/nagios -v/usr/local/nagios/etc/nagios.cfg

   /etc/init.d/nagios reload

vim /usr/local/apache/conf/extra/nagiosgraph.conf

ScriptAlias/nagiosgraph/cgi-bin "/usr/local/nagios/sbin"

<Directory"/usr/local/nagios/sbin">

   Options ExecCGI

   AllowOverride None

   Order allow,deny

   Allow from all

   AuthName "Nagios Access"

   AuthType Basic

 # AuthUserFile NAGIOS_ETC_DIR/htpasswd.users

   AuthUserFile/usr/local/nagios/etc/htpasswd.users

   Require valid-user

</Directory>

# enablenagiosgraph CSS and JavaScript

Alias/nagiosgraph "/usr/local/nagios/share"

<Directory"/usr/local/nagios/share">

   Options None

   AllowOverride None

   Order allow,deny

   Allow from all

</Directory>

vim httpd.conf

DirectoryIndexindex.html index.php

Includeconf/extra/nagiosgraph.conf

七、      MRTG for nagios

cp /usr/local/src/nagios/nagios-4.1.1/sample-config/mrtg.cfg/usr/local/nagios/etc/

mkdir -p/usr/local/nagios/share/stats

vim/usr/local/nagios/etc/mrtg.cfg,在前面添加

WorkDir:/usr/local/nagios/share/stats

初始化

env /usr/bin/mrtg/usr/local/nagios/etc/mrtg.cfg

創建HTML頁面

/usr/bin/indexmaker/usr/local/nagios/etc/mrtg.cfg--output=/usr/local/nagios/share/stats/index.html

配置定時任務

vim/etc/cron.d/mrtg-nagios

Add thefollowing:

*/5 * * * *  root env /usr/bin/mrtg /usr/local/nagios/etc/mrtg.cfg

You can nownavigate to https://example.org/nagios/stats/ to see the graphs.

 

編輯 sidebar file:

vim/usr/local/nagios/share/side.php

And add thefollowing somewhere in the menu:

<divclass="navsection">

    <divclass="navsectiontitle">Extra Tools</div>

        <divclass="navsectionlinks">

            <ulclass="navsectionlinks">

                <li><ahref="/nagios/stats" target="<?php echo$link_target;?>">MRTG stats</a></li>

                <li><ahref="/nagiosgraph/cgi-bin/show.cgi" target="<?php echo$link_target;?>">Nagios Graph</a></li>

            </ul>

        </div>

    </div>

</div>

 

八、      定義配置文件

hosts.cfg

hostgroups.cfg

service-test.cfg

servicegroups.cfg

重點強調templates.cfg commands.cfg

vim templates.cfg添加

define service {

      name              graphed-service

      action_url       /nagiosgraph/cgi-bin/show.cgi?host=$HOSTNAME$&service=$SERVICEDESC$'onMouseOver='showGraphPopup(this)' onMouseOut='hideGraphPopup()'rel='/nagiosgraph/cgi-bin/showgraph.cgi?host=$HOSTNAME$&service=$SERVICEDESC$&period=week&rrdopts=-w+450+-j

      register                        0   

}

vim commands.cfg

define command{

         command_name    check_nrpe

         command_line    /usr/local/nagios/libexec/check_nrpe -H$HOSTADDRESS$ -c $ARG1$  -t 120

         }

由于整理資料費時,配置文件配置可參考/usr/local/nagios/etc/object/localhost.cfg,這里不細寫 安裝過程有其他問題google一下。

參考文件有官網的Installing_Nagios_Core_From_Source.pdf NRPE.pdf安裝nagiosgraph.txtNagios網絡監控中文版.pdf

官網地址:https://www.nagios.org

                                                               2016-03-01 lin3

 

附件:http://down.51cto.com/data/2367411
向AI問一下細節

免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。

AI

台中市| 雅安市| 固阳县| 南平市| 铜山县| 阳西县| 石首市| 古丈县| 汕尾市| 肥西县| 广东省| 怀来县| 昌江| 保康县| 胶南市| 河曲县| 南投县| 封开县| 万荣县| 灵山县| 朝阳县| 出国| 洛南县| 唐山市| 竹溪县| 谷城县| 嵩明县| 灵武市| 无锡市| 临朐县| 辽源市| 武宁县| 尉氏县| 安阳市| 阿鲁科尔沁旗| 湖南省| 华容县| 宾阳县| 湖北省| 搜索| 云阳县|