Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Nginx Troubleshooting

You're reading from   Nginx Troubleshooting Investigate and solve problems with Nginx-powered websites using a deep understanding of the underlying principles

Arrow left icon
Product type Paperback
Published in Apr 2016
Publisher
ISBN-13 9781785288654
Length 172 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Alexey Kapranov Alexey Kapranov
Author Profile Icon Alexey Kapranov
Alexey Kapranov
Arrow right icon
View More author details
Toc

Getting statistics from http_stub_status


Nginx base distribution contains a simple module that provides access to several rather basic but useful counters inside Nginx that are very important to monitor on a regular basis. The module is named ngx_http_stub_status, and we will describe how to use it in monitoring.

This module is not compiled by default. To check if your Nginx distribution is compiled with the stub_status module, you can use this command:

$ nginx -V 2>&1 | fgrep -c http_stub_status_module
1
$

If you see 1, then this module is compiled and linked to your Nginx binary. Otherwise, you need to compile it using --with-http_stub_status_module parameter to configure script that is invoked during Nginx compilation.

Once you have this module available, you can use its directives (actually, there is only one) in nginx.conf. This is an example of stub-status sharing:

location /stub-status {
    stub_status;
}

This module belongs to the family of the so-called content-generating modules...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime