ansible.builtin.nginx_status_info (v2.9.27) — module

Retrieve information on nginx status.

| "added in version" 2.9 of ansible.builtin"

Authors: René Moser (@resmo)

preview | supported by community

Install Ansible via pip

Install with pip install ansible==2.9.27

Description

Gathers information from nginx from an URL having C(stub_status) enabled.

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Gather status info from nginx on localhost
- name: get current http stats
  nginx_status_info:
    url: http://localhost/nginx_status
  register: result
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
# Gather status info from nginx on localhost with a custom timeout of 20 seconds
- name: get current http stats
  nginx_status_info:
    url: http://localhost/nginx_status
    timeout: 20
  register: result

Inputs

    
url:
    description:
    - URL of the nginx status.
    required: true
    type: str

timeout:
    default: 10
    description:
    - HTTP connection timeout in seconds.
    required: false
    type: int

Outputs

accepts:
  description: The total number of accepted client connections.
  returned: success
  sample: 81769947
  type: int
active_connections:
  description: Active connections.
  returned: success
  sample: 2340
  type: int
data:
  description: HTTP response as is.
  returned: success
  sample: "Active connections: 2340 \nserver accepts handled requests\n 81769947 81769947\
    \ 144332345 \nReading: 0 Writing: 241 Waiting: 2092 \n"
  type: str
handled:
  description: The total number of handled connections. Generally, the parameter value
    is the same as accepts unless some resource limits have been reached.
  returned: success
  sample: 81769947
  type: int
reading:
  description: The current number of connections where nginx is reading the request
    header.
  returned: success
  sample: 0
  type: int
requests:
  description: The total number of client requests.
  returned: success
  sample: 144332345
  type: int
waiting:
  description: The current number of idle client connections waiting for a request.
  returned: success
  sample: 2092
  type: int
writing:
  description: The current number of connections where nginx is writing the response
    back to the client.
  returned: success
  sample: 241
  type: int