community.general.nginx_status_info module – Retrieve information on nginx status.
Note
This module is part of the community.general collection (version 4.8.3).
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
.
Parameters
Parameter |
Comments |
---|---|
HTTP connection timeout in seconds. Default: 10 |
|
URL of the nginx status. |
Notes
Note
See http://nginx.org/en/docs/http/ngx_http_stub_status_module.html for more information.
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 |
Description |
---|---|
The total number of accepted client connections. Returned: success Sample: 81769947 |
|
Active connections. Returned: success Sample: 2340 |
|
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” |
|
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 |
|
The current number of connections where nginx is reading the request header. Returned: success Sample: 0 |
|
The total number of client requests. Returned: success Sample: 144332345 |
|
The current number of idle client connections waiting for a request. Returned: success Sample: 2092 |
|
The current number of connections where nginx is writing the response back to the client. Returned: success Sample: 241 |
Authors
René Moser (@resmo)
Collection links
Issue Tracker Repository (Sources) Submit a bug report Request a feature Communication