cacti添加nginx status监控
cacti添加nginx status监控1.首先要在被监控的 nginx配置文件里加入如下配置:location /NginxStatus {
stub_status on;
access_log /opt/nginx/logs/status.log;
allow all;
#deny all; }2.测试配置是否成功
http://你的服务器IP/NginxStatus,如果出现
如果NginxStatus状态页内容出现如上图,表明nginx配置成功
active connections – 所有打开的连接,包括连接到后端服务器的。
server accepts handled requests – nginx已经接受并处理36889564个连接,44301399个请求(每个连接1.2个请求)。
reading – 正在读取的请求头。
writing – 正在读取的请求主体,正在处理的请求或者正在写入的应答。
waiting – keepalive连接数,等于active - (reading + writing)。
3.下载cacti监控nginx status插件
http://www.oschina.net/uploads/code/cacti-nginx.tar.gz
解压后一共有5个文件,首先把 get_nginx_socket_status.pl 以及 get_nginx_clients_status.pl 上传至服务器cacti 目录下scripts 并设置可执行权限跟755读写权限
4.检测插件# /var/www/cacti/scripts/get_nginx_clients_status.pl http://你的服务器IP/NginxStatus
显示的内容跟 NginxStatus 状态页内容相当即可。
5然后在cacti管理界面板导入模板
导入的方式是:导入模板 -》从本地文件中导入
导入的文件是插件包得另外两个文件(cacti_graph_template_nginx_clients_stat.xml,cacti_graph_template_nginx_sockets_stat.xml)
6两个文件导入成功的话 都会显示
这时你就能够在图像模板中看到导入xml后产生的模板
7.最后你就可以为需要监控nginx status的服务器新建图像了,这个就不多说了
配置完成
页:
[1]