1 先配置加载lighttpd的mod_status模块
这里是用的lighttpd-1.4.28版本的,有两种方法
第一中,1编辑lighttpd的module.conf 配置文件,加载mod_status模块,并取消include “conf.d/status.conf” 注释
server.modules =(
“mod_access”;
“ mod_status“;
……
)
2 编辑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"
}
2 下载cacti监控lighttpd的模板
http://forums.cacti.net/about19676.html
lighttpd_stats_1.0.tar
解压并把对应的php 脚本拷贝到caci的scripts的目录下面
#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
3 把cacti监控lighttpd的模板cacti_host_template_webserver_lighttpd.xml 导入到cacti中