添加Nginx-1.0.4/5的Munin-1.4.6的监控(Munin+Nginx)和需要依赖perl-libwww-perl
来源:互联网 发布:淘宝怎么用微信付款 编辑:程序博客网 时间:2024/05/18 18:46
1. 确认你的nginx加载了http_stub_status_module模块,没有的话,重新编译。
查看Nginx版本:
1
[root@hexuweb102 monitor]$ /usr/
local
/nginx/sbin/nginx -
v
2
#nginx: nginx version: nginx/1.0.4
查看安装哪些模块:
1
[root@hexuweb102 monitor]$ /usr/
local
/nginx/sbin/nginx -V
2
#nginx: nginx version: nginx/1.0.4
3
#nginx: built by gcc 4.1.2 20080704 (Red Hat 4.1.2-50)
4
#nginx: TLS SNI support disabled
5
#nginx: configure arguments: --prefix=/usr/local/nginx --user=nobody --group=nobody --with-http_ssl_module --with-http_stub_status_module --with-http_gzip_static_module
从上面看,我的已经安装,如果你的没有安装使用下方法重新编译安装即可:
01
[root@hexuweb102 monitor]$
tar
zxf nginx-1.0.4.
tar
.gz
02
[root@hexuweb102 monitor]$
cd
nginx-1.0.4
03
[root@hexuweb102 monitor]$./configure \
04
--prefix=/usr/
local
/nginx \
05
--user=nobody \
06
--group=nobody \
07
--with-http_ssl_module \
08
--with-http_stub_status_module \
## 添加此模块
09
--with-http_gzip_static_module
10
[root@hexuweb102 monitor]$
make
&&
make
install
2. 在Nginx Server (Vhost) 添加下面代码:
01
[root@hexuweb102 monitor]$
vi
/usr/
local
/nginx/conf/nginx.conf
02
server {
03
listen 127.0.0.1;
04
server_name localhost;
05
location /nginx_status {
06
stub_status on;
07
access_log off;
08
allow 127.0.0.1;
09
deny all;
10
}
11
}
下载nginx plugin for munin,重命名为nginx_combined_
1
http://exchange.munin-monitoring.org/plugins/nginx-combined/details
2
3
http://exchange.munin-monitoring.org/plugins/nginx-combined/version/2/download
将文件拷贝(到你的munin插件库目录)并改名字:
1
[root@hexuweb102 monitor]$
cp
./Nginx_Combined-v2 /opt/munin/lib/plugins/nginx_combined_
然后 ln 到(注意后面名字会显示在 munin):
1
[root@hexuweb102 monitor]$
ln
-s /opt/munin/lib/plugins/nginx_combined_ /etc/opt/munin/plugins/nginx_combined
2
#也可以其它方式::
3
#example1: ./nginx_mysite.net
4
#example2: ./nginx_10.0.0.1
完成上面两步之后,重启munin-node即可,如果想马上看到就执行一下munin-cron:
1
[root@hexuweb102 monitor]$
ps
aux |
grep
munin
## 查看 munin ID
2
[root@hexuweb102 monitor]$
kill
$muninId
## ps 看到 ID
3
[root@hexuweb102 monitor]$
kill
$muninId
## ps 看到 ID
4
[root@hexuweb102 monitor]$ /opt/munin/sbin/munin-node
## 启动
5
[root@hexuweb102 monitor]$ /opt/munin/bin/munin-
cron
## 可以马上看到
nginx_combined 默认Title个人感觉整个不合配置,改下面内容即可:
1
### 因为这里有一从此 $URL ######
2
#print "graph_title NGINX status: $URL\n;
3
print
"graph_title NGINX status combined\n"
;
注意,如果所有操作完成后,为确保成功正常的运行,可以使用munin-run测试,下面使用munin自带的nginx_request测试
常见问题: munin监控nginx出现 no (LWP::UserAgent not found)
1
[root@hexuweb102 monitor]$ /opt/munin/sbin/munin-run nginx_request
2
#Can't locate object method "new" via package "LWP::UserAgent" at /etc/opt/munin/plugins/nginx_request line 106.
发现有BUG了,是因为perl-libwww-perl没有安装,安装即可:
1
[root@hexuweb102 monitor]$ yum -y
install
perl-libwww-perl
然后再确认:
1
[root@hexuweb102 monitor]$ /opt/munin/sbin/munin-run nginx_request
2
#request.value 3351969
- 添加Nginx-1.0.4/5的Munin-1.4.6的监控(Munin+Nginx)和需要依赖perl-libwww-perl
- 服务器监控Munin的配置
- munin系统监控工具的使用
- Munin监控的安装与配置
- 基于CentOS5.x的munin 服务器监控安装配置
- nginx和perl和jsp的关联
- c#和perl和nginx的关联
- Linux 安装 Master/Node munin-1.4.6 + rrdtool-1.4.5 监控服务运行状态
- munin监控配置
- munin监控配置
- 资源监控工具Munin
- 服务器监视的好工具munin
- Munin 基于Web的性能工具
- Centos5.6安装MUNIN
- Linux系统轻量级监控工具monitorix和munin安装
- Linux系统轻量级监控工具monitorix和munin安装
- nginx的perl cgi支持修改
- 使用 Perl 来开发 Nginx 的模块
- 在 AIX 5.3 和 6.1 中使用 Veritas Volume Manager (VxVM) V5 管理逻辑卷
- 黑马程序员:Java学习笔记——反射
- 从宠物浴液做一个O2O项目的设想
- 祝福你亲爱的
- 学习动态代理stepbystep(4)
- 添加Nginx-1.0.4/5的Munin-1.4.6的监控(Munin+Nginx)和需要依赖perl-libwww-perl
- VIM 历史简介
- About Computer
- Servlet中的forwar和include的区别
- 负载均衡技术解读
- Brian Kernighan's homepage
- 关于分位数
- 斐波那契数列(二)
- 《GWT揭秘》