telegraf/plugins/inputs/nginx
Sven Rebhan 5bb0002948
docs(inputs): Add plugin metadata and update description for n* (#16692)
2025-04-08 10:27:01 +01:00
..
README.md docs(inputs): Add plugin metadata and update description for n* (#16692) 2025-04-08 10:27:01 +01:00
nginx.go chore: Fix linter findings for `revive:exported` in `plugins/inputs/n*` (#16205) 2024-11-25 11:23:17 +01:00
nginx_test.go chore(linters): Fix findings found by `testifylint`: `go-require` for handlers for `plugins/inputs/[n-z]` (#16098) 2024-10-30 12:11:55 +01:00
sample.conf chore(inputs_m-z): migrate sample configs into separate files (#11133) 2022-05-18 11:31:34 -05:00

README.md

Nginx Input Plugin

This plugin gathers metrics from the open source Nginx web server. Nginx Plus is a commercial version. For more information about differences between Nginx (F/OSS) and Nginx Plus, see the Nginx documentation.

Telegraf v0.1.5 🏷️ server, web 💻 all

Global configuration options

In addition to the plugin-specific configuration settings, plugins support additional global and plugin configuration settings. These settings are used to modify metrics, tags, and field or create aliases and configure ordering, etc. See the CONFIGURATION.md for more details.

Configuration

# Read Nginx's basic status information (ngx_http_stub_status_module)
[[inputs.nginx]]
  ## An array of Nginx stub_status URI to gather stats.
  urls = ["http://localhost/server_status"]

  ## Optional TLS Config
  # tls_ca = "/etc/telegraf/ca.pem"
  # tls_cert = "/etc/telegraf/cert.pem"
  # tls_key = "/etc/telegraf/key.pem"
  ## Use TLS but skip chain & host verification
  # insecure_skip_verify = false

  ## HTTP response timeout (default: 5s)
  response_timeout = "5s"

Metrics

  • Measurement
    • accepts
    • active
    • handled
    • reading
    • requests
    • waiting
    • writing

Tags

  • All measurements have the following tags:
    • port
    • server

Example Output

Using this configuration:

[[inputs.nginx]]
  ## An array of Nginx stub_status URI to gather stats.
  urls = ["http://localhost/status"]

When run with:

./telegraf --config telegraf.conf --input-filter nginx --test

It produces:

nginx,port=80,server=localhost accepts=605i,active=2i,handled=605i,reading=0i,requests=12132i,waiting=1i,writing=1i 1456690994701784331