Added missing UserParameterDir parameter for agent and agent2

This commit is contained in:
Alexey Pustovalov 2024-12-24 02:44:23 +09:00
parent 8eccc240f9
commit 9645d19a55
21 changed files with 22 additions and 0 deletions

View File

@ -65,6 +65,7 @@ RUN set -eux && \
mkdir -p /var/lib/zabbix/enc && \
mkdir -p /var/lib/zabbix/enc_internal && \
mkdir -p /var/lib/zabbix/modules && \
mkdir -p /var/lib/zabbix/user_scripts && \
chown --quiet -R zabbix:root /etc/zabbix/ /var/lib/zabbix/ && \
chgrp -R 0 /etc/zabbix/ /var/lib/zabbix/ && \
chmod -R g=u /etc/zabbix/ /var/lib/zabbix/

View File

@ -187,6 +187,7 @@ prepare_zbx_agent_config() {
# update_config_multiple_var $ZBX_AGENT_CONFIG "Alias" ${ZBX_ALIAS}
update_config_var $ZBX_AGENT_CONFIG "Timeout" "${ZBX_TIMEOUT}"
update_config_var $ZBX_AGENT_CONFIG "Include" "/etc/zabbix/zabbix_agentd.d/*.conf"
update_config_var $ZBX_AGENT_CONFIG "UserParameterDir" "$ZABBIX_USER_HOME_DIR/user_scripts"
update_config_var $ZBX_AGENT_CONFIG "UnsafeUserParameters" "${ZBX_UNSAFEUSERPARAMETERS}"
update_config_var $ZBX_AGENT_CONFIG "LoadModulePath" "$ZABBIX_USER_HOME_DIR/modules/"
update_config_multiple_var $ZBX_AGENT_CONFIG "LoadModule" "${ZBX_LOADMODULE}"

View File

@ -81,6 +81,7 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
mkdir -p /var/lib/zabbix/enc && \
mkdir -p /var/lib/zabbix/enc_internal && \
mkdir -p /var/lib/zabbix/modules && \
mkdir -p /var/lib/zabbix/user_scripts && \
chown --quiet -R zabbix:root /etc/zabbix/ /var/lib/zabbix/ && \
chgrp -R 0 /etc/zabbix/ /var/lib/zabbix/ && \
chmod -R g=u /etc/zabbix/ /var/lib/zabbix/ && \

View File

@ -187,6 +187,7 @@ prepare_zbx_agent_config() {
# update_config_multiple_var $ZBX_AGENT_CONFIG "Alias" ${ZBX_ALIAS}
update_config_var $ZBX_AGENT_CONFIG "Timeout" "${ZBX_TIMEOUT}"
update_config_var $ZBX_AGENT_CONFIG "Include" "/etc/zabbix/zabbix_agentd.d/*.conf"
update_config_var $ZBX_AGENT_CONFIG "UserParameterDir" "$ZABBIX_USER_HOME_DIR/user_scripts"
update_config_var $ZBX_AGENT_CONFIG "UnsafeUserParameters" "${ZBX_UNSAFEUSERPARAMETERS}"
update_config_var $ZBX_AGENT_CONFIG "LoadModulePath" "$ZABBIX_USER_HOME_DIR/modules/"
update_config_multiple_var $ZBX_AGENT_CONFIG "LoadModule" "${ZBX_LOADMODULE}"

View File

@ -69,6 +69,7 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
mkdir -p /var/lib/zabbix/enc && \
mkdir -p /var/lib/zabbix/enc_internal && \
mkdir -p /var/lib/zabbix/modules && \
mkdir -p /var/lib/zabbix/user_scripts && \
chown --quiet -R zabbix:root /etc/zabbix/ /var/lib/zabbix/ && \
chgrp -R 0 /etc/zabbix/ /var/lib/zabbix/ && \
chmod -R g=u /etc/zabbix/ /var/lib/zabbix/ && \

View File

@ -187,6 +187,7 @@ prepare_zbx_agent_config() {
# update_config_multiple_var $ZBX_AGENT_CONFIG "Alias" ${ZBX_ALIAS}
update_config_var $ZBX_AGENT_CONFIG "Timeout" "${ZBX_TIMEOUT}"
update_config_var $ZBX_AGENT_CONFIG "Include" "/etc/zabbix/zabbix_agentd.d/*.conf"
update_config_var $ZBX_AGENT_CONFIG "UserParameterDir" "$ZABBIX_USER_HOME_DIR/user_scripts"
update_config_var $ZBX_AGENT_CONFIG "UnsafeUserParameters" "${ZBX_UNSAFEUSERPARAMETERS}"
update_config_var $ZBX_AGENT_CONFIG "LoadModulePath" "$ZABBIX_USER_HOME_DIR/modules/"
update_config_multiple_var $ZBX_AGENT_CONFIG "LoadModule" "${ZBX_LOADMODULE}"

View File

@ -107,6 +107,7 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
mkdir -p /var/lib/zabbix/enc && \
mkdir -p /var/lib/zabbix/enc_internal && \
mkdir -p /var/lib/zabbix/modules && \
mkdir -p /var/lib/zabbix/user_scripts && \
chown --quiet -R zabbix:root /etc/zabbix/ /var/lib/zabbix/ && \
chgrp -R 0 /etc/zabbix/ /var/lib/zabbix/ && \
chmod -R g=u /etc/zabbix/ /var/lib/zabbix/ && \

View File

@ -187,6 +187,7 @@ prepare_zbx_agent_config() {
# update_config_multiple_var $ZBX_AGENT_CONFIG "Alias" ${ZBX_ALIAS}
update_config_var $ZBX_AGENT_CONFIG "Timeout" "${ZBX_TIMEOUT}"
update_config_var $ZBX_AGENT_CONFIG "Include" "/etc/zabbix/zabbix_agentd.d/*.conf"
update_config_var $ZBX_AGENT_CONFIG "UserParameterDir" "$ZABBIX_USER_HOME_DIR/user_scripts"
update_config_var $ZBX_AGENT_CONFIG "UnsafeUserParameters" "${ZBX_UNSAFEUSERPARAMETERS}"
update_config_var $ZBX_AGENT_CONFIG "LoadModulePath" "$ZABBIX_USER_HOME_DIR/modules/"
update_config_multiple_var $ZBX_AGENT_CONFIG "LoadModule" "${ZBX_LOADMODULE}"

View File

@ -65,6 +65,7 @@ RUN --mount=type=cache,target=/var/lib/apt/,sharing=locked \
mkdir -p /var/lib/zabbix/enc && \
mkdir -p /var/lib/zabbix/enc_internal && \
mkdir -p /var/lib/zabbix/modules && \
mkdir -p /var/lib/zabbix/user_scripts && \
chown --quiet -R zabbix:root /etc/zabbix/ /var/lib/zabbix/ && \
chgrp -R 0 /etc/zabbix/ /var/lib/zabbix/ && \
chmod -R g=u /etc/zabbix/ /var/lib/zabbix/ && \

View File

@ -187,6 +187,7 @@ prepare_zbx_agent_config() {
# update_config_multiple_var $ZBX_AGENT_CONFIG "Alias" ${ZBX_ALIAS}
update_config_var $ZBX_AGENT_CONFIG "Timeout" "${ZBX_TIMEOUT}"
update_config_var $ZBX_AGENT_CONFIG "Include" "/etc/zabbix/zabbix_agentd.d/*.conf"
update_config_var $ZBX_AGENT_CONFIG "UserParameterDir" "$ZABBIX_USER_HOME_DIR/user_scripts"
update_config_var $ZBX_AGENT_CONFIG "UnsafeUserParameters" "${ZBX_UNSAFEUSERPARAMETERS}"
update_config_var $ZBX_AGENT_CONFIG "LoadModulePath" "$ZABBIX_USER_HOME_DIR/modules/"
update_config_multiple_var $ZBX_AGENT_CONFIG "LoadModule" "${ZBX_LOADMODULE}"

View File

@ -65,6 +65,7 @@ RUN set -eux && \
mkdir -p /var/lib/zabbix/enc_internal && \
mkdir -p /var/lib/zabbix/modules && \
mkdir -p /var/lib/zabbix/buffer && \
mkdir -p /var/lib/zabbix/user_scripts && \
chown --quiet -R zabbix:root /etc/zabbix/ /var/lib/zabbix/ /usr/sbin/zabbix-agent2-plugin/ && \
chgrp -R 0 /etc/zabbix/ /var/lib/zabbix/ /usr/sbin/zabbix-agent2-plugin/ && \
chmod -R g=u /etc/zabbix/ /var/lib/zabbix/ /usr/sbin/zabbix-agent2-plugin/

View File

@ -197,6 +197,7 @@ prepare_zbx_agent_config() {
update_config_var $ZBX_AGENT_CONFIG "Timeout" "${ZBX_TIMEOUT}"
update_config_var $ZBX_AGENT_CONFIG "Include" "/etc/zabbix/zabbix_agent2.d/plugins.d/*.conf"
update_config_var $ZBX_AGENT_CONFIG "Include" "/etc/zabbix/zabbix_agentd.d/*.conf" "true"
update_config_var $ZBX_AGENT_CONFIG "UserParameterDir" "$ZABBIX_USER_HOME_DIR/user_scripts"
update_config_var $ZBX_AGENT_CONFIG "UnsafeUserParameters" "${ZBX_UNSAFEUSERPARAMETERS}"
update_config_var $ZBX_AGENT_CONFIG "TLSConnect" "${ZBX_TLSCONNECT}"
update_config_var $ZBX_AGENT_CONFIG "TLSAccept" "${ZBX_TLSACCEPT}"

View File

@ -84,6 +84,7 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
mkdir -p /var/lib/zabbix/enc_internal && \
mkdir -p /var/lib/zabbix/modules && \
mkdir -p /var/lib/zabbix/buffer && \
mkdir -p /var/lib/zabbix/user_scripts && \
chown --quiet -R zabbix:root /etc/zabbix/ /var/lib/zabbix/ /usr/sbin/zabbix-agent2-plugin/ && \
chgrp -R 0 /etc/zabbix/ /var/lib/zabbix/ /usr/sbin/zabbix-agent2-plugin/ && \
chmod -R g=u /etc/zabbix/ /var/lib/zabbix/ /usr/sbin/zabbix-agent2-plugin/ && \

View File

@ -197,6 +197,7 @@ prepare_zbx_agent_config() {
update_config_var $ZBX_AGENT_CONFIG "Timeout" "${ZBX_TIMEOUT}"
update_config_var $ZBX_AGENT_CONFIG "Include" "/etc/zabbix/zabbix_agent2.d/plugins.d/*.conf"
update_config_var $ZBX_AGENT_CONFIG "Include" "/etc/zabbix/zabbix_agentd.d/*.conf" "true"
update_config_var $ZBX_AGENT_CONFIG "UserParameterDir" "$ZABBIX_USER_HOME_DIR/user_scripts"
update_config_var $ZBX_AGENT_CONFIG "UnsafeUserParameters" "${ZBX_UNSAFEUSERPARAMETERS}"
update_config_var $ZBX_AGENT_CONFIG "TLSConnect" "${ZBX_TLSCONNECT}"
update_config_var $ZBX_AGENT_CONFIG "TLSAccept" "${ZBX_TLSACCEPT}"

View File

@ -71,6 +71,7 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
mkdir -p /var/lib/zabbix/enc_internal && \
mkdir -p /var/lib/zabbix/modules && \
mkdir -p /var/lib/zabbix/buffer && \
mkdir -p /var/lib/zabbix/user_scripts && \
chown --quiet -R zabbix:root /etc/zabbix/ /var/lib/zabbix/ /usr/sbin/zabbix-agent2-plugin/ && \
chgrp -R 0 /etc/zabbix/ /var/lib/zabbix/ /usr/sbin/zabbix-agent2-plugin/ && \
chmod -R g=u /etc/zabbix/ /var/lib/zabbix/ /usr/sbin/zabbix-agent2-plugin/ && \

View File

@ -197,6 +197,7 @@ prepare_zbx_agent_config() {
update_config_var $ZBX_AGENT_CONFIG "Timeout" "${ZBX_TIMEOUT}"
update_config_var $ZBX_AGENT_CONFIG "Include" "/etc/zabbix/zabbix_agent2.d/plugins.d/*.conf"
update_config_var $ZBX_AGENT_CONFIG "Include" "/etc/zabbix/zabbix_agentd.d/*.conf" "true"
update_config_var $ZBX_AGENT_CONFIG "UserParameterDir" "$ZABBIX_USER_HOME_DIR/user_scripts"
update_config_var $ZBX_AGENT_CONFIG "UnsafeUserParameters" "${ZBX_UNSAFEUSERPARAMETERS}"
update_config_var $ZBX_AGENT_CONFIG "TLSConnect" "${ZBX_TLSCONNECT}"
update_config_var $ZBX_AGENT_CONFIG "TLSAccept" "${ZBX_TLSACCEPT}"

View File

@ -109,6 +109,7 @@ RUN --mount=type=tmpfs,target=/var/lib/dnf/ \
mkdir -p /var/lib/zabbix/enc_internal && \
mkdir -p /var/lib/zabbix/modules && \
mkdir -p /var/lib/zabbix/buffer && \
mkdir -p /var/lib/zabbix/user_scripts && \
chown --quiet -R zabbix:root /etc/zabbix/ /var/lib/zabbix/ /usr/sbin/zabbix-agent2-plugin/ && \
chgrp -R 0 /etc/zabbix/ /var/lib/zabbix/ /usr/sbin/zabbix-agent2-plugin/ && \
chmod -R g=u /etc/zabbix/ /var/lib/zabbix/ /usr/sbin/zabbix-agent2-plugin/ && \

View File

@ -197,6 +197,7 @@ prepare_zbx_agent_config() {
update_config_var $ZBX_AGENT_CONFIG "Timeout" "${ZBX_TIMEOUT}"
update_config_var $ZBX_AGENT_CONFIG "Include" "/etc/zabbix/zabbix_agent2.d/plugins.d/*.conf"
update_config_var $ZBX_AGENT_CONFIG "Include" "/etc/zabbix/zabbix_agentd.d/*.conf" "true"
update_config_var $ZBX_AGENT_CONFIG "UserParameterDir" "$ZABBIX_USER_HOME_DIR/user_scripts"
update_config_var $ZBX_AGENT_CONFIG "UnsafeUserParameters" "${ZBX_UNSAFEUSERPARAMETERS}"
update_config_var $ZBX_AGENT_CONFIG "TLSConnect" "${ZBX_TLSCONNECT}"
update_config_var $ZBX_AGENT_CONFIG "TLSAccept" "${ZBX_TLSACCEPT}"

View File

@ -67,6 +67,7 @@ RUN --mount=type=cache,target=/var/lib/apt/,sharing=locked \
mkdir -p /var/lib/zabbix/enc_internal && \
mkdir -p /var/lib/zabbix/modules && \
mkdir -p /var/lib/zabbix/buffer && \
mkdir -p /var/lib/zabbix/user_scripts && \
chown --quiet -R zabbix:root /etc/zabbix/ /var/lib/zabbix/ /usr/sbin/zabbix-agent2-plugin/ && \
chgrp -R 0 /etc/zabbix/ /var/lib/zabbix/ /usr/sbin/zabbix-agent2-plugin/ && \
chmod -R g=u /etc/zabbix/ /var/lib/zabbix/ /usr/sbin/zabbix-agent2-plugin/ && \

View File

@ -197,6 +197,7 @@ prepare_zbx_agent_config() {
update_config_var $ZBX_AGENT_CONFIG "Timeout" "${ZBX_TIMEOUT}"
update_config_var $ZBX_AGENT_CONFIG "Include" "/etc/zabbix/zabbix_agent2.d/plugins.d/*.conf"
update_config_var $ZBX_AGENT_CONFIG "Include" "/etc/zabbix/zabbix_agentd.d/*.conf" "true"
update_config_var $ZBX_AGENT_CONFIG "UserParameterDir" "$ZABBIX_USER_HOME_DIR/user_scripts"
update_config_var $ZBX_AGENT_CONFIG "UnsafeUserParameters" "${ZBX_UNSAFEUSERPARAMETERS}"
update_config_var $ZBX_AGENT_CONFIG "TLSConnect" "${ZBX_TLSCONNECT}"
update_config_var $ZBX_AGENT_CONFIG "TLSAccept" "${ZBX_TLSACCEPT}"

View File

@ -399,6 +399,7 @@ services:
- ${DATA_DIRECTORY}/var/lib/zabbix/modules:/var/lib/zabbix/modules:ro
- ${DATA_DIRECTORY}/var/lib/zabbix/enc:/var/lib/zabbix/enc:ro
- ${DATA_DIRECTORY}/var/lib/zabbix/ssh_keys:/var/lib/zabbix/ssh_keys:ro
- ${DATA_DIRECTORY}/var/lib/zabbix/user_scripts:/var/lib/zabbix/user_scripts:ro
tmpfs: /tmp
deploy:
resources:
@ -448,6 +449,7 @@ services:
- ${DATA_DIRECTORY}/var/lib/zabbix/modules:/var/lib/zabbix/modules:ro
- ${DATA_DIRECTORY}/var/lib/zabbix/enc:/var/lib/zabbix/enc:ro
- ${DATA_DIRECTORY}/var/lib/zabbix/ssh_keys:/var/lib/zabbix/ssh_keys:ro
- ${DATA_DIRECTORY}/var/lib/zabbix/user_scripts:/var/lib/zabbix/user_scripts:ro
tmpfs: /tmp
deploy:
resources: