This repository has been archived by the owner on Oct 11, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 20
/
python_input.yml
271 lines (257 loc) · 8.64 KB
/
python_input.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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
#############################################################################
# note: update these variables, don't change the data structure.
#############################################################################
#############################################################################
# healthbot host and credentials
#############################################################################
server: 100.123.35.0
authuser: jcluser
authpwd: Juniper!1
#############################################################################
# network devices details to add to healthbot
#############################################################################
devices_list:
- authentication:
password:
password: Juniper!1
username: jcluser
description: vMX1
device-id: vMX1
host: 100.123.1.0
iAgent:
port: 830
open-config:
port: 32768
system-id: vMX1
- authentication:
password:
password: Juniper!1
username: jcluser
description: vMX2
device-id: vMX2
host: 100.123.1.1
iAgent:
port: 830
open-config:
port: 32768
system-id: vMX2
- authentication:
password:
password: Juniper!1
username: jcluser
description: vMX3
device-id: vMX3
host: 100.123.1.2
iAgent:
port: 830
open-config:
port: 32768
system-id: vMX3
- authentication:
password:
password: Juniper!1
username: jcluser
description: vMX4
device-id: vMX4
host: 100.123.1.3
iAgent:
port: 830
open-config:
port: 32768
system-id: vMX4
- authentication:
password:
password: Juniper!1
username: jcluser
description: vMX5
device-id: vMX5
host: 100.123.1.4
iAgent:
port: 830
open-config:
port: 32768
system-id: vMX5
- authentication:
password:
password: Juniper!1
username: jcluser
description: vMX6
device-id: vMX6
host: 100.123.1.5
iAgent:
port: 830
open-config:
port: 32768
system-id: vMX6
- authentication:
password:
password: Juniper!1
username: jcluser
description: vMX7
device-id: vMX7
host: 100.123.1.6
iAgent:
port: 830
open-config:
port: 32768
system-id: vMX7
#############################################################################
# tables and views to load on healthbot (from the directory tables_and_views)
#############################################################################
tables_and_views:
- bgp_sessions_state.yml
#############################################################################
# notifications to add to healthbot
#############################################################################
notifications:
- notification-name: healthbot_to_saltstack
description: "healthbot to saltstack webhook notifications"
http-post:
url: http://100.123.35.1:5001/healthbot
#############################################################################
# topics and rules to add to healthbot
#############################################################################
topics:
- topic-name: bgp
synopsis: bgp
description: This topic is to monitor bgp details
rule:
- field:
- field-name: bgpPeerRemoteAddr
description: bgpPeerRemoteAddr
sensor:
- path: bgpPeerRemoteAddr
sensor-name: bgpPeerTable
type: string
- field-name: bgpPeerState
description: bgpPeerState
sensor:
- path: bgpPeerState
sensor-name: bgpPeerTable
type: integer
keys:
- bgpPeerRemoteAddr
rule-name: check-bgp-state-using-snmp
sensor:
- sensor-name: bgpPeerTable
snmp:
frequency: 15s
table: 1.3.6.1.2.1.15.3
trigger:
- frequency: 30s
term:
- term-name: session_is_established
then:
status:
color: green
message: BGP neighbor $bgpPeerRemoteAddr is in ESTABLISHED state
when:
equal-to:
- left-operand: $bgpPeerState
right-operand: "6"
- term-name: session_is_not_established
then:
status:
color: red
message: BGP neighbor $bgpPeerRemoteAddr is NOT in ESTABLISHED state
trigger-name: state
- field:
- description: peer-address
field-name: peer-address
sensor:
- path: peer-address
sensor-name: session_state
type: string
- description: state
field-name: state
sensor:
- path: peer_state
sensor-name: session_state
type: string
keys:
- peer-address
rule-name: check-bgp-state-using-netconf
sensor:
- iAgent:
file: bgp_sessions_state.yml
frequency: 15s
table: bgpTable
sensor-name: session_state
trigger:
- frequency: 30s
term:
- term-name: session_is_established
then:
status:
color: green
message: BGP neighbor $peer-address is in $state state
when:
matches-with:
- left-operand: $state
right-operand: Established
- term-name: session_is_not_established
then:
status:
color: red
message: BGP neighbor $peer-address is in $state state
trigger-name: neighborship
variable:
- description: Enter neighbor name or address using regular expression
name: neighbors
type: string
value: .*
#############################################################################
# playbook to add to healthbot
#############################################################################
playbooks:
- playbook-name: bgp-using-netconf
description: playbook to monitor bgp using netconf
synopsis: playbook to monitor bgp using netconf
rules:
- bgp/check-bgp-state-using-netconf
- playbook-name: bgp-using-snmp
description: playbook to monitor bgp using snmp
synopsis: playbook to monitor bgp using snmp
rules:
- bgp/check-bgp-state-using-snmp
#############################################################################
# device groups details to add to healthbot
#############################################################################
device_groups:
- description: Group1
device-group-name: Group1
devices:
- vMX1
- vMX2
- vMX3
- vMX4
- vMX5
- vMX6
- vMX7
playbooks:
- bgp-using-netconf
notification:
major:
- healthbot_to_saltstack
minor:
- healthbot_to_saltstack
enable:
- null
variable:
- instance-id: bgp_using_netconf_intance_1
playbook: bgp-using-netconf
rule: bgp/check-bgp-state-using-netconf
variable-value:
- name: neighbors
value: 192.*
- description: Group2
device-group-name: Group2
devices:
- vMX3
- vMX4
playbooks:
- bgp-using-snmp
variable:
- instance-id: bgp_using_snmp_intance_1
playbook: bgp-using-snmp
rule: bgp/check-bgp-state-using-snmp