Skip to content

Commit

Permalink
Merge pull request #104 from siegy22/master
Browse files Browse the repository at this point in the history
Add support for browser monitoring
  • Loading branch information
aeciopires authored Sep 24, 2024
2 parents 54bdbe8 + 49ed1e2 commit 14dc84e
Show file tree
Hide file tree
Showing 4 changed files with 96 additions and 0 deletions.
32 changes: 32 additions & 0 deletions charts/zabbix/templates/deployment-webdriver.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{{- if and .Values.zabbixBrowserMonitoring.enabled .Values.zabbixBrowserMonitoring.webdriver.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ template "zabbix.fullname" . }}-{{ .Values.zabbixBrowserMonitoring.webdriver.name }}
labels:
app: {{ template "zabbix.name" . }}
release: {{ .Release.Name }}
component: webdriver
spec:
replicas: 1
selector:
matchLabels:
app: {{ template "zabbix.name" . }}
component: webdriver
template:
metadata:
labels:
app: {{ template "zabbix.name" . }}
component: webdriver
spec:
containers:
- name: {{ .Values.zabbixBrowserMonitoring.webdriver.name }}
imagePullPolicy: {{ .Values.zabbixBrowserMonitoring.webdriver.image.pullPolicy }}
image: {{ .Values.zabbixBrowserMonitoring.webdriver.image.repository }}:{{ .Values.zabbixBrowserMonitoring.webdriver.image.tag }}
ports:
- containerPort: {{ .Values.zabbixBrowserMonitoring.webdriver.port }}
{{- end }}
imagePullSecrets:
{{- range .Values.zabbixBrowserMonitoring.webdriver.pullSecrets }}
- name: {{ . | quote }}
{{- end }}
11 changes: 11 additions & 0 deletions charts/zabbix/templates/deployment-zabbix-server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,17 @@ spec:
- name: ZBX_STARTJAVAPOLLERS
value: {{ .Values.zabbixJavaGateway.ZBX_STARTJAVAPOLLERS | quote }}
{{- end }}
{{- if .Values.zabbixBrowserMonitoring.enabled }}
- name: ZBX_STARTBROWSERPOLLERS
value: {{ .Values.zabbixBrowserMonitoring.pollers | quote }}
{{- end }}
{{- if .Values.zabbixBrowserMonitoring.customWebDriverURL }}
- name: ZBX_WEBDRIVERURL
value: {{ .Values.zabbixBrowserMonitoring.customWebDriverURL | quote }}
{{- else }}
- name: ZBX_WEBDRIVERURL
value: http://{{ template "zabbix.fullname" . }}-{{ .Values.zabbixBrowserMonitoring.webdriver.name }}:{{ .Values.zabbixBrowserMonitoring.webdriver.port }}
{{- end }}
{{- with .Values.zabbixServer.extraVolumeMounts }}
volumeMounts:
{{- toYaml . | nindent 12 }}
Expand Down
20 changes: 20 additions & 0 deletions charts/zabbix/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -334,3 +334,23 @@ spec:
selector:
app: {{ template "zabbix.fullname" . }}-{{ .Values.zabbixJavaGateway.ZBX_JAVAGATEWAY }}
{{- end }}
---
{{- if and .Values.zabbixBrowserMonitoring.enabled .Values.zabbixBrowserMonitoring.webdriver.enabled }}
apiVersion: v1
kind: Service
metadata:
name: {{ template "zabbix.fullname" . }}-{{ .Values.zabbixBrowserMonitoring.webdriver.name }}
labels:
app: {{ template "zabbix.name" . }}
release: {{ .Release.Name }}
component: webdriver
spec:
ports:
- port: {{ .Values.zabbixBrowserMonitoring.webdriver.port }}
targetPort: {{ .Values.zabbixBrowserMonitoring.webdriver.port }}
protocol: TCP
selector:
app: {{ template "zabbix.name" . }}
component: webdriver
type: ClusterIP
{{- end }}
33 changes: 33 additions & 0 deletions charts/zabbix/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -795,6 +795,39 @@ zabbixJavaGateway:
failureThreshold: 5
successThreshold: 1

# Zabbix Browser Monitoring, supported since 7.0.
# See https://assets.zabbix.com/files/events/2024/conference_benelux_2024/KasparsM_browser_monitoring.pdf
# and https://www.zabbix.com/documentation/current/en/manual/config/items/itemtypes/browser
zabbixBrowserMonitoring:
# -- Enable browser pollers
enabled: false

# -- Number of browser pollers to start
pollers: 1

webdriver:
# -- Enable webdriver
enabled: true

# -- WebDriver container name
name: chrome

image:
# -- WebDriver container image
repository: selenium/standalone-chrome
# -- WebDriver container image tag, See https://hub.docker.com/r/selenium/standalone-chrome/tags
tag: 127.0-chromedriver-127.0-grid-4.23.0-20240727
# -- Pull policy of Docker image
pullPolicy: IfNotPresent
# -- List of dockerconfig secrets names to use when pulling images
pullSecrets: []

# -- WebDriver container port
port: 4444

# -- Custom WebDriver URL. If set, it overrides the default internal WebDriver service URL. Set zabbixBrowserMonitoring.webdriver.enabled to false when setting this.
customWebDriverURL: ""

# Ingress configurations
ingress:
# -- Enables Ingress
Expand Down

0 comments on commit 14dc84e

Please sign in to comment.