W3cubDocs

/Ansible

community.general.nginx_status_info – Retrieve information on nginx status.

Note

This plugin is part of the community.general collection (version 3.8.1).

You might already have this collection installed if you are using the ansible package. It is not included in ansible-core. To check whether it is installed, run ansible-galaxy collection list.

To install it, use: ansible-galaxy collection install community.general.

To use it in a playbook, specify: community.general.nginx_status_info.

Synopsis

  • Gathers information from nginx from an URL having stub_status enabled.

Parameters

Parameter Choices/Defaults Comments
timeout
integer
Default:
10
HTTP connection timeout in seconds.
url
string / required
URL of the nginx status.

Notes

Examples

# Gather status info from nginx on localhost
- name: Get current http stats
  community.general.nginx_status_info:
    url: http://localhost/nginx_status
  register: result

# Gather status info from nginx on localhost with a custom timeout of 20 seconds
- name: Get current http stats
  community.general.nginx_status_info:
    url: http://localhost/nginx_status
    timeout: 20
  register: result

Return Values

Common return values are documented here, the following are the fields unique to this module:

Key Returned Description
accepts
integer
success
The total number of accepted client connections.

Sample:
81769947
active_connections
integer
success
Active connections.

Sample:
2340
data
string
success
HTTP response as is.

Sample:
Active connections: 2340 server accepts handled requests 81769947 81769947 144332345 Reading: 0 Writing: 241 Waiting: 2092
handled
integer
success
The total number of handled connections. Generally, the parameter value is the same as accepts unless some resource limits have been reached.

Sample:
81769947
reading
integer
success
The current number of connections where nginx is reading the request header.

requests
integer
success
The total number of client requests.

Sample:
144332345
waiting
integer
success
The current number of idle client connections waiting for a request.

Sample:
2092
writing
integer
success
The current number of connections where nginx is writing the response back to the client.

Sample:
241


Authors

  • René Moser (@resmo)

© 2012–2018 Michael DeHaan
© 2018–2021 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/latest/collections/community/general/nginx_status_info_module.html