2022-09-11 13:24:35 +00:00
|
|
|
---
|
|
|
|
apiVersion: monitoring.coreos.com/v1
|
|
|
|
kind: Probe
|
|
|
|
metadata:
|
|
|
|
name: mikrotik
|
|
|
|
spec:
|
2024-09-04 19:33:15 +00:00
|
|
|
basicAuth:
|
|
|
|
username:
|
|
|
|
name: mikrotik-exporter
|
|
|
|
key: username
|
|
|
|
password:
|
|
|
|
name: mikrotik-exporter
|
|
|
|
key: password
|
2022-09-11 13:24:35 +00:00
|
|
|
prober:
|
|
|
|
url: mikrotik-exporter
|
2024-09-04 19:33:15 +00:00
|
|
|
module: full
|
2022-09-11 13:24:35 +00:00
|
|
|
targets:
|
|
|
|
staticConfig:
|
|
|
|
static:
|
2024-09-04 19:33:15 +00:00
|
|
|
- 172.23.0.1
|
|
|
|
- 172.23.0.100
|
|
|
|
- 100.102.1.111
|
|
|
|
- 100.102.1.112
|
|
|
|
- 100.102.1.114
|
|
|
|
- 100.102.1.115
|
|
|
|
- 100.102.1.121
|
|
|
|
- 100.102.1.131
|
|
|
|
- 100.102.1.141
|
|
|
|
- 100.102.1.151
|
2022-09-11 13:24:35 +00:00
|
|
|
---
|
|
|
|
apiVersion: monitoring.coreos.com/v1
|
|
|
|
kind: PrometheusRule
|
|
|
|
metadata:
|
|
|
|
name: mikrotik
|
|
|
|
spec:
|
|
|
|
groups:
|
|
|
|
- name: mikrotik
|
|
|
|
rules:
|
|
|
|
- alert: MikrotikUplinkRedundancyLost
|
|
|
|
expr: mikrotik_interface_running{port=~"sfp-sfpplus[12]", instance!~"sw_core.*", instance!~"sw_mgmt.*"} == 0
|
|
|
|
for: 0m
|
|
|
|
labels:
|
|
|
|
severity: error
|
|
|
|
annotations:
|
|
|
|
summary: Switch uplink high availability lost
|
|
|
|
description: One of the two 10Gb optical links is malfunctioning
|
|
|
|
- alert: MikrotikLinkRateDegraded
|
|
|
|
expr: mikrotik_interface_rate{port=~"sfp-sfpplus.*"} < 10000000000
|
|
|
|
for: 0m
|
|
|
|
labels:
|
|
|
|
severity: error
|
|
|
|
annotations:
|
|
|
|
summary: 10Gb link degraded
|
|
|
|
description: One of the 10Gb links is running at lower speed
|
|
|
|
---
|
|
|
|
apiVersion: apps/v1
|
|
|
|
kind: Deployment
|
|
|
|
metadata:
|
|
|
|
name: mikrotik-exporter
|
|
|
|
spec:
|
|
|
|
revisionHistoryLimit: 0
|
|
|
|
replicas: 2
|
|
|
|
selector:
|
|
|
|
matchLabels:
|
|
|
|
app: mikrotik-exporter
|
|
|
|
template:
|
|
|
|
metadata:
|
|
|
|
labels:
|
|
|
|
app: mikrotik-exporter
|
|
|
|
spec:
|
|
|
|
containers:
|
|
|
|
- name: mikrotik-exporter
|
2024-07-26 11:15:18 +00:00
|
|
|
image: mirror.gcr.io/codemowers/mikrotik-exporter:latest
|
2024-08-21 04:11:06 +00:00
|
|
|
topologySpreadConstraints:
|
|
|
|
- maxSkew: 1
|
|
|
|
topologyKey: topology.kubernetes.io/zone
|
|
|
|
whenUnsatisfiable: DoNotSchedule
|
|
|
|
labelSelector:
|
|
|
|
matchLabels:
|
|
|
|
app: mikrotik-exporter
|
2022-09-11 13:24:35 +00:00
|
|
|
nodeSelector:
|
2024-08-23 04:58:26 +00:00
|
|
|
node-role.kubernetes.io/control-plane: ''
|
2022-09-11 13:24:35 +00:00
|
|
|
tolerations:
|
2024-08-23 04:58:26 +00:00
|
|
|
- key: node-role.kubernetes.io/control-plane
|
|
|
|
operator: Equal
|
|
|
|
value: ''
|
|
|
|
effect: NoSchedule
|
2022-09-11 13:24:35 +00:00
|
|
|
affinity:
|
|
|
|
podAntiAffinity:
|
|
|
|
requiredDuringSchedulingIgnoredDuringExecution:
|
2022-11-12 14:50:31 +00:00
|
|
|
- labelSelector:
|
|
|
|
matchExpressions:
|
|
|
|
- key: app
|
|
|
|
operator: In
|
|
|
|
values:
|
|
|
|
- mikrotik-exporter
|
|
|
|
topologyKey: "kubernetes.io/hostname"
|
2022-09-11 13:24:35 +00:00
|
|
|
---
|
|
|
|
kind: Service
|
|
|
|
apiVersion: v1
|
|
|
|
metadata:
|
|
|
|
name: mikrotik-exporter
|
|
|
|
spec:
|
|
|
|
type: ClusterIP
|
|
|
|
ports:
|
|
|
|
- name: http
|
|
|
|
port: 80
|
|
|
|
protocol: TCP
|
|
|
|
targetPort: 3001
|
|
|
|
selector:
|
|
|
|
app: mikrotik-exporter
|