cacti監控lighttpd

weixin_33766168發表於2017-11-23

 

先配置載入lighttpdmod_status模組

這裡是用的lighttpd-1.4.28版本的,有兩種方法

第一中,1編輯lighttpdmodule.conf 配置檔案,載入mod_status模組,並取消include conf.d/status.conf 註釋

           server.modules =

                         mod_access”;

                           mod_status“;

                             ……

                            )

       編輯mod_status 的配置文

               #cd conf.d

               #vim  status.conf

                  #server.modules += ( "mod_status" )

                     注:註釋此項因為已經在module.conf中已經載入了該模組,如果再次載入,回報下面的錯誤

Starting lighttpd: 2010-09-09 02:33:15: (plugin.c.131) Cannot load plugin mod_status more than once, please fix your config (we may not accept such configs in future releases

 

$HTTP["remoteip"] == "192.168.2.194" {

   #注:此項是設定 允許那臺主機訪問http://ip/server-status 這個頁面,來檢視lighttpd的工作狀態

                   status.status-url          = "/server-status"

  status.config-url          = "/server-config"

                   status.statistics-url      = "/server-statistics"

                   status.enable-sort         = "enable"

}

 

   第二種方法就是在module.conf檔案中只需要取消include conf.d/status.conf 註釋

           並編輯mod_status的配置檔案

                             server.modules += ( "mod_status" )

 

$HTTP["remoteip"] == "192.168.2.194" {

                             status.status-url          = "/server-status"

                             status.config-url          = "/server-config"

                             status.statistics-url      = "/server-statistics"

 status.enable-sort         = "enable"

}

 

 

 

 

 

 

下載cacti監控lighttpd的模板

      http://forums.cacti.net/about19676.html 

                  lighttpd_stats_1.0.tar

 

解壓並把對應的php 指令碼拷貝到caciscripts的目錄下面

 

    #tar xvf lighttpd_stats_1.0.tar

    #cd  lighttpd_stats_1.0

    #cp  ss_lighttpd_stats.php  /var/www/html/cacti/scripts

 注意並修改該指令碼的屬主,不然cacti會報錯

     

09/09/2010 11:55:07 AM - PHPSVR: Poller[0] WARNING: Function does not exist

09/09/2010 11:55:07 AM - PHPSVR: Poller[0] WARNING: Function does not exist

09/09/2010 11:55:07 AM - PHPSVR: Poller[0] WARNING: Function does not exist

09/09/2010 11:55:07 AM - PHPSVR: Poller[0] WARNING: Function does not exist

所以一定要修改該php指令碼的許可權

   #chown cactiuer ss_lighttpd_stats.php

cacti監控lighttpd的模板cacti_host_template_webserver_lighttpd.xml 匯入到cacti










本文轉自 freehat08 51CTO部落格,原文連結:http://blog.51cto.com/freehat/391270,如需轉載請自行聯絡原作者

相關文章