centos Install Mrtg

來源:互聯網
上載者:User

標籤:

  1. 安裝支援軟體包
    yum –y install gcc perl gd libpng zlib net-snmp mrtg
    配置snmpd
    編輯/etc/snmp/snmpd.conf檔案
    備份snmpd.conf檔案,建立空白snmpd.conf. 添加如下內容儲存即可
    com2sec notConfigUser localhost public
    group notConfigGroup v1 notConfigUser
    group notConfigGroup v2c notConfigUser 
    view systemview included .1.3.6.1.2.1.1
    view systemview included .1.3.6.1.2.1.25.1.1
    access notConfigGroup "" any noauth exact all none none
    view all included .1 80
    syslocation Unknown (edit /etc/snmp/snmpd.conf)
    syscontact Root
  2. 修改完成後重啟snmpd
    service snmpd restart 
    chkconfig snmpd on
  3. 配置mrtg
    預設的mrtg設定檔儲存在/etc/mrtg/mrtg.cfg
    建議使用命令產生mrtg.cfg模板。
    cfgmaker [email protected] --output /etc/mrtg.cfg
  4. 修改/etc/mrtg.cfg檔案
    只需將WorkDir: 修改為訪問路徑即可
    如:WorkDir: /var/www/mrtg
    mkdir /var/www/mrtg
  5. 產生mrtg首頁
    Indexmaker /etc/mrtg/cfg > /var/www/mrtg/index.html
    賦權:chmod 777 /usr/bin/rateup
  6. 使用mrtg繪製資料圖表
    env LANG=C /usr/bin/mrtg /etc/mrtg.cfg
  7. 建立定時任務
    */5 * * * * env LANG=C /usr/bin/mrtg /etc/mrtg.cfg
  8. 修改/etc/httpd/conf.d/mrtg.conf (預設只運行本機訪問)

    Alias /mrtg /var/www/mrtg

    <Location /mrtg>
    Order deny,allow
    Deny from none
    Allow from all
    Allow from ::1
    # Allow from .example.com
    </Location>

    重啟apache訪問http://your-ip/mrtg/即可

參考:http://my.oschina.net/jack230230/blog/150470 (包括CPU、記憶體監控)

centos Install Mrtg

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.