gpt4 book ai didi

nginx - Collectd 和 Nginx 插件不工作

转载 作者:行者123 更新时间:2023-12-03 02:42:55 24 4
gpt4 key购买 nike

我的collectd配置如下:

LoadPlugin nginx
...
<Plugin "nginx">
URL "http://localhost:8080/nginx_status?auto"
</Plugin>

Nginx 配置看起来像:

server {
listen 8080;
index index.html index.htm;
server_name localhost;
root /var/www/default/;

location / {
try_files $uri $uri/ /index.html;
}

location /nginx_status {
stub_status on;
access_log off;
allow 127.0.0.1;
deny all;
}
}

当我执行时

$ curl http://localhost:8080/nginx_status?auto

它输出:

Active connections: 1 
server accepts handled requests
56 56 322
Reading: 0 Writing: 1 Waiting: 0

但是当打开 Graphite 时,没有可用的 nginx 图。Collectd 和 Nginx 被重启了很多次。有什么建议吗?

最佳答案

终于解决了。日志文件插件开启后:

LoadPlugin logfile

<Plugin logfile>
LogLevel info
File "/var/log/collectd.log"
Timestamp true
</Plugin>

我发现nginx插件没有安装:

[2014-10-14 06:30:59] plugin_load: Could not find plugin "nginx" in /usr/lib64/collectd
[2014-10-14 06:30:59] Found a configuration for the `nginx' plugin, but the plugin isn't loaded or didn't register a configuration callback.

只需执行(AMI):

$ sudo yum install collectd-nginx

一切都完美

关于nginx - Collectd 和 Nginx 插件不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26341199/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com