-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathdaily_report.yaml
30 lines (27 loc) · 951 Bytes
/
daily_report.yaml
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
---
- hosts: "{{ run_hosts | mandatory }}"
gather_facts: no
connection: local
tasks:
- name: Gather System Status
eos_command:
commands:
- command: 'show logging alerts last 25 hours'
output: 'text'
- command: 'show interfaces counters discards'
output: 'json'
- command: 'show interfaces counters discards | nz'
output: 'text'
provider: '{{ provider }}'
register: status
- name: Check for Alerts
assert:
that:
- "status['stdout'][0] == ''"
msg: "Alerts were found {{ status['stdout'][0] }}"
- name: Check for Discards
assert:
that:
- "status['stdout'][1]['inDiscardsTotal'] == 0"
- "status['stdout'][1]['outDiscardsTotal'] == 0"
msg: "Interface discards found. In {{ status['stdout'][1]['inDiscardsTotal'] }}, Out {{ status['stdout'][1]['outDiscardsTotal'] }}"