You are here

nginx http service check

6 posts / 0 new
Last post
nmilas
nmilas's picture
nginx http service check

Hello,

I am running Opsview Core 3.20130903.0 on CentOS 5.9 x86_64.

Could you please tell me if there exists a Host Template for nginx server monitoring (e.g. Application - NGINX HTTP), providing about the same info as the Apache Template: Accesses, Active Sessions, bytes per request, requests per second, traffic (and possibly more, if available).

If so, where can I find it and install it?

Thanks,
Nick
 

smarsh
smarsh's picture
Re: nginx http service check

Hi Nick,

No none exists - your best bet is to look here http://exchange.nagios.org/directory/Plugins/Web-Servers/nginx or Google for a nginx plugin.

Best,

Sam

nmilas
nmilas's picture
Re: nginx http service check

Thanks,

Something like:

http://exchange.nagios.org/directory/Plugins/Web-Servers/nginx/check_nginx_status-2Epl/details

...looks OK.

Is there a guide on how to integrate such a plugin in Opsview as a service check and then creating a custom Host Template?

By the way, some time Opsview might want to add an NGINX host template. It is a quite extensively used web server:

http://w3techs.com/technologies/history_overview/web_server/ms/y

Thanks again,
Nick

smarsh
smarsh's picture
Re: nginx http service check

Hi Nick,

To add the plugin, just copy it to /usr/local/nagios/libexec and chmod +x / chown nagios:nagios it. Then create service checks using that plugin by going to "Settings > Service checks", add new, then at the bottom select the plugin you just copied, i.e. check_nginx for example. Then either create a host template from your newly made checks and apply that to your hosts, or apply them one by one via the monitors tab.

Best,

Sam.

nmilas
nmilas's picture
Re: nginx http service check

Hi again,

It may be some time since I left this thread, but I have finally found the time to work on this and I have successfully used the above mentioned nginx service check.

However, I would need to ask your advice on graphing data.

The service output is as follows:

NGINX OK - 0.065 sec. response time, Active: 36 (Writing: 2 Reading: 0 Waiting: 34) ReqPerSec: 2.182 ConnPerSec: 1.727 ReqPerConn: 2.217

Opsview automatically graphs the "Writing" value only! Yet, I would only want to graph ReqPerSec, ConnPerSec and ReqPerConn.

How should the service check output be laid out so that Opsview picks up the above values automatically and graphs them correctly? Can you please provide a sample output that would work?

Note: If I run the same check from the command line I get more output (I have changed real IP address and domain names):

# ./check_nginx_status.pl -H 10.10.10.100 -u http://www.example.com/nginx_status -s www.example.com -w "-1,-1,-1" -c "-1,-1,-1" Unknown option: 1 Unknown option: , Unknown option: 1,-1 Unknown option: 1 Unknown option: , Unknown option: 1,-1 NGINX OK -  0.034 sec. response time, Active: 47 (Writing: 1 Reading: 0 Waiting: 46) ReqPerSec: 4.938 ConnPerSec: 2.625 ReqPerConn: 2.217|Writing=1;Reading=0;Waiting=46;Active=47;ReqPerSec=4.937500;ConnPerSec=2.625000;ReqPerConn=2.216513

The last part ("Writing=1;Reading=0;Waiting=46;Active=47;ReqPerSec=4.937500;ConnPerSec=2.625000;ReqPerConn=2.216513") appears as Performance Data in the Service Check Details.

Please advise.

Thanks in advance,
Nick

 

nmilas
nmilas's picture
Re: nginx http service check

Hmm, anyways,

I found the following threads:

and I decided I should try formatting performance data as follows:

ReqPerSec=4.937500;;;; ConnPerSec=2.625000;;;; ReqPerConn=2.216513;;;;

and this did the trick; Opsview now picks up the above values automatically and graphs them.

However, any other advice would be appreciated!

All the best,
Nick