Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Collectd and Nginx plugin not working

Tags:

nginx

collectd

My collectd config looks like:

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

Nginx conf looks like:

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;
  }
}

When i execute

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

it outputs:

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

But when open graphite there is no nginx graph avaliable. Collectd and Nginx was restarted many times. Any suggestions?

like image 425
sredni Avatar asked Dec 08 '22 06:12

sredni


1 Answers

Finaly resolved. After logfile plugin turned on:

LoadPlugin logfile

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

I found that nginx plugin is not installed:

[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.

Simply execute (AMI):

$ sudo yum install collectd-nginx

And all works perfectly

like image 75
sredni Avatar answered Dec 11 '22 12:12

sredni