-
Notifications
You must be signed in to change notification settings - Fork 3.9k
zabbix: bring to parity between agent, server, and proxy; and do some cleanup #30010
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
danielfdickinson
wants to merge
9
commits into
openwrt:master
from
danielfdickinson:pr-zabbix-bump-7-0-28
Closed
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
cee63f4
zabbix: bump version to 7.0.28
danielfdickinson 224811d
zabbix: use separate users for server and proxy
danielfdickinson 26812a0
zabbix: tweak patch agent and server patch configs
danielfdickinson 2f2e421
zabbix: tweak server initscript and bring agentd to parity
danielfdickinson 015bbbe
zabbix: bring proxy to parity with server and agentd
danielfdickinson 7f8c1d6
zabbix: preserve user config files across sysupgrade
danielfdickinson 9c2f3ae
zabbix: move agentd openwrt-supplied params to separate dir
danielfdickinson 612b66a
zabbix: stop shipping sysctl.d conf in package
danielfdickinson ed755c1
zabbix: add php8-mod-simplexml dependency to frontend
danielfdickinson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
|
|
||
| config zabbix_agentd 'general' | ||
| option enabled 0 | ||
| # option never_root 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| #!/bin/sh | ||
|
|
||
| chown zabbix-agent:zabbix-agent /etc/zabbix_agentd.conf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,26 +1,50 @@ | ||
| #!/bin/sh /etc/rc.common | ||
| # Copyright (C) 2008-2011 OpenWrt.org | ||
|
|
||
| # shellcheck shell=busybox | ||
|
|
||
| # shellcheck disable=SC2034 | ||
| START=60 | ||
|
|
||
| # shellcheck disable=SC2034 | ||
| USE_PROCD=1 | ||
| PROG=/usr/sbin/zabbix_agentd | ||
| CONFIG=/etc/zabbix_agentd.conf | ||
| NAME=zabbix_agentd | ||
| PROG=/usr/sbin/${NAME} | ||
| CONFIG=/etc/${NAME}.conf | ||
| USER=zabbix-agent | ||
|
|
||
| start_service() { | ||
| local enabled never_root | ||
|
|
||
| # Sometimes the agentd config was installed in /etc/zabbix/zabbix_agentd.conf | ||
| [ -f /etc/zabbix/zabbix_agentd.conf ] && mv /etc/zabbix/zabbix_agentd.conf ${CONFIG} | ||
|
|
||
| [ -f ${CONFIG} ] || return 1 | ||
| if [ ! -f "${CONFIG}" ]; then | ||
| logger "Configuration file not found: '${CONFIG}'" | ||
| return 1 | ||
| fi | ||
|
|
||
| # Get enabled config option | ||
| config_load "$NAME" | ||
| config_get_bool enabled general enabled 0 | ||
| config_get_bool never_root general never_root 1 | ||
|
|
||
| mkdir -p /var/run/zabbix-agent | ||
| chown zabbix-agent:zabbix-agent /var/run/zabbix-agent | ||
| # shellcheck disable=SC2154 | ||
| if [ "$enabled" -eq 0 ]; then | ||
| logger "service not enabled in /etc/config/$NAME" | ||
| return 1 | ||
| fi | ||
|
|
||
| mkdir -p "/var/run/$USER" | ||
| chown $USER:$USER "/var/run/$USER" | ||
|
|
||
| procd_open_instance | ||
| procd_set_param command ${PROG} -c ${CONFIG} -f | ||
| if [ "$never_root" -eq 1 ]; then | ||
| procd_set_param user ${USER} | ||
| fi | ||
| procd_set_param respawn | ||
| procd_set_param stdout 1 | ||
| procd_set_param stderr 1 | ||
| procd_close_instance | ||
| } | ||
|
|
||
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
|
|
||
| config zabbix_proxy 'general' | ||
| option enabled 0 | ||
| # option never_root 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| #!/bin/sh | ||
|
|
||
| chown zabbix-proxy:zabbix-proxy /etc/zabbix_proxy.conf |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| #!/bin/sh /etc/rc.common | ||
| # Copyright (C) 2008-2025 OpenWrt.org | ||
|
|
||
| # shellcheck shell=busybox | ||
|
|
||
| # shellcheck disable=SC2034 | ||
| START=59 | ||
|
|
||
| # shellcheck disable=SC2034 | ||
| USE_PROCD=1 | ||
|
|
||
| NAME=zabbix_proxy | ||
| PROG=/usr/sbin/${NAME} | ||
| CONFIG=/etc/${NAME}.conf | ||
| USER=zabbix-proxy | ||
|
|
||
| start_service() { | ||
| local enabled never_root | ||
|
|
||
| if [ ! -f "${CONFIG}" ]; then | ||
| logger "Configuration file not found: '${CONFIG}'" | ||
| return 1 | ||
| fi | ||
|
|
||
| # Get enabled config option | ||
| config_load "$NAME" | ||
| config_get_bool enabled general enabled 0 | ||
| config_get_bool never_root general never_root 1 | ||
|
|
||
| # shellcheck disable=SC2154 | ||
| if [ "$enabled" -eq 0 ]; then | ||
| logger "service not enabled in /etc/config/$NAME" | ||
| return 1 | ||
| fi | ||
|
|
||
| mkdir -p "/var/run/$USER" | ||
| chown $USER:$USER "/var/run/$USER" | ||
|
|
||
| procd_open_instance | ||
| procd_set_param command ${PROG} -c ${CONFIG} -f | ||
| if [ "$never_root" -eq 1 ]; then | ||
| procd_set_param user ${USER} | ||
| fi | ||
| procd_set_param file ${CONFIG} | ||
| procd_set_param respawn | ||
| procd_set_param stdout 1 | ||
| procd_set_param stderr 1 | ||
| procd_close_instance | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,4 @@ | ||
|
|
||
| config zabbix_server 'general' | ||
| option enabled 0 | ||
| # option never_root 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: This commit brings agentd to parity with
zabbix_server, but the agentd instance omitsprocd_set_param file ${CONFIG}, which bothzabbix_server.init:45andzabbix_proxy.init:44set. Without it procd won't track the config file, so editing/etc/zabbix_agentd.confand runningreloadwon't restart the agent. If the omission is intentional, ignore; otherwise:Generated by Claude Code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed this is #30026 where these changes now live.