-
Notifications
You must be signed in to change notification settings - Fork 1
/
ps_performance_host_live_maxWrite_kB_per_sec.yml
45 lines (41 loc) · 1.32 KB
/
ps_performance_host_live_maxWrite_kB_per_sec.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
---
# Example playbook to report Max BW per host performance on a FlashArray
#
# Execute as follows
#
# ansible-playbook playbooks/ps_performance_host_live_maxBW.yml -e "input_per_sec=100000"
# if you want Ansible to report live hosts with Max Write BW > 100000 bytes/sec
#
- name: Max Bandwidth Host performance Information on FlashArray
hosts: localhost
gather_facts: no
tasks:
- name: open session
uri:
url: https://{{ arrayurl }}/api/{{ api_version }}/auth/session
method: POST
validate_certs: no
return_content: yes
body:
api_token: "{{ array_token }}"
body_format: json
register: session
- name: max bw host performance
uri:
url: https://{{ arrayurl }}/api/{{ api_version }}/host?action=monitor&filter=input_per_sec>{{ input_per_sec }}
method: GET
validate_certs: no
HEADER_Cookie: "{{session.set_cookie}}"
return_content: yes
ignore_errors: yes
register: perfdata
- name: show max BW per host
debug: msg="{{ perfdata.json }}"
- name: close session
uri:
url: https://{{ arrayurl }}/api/{{ api_version }}/auth/session
method: DELETE
validate_certs: no
return_content: yes
HEADER_Cookie: "{{session.set_cookie}}"
register: session_close