-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathassert.yml
115 lines (99 loc) · 3.34 KB
/
assert.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
---
#- name: finding files
# find:
# paths: '{{ beat_logs_path }}'
# patterns: "output*"
# recurse: "yes"
# file_type: "file"
# register: find_result
#
#- name: Set config/output/log file vars in Assert
# set_fact:
# beat_output_file: '{{ item.path }}'
# with_items: '{{ find_result.files }}'
#
#- name: 'Stat {{ beat_name }} output file'
# stat:
# path: '{{ beat_output_file }}'
# register: output_stat
#- name: '{{ beat_name }} output file stats'
# debug:
# var: output_stat
#- name: "Assert that {{ beat_name }} output file exists"
# assert:
# that:
# - "output_stat.stat.exists"
# - "output_stat.stat.size > 0"
#- name: 'Stat {{ beat_name }} log file'
# stat:
# path: '{{ beat_log_file }}'
# register: log_stat
#- name: '{{ beat_name }} log file stats'
# debug:
# var: log_stat
#- name: 'Assert that {{ beat_name }} log file exists'
# assert:
# that:
# - "log_stat.stat.exists"
# - "log_stat.stat.size > 0"
#- name: 'Stat {{ beat_name }} registry file'
# stat:
# path: '{{ beat_registry_file }}'
# register: registry_stat
# when: registry_file != ''
#- name: '{{ beat_name }} registry file stats'
# debug:
# var: registry_stat
# when: registry_file != ''
#- name: 'Check {{ beat_name }} registry file'
# assert:
# that:
# - "registry_stat.stat.exists"
# - "registry_stat.stat.size > 0"
# when: registry_file != ''
#- name: 'Get {{ beat_name }} metrics'
# shell: 'head -1 {{ beat_metrics_file }}'
# register: log_metrics
#- set_fact: log_metrics_event='{{ log_metrics.stdout | from_json }}'
#- name: '{{ beat_name }} monitoring metrics'
# debug:
# var: log_metrics_event
#- name: 'Check {{ beat_name }} has monitoring metrics'
# assert:
# that:
# - "log_metrics_event.beat.cpu.system.ticks >= 0"
# - "log_metrics_event.beat.cpu.system.time.ms >= 0"
# - "log_metrics_event.beat.cpu.total.ticks >= 0"
# - "log_metrics_event.beat.cpu.total.time.ms >= 0"
# - "log_metrics_event.beat.cpu.total.value >= 0"
# - "log_metrics_event.beat.cpu.user.ticks >= 0"
# - "log_metrics_event.beat.cpu.user.time.ms >= 0"
# - "log_metrics_event.beat.info.ephemeral_id"
# - "log_metrics_event.beat.info.uptime.ms"
# - "log_metrics_event.system.cpu.cores"
# - "'1' in log_metrics_event.system.load"
# - "'15' in log_metrics_event.system.load"
# - "'5' in log_metrics_event.system.load"
# - "'1' in log_metrics_event.system.load.norm"
# - "'15' in log_metrics_event.system.load.norm"
# - "'5' in log_metrics_event.system.load.norm"
# # These metric names were established in 6.3.
# when: "version is version_compare('6.3', '>=')"
#- name: 'Check {{ beat_name }} reports the number of open handles'
# assert:
# that:
# - "log_metrics_event.beat.handles.open >= 0"
# # These metric names were established in 6.5.
# when:
# - "version is version_compare('6.5', '>=')"
# - "project != 'apm-server'"
#- name: 'Check {{ beat_name }} reports the limits of open handles (Linux)'
# assert:
# that:
# - "log_metrics_event.beat.handles.limit.hard >= 0"
# - "log_metrics_event.beat.handles.limit.soft >= 0"
# # These metric names were established in 6.5.
# when:
# - "version is version_compare('6.5', '>=')"
# - ansible_system == "Linux"
# - "project != 'apm-server'"###