---
title: Telegraf Documentation
description: Telegraf plugin for collecting metrics from Nginx Plus API
url: https://docs.influxdata.com/telegraf/v1/input-plugins/nginx_plus_api/
estimated_tokens: 5952
product: Telegraf
version: v1
---

-   Telegraf v1.9.0+

# Nginx Plus API Input Plugin

This plugin gathers metrics from the commercial [Nginx Plus web server](https://www.f5.com/products/nginx/nginx-plus) via the [REST API](https://demo.nginx.com/swagger-ui/).

Using this plugin requires a license.

For more information about differences between Nginx (F/OSS) and Nginx Plus, see the Nginx [documentation](https://www.nginx.com/blog/whats-difference-nginx-foss-nginx-plus/).

**Introduced in:** Telegraf v1.9.0 **Tags:** server, web **OS support:** all

## Global configuration options

Plugins support additional global and plugin configuration settings for tasks such as modifying metrics, tags, and fields, creating aliases, and configuring plugin ordering. See [CONFIGURATION.md](/telegraf/v1/configuration/#plugins) for more details.

## Configuration

```toml
# Read Nginx Plus API advanced status information
[[inputs.nginx_plus_api]]
  ## An array of Nginx API URIs to gather stats.
  urls = ["http://localhost/api", "http+unix:///var/run/nginx.sock:/api"]
  # Nginx API version, default: 3
  # api_version = 3

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

  ## 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
```

## Migration from Nginx Plus (Status) input plugin

| Nginx Plus | Nginx Plus API |
| --- | --- |
| nginx_plus_processes | nginx_plus_api_processes |
| nginx_plus_connections | nginx_plus_api_connections |
| nginx_plus_ssl | nginx_plus_api_ssl |
| nginx_plus_requests | nginx_plus_api_http_requests |
| nginx_plus_zone | nginx_plus_api_http_server_zones |
| nginx_plus_upstream | nginx_plus_api_http_upstreams |
| nginx_plus_upstream_peer | nginx_plus_api_http_upstream_peers |
| nginx_plus_cache | nginx_plus_api_http_caches |
| nginx_plus_stream_upstream | nginx_plus_api_stream_upstreams |
| nginx_plus_stream_upstream_peer | nginx_plus_api_stream_upstream_peers |
| nginx.stream.zone | nginx_plus_api_stream_server_zones |

## Measurements by API version

| Measurement | API version (api_version) |
| --- | --- |
| nginx_plus_api_processes | >= 3 |
| nginx_plus_api_connections | >= 3 |
| nginx_plus_api_ssl | >= 3 |
| nginx_plus_api_slabs_pages | >= 3 |
| nginx_plus_api_slabs_slots | >= 3 |
| nginx_plus_api_http_requests | >= 3 |
| nginx_plus_api_http_server_zones | >= 3 |
| nginx_plus_api_http_upstreams | >= 3 |
| nginx_plus_api_http_upstream_peers | >= 3 |
| nginx_plus_api_http_caches | >= 3 |
| nginx_plus_api_stream_upstreams | >= 3 |
| nginx_plus_api_stream_upstream_peers | >= 3 |
| nginx_plus_api_stream_server_zones | >= 3 |
| nginx_plus_api_http_location_zones | >= 5 |
| nginx_plus_api_resolver_zones | >= 5 |
| nginx_plus_api_http_limit_reqs | >= 6 |

## Metrics

-   nginx\_plus\_api\_processes
    -   respawned
-   nginx\_plus\_api\_connections
    -   accepted
    -   dropped
    -   active
    -   idle
-   nginx\_plus\_api\_slabs\_pages
    -   used
    -   free
-   nginx\_plus\_api\_slabs\_slots
    -   used
    -   free
    -   reqs
    -   fails
-   nginx\_plus\_api\_ssl
    -   handshakes
    -   handshakes\_failed
    -   session\_reuses
-   nginx\_plus\_api\_http\_requests
    -   total
    -   current
-   nginx\_plus\_api\_http\_server\_zones
    -   processing
    -   requests
    -   responses\_1xx
    -   responses\_2xx
    -   responses\_3xx
    -   responses\_4xx
    -   responses\_5xx
    -   responses\_total
    -   received
    -   sent
    -   discarded
-   nginx\_plus\_api\_http\_upstreams
    -   keepalive
    -   zombies
-   nginx\_plus\_api\_http\_upstream\_peers
    -   requests
    -   unavail
    -   healthchecks\_checks
    -   header\_time
    -   state
    -   response\_time
    -   active
    -   healthchecks\_last\_passed
    -   weight
    -   responses\_1xx
    -   responses\_2xx
    -   responses\_3xx
    -   responses\_4xx
    -   responses\_5xx
    -   received
    -   healthchecks\_fails
    -   healthchecks\_unhealthy
    -   backup
    -   responses\_total
    -   sent
    -   fails
    -   downtime
-   nginx\_plus\_api\_http\_caches
    -   size
    -   max\_size
    -   cold
    -   hit\_responses
    -   hit\_bytes
    -   stale\_responses
    -   stale\_bytes
    -   updating\_responses
    -   updating\_bytes
    -   revalidated\_responses
    -   revalidated\_bytes
    -   miss\_responses
    -   miss\_bytes
    -   miss\_responses\_written
    -   miss\_bytes\_written
    -   expired\_responses
    -   expired\_bytes
    -   expired\_responses\_written
    -   expired\_bytes\_written
    -   bypass\_responses
    -   bypass\_bytes
    -   bypass\_responses\_written
    -   bypass\_bytes\_written
-   nginx\_plus\_api\_stream\_upstreams
    -   zombies
-   nginx\_plus\_api\_stream\_upstream\_peers
    -   unavail
    -   healthchecks\_checks
    -   healthchecks\_fails
    -   healthchecks\_unhealthy
    -   healthchecks\_last\_passed
    -   response\_time
    -   state
    -   active
    -   weight
    -   received
    -   backup
    -   sent
    -   fails
    -   downtime
-   nginx\_plus\_api\_stream\_server\_zones
    -   processing
    -   connections
    -   received
    -   sent
-   nginx\_plus\_api\_location\_zones
    -   requests
    -   responses\_1xx
    -   responses\_2xx
    -   responses\_3xx
    -   responses\_4xx
    -   responses\_5xx
    -   responses\_total
    -   received
    -   sent
    -   discarded
-   nginx\_plus\_api\_resolver\_zones
    -   name
    -   srv
    -   addr
    -   noerror
    -   formerr
    -   servfail
    -   nxdomain
    -   notimp
    -   refused
    -   timedout
    -   unknown
-   nginx\_plus\_api\_http\_limit\_reqs
    -   passed
    -   delayed
    -   rejected
    -   delayed\_dry\_run
    -   rejected\_dry\_run

### Tags

-   nginx\_plus\_api\_processes, nginx\_plus\_api\_connections, nginx\_plus\_api\_ssl, nginx\_plus\_api\_http\_requests
    
    -   source
    -   port
-   nginx\_plus\_api\_http\_upstreams, nginx\_plus\_api\_stream\_upstreams
    
    -   upstream
    -   source
    -   port
-   nginx\_plus\_api\_http\_server\_zones, nginx\_plus\_api\_upstream\_server\_zones, nginx\_plus\_api\_http\_location\_zones, nginx\_plus\_api\_resolver\_zones, nginx\_plus\_api\_slabs\_pages
    
    -   source
    -   port
    -   zone
-   nginx\_plus\_api\_slabs\_slots
    
    -   source
    -   port
    -   zone
    -   slot
-   nginx\_plus\_api\_upstream\_peers, nginx\_plus\_api\_stream\_upstream\_peers
    
    -   id
    -   upstream
    -   source
    -   port
    -   upstream\_address
-   nginx\_plus\_api\_http\_caches
    
    -   source
    -   port
-   nginx\_plus\_api\_http\_limit\_reqs
    
    -   source
    -   port
    -   limit

## Example Output

Using this configuration:

```toml
[[inputs.nginx_plus_api]]
  ## An array of Nginx Plus API URIs to gather stats.
  urls = ["http://localhost/api"]
```

When run with:

```sh
./telegraf -config telegraf.conf -input-filter nginx_plus_api -test
```

It produces:

```text
nginx_plus_api_processes,port=80,source=demo.nginx.com respawned=0i 1570696321000000000
nginx_plus_api_connections,port=80,source=demo.nginx.com accepted=68998606i,active=7i,dropped=0i,idle=57i 1570696322000000000
nginx_plus_api_slabs_pages,port=80,source=demo.nginx.com,zone=hg.nginx.org used=1i,free=503i 1570696322000000000
nginx_plus_api_slabs_pages,port=80,source=demo.nginx.com,zone=trac.nginx.org used=3i,free=500i 1570696322000000000
nginx_plus_api_slabs_slots,port=80,source=demo.nginx.com,zone=hg.nginx.org,slot=8 used=1i,free=503i,reqs=10i,fails=0i 1570696322000000000
nginx_plus_api_slabs_slots,port=80,source=demo.nginx.com,zone=hg.nginx.org,slot=16 used=3i,free=500i,reqs=1024i,fails=0i 1570696322000000000
nginx_plus_api_slabs_slots,port=80,source=demo.nginx.com,zone=trac.nginx.org,slot=8 used=1i,free=503i,reqs=10i,fails=0i 1570696322000000000
nginx_plus_api_slabs_slots,port=80,source=demo.nginx.com,zone=trac.nginx.org,slot=16 used=0i,free=1520i,reqs=0i,fails=1i 1570696322000000000
nginx_plus_api_ssl,port=80,source=demo.nginx.com handshakes=9398978i,handshakes_failed=289353i,session_reuses=1004389i 1570696322000000000
nginx_plus_api_http_requests,port=80,source=demo.nginx.com current=51i,total=264649353i 1570696322000000000
nginx_plus_api_http_server_zones,port=80,source=demo.nginx.com,zone=hg.nginx.org discarded=5i,processing=0i,received=24123604i,requests=60138i,responses_1xx=0i,responses_2xx=59353i,responses_3xx=531i,responses_4xx=249i,responses_5xx=0i,responses_total=60133i,sent=830165221i 1570696322000000000
nginx_plus_api_http_server_zones,port=80,source=demo.nginx.com,zone=trac.nginx.org discarded=250i,processing=0i,received=2184618i,requests=12404i,responses_1xx=0i,responses_2xx=8579i,responses_3xx=2513i,responses_4xx=583i,responses_5xx=479i,responses_total=12154i,sent=139384159i 1570696322000000000
nginx_plus_api_http_server_zones,port=80,source=demo.nginx.com,zone=lxr.nginx.org discarded=1i,processing=0i,received=1011701i,requests=4523i,responses_1xx=0i,responses_2xx=4332i,responses_3xx=28i,responses_4xx=39i,responses_5xx=123i,responses_total=4522i,sent=72631354i 1570696322000000000
nginx_plus_api_http_upstreams,port=80,source=demo.nginx.com,upstream=trac-backend keepalive=0i,zombies=0i 1570696322000000000
nginx_plus_api_http_upstream_peers,id=0,port=80,source=demo.nginx.com,upstream=trac-backend,upstream_address=10.0.0.1:8080 active=0i,backup=false,downtime=0i,fails=0i,header_time=235i,healthchecks_checks=0i,healthchecks_fails=0i,healthchecks_unhealthy=0i,received=88581178i,requests=3180i,response_time=235i,responses_1xx=0i,responses_2xx=3168i,responses_3xx=5i,responses_4xx=6i,responses_5xx=0i,responses_total=3179i,sent=1321720i,state="up",unavail=0i,weight=1i 1570696322000000000
nginx_plus_api_http_upstream_peers,id=1,port=80,source=demo.nginx.com,upstream=trac-backend,upstream_address=10.0.0.1:8081 active=0i,backup=true,downtime=0i,fails=0i,healthchecks_checks=0i,healthchecks_fails=0i,healthchecks_unhealthy=0i,received=0i,requests=0i,responses_1xx=0i,responses_2xx=0i,responses_3xx=0i,responses_4xx=0i,responses_5xx=0i,responses_total=0i,sent=0i,state="up",unavail=0i,weight=1i 1570696322000000000
nginx_plus_api_http_upstreams,port=80,source=demo.nginx.com,upstream=hg-backend keepalive=0i,zombies=0i 1570696322000000000
nginx_plus_api_http_upstream_peers,id=0,port=80,source=demo.nginx.com,upstream=hg-backend,upstream_address=10.0.0.1:8088 active=0i,backup=false,downtime=0i,fails=0i,header_time=22i,healthchecks_checks=0i,healthchecks_fails=0i,healthchecks_unhealthy=0i,received=909402572i,requests=18514i,response_time=88i,responses_1xx=0i,responses_2xx=17799i,responses_3xx=531i,responses_4xx=179i,responses_5xx=0i,responses_total=18509i,sent=10608107i,state="up",unavail=0i,weight=5i 1570696322000000000
nginx_plus_api_http_upstream_peers,id=1,port=80,source=demo.nginx.com,upstream=hg-backend,upstream_address=10.0.0.1:8089 active=0i,backup=true,downtime=0i,fails=0i,healthchecks_checks=0i,healthchecks_fails=0i,healthchecks_unhealthy=0i,received=0i,requests=0i,responses_1xx=0i,responses_2xx=0i,responses_3xx=0i,responses_4xx=0i,responses_5xx=0i,responses_total=0i,sent=0i,state="up",unavail=0i,weight=1i 1570696322000000000
nginx_plus_api_http_upstreams,port=80,source=demo.nginx.com,upstream=lxr-backend keepalive=0i,zombies=0i 1570696322000000000
nginx_plus_api_http_upstream_peers,id=0,port=80,source=demo.nginx.com,upstream=lxr-backend,upstream_address=unix:/tmp/cgi.sock active=0i,backup=false,downtime=0i,fails=123i,header_time=91i,healthchecks_checks=0i,healthchecks_fails=0i,healthchecks_unhealthy=0i,received=71782888i,requests=4354i,response_time=91i,responses_1xx=0i,responses_2xx=4230i,responses_3xx=0i,responses_4xx=0i,responses_5xx=0i,responses_total=4230i,sent=3088656i,state="up",unavail=0i,weight=1i 1570696322000000000
nginx_plus_api_http_upstream_peers,id=1,port=80,source=demo.nginx.com,upstream=lxr-backend,upstream_address=unix:/tmp/cgib.sock active=0i,backup=true,downtime=0i,fails=0i,healthchecks_checks=0i,healthchecks_fails=0i,healthchecks_unhealthy=0i,max_conns=42i,received=0i,requests=0i,responses_1xx=0i,responses_2xx=0i,responses_3xx=0i,responses_4xx=0i,responses_5xx=0i,responses_total=0i,sent=0i,state="up",unavail=0i,weight=1i 1570696322000000000
nginx_plus_api_http_upstreams,port=80,source=demo.nginx.com,upstream=demo-backend keepalive=0i,zombies=0i 1570696322000000000
nginx_plus_api_http_upstream_peers,id=0,port=80,source=demo.nginx.com,upstream=demo-backend,upstream_address=10.0.0.2:15431 active=0i,backup=false,downtime=0i,fails=0i,healthchecks_checks=0i,healthchecks_fails=0i,healthchecks_unhealthy=0i,received=0i,requests=0i,responses_1xx=0i,responses_2xx=0i,responses_3xx=0i,responses_4xx=0i,responses_5xx=0i,responses_total=0i,sent=0i,state="up",unavail=0i,weight=1i 1570696322000000000
nginx_plus_api_http_caches,cache=http_cache,port=80,source=demo.nginx.com bypass_bytes=0i,bypass_bytes_written=0i,bypass_responses=0i,bypass_responses_written=0i,cold=false,expired_bytes=381518640i,expired_bytes_written=363449785i,expired_responses=42114i,expired_responses_written=39954i,hit_bytes=6321885979i,hit_responses=596730i,max_size=536870912i,miss_bytes=48512185i,miss_bytes_written=155600i,miss_responses=6052i,miss_responses_written=136i,revalidated_bytes=0i,revalidated_responses=0i,size=765952i,stale_bytes=0i,stale_responses=0i,updating_bytes=0i,updating_responses=0i 1570696323000000000
nginx_plus_api_stream_server_zones,port=80,source=demo.nginx.com,zone=postgresql_loadbalancer connections=0i,processing=0i,received=0i,sent=0i 1570696323000000000
nginx_plus_api_stream_server_zones,port=80,source=demo.nginx.com,zone=dns_loadbalancer connections=0i,processing=0i,received=0i,sent=0i 1570696323000000000
nginx_plus_api_stream_upstreams,port=80,source=demo.nginx.com,upstream=postgresql_backends zombies=0i 1570696323000000000
nginx_plus_api_stream_upstream_peers,id=0,port=80,source=demo.nginx.com,upstream=postgresql_backends,upstream_address=10.0.0.2:15432 active=0i,backup=false,connections=0i,downtime=0i,fails=0i,healthchecks_checks=0i,healthchecks_fails=0i,healthchecks_unhealthy=0i,received=0i,sent=0i,state="up",unavail=0i,weight=1i 1570696323000000000
nginx_plus_api_stream_upstream_peers,id=1,port=80,source=demo.nginx.com,upstream=postgresql_backends,upstream_address=10.0.0.2:15433 active=0i,backup=false,connections=0i,downtime=0i,fails=0i,healthchecks_checks=0i,healthchecks_fails=0i,healthchecks_unhealthy=0i,received=0i,sent=0i,state="up",unavail=0i,weight=1i 1570696323000000000
nginx_plus_api_stream_upstream_peers,id=2,port=80,source=demo.nginx.com,upstream=postgresql_backends,upstream_address=10.0.0.2:15434 active=0i,backup=false,connections=0i,downtime=0i,fails=0i,healthchecks_checks=0i,healthchecks_fails=0i,healthchecks_unhealthy=0i,received=0i,sent=0i,state="up",unavail=0i,weight=1i 1570696323000000000
nginx_plus_api_stream_upstream_peers,id=3,port=80,source=demo.nginx.com,upstream=postgresql_backends,upstream_address=10.0.0.2:15435 active=0i,backup=false,connections=0i,downtime=0i,fails=0i,healthchecks_checks=0i,healthchecks_fails=0i,healthchecks_unhealthy=0i,received=0i,sent=0i,state="down",unavail=0i,weight=1i 1570696323000000000
nginx_plus_api_stream_upstreams,port=80,source=demo.nginx.com,upstream=dns_udp_backends zombies=0i 1570696323000000000
nginx_plus_api_stream_upstream_peers,id=0,port=80,source=demo.nginx.com,upstream=dns_udp_backends,upstream_address=10.0.0.5:53 active=0i,backup=false,connections=0i,downtime=0i,fails=0i,healthchecks_checks=0i,healthchecks_fails=0i,healthchecks_unhealthy=0i,received=0i,sent=0i,state="up",unavail=0i,weight=2i 1570696323000000000
nginx_plus_api_stream_upstream_peers,id=1,port=80,source=demo.nginx.com,upstream=dns_udp_backends,upstream_address=10.0.0.2:53 active=0i,backup=false,connections=0i,downtime=0i,fails=0i,healthchecks_checks=0i,healthchecks_fails=0i,healthchecks_unhealthy=0i,received=0i,sent=0i,state="up",unavail=0i,weight=1i 1570696323000000000
nginx_plus_api_stream_upstream_peers,id=2,port=80,source=demo.nginx.com,upstream=dns_udp_backends,upstream_address=10.0.0.7:53 active=0i,backup=false,connections=0i,downtime=0i,fails=0i,healthchecks_checks=0i,healthchecks_fails=0i,healthchecks_unhealthy=0i,received=0i,sent=0i,state="down",unavail=0i,weight=1i 1570696323000000000
nginx_plus_api_stream_upstreams,port=80,source=demo.nginx.com,upstream=unused_tcp_backends zombies=0i 1570696323000000000
nginx_plus_api_http_location_zones,port=80,source=demo.nginx.com,zone=swagger discarded=0i,received=1622i,requests=8i,responses_1xx=0i,responses_2xx=7i,responses_3xx=0i,responses_4xx=1i,responses_5xx=0i,responses_total=8i,sent=638333i 1570696323000000000
nginx_plus_api_http_location_zones,port=80,source=demo.nginx.com,zone=api-calls discarded=64i,received=337530181i,requests=1726513i,responses_1xx=0i,responses_2xx=1726428i,responses_3xx=0i,responses_4xx=21i,responses_5xx=0i,responses_total=1726449i,sent=1902577668i 1570696323000000000
nginx_plus_api_resolver_zones,port=80,source=demo.nginx.com,zone=resolver1 addr=0i,formerr=0i,name=0i,noerror=0i,notimp=0i,nxdomain=0i,refused=0i,servfail=0i,srv=0i,timedout=0i,unknown=0i 1570696324000000000
nginx_plus_api_http_limit_reqs,port=80,source=demo.nginx.com,limit=limit_1 delayed=0i,delayed_dry_run=0i,passed=6i,rejected=9i,rejected_dry_run=0i 1570696322000000000
nginx_plus_api_http_limit_reqs,port=80,source=demo.nginx.com,limit=limit_2 delayed=13i,delayed_dry_run=3i,passed=6i,rejected=1i,rejected_dry_run=31i 1570696322000000000
```

### Reference material

-   [api documentation](http://demo.nginx.com/swagger-ui/#/)
-   [nginx\_api\_module documentation](http://nginx.org/en/docs/http/ngx_http_api_module.html)

#### Related

-   [Configure plugins](/telegraf/v1/configure_plugins/)
-   [Nginx Plus API Plugin Source](https://github.com/influxdata/telegraf/tree/v1.38.4/plugins/inputs/nginx_plus_api/README.md)
