1.配置nginx.conf
server
{
listen 80;
server_name localhost;
index index.php index.html;
root html;
location ~ .*\.(php|php5)?$
{
fastcgi_pass 127.0.0.1:9000;
fastcgi_index index.php;
include fastcgi.conf;
}
location /status {
stub_status on;
access_log off;
allow 192.168.6.0/24;
allow x.x.x.x;
deny all;
}
access_log off;
}
2.下载cacti for nginx 插件包:
3.解压后一共有5个文件,首先把 get_nginx_socket_status.pl 以及 get_nginx_clients_status.pl 上传至服务器cacti 目录下scripts 并设置可执行权
限
检测插件(举例)
[root@WTtraffic scripts]# ./get_nginx_clients_status.pl
nginx_active:2118 nginx_reading:50 nginx_writing:1 nginx_waiting:2067
然后在cacti管理面板导入
导入的方式是 Import Templates > Import Template from Local File (浏览导入插件包另外2个文件)
cacti_graph_template_nginx_clients_stat.xml
cacti_graph_template_nginx_sockets_stat.xml
阅读(1392) | 评论(0) | 转发(0) |