Nagios check for nginx with separate metrics

Hello,

I am trying to run a Nagios check for nginx (in Opsview Core) but I have
a problem: All of the available (to my knowledge) nginx Nagios checks
(http://exchange.nagios.org/directory/Plugins/Web-Servers/nginx/)
produce comprehensive output which includes all “metrics” together,
while I would want one that can output a selected metric at a time, by
using a parameter, like “-m ,” in the following example:

./check_nginx.sh -H localhost -P 80 -p /var/run -n nginx.pid -s
nginx_status -o /tmp -m current_requests

  • or -
    ./check_nginx.sh -H localhost -P 80 -p /var/run -n nginx.pid -s
    nginx_status -o /tmp -m requests_per_second
  • or -
    ./check_nginx.sh -H localhost -P 80 -p /var/run -n nginx.pid -s
    nginx_status -o /tmp -m accesses
    etc.

Does anyone know whether such an nginx Nagios check exists (and where)
or we would have to modify source code of one of these plugins to
achieve the required behavior? (Frankly, I would be surprised if such a
check does not exist yet, but I couldn’t find one on the Net, despite my
searches.)

Output with a single metric at a time is important for use in
server/network monitoring systems.

(I know that the issue is more related to Nagios, but I am hoping that
someone on this mailing list has faced this problem with monitoring
NGINX and can point to a solution.)

Thanks and regards,
Nick

On 27/10/2013 9:09 μμ, Nikolaos M. wrote:

  • or -
    a check does not exist yet, but I couldn’t find one on the Net,
    despite my searches.)

Output with a single metric at a time is important for use in
server/network monitoring systems.

Anyone? No NGINX Nagios users around?

Regards,
Nick

On Wed, Nov 13, 2013 at 05:10:25PM +0200, Nikolaos M. wrote:

On 27/10/2013 9:09 μμ, Nikolaos M. wrote:

Hi there,

All of the available (to my knowledge) nginx Nagios checks

produce comprehensive output which includes all “metrics” together,

Output with a single metric at a time is important for use in
server/network monitoring systems.

If everyone who writes a checker provides multiple metrics at once,
that
kind of suggests that a single metric at a time isn’t all that
important.

Does anyone know whether such an nginx Nagios check exists (and where)
or we would have to modify source code of one of these plugins to
achieve the required behavior?

I suspect you’re going to have to write your own – maybe from scratch,
maybe a wrapper around one you like.

Presumably they all ask for a url where nginx serves “stub_status”, and
process the numbers returned. In your version, just ignore the numbers
you don’t care about. (Or cache them and serve slightly-stale
information,
to avoid making the same request three times in succession.)

Good luck with it,

f

Francis D. [email protected]

On 14/11/2013 12:00 πμ, Francis D. wrote:

Ifeveryone who writes a checker provides multiple metrics at once, that
kind of suggests that a single metric at a time isn’t all that important.

I won’t disagree, you need to correlate metrics, but you cannot graph
them as a function of time if you don’t log them separately.

Presumably they all ask for a url where nginx serves “stub_status”, and
process the numbers returned.

Right. That’s how they operate.

In your version, just ignore the numbers you don’t care about. (Or cache them
and serve slightly-stale information,
to avoid making the same request three times in succession.)

Good luck with it,

I am still surprised, however, that I couldn’t find such a thing around,
esp. since it’s standard in Apache Nagios checks!

I can (most probably) do it, but life is just not enough to find time to
do everything by yourself! :frowning:

Thanks,
Nick

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs