mirror of
https://github.com/outbackdingo/homelab-v.git
synced 2026-08-25 14:53:19 +00:00
feat(unpoller): add monitoring of unifi equipment
Signed-off-by: Vegard Hagen <[email protected]>
This commit is contained in:
@@ -11,6 +11,8 @@ spec:
|
|||||||
server: '*'
|
server: '*'
|
||||||
- namespace: 'torrent'
|
- namespace: 'torrent'
|
||||||
server: '*'
|
server: '*'
|
||||||
|
- namespace: 'unpoller'
|
||||||
|
server: '*'
|
||||||
- namespace: 'unrar'
|
- namespace: 'unrar'
|
||||||
server: '*'
|
server: '*'
|
||||||
clusterResourceWhitelist:
|
clusterResourceWhitelist:
|
||||||
|
|||||||
@@ -0,0 +1,46 @@
|
|||||||
|
# https://github.com/unpoller/unpoller/blob/master/examples/up.conf.example
|
||||||
|
[poller]
|
||||||
|
debug = false
|
||||||
|
quiet = false
|
||||||
|
plugins = []
|
||||||
|
|
||||||
|
[prometheus]
|
||||||
|
disable = false
|
||||||
|
http_listen = "0.0.0.0:9130"
|
||||||
|
report_errors = true
|
||||||
|
dead_ports = false
|
||||||
|
|
||||||
|
[influxdb]
|
||||||
|
disable = true
|
||||||
|
|
||||||
|
[loki]
|
||||||
|
disable = true
|
||||||
|
|
||||||
|
[datadog]
|
||||||
|
enable = false
|
||||||
|
[webserver]
|
||||||
|
enable = false
|
||||||
|
port = 37288
|
||||||
|
|
||||||
|
[unifi]
|
||||||
|
dynamic = false
|
||||||
|
|
||||||
|
[unifi.defaults]
|
||||||
|
url = "https://192.168.1.1"
|
||||||
|
|
||||||
|
user = "unifipoller"
|
||||||
|
pass = "file:///mnt/secrets/password"
|
||||||
|
|
||||||
|
sites = ["all"]
|
||||||
|
|
||||||
|
save_sites = true
|
||||||
|
|
||||||
|
hash_pii = false
|
||||||
|
save_ids = false
|
||||||
|
save_events = false
|
||||||
|
save_alarms = false
|
||||||
|
save_anomalies = false
|
||||||
|
save_dpi = false
|
||||||
|
save_rogue = false
|
||||||
|
verify_ssl = false
|
||||||
|
ssl_cert_paths = []
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
apiVersion: grafana.integreatly.org/v1beta1
|
||||||
|
kind: GrafanaDashboard
|
||||||
|
metadata:
|
||||||
|
name: client-insights
|
||||||
|
namespace: unpoller
|
||||||
|
spec:
|
||||||
|
allowCrossNamespaceImport: true
|
||||||
|
folder: UniFi
|
||||||
|
resyncPeriod: 10m
|
||||||
|
instanceSelector:
|
||||||
|
matchLabels:
|
||||||
|
app: grafana
|
||||||
|
datasources:
|
||||||
|
- inputName: DS_PROMETHEUS
|
||||||
|
datasourceName: default
|
||||||
|
url: https://grafana.com/api/dashboards/11315/revisions/latest/download
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
apiVersion: grafana.integreatly.org/v1beta1
|
||||||
|
kind: GrafanaDashboard
|
||||||
|
metadata:
|
||||||
|
name: network-sites
|
||||||
|
namespace: unpoller
|
||||||
|
spec:
|
||||||
|
allowCrossNamespaceImport: true
|
||||||
|
folder: UniFi
|
||||||
|
resyncPeriod: 10m
|
||||||
|
instanceSelector:
|
||||||
|
matchLabels:
|
||||||
|
app: grafana
|
||||||
|
datasources:
|
||||||
|
- inputName: DS_PROMETHEUS
|
||||||
|
datasourceName: default
|
||||||
|
url: https://grafana.com/api/dashboards/11311/revisions/latest/download
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
apiVersion: grafana.integreatly.org/v1beta1
|
||||||
|
kind: GrafanaDashboard
|
||||||
|
metadata:
|
||||||
|
name: uap-insights
|
||||||
|
namespace: unpoller
|
||||||
|
spec:
|
||||||
|
allowCrossNamespaceImport: true
|
||||||
|
folder: UniFi
|
||||||
|
resyncPeriod: 10m
|
||||||
|
instanceSelector:
|
||||||
|
matchLabels:
|
||||||
|
app: grafana
|
||||||
|
datasources:
|
||||||
|
- inputName: DS_PROMETHEUS
|
||||||
|
datasourceName: default
|
||||||
|
url: https://grafana.com/api/dashboards/11314/revisions/latest/download
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
apiVersion: grafana.integreatly.org/v1beta1
|
||||||
|
kind: GrafanaDashboard
|
||||||
|
metadata:
|
||||||
|
name: usg-insights
|
||||||
|
namespace: unpoller
|
||||||
|
spec:
|
||||||
|
allowCrossNamespaceImport: true
|
||||||
|
folder: UniFi
|
||||||
|
resyncPeriod: 10m
|
||||||
|
instanceSelector:
|
||||||
|
matchLabels:
|
||||||
|
app: grafana
|
||||||
|
datasources:
|
||||||
|
- inputName: DS_PROMETHEUS
|
||||||
|
datasourceName: default
|
||||||
|
url: https://grafana.com/api/dashboards/11313/revisions/latest/download
|
||||||
@@ -0,0 +1,16 @@
|
|||||||
|
apiVersion: grafana.integreatly.org/v1beta1
|
||||||
|
kind: GrafanaDashboard
|
||||||
|
metadata:
|
||||||
|
name: usw-insights
|
||||||
|
namespace: unpoller
|
||||||
|
spec:
|
||||||
|
allowCrossNamespaceImport: true
|
||||||
|
folder: UniFi
|
||||||
|
resyncPeriod: 10m
|
||||||
|
instanceSelector:
|
||||||
|
matchLabels:
|
||||||
|
app: grafana
|
||||||
|
datasources:
|
||||||
|
- inputName: DS_PROMETHEUS
|
||||||
|
datasourceName: default
|
||||||
|
url: https://grafana.com/api/dashboards/11312/revisions/latest/download
|
||||||
@@ -0,0 +1,58 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: unpoller
|
||||||
|
namespace: unpoller
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: unpoller
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: unpoller
|
||||||
|
spec:
|
||||||
|
securityContext:
|
||||||
|
runAsNonRoot: true
|
||||||
|
runAsUser: 65534
|
||||||
|
runAsGroup: 65534
|
||||||
|
fsGroup: 65534
|
||||||
|
fsGroupChangePolicy: OnRootMismatch
|
||||||
|
seccompProfile:
|
||||||
|
type: RuntimeDefault
|
||||||
|
containers:
|
||||||
|
- name: unpoller
|
||||||
|
image: ghcr.io/unpoller/unpoller:v2.15.3 # renovate: github-releases=unpoller/unpoller
|
||||||
|
securityContext:
|
||||||
|
allowPrivilegeEscalation: false
|
||||||
|
readOnlyRootFilesystem: true
|
||||||
|
runAsNonRoot: true
|
||||||
|
capabilities:
|
||||||
|
drop: [ ALL ]
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
memory: 16Mi
|
||||||
|
cpu: 5m
|
||||||
|
limits:
|
||||||
|
memory: 32Mi
|
||||||
|
ports:
|
||||||
|
- name: metrics
|
||||||
|
containerPort: 9130
|
||||||
|
livenessProbe:
|
||||||
|
httpGet: { path: /, port: metrics }
|
||||||
|
readinessProbe:
|
||||||
|
httpGet: { path: /, port: metrics }
|
||||||
|
volumeMounts:
|
||||||
|
- name: config
|
||||||
|
mountPath: /etc/unpoller/up.conf
|
||||||
|
subPath: up.conf
|
||||||
|
- name: user-credentials
|
||||||
|
mountPath: /mnt/secrets/password
|
||||||
|
subPath: password
|
||||||
|
volumes:
|
||||||
|
- name: config
|
||||||
|
configMap:
|
||||||
|
name: unpoller-config
|
||||||
|
- name: user-credentials
|
||||||
|
secret:
|
||||||
|
secretName: user-credentials
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
apiVersion: kustomize.config.k8s.io/v1beta1
|
||||||
|
kind: Kustomization
|
||||||
|
|
||||||
|
configMapGenerator:
|
||||||
|
- name: unpoller-config
|
||||||
|
namespace: unpoller
|
||||||
|
files: [ ./config/up.conf ]
|
||||||
|
|
||||||
|
resources:
|
||||||
|
- ns.yaml
|
||||||
|
- svc.yaml
|
||||||
|
- deployment.yaml
|
||||||
|
- serviceMonitor.yaml
|
||||||
|
- user-credentials.yaml
|
||||||
|
- dashboards/client-insights.yaml
|
||||||
|
- dashboards/network-sites.yaml
|
||||||
|
- dashboards/uap-insights.yaml
|
||||||
|
- dashboards/usg-insights.yaml
|
||||||
|
- dashboards/usw-insigts.yaml
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
name: unpoller
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
apiVersion: monitoring.coreos.com/v1
|
||||||
|
kind: ServiceMonitor
|
||||||
|
metadata:
|
||||||
|
name: unpoller
|
||||||
|
namespace: unpoller
|
||||||
|
spec:
|
||||||
|
endpoints:
|
||||||
|
- path: /metrics
|
||||||
|
port: metrics
|
||||||
|
namespaceSelector:
|
||||||
|
matchNames:
|
||||||
|
- unpoller
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: unpoller
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: unpoller
|
||||||
|
namespace: unpoller
|
||||||
|
labels:
|
||||||
|
app: unpoller
|
||||||
|
spec:
|
||||||
|
type: ClusterIP
|
||||||
|
selector:
|
||||||
|
app: unpoller
|
||||||
|
ports:
|
||||||
|
- name: metrics
|
||||||
|
port: 9130
|
||||||
|
targetPort: metrics
|
||||||
@@ -0,0 +1,13 @@
|
|||||||
|
apiVersion: bitnami.com/v1alpha1
|
||||||
|
kind: SealedSecret
|
||||||
|
metadata:
|
||||||
|
name: user-credentials
|
||||||
|
namespace: unpoller
|
||||||
|
spec:
|
||||||
|
encryptedData:
|
||||||
|
password: AgCls8+38jIVmZP8oK/I/EgaZ0aKaTMyOJZAiykYL/nsO8Ol95X1VA7agInCOGe+bhlkU8E1Och5IIFq23rkPW6ej2nf4tOOV7go4gsT6nAS8Hlfqc8gihYxPkXLU+/xZI2mYQv+vlDsZ5ZWgiuLo06YqKKWX5i9QSgH+pNqNAnHD40ZpAHpq+51fqg8C5guSzoDcrg7kqev8DVALKIc4U7za3sEXRhi/DpTNNCvi87Licv7yz5blnvoqWWIKlYJCS6TmRiuN2fQefEsbBqgnRSOi9qpXxoyv3+YGNj/3DTx4RNFcfdRxaAchxKoZ3NHU9ndCCk2yNlsspRXC1tGaU84EzTTltk3gBhvvvaZK/dyvasftjrK91RDt4HOuwlmkwjX1LvEhN2GX9AZIFOgfQafkp5kDSlA8pGfYUYvBCvKqKYf64OZKmyURsmPURVqbIKi6L3u4+q35tGSz0XsxBz1A8G82FYbY3UXbNzPAZmteNsi4wotl8PlHoRYJxcmL2SxIIb+a3jX4dzH66mj1+iiIoDtufsf/dNzN5Sh77ZywlhR8cK6/owt4bpL8z5YZoIDj4Ajqj1q0ou2cVcAi2K+G9rmrvrsAcWNaw/0rptX7BrFeUA5L8MMID2SrT+CarZSLIOaF/PAq3F0kny/ZOpAcOCl9Ph5Fj2IsOzpcZPrSieOcesUNeKxTgkBMDOcOGIqYv35TWDM2NOk1pT741QnLr/qkUbJTOJrNmkG7p5LETSDC2I=
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
name: user-credentials
|
||||||
|
namespace: unpoller
|
||||||
|
type: Opaque
|
||||||
Reference in New Issue
Block a user