Anons79 Mini Shell

Directory : /lib/python2.7/site-packages/ansible/modules/web_infrastructure/
Upload File :
Current File : //lib/python2.7/site-packages/ansible/modules/web_infrastructure/_nginx_status_facts.pyo

�
�Udac@`s�ddlmZmZmZeZidd6dgd6dd6ZdZd	Zd
Z	ddl
Z
ddlmZdd
l
mZddlmZdefd��YZd�Zedkr�e�ndS(i(tabsolute_importtdivisiontprint_functions1.1tmetadata_versiont
deprecatedtstatust	communitytsupported_bys�
---
module: nginx_status_facts
deprecated:
  removed_in: '2.13'
  why: Deprecated in favour of C(_info) module.
  alternative: Use M(nginx_status_info) instead.
short_description: Retrieve nginx status facts.
description:
  - Gathers facts from nginx from an URL having C(stub_status) enabled.
version_added: "2.3"
author: "René Moser (@resmo)"
options:
  url:
    description:
      - URL of the nginx status.
    required: true
  timeout:
    description:
      - HTTP connection timeout in seconds.
    required: false
    default: 10

notes:
  - See http://nginx.org/en/docs/http/ngx_http_stub_status_module.html for more information.
sJ
# Gather status facts from nginx on localhost
- name: get current http stats
  nginx_status_facts:
    url: http://localhost/nginx_status

# Gather status facts from nginx on localhost with a custom timeout of 20 seconds
- name: get current http stats
  nginx_status_facts:
    url: http://localhost/nginx_status
    timeout: 20
s]
---
nginx_status_facts.active_connections:
  description: Active connections.
  returned: success
  type: int
  sample: 2340
nginx_status_facts.accepts:
  description: The total number of accepted client connections.
  returned: success
  type: int
  sample: 81769947
nginx_status_facts.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
  type: int
  sample: 81769947
nginx_status_facts.requests:
  description: The total number of client requests.
  returned: success
  type: int
  sample: 144332345
nginx_status_facts.reading:
  description: The current number of connections where nginx is reading the request header.
  returned: success
  type: int
  sample: 0
nginx_status_facts.writing:
  description: The current number of connections where nginx is writing the response back to the client.
  returned: success
  type: int
  sample: 241
nginx_status_facts.waiting:
  description: The current number of idle client connections waiting for a request.
  returned: success
  type: int
  sample: 2092
nginx_status_facts.data:
  description: HTTP response as is.
  returned: success
  type: str
  sample: "Active connections: 2340 
server accepts handled requests
 81769947 81769947 144332345 
Reading: 0 Writing: 241 Waiting: 2092 
"
N(t
AnsibleModule(t	fetch_url(tto_texttNginxStatusFactscB`seZd�Zd�ZRS(cC`s.tjjd�|_tjjd�|_dS(Nturlttimeout(tmoduletparamstgetRR
(tself((sZ/usr/lib/python2.7/site-packages/ansible/modules/web_infrastructure/_nginx_status_facts.pyt__init__lsc	C`s�iidd6dd6dd6dd6dd6dd6dd6dd6d	6}td
td|jdtd
|j�\}}|s�tjdd|j|jf�nt|j�dd�}|s�|S||d	d<d}t	j
||t	j�}|r�t|j
d��|d	d<t|j
d��|d	d<t|j
d��|d	d<t|j
d��|d	d<t|j
d��|d	d<t|j
d��|d	d<t|j
d��|d	d<n|S(Ntactive_connectionstacceptsthandledtrequeststreadingtwritingtwaitingtdatatnginx_status_factsRRtforceR
tmsgs?No valid or no response from url %s within %s seconds (timeout)terrorstsurrogate_or_stricts�Active connections: ([0-9]+) \nserver accepts handled requests\n ([0-9]+) ([0-9]+) ([0-9]+) \nReading: ([0-9]+) Writing: ([0-9]+) Waiting: ([0-9]+)iiiiiii(tNoneR	RRtTrueR
t	fail_jsonR
treadtretmatchtStinttgroup(RtresulttresponsetinfoRtexprR%((sZ/usr/lib/python2.7/site-packages/ansible/modules/web_infrastructure/_nginx_status_facts.pytrunps8-# (t__name__t
__module__RR-(((sZ/usr/lib/python2.7/site-packages/ansible/modules/web_infrastructure/_nginx_status_facts.pyRjs	cC`sqtdtdtdt�dtdddd��d	t�at�j�}td
td|�}tj|�dS(Nt
argument_specRtrequiredR
ttypeR'tdefaulti
tsupports_check_modetchangedt
ansible_facts(RtdictR!RRR-tFalset	exit_json(RR)((sZ/usr/lib/python2.7/site-packages/ansible/modules/web_infrastructure/_nginx_status_facts.pytmain�s	t__main__(t
__future__RRRR2t
__metaclass__tANSIBLE_METADATAt
DOCUMENTATIONtEXAMPLEStRETURNR$tansible.module_utils.basicRtansible.module_utils.urlsR	tansible.module_utils._textR
tobjectRR:R.(((sZ/usr/lib/python2.7/site-packages/ansible/modules/web_infrastructure/_nginx_status_facts.pyt<module>s



,*	

Anons79 File Manager Version 1.0, Coded By Anons79
Email: [email protected]