Jump to: navigation, search
Revision as of 17:15, 21 September 2011 by Falz (Talk | contribs)

Contents

Description

The nginx application monitor uses a Python script to extend the SNMP server on the host to be monitored. All stats are polled via SNMP and no further ports need to be opened.

Example Graphs

0990.png 5da7d.png


Instructions

You need the stub status module for this. You will also need to allow connections from localhost as to making the snmp-server being able to use the script to provide data over SNMP. It should look something like this:

location /nginx-status {
    stub_status on;
    access_log   off;
    allow 127.0.0.1;
    deny all;
}

Now, place the nginx-stats script (observium/scripts) somewhere where the snmp-server can find it. I placed it in /usr/local/etc/snmp-scripts. Make sure it's executable and then proceed to configure net-snmp.

Put this in the appropriate section of net-snmp (modify path accordingly):

 extend nginx /path/to/nginx-stats

Do not forget to restart net-snmp.

You should now be able to add the "nginx" application to your host on Observium and have it correctly polled.

Observium Configuration

Sample web server config for nginx:

server {
	listen  1.2.3.4:80;
	listen  [2600:a4a0::2]:80;
	server_name observium.example.com;
	root   /usr/local/www/observium/html;
	index  index.php;

	location / {
		try_files $uri $uri/ @observium;
	}

	location @observium {
		rewrite ^(.+)$ /index.php/$1/ last;
	}

       location ~ ^/(.*.php).*$ {
               alias /usr/local/www/observium/html/$1;
               include php;
       }
}