...
分类: LINUX
2010-04-06 19:15:32
一. squid
1. squid编译时要加入参数–enable-snmp
编辑squid.conf,加入如下行
snmp_port 3401
acl snmppublic snmp_community blog.zhangjianfeng.com
snmp_access allow snmppublic
snmp_incoming_address 0.0.0.0
snmp_outgoing_address 255.255.255.255
2.编辑snmpd.conf,加入如下行
view systemview included .1.3.6.1.4.1.3495.1
proxy -v 1 -c blog.zhangjianfeng.com 127.0.0.1:3401 .1.3.6.1.4.1.3495.1
# 可以手工检查 snmpwalk -v 1 -c blog.zhangjianfeng.com squidIP .1.3.6.1.4.1.3495.
3.下载三个模版文件
wget
wget
wget
4.在cacti管理页面中导入相关xml文件–”Import Templates”
二.mysql
– cacti server
Put mysql_stats.php and dumpMemcachedStats.php in cacti/scripts/
Import .XMLs
– mysql server
GRANT PROCESS ON *.* TO cactiuser@’%’ IDENTIFIED by ‘iloveyou’;
GRANT SUPER ON *.* TO cactiuser@’%’ IDENTIFIED BY ‘iloveyou’;
三.apache
导入两个xml
将pl脚本放到cacti/scripts/目录下
—apache服务器
ExtendedStatus On
SetHandler server-status
Order deny,allow
Deny from all
Allow from cactiserverip
四.nginx
– nginx server
location /nginx_status {
stub_status on;
access_log off;
}
– cacti server
cp get_nginx_clients_status.pl
cp get_nginx_socket_status.pl
chmod 0755
chmod 0755
手工检查 get_nginx_clients_status.pl
# 如出现no (LWP::UserAgent not found)
# perl -MCPAN -e shell
# cpan> install LWP::UserAgent
在CACTI中建图的时候需要填写一下URL of nginx stub status为完整URL,如
五.memcached
http://dealnews.com/developers/cacti/memcached.html
1. Python Client API Installation
下载python-memcached ftp://ftp.tummy.com/pub/python-memcached/
tar xzf python-memcached-
python setup.py install
2. Template Installation
wget http://content.dealnews.com/dealnews/developers/cacti-memcached-1.0.tar.gz
复制memcached.py 到
测试 python
默认端口号是11211,如果memcache的监听端口不是这个,需要调整
1). Data Input Methods – Memcached – Statistics
2). Under the Data Input Methods section, in the Input String textbox, add -p PORT before
e.g. python
六.Tcp Connstats
导入两个xml
将pl脚本放到cacti/scripts/目录下