Cacti如何监控Nginx运行状态
来源:互联网 发布:unity3d美工 编辑:程序博客网 时间:2024/06/14 15:14
环境:
Cacti或者是Cactiez监控主机:192.168.12.5
Nginx服务器:192.168.9.25
1、 首先nginx编译时允许http_stub_status_module,不然是监控不到nginx的运行状态的
2、编辑配置文件
# vi /usr/local/nginx/conf/nginx.conf
location /NginxStatus/ {
stub_status on;
access_log off;
allow 192.168.0.0/16;#意思是只允许内网能看到监控信息
deny all;
}
3、重新加载nginx的配置文件
# kill -HUP `cat /usr/local/nginx/logs/nginx.pid`
4、在Cacti主机上下载nginx监控模板
# wget http://forums.cacti.net/download.php?id=12676
# 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*
5、检测插件
# /data/cacti/scripts/get_nginx_clients_status.pl http://192.168.9.25/NginxStatus/
输出信息:nginx_active:245 nginx_reading:11 nginx_writing:4 nginx_waiting:230
/data/cacti/scripts/get_nginx_socket_status.pl http://192.168.9.25/NginxStatus/
输出信息:nginx_accepts:41377 nginx_handled:41377 nginx_requests:223307
6、在cacti管理面板导入
cacti_graph_template_nginx_clients_stat.xml
cacti_graph_template_nginx_sockets_stat.xml
7、添加主机,在创建图形的时候会提示你输入URL of nginx stub status,后面你所监控的页面额url,比如上面我们的http://192.168.9.25/NginxStatus/,然后稍等下数据就会出来了。
8、如果你在测试第5步的过程中出现了以下信息:no (LWP::UserAgent not found),出现这个问题是perl里缺少组件,你可以按照下面的步骤解决:
# perl -MCPAN -e shell
# cpan> install LWP::UserAgent
如果perl组件安装成功,那么在此检测你就会得到正常的数据了。
- Cacti如何监控Nginx运行状态
- Cacti监控Nginx运行状态的方法
- lenny下Cacti连续监控Nginx运行状态
- cacti监控nginx服务
- cacti监控nginx
- Cacti如何监控Tomcat
- 用cacti监控memcached状态
- Cacti监控TCP连接状态
- 通过日志监控Nginx运行状态
- Cacti安装nginx状态监控时出现No such file or directory错误的解决办法
- cacti如何进行进程监控
- 配置 CACTI 监控 MySQL 数据库状态
- [Cacti] memcache安装运行、cacti监控memcache实战
- [Cacti] memcache安装运行、cacti监控memcache实战
- 开启nginx状态监控
- nginx状态监控
- nginx状态监控
- nginx状态监控
- C语言的谜题
- configure编译时,出现 configure: error: C compiler cannot create executables错误解决
- 普通字符串转换为宽字符串
- 解决linux中flash掉电丢失数据问题
- 几何矩的由来及应用
- Cacti如何监控Nginx运行状态
- 查看文件属性 为什么大小和占用空间不同
- 提升工作效率的9个习惯
- 目标区域的几何形状特征参数概述
- cacti监控windows主机
- 对Arx的向量的体会
- Android下打印调用栈
- 石子归并
- PhpEclipse的一些快捷方式