公告板
 [2008-05-06] 新RSS訂閱連結: http://feeds.ssorc.tw/ssorc
 [2007-09-12] 新網址 http://ssorc.tw
 [2007-07-06] ChangeLog 記錄舊文章變動

munin + mod_watch 監控多台主機的 Virtual Host 網站流量 (未完)

1。登入主機

2。yum -y install httpd-devel

3。下載 wget http://updates.interworx.info/iworx/legacy/sources/mod_watch403.tgz

4。解開 tar zxvf mod_watch403.tgz ; cd mod_watch-4.3

5。編輯 Makefile.dso,更改 APXS=/usr/sbin/apxs

6。編譯 make -f Makefile.dso install

7。編輯 vi /etc/httpd/conf.d/mod_watch.conf,內容如下

  <IfModule mod_watch.c>
    # Allows the URL used to query virtual host data:
    #
    #   http://www.snert.com/watch-info
    #
    <Location /watch-info>
    SetHandler watch-info
  Order deny,allow
  Deny from all
  Allow from 127.0.0.1 192.168.1.0/24 59.120.209.208/28 59.120.37.184 59.120.37.185 59.120.37.186
    </Location>

    # Allows the URL used to query file owner and web
    # server data:
    #
    #   http://www.snert.com/~achowe/watch-info
    #   http://www.snert.com/~SERVER/watch-info
    #
    <Location /~*/watch-info>
    SetHandler watch-info
  Order deny,allow
  Deny from all
  Allow from 127.0.0.1 192.168.1.0/24 59.120.209.208/28 59.120.37.184 59.120.37.185 59.120.37.186
    </Location>
# Intended for debugging and analysis of shared memory
  # hash table and weenie files:
  #
  #     http://www.snert.com/watch-table
  #
  <Location /watch-table>
  SetHandler watch-table
  Order deny,allow
  Deny from all
  Allow from 127.0.0.1 192.168.1.0/24 59.120.209.208/28 59.120.37.184 59.120.37.185 59.120.37.186
  </Location>

  <Location /watch-flush>
  SetHandler watch-flush
  Order deny,allow
  Deny from all
  Allow from 127.0.0.1 192.168.1.0/24 59.120.209.208/28 59.120.37.184 59.120.37.185 59.120.37.186
  </Location>

  <Location /watch-list>
  SetHandler watch-list
  Order deny,allow
  Deny from all
  Allow from 127.0.0.1 192.168.1.0/24 59.120.209.208/28 59.120.37.184 59.120.37.185 59.120.37.186
  </Location>
  </IfModule>

8。看設定OK不OK,執行 apachectl configtest,再來 service httpd restart

9。至 192.168.1.15 監控主機的 /etc/munin/plugins/ 底下執行 ln -sf /usr/share/munin/plugins/apache_mod_watch_ apache_mod_watch_192.168.1.15

10。service munin-node restart

11。sudo -u munin munin-cron

12。瀏覽 http://192.168.1.15/munin/

標籤: 監控 apache
評論: 0 | 引用: 0 | 閱讀: 1385 | 列印 | 文件 | 轉發

發表評論
暱 稱: 密 碼:
網 址: E - mail:
驗證碼: 驗證碼圖片 選 項:
頭 像:
內 容:
  • 粗體
  • 斜體
  • 底線
  • 插入圖片
  • 超連結
  • 電子郵件
  • 插入引用
  • 表情符號