使用Cacti监控Nginx

利用Nginx_status状态来画图实现CACTI监控

nginx编译时允许http_stub_status_module

# vi /usr/local/nginx/conf/nginx.conf

location /nginx_status {

stub_status on;

access_log off;

allow 192.168.1.37;

deny all;

}

复制代码

# kill -HUP `cat /usr/local/nginx/logs/nginx.pid`

# tar xvfz cacti-nginx.tar.gz

# cp cacti-nginx/get_nginx_socket_status.pl /data/cacti/scripts/

# cp cacti-nginx/get_nginx_clients_status.pl /data/cacti/scripts/

# chmod 755 /data/cacti/scripts/get_nginx*

复制代码

检测插件

# /data/cacti/scripts/get_nginx_clients_status.pl http://192.168.1.37/nginx_status

复制代码

在cacti管理面板导入

cacti_graph_template_nginx_clients_stat.xml

cacti_graph_template_nginx_sockets_stat.xml

相关推荐