[collectd] Confusion for nginx

Giovanni Torres giovtorres at hotmail.com
Sat Feb 14 22:58:47 CET 2015



________________________________
> Date: Thu, 15 Jan 2015 17:23:57 -0800 
> From: tendoncs at gmail.com 
> To: list at collectd.org 
> Subject: [collectd] Confusion for nginx 
>  
> I just have nginx left to set up on about 40 servers. 
>  
> I look in the basic conf and I see this 
>  
> #<Plugin nginx> 
> #       URL "http://localhost/status?auto" 
> #       User "www-user" 
> #       Password "secret" 
> #       VerifyPeer false 
> #       VerifyHost false 
> #       CACert "/etc/ssl/ca.crt" 
> #</Plugin> 
>  
> I then see this one at https://collectd.org/wiki/index.php/Plugin:nginx 
>  
> <Plugin "nginx"> 
>    URL "https://localhost:8433" 
>    User "stats" 
>    Password "uleePi4A" 
> </Plugin> 
>  
> It may be I am new to nginx however I don't have a user or password. I  
> Am running it from the local machine.. I have tried a few ways to set  
> the conf up none of them result in metrics. 
>  
> Any help would be useful. 
>  

First, make sure the stub_status module is configured and working with your nginx servers:

# nginx -V | grep stub_status

Next, have a look here to configure the status module in nginx: http://nginx.org/en/docs/http/ngx_http_stub_status_module.html#stub_status  

You will need something like the example config shown on that page.  If you are running an older version ( < 1.7.5 ), you may need "stub_status on;" instead of just "stub_status".  Verify that this works before trying to configure the collectd nginx plugin.  Go to http://<ipaddr>/basic_status (replace /basic_status with whatever you put in the stub_status config in nginx.conf.  Once you've verified that the status page reports information, the last step would then be to configure the nginx collectd plugin.

Your config could look like this:

### BEGIN ###
LoadPlugin nginx

<Plugin nginx>
    URL "http://localhost/basic_status"
</Plugin>

### END ###

The user and password are optional and only needed if you configured the stub_status location with a username and password.  The other parameters are related to SSL and again only required if your status page is only accessible via HTTPS.  If not, the URL should suffice.

That should do it.

-Giovanni
 		 	   		  


More information about the collectd mailing list