New Question
 
 
PRTG Network Monitor

Intuitive to Use.
Easy to manage.

200.000 administrators have chosen PRTG to monitor their network. Find out how you can reduce cost, increase QoS and ease planning, as well.

Free PRTG
Download >>

 

What is this?

This knowledgebase contains questions and answers about PRTG Network Monitor and network monitoring in general. You are invited to get involved by asking and answering questions!

Learn more

 

Top Tags


View all Tags


nginx monitoring

Votes:

0

Your Vote:

Up

Down

Hello, How can i monitor nginx web-server (linux)? I need a sensor like "Windows IIS Application sensor".

monitoring nginx prtg

Created on May 27, 2014 8:19:54 AM by  MAA (1) 1



4 Replies

Votes:

0

Your Vote:

Up

Down

Have you seen this KB article already? http://kb.paessler.com/en/topic/60186

It describes monitoring NGiNX with a custom exe sensor :)

Created on May 27, 2014 8:36:14 AM by  Stephan Linke [Paessler Support]



Votes:

0

Your Vote:

Up

Down

Hi MAA,

I have been monitoring nginx with the status page for some time, but have had to patch the source code to make it PRTG compatible. See the patch below, then use a HTTP Content sensor with 6 channels.

--- src/http/modules/ngx_http_stub_status_module.c      2013-05-06 11:26:50.000000000 +0100
+++ src/http/modules/ngx_http_stub_status_module.cmh    2013-06-14 14:51:05.303729784 +0100
@@ -131,14 +131,14 @@
     wr = *ngx_stat_writing;
     wa = *ngx_stat_waiting;

-    b->last = ngx_sprintf(b->last, "Active connections: %uA \n", ac);
+    b->last = ngx_sprintf(b->last, "Active connections: [%uA] \n", ac);

     b->last = ngx_cpymem(b->last, "server accepts handled requests\n",
                          sizeof("server accepts handled requests\n") - 1);

-    b->last = ngx_sprintf(b->last, " %uA %uA %uA \n", ap, hn, rq);
+    b->last = ngx_sprintf(b->last, " [%uA] [%uA] [%uA] \n", ap, hn, rq);

-    b->last = ngx_sprintf(b->last, "Reading: %uA Writing: %uA Waiting: %uA \n",
+    b->last = ngx_sprintf(b->last, "Reading: [%uA] Writing: [%uA] Waiting: [%uA] \n",
                           rd, wr, wa);

     r->headers_out.status = NGX_HTTP_OK;

Created on May 29, 2014 8:13:52 AM by  Matthew Horwood (0) 1



Votes:

2

Your Vote:

Up

Down

If you're merely interested in recording the connection information from the status page, you can use the embedded variables that the status module exposes, and format them for consumption by the HTTP Content sensor directly in the NGINX configuration:

location /prtg {
    return 200 [$connections_active][$connections_reading][$connections_writing][$connections_waiting];
    access_log off;
    allow x.x.x.x/y;
    deny all;
}

Reference: https://nginx.org/en/docs/http/ngx_http_stub_status_module.html

Created on Jun 15, 2018 2:59:41 AM by  ek (50)

Last change on Jun 15, 2018 6:23:46 AM by  Luciano Lingnau [Paessler Support]



Votes:

0

Your Vote:

Up

Down

The HTTP Content sensor option provided by above worked perfectly. Thanks!

Note: for reference, and common sense would prevail on this, when creating the sensor increase the # channels to 4 corresponding with the # of embedded variables. Additionally, after creating the sensor, edited the channel names to reflect the variables. Channel ID #'s in order of listing order in NGiNX config from above.

Created on Apr 11, 2019 8:12:27 PM by  KryPRTGadmin (50) 1



Please log in or register to enter your reply.


Disclaimer: The information in the Paessler Knowledge Base comes without warranty of any kind. Use at your own risk. Before applying any instructions please exercise proper system administrator housekeeping. You must make sure that a proper backup of all your data is available.