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
|
# File 'modules/netops/manifests/monitoring.pp', line 6
class netops::monitoring(
Wmflib::Infra::Devices $infra_devices,
) {
include passwords::network
$routers_defaults = {
snmp_community => $passwords::network::snmp_ro_community,
alarms => false,
critical => true,
os => 'Junos',
ospf => true,
}
$routers = $infra_devices.filter |$device, $config| {
$config['role'] in ['cr', 'pfw']
}
create_resources(netops::check, $routers, $routers_defaults)
# mgmt routers
$mgmt_routers_defaults = {
snmp_community => $passwords::network::snmp_ro_community,
alarms => true,
interfaces => true,
os => 'Junos',
ospf => true,
}
$mgmt_routers = $infra_devices.filter |$device, $config| {
$config['role'] == 'mr'
}
create_resources(netops::check, $mgmt_routers, $mgmt_routers_defaults)
# OOB interfaces -- no SNMP for these
$oob = {
'mr1-eqiad.oob' => { ipv4 => '149.97.228.94', ipv6 => '2607:f6f0:1000:1194::2', parents => ['mr1-eqiad'] },
'mr1-codfw.oob' => { ipv4 => '216.117.46.36', parents => ['mr1-codfw'] },
'mr1-esams.oob' => { ipv4 => '185.27.16.142', ipv6 => '2a00:1188:5:e::4', parents => ['mr1-esams'] },
'mr1-ulsfo.oob' => { ipv4 => '198.24.47.102', ipv6 => '2607:fb58:9000:7::2', parents => ['mr1-ulsfo'] },
'mr1-eqsin.oob' => { ipv4 => '27.111.227.106', ipv6 => '2403:b100:3001:9::2', parents => ['mr1-eqsin'] },
'mr1-drmrs.oob' => { ipv4 => '193.251.154.146', ipv6 => '2001:688:0:4::2d4', parents => ['mr1-drmrs'] },
'mr1-magru.oob' => { ipv4 => '177.185.14.4', ipv6 => '2804:ad4:ff12:19::84', parents => ['mr1-magru'] },
're0.cr1-eqiad.mgmt' => { ipv4 => '10.65.0.12', parents => ['msw1-eqiad'] },
're0.cr2-eqiad.mgmt' => { ipv4 => '10.65.0.14', parents => ['msw1-eqiad'] },
're0.cr1-codfw.mgmt' => { ipv4 => '10.193.0.10', parents => ['msw1-codfw'] },
're0.cr2-codfw.mgmt' => { ipv4 => '10.193.0.12', parents => ['msw1-codfw'] },
'cr2-esams.mgmt' => { ipv4 => '10.80.128.19', parents => ['mr1-esams'] },
're0.cr1-esams.mgmt' => { ipv4 => '10.80.128.2', parents => ['mr1-esams'] },
'cr3-ulsfo.mgmt' => { ipv4 => '10.128.128.4', parents => ['mr1-ulsfo'] },
'cr4-ulsfo.mgmt' => { ipv4 => '10.128.128.5', parents => ['mr1-ulsfo'] },
'cr3-eqsin.mgmt' => { ipv4 => '10.132.128.7', parents => ['mr1-eqsin'] },
'cr2-eqsin.mgmt' => { ipv4 => '10.132.128.6', parents => ['mr1-eqsin'] },
'cr1-drmrs.mgmt' => { ipv4 => '10.136.128.6', parents => ['mr1-drmrs'] },
'cr2-drmrs.mgmt' => { ipv4 => '10.136.128.7', parents => ['mr1-drmrs'] },
}
create_resources(netops::check, $oob)
#
# Management switches
#
$mgmt_switches_defaults = {
snmp_community => $passwords::network::snmp_ro_community,
alarms => true,
os => 'Junos',
}
$mgmt_switches = $infra_devices.filter |$device, $config| {
$config['role'] == 'msw'
}
create_resources(netops::check, $mgmt_switches, $mgmt_switches_defaults)
#
# L2 only "legacy" switches
#
# Note: The parents attribute is used to capture a view of the network
# topology. It is not complete on purpose as icinga is not able to
# work well with loops.
#
$switches_defaults = {
snmp_community => $passwords::network::snmp_ro_community,
alarms => true,
os => 'Junos',
vcp => true, # Will report as OK if no VCP in use
}
$switches = $infra_devices.filter |$device, $config| {
$config['role'] == 'l2sw'
}
create_resources(netops::check, $switches, $switches_defaults)
#
# L3 switches (data plane interface)
#
# Those devices have both mgmt and data plane IPs (usually loopback)
# The dataplane IP is used for parent/child relationship, as well as checking basic connectivity.
# This is also the name automatically used for servers' parents using LLDP.
#
$l3_switches_defaults = {
os => 'Junos',
}
$l3_switches = $infra_devices.filter |$device, $config| {
$config['role'] == 'l3sw'
}
create_resources(netops::check, $l3_switches, $l3_switches_defaults)
#
# L3 switches (mgmt interface)
#
# The mgmt IP is used to run extra checks via SNMP in adition to checking mgmt reachability.
#
$l3_switches_mgmt_defaults = {
snmp_community => $passwords::network::snmp_ro_community,
bfd => true, # Will report as OK if no BFD is in use
ospf => true, # Will report as OK if no OSPF in use
os => 'Junos',
}
$l3_switches_mgmt = {
# eqiad cloud
'cloudsw1-c8-eqiad.mgmt' => { ipv4 => '10.65.0.7', parents => ['msw1-eqiad']},
'cloudsw1-d5-eqiad.mgmt' => { ipv4 => '10.65.0.6', parents => ['msw1-eqiad']},
'cloudsw1-e4-eqiad.mgmt' => { ipv4 => '10.65.1.231', parents => ['msw2-eqiad']},
'cloudsw1-f4-eqiad.mgmt' => { ipv4 => '10.65.1.235', parents => ['msw2-eqiad']},
# eqiad prod
'ssw1-d1-eqiad.mgmt' => { ipv4 => '10.65.0.74', parents => ['msw1-eqiad'], ospf => false, bfd => false },
'ssw1-d8-eqiad.mgmt' => { ipv4 => '10.65.4.214', parents => ['msw1-eqiad'], ospf => false, bfd => false },
'lsw1-c2-eqiad.mgmt' => { ipv4 => '10.65.4.146', parents => ['msw1-eqiad'], ospf => false, bfd => false },
'lsw1-c3-eqiad.mgmt' => { ipv4 => '10.65.4.148', parents => ['msw1-eqiad'], ospf => false, bfd => false },
'lsw1-c4-eqiad.mgmt' => { ipv4 => '10.65.4.161', parents => ['msw1-eqiad'], ospf => false, bfd => false },
'lsw1-c5-eqiad.mgmt' => { ipv4 => '10.65.4.162', parents => ['msw1-eqiad'], ospf => false, bfd => false },
'lsw1-c6-eqiad.mgmt' => { ipv4 => '10.65.4.172', parents => ['msw1-eqiad'], ospf => false, bfd => false },
'lsw1-c7-eqiad.mgmt' => { ipv4 => '10.65.4.187', parents => ['msw1-eqiad'], ospf => false, bfd => false },
'lsw1-d1-eqiad.mgmt' => { ipv4 => '10.65.4.208', parents => ['msw1-eqiad'], ospf => false, bfd => false },
'lsw1-d2-eqiad.mgmt' => { ipv4 => '10.65.4.209', parents => ['msw1-eqiad'], ospf => false, bfd => false },
'lsw1-d3-eqiad.mgmt' => { ipv4 => '10.65.4.210', parents => ['msw1-eqiad'], ospf => false, bfd => false },
'lsw1-d4-eqiad.mgmt' => { ipv4 => '10.65.4.211', parents => ['msw1-eqiad'], ospf => false, bfd => false },
'lsw1-d6-eqiad.mgmt' => { ipv4 => '10.65.4.212', parents => ['msw1-eqiad'], ospf => false, bfd => false },
'lsw1-d7-eqiad.mgmt' => { ipv4 => '10.65.4.213', parents => ['msw1-eqiad'], ospf => false, bfd => false },
'lsw1-d8-eqiad.mgmt' => { ipv4 => '10.65.4.217', parents => ['msw1-eqiad'], ospf => false, bfd => false },
'ssw1-e1-eqiad.mgmt' => { ipv4 => '10.65.2.143', parents => ['msw2-eqiad'] },
'lsw1-e1-eqiad.mgmt' => { ipv4 => '10.65.1.228', parents => ['msw2-eqiad'] },
'lsw1-e2-eqiad.mgmt' => { ipv4 => '10.65.1.229', parents => ['msw2-eqiad'] },
'lsw1-e3-eqiad.mgmt' => { ipv4 => '10.65.1.230', parents => ['msw2-eqiad'] },
'lsw1-e5-eqiad.mgmt' => { ipv4 => '10.65.7.109', parents => ['msw2-eqiad'] },
'lsw1-e6-eqiad.mgmt' => { ipv4 => '10.65.7.110', parents => ['msw2-eqiad'] },
'lsw1-e7-eqiad.mgmt' => { ipv4 => '10.65.7.111', parents => ['msw2-eqiad'] },
'lsw1-e8-eqiad.mgmt' => { ipv4 => '10.65.2.150', parents => ['msw2-eqiad'] },
'ssw1-f1-eqiad.mgmt' => { ipv4 => '10.65.2.144', parents => ['msw2-eqiad'] },
'lsw1-f1-eqiad.mgmt' => { ipv4 => '10.65.1.232', parents => ['msw2-eqiad'] },
'lsw1-f2-eqiad.mgmt' => { ipv4 => '10.65.1.233', parents => ['msw2-eqiad'] },
'lsw1-f3-eqiad.mgmt' => { ipv4 => '10.65.1.234', parents => ['msw2-eqiad'] },
'lsw1-f5-eqiad.mgmt' => { ipv4 => '10.65.7.112', parents => ['msw2-eqiad'] },
'lsw1-f6-eqiad.mgmt' => { ipv4 => '10.65.7.113', parents => ['msw2-eqiad'] },
'lsw1-f7-eqiad.mgmt' => { ipv4 => '10.65.7.114', parents => ['msw2-eqiad'] },
'lsw1-f8-eqiad.mgmt' => { ipv4 => '10.65.3.7', parents => ['msw2-eqiad'] },
# codfw prod
'ssw1-a1-codfw.mgmt' => { ipv4 => '10.193.1.204', parents => ['msw1-codfw'] },
'ssw1-a8-codfw.mgmt' => { ipv4 => '10.193.2.1', parents => ['msw1-codfw'] },
'ssw1-d1-codfw.mgmt' => { ipv4 => '10.193.2.208', parents => ['msw1-codfw'] },
'ssw1-d8-codfw.mgmt' => { ipv4 => '10.193.2.210', parents => ['msw1-codfw'] },
'lsw1-a2-codfw.mgmt' => { ipv4 => '10.193.1.207', parents => ['msw1-codfw'] },
'lsw1-a3-codfw.mgmt' => { ipv4 => '10.193.2.18', parents => ['msw1-codfw'] },
'lsw1-a4-codfw.mgmt' => { ipv4 => '10.193.2.19', parents => ['msw1-codfw'] },
'lsw1-a5-codfw.mgmt' => { ipv4 => '10.193.2.20', parents => ['msw1-codfw'] },
'lsw1-a6-codfw.mgmt' => { ipv4 => '10.193.2.21', parents => ['msw1-codfw'] },
'lsw1-a7-codfw.mgmt' => { ipv4 => '10.193.2.22', parents => ['msw1-codfw'] },
'lsw1-a8-codfw.mgmt' => { ipv4 => '10.193.2.23', parents => ['msw1-codfw'] },
'lsw1-b2-codfw.mgmt' => { ipv4 => '10.193.2.73', parents => ['msw1-codfw'] },
'lsw1-b3-codfw.mgmt' => { ipv4 => '10.193.2.74', parents => ['msw1-codfw'] },
'lsw1-b4-codfw.mgmt' => { ipv4 => '10.193.2.75', parents => ['msw1-codfw'] },
'lsw1-b5-codfw.mgmt' => { ipv4 => '10.193.2.76', parents => ['msw1-codfw'] },
'lsw1-b6-codfw.mgmt' => { ipv4 => '10.193.2.77', parents => ['msw1-codfw'] },
'lsw1-b7-codfw.mgmt' => { ipv4 => '10.193.2.78', parents => ['msw1-codfw'] },
'lsw1-b8-codfw.mgmt' => { ipv4 => '10.193.2.79', parents => ['msw1-codfw'] },
'lsw1-c1-codfw.mgmt' => { ipv4 => '10.193.1.154', parents => ['msw1-codfw'] },
'lsw1-c2-codfw.mgmt' => { ipv4 => '10.193.2.211', parents => ['msw1-codfw'] },
'lsw1-c3-codfw.mgmt' => { ipv4 => '10.193.1.232', parents => ['msw1-codfw'] },
'lsw1-c4-codfw.mgmt' => { ipv4 => '10.193.1.233', parents => ['msw1-codfw'] },
'lsw1-c5-codfw.mgmt' => { ipv4 => '10.193.1.231', parents => ['msw1-codfw'] },
'lsw1-c6-codfw.mgmt' => { ipv4 => '10.193.1.234', parents => ['msw1-codfw'] },
'lsw1-c7-codfw.mgmt' => { ipv4 => '10.193.2.2', parents => ['msw1-codfw'] },
'lsw1-d1-codfw.mgmt' => { ipv4 => '10.193.1.205', parents => ['msw1-codfw'] },
'lsw1-d2-codfw.mgmt' => { ipv4 => '10.193.2.80', parents => ['msw1-codfw'] },
'lsw1-d3-codfw.mgmt' => { ipv4 => '10.193.2.118', parents => ['msw1-codfw'] },
'lsw1-d4-codfw.mgmt' => { ipv4 => '10.193.2.152', parents => ['msw1-codfw'] },
'lsw1-d5-codfw.mgmt' => { ipv4 => '10.193.2.174', parents => ['msw1-codfw'] },
'lsw1-d6-codfw.mgmt' => { ipv4 => '10.193.2.186', parents => ['msw1-codfw'] },
'lsw1-d7-codfw.mgmt' => { ipv4 => '10.193.2.192', parents => ['msw1-codfw'] },
'lsw1-d8-codfw.mgmt' => { ipv4 => '10.193.2.207', parents => ['msw1-codfw'] },
'ssw1-e1-codfw.mgmt' => { ipv4 => '10.193.3.38', parents => ['msw2-codfw'] },
'ssw1-f1-codfw.mgmt' => { ipv4 => '10.193.3.215', parents => ['msw2-codfw'] },
'lsw1-e1-codfw.mgmt' => { ipv4 => '10.193.3.39', parents => ['msw2-codfw'] },
'lsw1-e2-codfw.mgmt' => { ipv4 => '10.193.1.95', parents => ['msw2-codfw'], ospf => false, bfd => false },
'lsw1-e3-codfw.mgmt' => { ipv4 => '10.193.3.209', parents => ['msw2-codfw'] },
'lsw1-e4-codfw.mgmt' => { ipv4 => '10.193.1.99', parents => ['msw2-codfw'], ospf => false, bfd => false },
'lsw1-e5-codfw.mgmt' => { ipv4 => '10.193.1.100', parents => ['msw2-codfw'], ospf => false, bfd => false },
'lsw1-f1-codfw.mgmt' => { ipv4 => '10.193.3.222', parents => ['msw2-codfw'] },
'lsw1-f2-codfw.mgmt' => { ipv4 => '10.193.1.245', parents => ['msw2-codfw'], ospf => false, bfd => false },
'lsw1-f3-codfw.mgmt' => { ipv4 => '10.193.3.221', parents => ['msw2-codfw'] },
'lsw1-f4-codfw.mgmt' => { ipv4 => '10.193.1.246', parents => ['msw2-codfw'], ospf => false, bfd => false },
# codfw cloud
'cloudsw1-b1-codfw.mgmt' => { ipv4 => '10.193.0.243', parents => ['msw1-codfw']},
# drmrs
'asw1-b12-drmrs.mgmt' => { ipv4 => '10.136.128.3', parents => ['mr1-drmrs'] },
'asw1-b13-drmrs.mgmt' => { ipv4 => '10.136.128.4', parents => ['mr1-drmrs'] },
# esams
'asw1-bw27-esams.mgmt' => { ipv4 => '10.80.128.3', parents => ['mr1-esams'] },
'asw1-by27-esams.mgmt' => { ipv4 => '10.80.128.5', parents => ['mr1-esams'] },
# magru
'asw1-b3-magru.mgmt' => { ipv4 => '10.140.128.4', parents => ['mr1-magru'] },
'asw1-b4-magru.mgmt' => { ipv4 => '10.140.128.5', parents => ['mr1-magru'] },
}
create_resources(netops::check, $l3_switches_mgmt, $l3_switches_mgmt_defaults)
# RIPE Atlases -- http checks from prometheus blackbox
$atlas = $infra_devices.filter |$device, $config| {
$config['role'] == 'atlas'
}
$atlas_blackbox_exporter = $atlas.map |$device, $config| {
{
"${device}" => {
'server_name' => "${device}.wikimedia.org",
'instance_label' => $device,
'ip4' => $config['ipv4'],
'ip6' => $config['ipv6'],
'port' => 80,
'status_matches' => [200],
'site' => $config['site'],
'proxy_url' => "http://webproxy.${config['site']}.wmnet:8080",
'prometheus_instance' => 'ops',
'severity' => 'critical',
'probe_summary' => 'Ripe Atlas anchor {{ $labels.instance }} is not returning HTTP 200 OK on port 80',
'probe_description' => 'The Ripe Atlas anchor {{ $labels.instance }} cannot be reached (via local proxy) from the Prometheus instance at its site ({{ $externalLabels.site }}), or it does not respond with an HTTP 200 OK status code.',
'probe_runbook' => 'https://wikitech.wikimedia.org/wiki/RIPE_Atlas#HTTP_checks_failing',
}
}
}.reduce( {} ) | $memo, $x | {
$memo + $x
}
create_resources(prometheus::blackbox::check::http, $atlas_blackbox_exporter)
# RIPE Atlases measurements checks moved to prometheus/alertmanar
# SCS -- Serial Console Servers
$scs = $infra_devices.filter |$device, $config| {
$config['role'] == 'scs'
}
create_resources(netops::check, $scs)
}
|