GithubHelp home page GithubHelp logo

nginx-munin's Introduction

Nginx requests, memory usage and connections statistics with Munin

Introduction

These three perl scripts are Munin plugins for monitoring the nginx HTTP server.

nginx_status

Based on the one provided in the Debian munin-node package. Which is itself a modified version of the one available at the Munin Plugin Exchange. It shows the connection status for nginx.

Presents the values returned by nginx, using the http_stub_status module, are respectively, the number of:

connections initiated, connections handled, requests served

nginx_connection_request

Presents the number of requests served by connection handled by nginx. The requests-connection ratio handled by the server is the ratio:

requests served / connections handled

This is implemented as a RRDtool datasource of type GAUGE, the default type for Munin.

nginx_request

Based on the one provided in the Debian munin-node package. Which is itself a modified version of the one available at the Munin Plugin Exchange.

It uses a derivative (technically a finite difference) to compute the connection rate value.

nginx_memory

Based on a previous plugin by AkyRhO. It uses ps and awk to get the memory used by the master and worker processes of nginx.

Installation & Configuration

  1. Copy all the scripts to /etc/munin/plugins.
  2. Restart the munin-node daemon: /etc/init.d/munin-node restart.
  3. Done. You should now start to see a new section nginx in your Munin pages with the corresponding graphs.
  4. All scripts have POD documentation. Issue perldoc <script name> to read them.

Environment Settings

Both nginx_request and nginx_status accept two environment variables:

  • URL: the URL of the nginx status data. The default value is:

    http://hostname/nginx_status

  • UA: the User Agent that the plugin sends in the HTTP header. Since most sites block the libwww-* user agent to get rid of bad bots and mostly up to no good scanners, the scripts send a different User Agent to get around that.

Both variables can be specified in the /etc/munin/plugin-conf.d/munin-node file.

Something like this for altering the URL:

[nginx_status] env.url=http://hostname:8888/nginx-status nginx_status

[nginx_connection_request] env.url=http://hostname:8888/nginx-status nginx_status

[nginx_request] env.url=http://hostname:8888/nginx-status nginx_status

Add env.ua for altering the User Agent.

Don’t forget to restart the munin-node daemon as described in step 2 of the installation instructions above.

Note: the github handling of Org mode markup is broken. Therefore the [nginx_status] [nginx_connection_request] and [nginx_request] lines are separate from the lines specifying the environment variables.

It’s not github’s responsibility but rather a bug in Org-Ruby.

nginx-munin's People

Contributors

perusio avatar vjt avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.