<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    于吉吉的技術(shù)博客

    建造高性能門戶網(wǎng)

      BlogJava :: 首頁(yè) :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理 ::
      65 隨筆 :: 6 文章 :: 149 評(píng)論 :: 0 Trackbacks
    上周給同事講解了cacti的安裝及其使用時(shí)做了一份ppt,在這里將這份ppt簡(jiǎn)單梳理一下介紹一下cacti在我們?nèi)粘9ぷ髦械谋O(jiān)控使用

    cacti的結(jié)構(gòu)
    在廣義上來(lái)說(shuō)cacti是一套網(wǎng)絡(luò)流量監(jiān)測(cè)圖形分析工具,但從狹義來(lái)說(shuō)cacti只是由php語(yǔ)言實(shí)現(xiàn)的一個(gè)軟件,

    它需要PHP,apache,Mysql,SNMP,RRDTool等工具的支持


    從上圖可以很明確看出cacti的三層架構(gòu)之間的關(guān)系
    第一層是數(shù)據(jù)采集,通過snmp簡(jiǎn)單網(wǎng)絡(luò)協(xié)議,和一批自定義的腳本進(jìn)行采集
    第二層是數(shù)據(jù)存儲(chǔ),分別通過mysql存儲(chǔ)cacti的模板和一些一定的信息,RRDTool用來(lái)存儲(chǔ)所監(jiān)控到的性能文件,后綴為.rrd
    第三層是數(shù)據(jù)展現(xiàn),cacti的web方式展現(xiàn)



    cacti主要功能是用snmp服務(wù)獲取數(shù)據(jù),然后用rrdtool儲(chǔ)存和更新數(shù)據(jù),當(dāng)用戶需要查看數(shù)據(jù)的時(shí)候,rrdtool生成圖表呈現(xiàn)給用戶。因此, snmp和rrdtool是cacti的關(guān)鍵,snmp關(guān)系著數(shù)據(jù)的收集,rrdtool關(guān)系著數(shù)據(jù)存儲(chǔ)和圖表的生成.


    snmp抓到數(shù)據(jù)不是存儲(chǔ)在mysql中而是存在rrdtool生成的rrd文件中,rrdtool對(duì)數(shù)據(jù)的更新和存儲(chǔ)就是對(duì)rrd文件的處理,rrd 文件是大小固定的檔案文件,它能夠存儲(chǔ)的數(shù)據(jù)筆數(shù)在創(chuàng)建時(shí)已經(jīng)定義.
    Mysql配合PHP程序存儲(chǔ)一些變量數(shù)據(jù)并對(duì)變量數(shù)據(jù)進(jìn)行調(diào)用,如:主機(jī)名、主機(jī) ip,snmp 團(tuán)體名、端口號(hào)、模板信息等變量。

    *.SNMP協(xié)議
    SNMP(簡(jiǎn)單網(wǎng)絡(luò)管理協(xié)議)前身是簡(jiǎn)單網(wǎng)關(guān)監(jiān)控協(xié)議(SGMP), 用來(lái)對(duì)通信線路進(jìn)行管理

    加入符合Internet定義的SMI和MIB進(jìn)行體系整合

    簡(jiǎn)單網(wǎng)絡(luò)管理協(xié)議(SNMP)是Internet組織用來(lái)管理Internet的網(wǎng)絡(luò)協(xié)議

    *.MIB & SMI
    MIB, 管理信息庫(kù),由網(wǎng)絡(luò)管理協(xié)議訪問的管理對(duì)象數(shù)據(jù)庫(kù),它包括SNMP可以通過網(wǎng)絡(luò)設(shè)備的SNMP管理代理進(jìn)行設(shè)置的變量
    SMI,管理信息結(jié)構(gòu),用于定義通過網(wǎng)絡(luò)管理協(xié)議可訪問的對(duì)象的規(guī)則。SMI定義在MIB中使用的數(shù)據(jù)類型及網(wǎng)絡(luò)資源在MIB中的名稱或表示。

    *.SNMP的網(wǎng)絡(luò)模型

    使用SNMP進(jìn)行網(wǎng)絡(luò)管理需要下面幾個(gè)重要部分:管理基站,管理代理,管理信息庫(kù)和網(wǎng)絡(luò)管理工具。管理基站通常是一個(gè)獨(dú)立的設(shè)備,它用作網(wǎng)絡(luò)管理者進(jìn)行網(wǎng) 絡(luò)管理的用戶接口。基站上必須裝備有管理軟件,管理員可以使用的用戶接口和從MIB取得信息的數(shù)據(jù)庫(kù),同時(shí)為了進(jìn)行網(wǎng)絡(luò)管理它應(yīng)該具備將管理命令發(fā)出基站的能力

    注:關(guān)于MIB介紹可以看<SNMP MIB完整手冊(cè)>

    *.net-snmp
    NET-SNMP是一個(gè)代理SNMP協(xié)議的軟件,并提供管理端的查詢工具,支持多種擴(kuò)展方式
    在被監(jiān)測(cè)和監(jiān)測(cè)機(jī)器進(jìn)行安裝
    http://www.net-snmp.org/download.html
    配置
    /etc/snmp/snmpd.conf




    設(shè)置自啟動(dòng)
    /usr/sbin/snmpd -c /usr/local/net-snmp/snmpd.conf &
    測(cè)試
    snmpwalk -v 2c -c public 127.0.0.1
    snmpwalk -v 1 -c public 127.0.0.1 .1.3.6.1.4.1.2021.10 (負(fù)載檢查)

    *.RRDTool
    RRDTool使用RRD(Round Robin Database)作為存儲(chǔ)格式,Round robin是一種處理定量數(shù)據(jù)、以及當(dāng)前元素指針的技術(shù)。RRDTool主要用來(lái)跟蹤對(duì)象的變化情況,生成這些變化的走勢(shì)圖
    RRDTool的存儲(chǔ)特點(diǎn)

    存儲(chǔ)數(shù)據(jù)的數(shù)據(jù)庫(kù)空間看成一個(gè)圓
    指針會(huì)隨著數(shù)據(jù)的讀寫操作在圓的刻度上自動(dòng)移動(dòng)
    圓沒有起點(diǎn)和終點(diǎn)
    當(dāng)所有的空間都存滿了數(shù)據(jù),就又從頭開始存放
    RRDtool 所使用的數(shù)據(jù)庫(kù)文件的后綴名是'.rrd'



    *.Cacti的安裝

    需要安裝以下軟件

    1)安裝Apache,Mysql,PHP
    2)安裝RRDTool
    (cgilib-0.5.tar.gz,zlib-1.2.3.tar.gz,libpng-1.2.18.tar.gz,freetype-2.3.5.tar.gz,libart_lgpl-2.3.17.tar.gz,rrdtool-1.2.23.tar.gz)
    3)安裝net-snmp
    4)安裝cacti

    *.Cacti的配置
    修改cacti的config.php


    新增crontab定時(shí)器



    接下來(lái)就可以訪問



    *.進(jìn)入cacti的設(shè)置



    配置SNMP版本,rrdtool類別,和net-snmp的工具路徑







    具體的安裝配置和應(yīng)用就不演示,下面是ppt附件,安裝和配置有什么問題可以同我聯(lián)系

    --------------------------------

    補(bǔ)充
    有朋友對(duì)rrdtools提了一點(diǎn)問題:

    RRDTool保存數(shù)據(jù)是循環(huán)的,而且大小不變。那是不是說(shuō),他只能保存一定數(shù)量活一段數(shù)據(jù),然后保持更新。
    比如:RRD只有6個(gè)刻度,用來(lái)保存一個(gè)小時(shí)內(nèi),每10分鐘的流量。從10點(diǎn)10分開始的話,到11點(diǎn)就滿了,那么就開始循環(huán)刷新了。
    11點(diǎn)10分的數(shù)據(jù)就覆蓋了10點(diǎn)10分的數(shù)據(jù)。
    可是如果我分析的沒錯(cuò)的話,那數(shù)據(jù)不就丟失了么?如果想查看歷史怎么辦呢?


    因?yàn)閞rd整個(gè)存儲(chǔ)空間的大小就是一個(gè)固定的值,在一段時(shí)間后,當(dāng)所有空間都存滿數(shù)據(jù)后,就會(huì)從頭開始存放,所以這涉及到rrdtool的前期規(guī)劃,以下是截取了http://www.rrdtool.org的說(shuō)明

        When monitoring the state of a system, it is convenient to have the data available at a constant time interval. Unfortunately, you may not always be able to fetch data at exactly the time you want to. Therefore RRDtool lets you update the log file at any time you want. It will automatically interpolate the value of the data-source (DS) at the latest official time-slot (interval) and write this interpolated value to the log. The original value you have supplied is stored as well and is also taken into account when interpolating the next log entry.
    Consolidation
        You may log data at a 1 minute interval, but you might also be interested to know the development of the data over the last year. You could do this by simply storing the data in 1 minute intervals for the whole year. While this would take considerable disk space it would also take a lot of time to analyze the data when you wanted to create a graph covering the whole year. RRDtool offers a solution to this problem through its data consolidation feature. When setting up an Round Robin Database (RRD), you can define at which interval this consolidation should occur, and what consolidation function (CF) (average, minimum, maximum, total, last) should be used to build the consolidated values (see rrdcreate). You can define any number of different consolidation setups within one RRD. They will all be maintained on the fly when new data is loaded into the RRD.
    Round Robin Archives
        Data values of the same consolidation setup are stored into Round Robin Archives (RRA). This is a very efficient manner to store data for a certain amount of time, while using a known and constant amount of storage space.
        It works like this: If you want to store 1'000 values in 5 minute interval, RRDtool will allocate space for 1'000 data values and a header area. In the header it will store a pointer telling which slots (value) in the storage area was last written to. New values are written to the Round Robin Archive in, you guessed it, a round robin manner. This automatically limits the history to the last 1'000 values (in our example). Because you can define several RRAs within a single RRD, you can setup another one, for storing 750 data values at a 2 hour interval, for example, and thus keep a log for the last two months at a lower resolution.
        The use of RRAs guarantees that the RRD does not grow over time and that old data is automatically eliminated. By using the consolidation feature, you can still keep data for a very long time, while gradually reducing the resolution of the data along the time axis.
        Using different consolidation functions (CF) allows you to store exactly the type of information that actually interests you: the maximum one minute traffic on the LAN, the minimum temperature of your wine cellar, the total minutes of down time, etc.

    ----------------------------------------

    by 陳于喆
    QQ:34174409
    Mail: dongbule@163.com




    posted on 2010-11-02 17:28 陳于喆 閱讀(3266) 評(píng)論(0)  編輯  收藏 所屬分類: linux安裝配置
    主站蜘蛛池模板: 最新亚洲人成网站在线观看| 三级毛片在线免费观看| 亚洲毛片网址在线观看中文字幕 | 91福利视频免费| 亚洲大香伊人蕉在人依线| 免费a级毛片高清视频不卡| 一区二区三区在线免费观看视频| 久久久www成人免费毛片| 边摸边吃奶边做爽免费视频99| 午夜神器成在线人成在线人免费 | 日韩久久无码免费毛片软件| 亚洲国产精品无码一线岛国| 在线观看免费人成视频色| 亚洲精品视频免费| 亚洲视频在线观看2018| 亚洲综合AV在线在线播放| 精品熟女少妇AV免费观看| 免费日本一区二区| 羞羞视频免费网站入口| 亚洲天堂电影在线观看| 亚洲精品夜夜夜妓女网| 好爽好紧好大的免费视频国产| 亚洲精品成a人在线观看☆ | 亚洲爆乳无码专区| 亚洲春色在线视频| 国产成人A在线观看视频免费| 亚洲国产系列一区二区三区| 中文字幕中韩乱码亚洲大片| 在线免费观看一级片| 四虎影视在线影院在线观看免费视频| 亚洲成A人片在线观看WWW| 成人毛片免费观看视频在线| 毛片无码免费无码播放 | 亚洲韩国在线一卡二卡| 最新国产AV无码专区亚洲| 美女黄网站人色视频免费国产| 亚洲欧美日韩一区二区三区在线| 免费观看成人毛片a片2008| 免费视频成人片在线观看| 黄视频在线观看免费| 精品国产亚洲AV麻豆|