Forum: NGINX Nagios check for nginx with separate metrics

34c7b0659e6361c2bbbdbfa6ca597cc0?d=identicon&s=25 Nikolaos Milas (Guest)
on 2013-10-27 20:10
(Received via mailing list)
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-S...)
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 <metric>," 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
34c7b0659e6361c2bbbdbfa6ca597cc0?d=identicon&s=25 Nikolaos Milas (Guest)
on 2013-11-13 16:11
(Received via mailing list)
On 27/10/2013 9:09 μμ, Nikolaos Milas 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
36a8284995fa0fb82e6aa2bede32adac?d=identicon&s=25 Francis Daly (Guest)
on 2013-11-13 23:01
(Received via mailing list)
On Wed, Nov 13, 2013 at 05:10:25PM +0200, Nikolaos Milas wrote:
> On 27/10/2013 9:09 μμ, Nikolaos Milas 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 Daly        francis@daoine.org
34c7b0659e6361c2bbbdbfa6ca597cc0?d=identicon&s=25 Nikolaos Milas (Guest)
on 2013-11-14 12:04
(Received via mailing list)
On 14/11/2013 12:00 πμ, Francis Daly wrote:

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

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! :-(

Thanks,
Nick
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.