linux安装cacti监控文档
配置snmp:vim /etc/snmp/snmpd.conf
更改 1、com2sec notConfigUser default public
改为:com2sec notConfigUser127.0.0.1 public
2、access notConfigGroup "" any noauth exact systemviewnone none
改为:access notConfigGroup "" any noauth exact allnonenone
3、#viewall included .1 80
将前面的 # 注释去掉。
保存退出 :wq
service snmpd restart
tar zxvf rrdtool-1.3.9.tar.gz
cd rrdtool-1.3.9
./configure --prefix=/user/web/rrdtool --disable-tcl --disable-python
Make
make install
cd ../
ln -s /user/web/rrdtool/bin/rrdtool/usr/bin/rrdtool
ln -s /user/web/rrdtool/bin/rrdupdate /usr/bin/rrdupdate
ln -s /user/web/rrdtool/bin/rrdcgi /usr/bin/rrdcgi
cd /user/soft
tar zxvf cacti-0.8.7d-cn-utf8.gz
mv cacti-0.8.7d-cn-utf8 /user/web/html/cacti
/user/web/mysql/bin/mysql -uroot -pJackHuang2009
登入执行:
create database cacti;
退出执行:
/user/web/mysql/bin/mysql -uroot -pJackHuang2009 cacti /dev/null 2>&1
3.4 cacti监控nginx服务
nginx编译时允许http_stub_status_module
在conf文件添加如下:
# vi /user/web/nginx/conf/nginx.conf
location /nginx_status {
stub_status on;
access_log off;
}
重启动
killall nginx
/user/web/nginx/sbin/nginx
tar zxvf cacti-nginx.tar.gz
cp cacti-nginx/get_nginx_socket_status.pl /user/web/html/cacti/scripts/
cp cacti-nginx/get_nginx_clients_status.pl /user/web/html/cacti/scripts/
chmod 755 /user/web/html/cacti/scripts/get_nginx*
在cacti管理面板导入:
cacti_graph_template_nginx_clients_stat.xml
cacti_graph_template_nginx_sockets_stat.xml
检测插件:
/user/web/html/cacti/scripts/get_nginx_clients_status.pl http://127.0.0.1/nginx_status
3.5 cacti监控apache服务
对Apache Server Status的启用
对Apache的状态管理的模块是LoadModulestatus_module modules/mod_status.so,所以这个需要有
然后打开下面的配置
ExtendedStatus On
配置Apache Server Status的权限
SetHandler server-status
Order Deny,Allow
Allow from 127.0.0.1
页:
[1]