From e4bdc345826490c3369d95ac9b71612e3531e81e Mon Sep 17 00:00:00 2001 From: Will Berry <73126355+wdberry@users.noreply.github.com> Date: Mon, 19 Oct 2020 13:21:33 -0400 Subject: [PATCH 1/3] Add parameter and default for Option SocketDir Added the parameter socketdir to be able to override Option SocketDir in both zabbix_server.conf and zabbix_proxy.conf via an ENC (such as Foreman). It was added in zabbix_server.conf for completeness, however, in Zabbix 5.0 the proxy service creates a Unix socket for preprocessing called zabbix_proxy_preprocessing.sock. In the default location, /tmp, SELinux violations on creating the socket prevented the zabbix-proxy service from starting in my deployment on CentOS 7. My workaround was to override SocketDir, which was added to zabbix_proxy.conf in 5.0, to change the directory that this socket is created in from the default to /var/run/zabbix. Because it only exists when the service is running, /var/run seemed the appropriate place, and /var/run/zabbix already existed and had appropriate SELinux labels due to the agent and proxy PID files. To resolve this issue without explicitly setting the parameter, I set the default for socketdir within zabbix::proxy to be /var/run/zabbix if zabbix_version is >= 5.0. That seems a safe and sane enough default that works when both SELinux is enabled or disabled so that it's not necessary to do a boolean and comparison against both zabbix_version and facts('os.selinux.enabled'). --- manifests/init.pp | 1 + manifests/params.pp | 5 +++++ manifests/proxy.pp | 5 +++++ manifests/server.pp | 5 +++++ spec/classes/proxy_spec.rb | 11 +++++++++++ spec/classes/server_spec.rb | 11 +++++++++++ templates/zabbix_proxy.conf.erb | 11 +++++++++++ templates/zabbix_server.conf.erb | 12 ++++++++++++ 8 files changed, 61 insertions(+) diff --git a/manifests/init.pp b/manifests/init.pp index 23713497e..a81e22da4 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -176,6 +176,7 @@ $include_dir = $zabbix::params::server_include, $loadmodulepath = $zabbix::params::server_loadmodulepath, $loadmodule = $zabbix::params::server_loadmodule, + Stdlib::Absolutepath $socketdir = $zabbix::params::server_socketdir, Boolean $manage_selinux = $zabbix::params::manage_selinux, String $additional_service_params = $zabbix::params::additional_service_params, Optional[String[1]] $zabbix_user = $zabbix::params::server_zabbix_user, diff --git a/manifests/params.pp b/manifests/params.pp index a8a25ca88..6743eedfc 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -284,6 +284,7 @@ $server_vmwarecachesize = '8M' $server_vmwarefrequency = '60' $server_vmwaretimeout = undef + $server_socketdir = '/tmp' # Agent specific params $agent_allowroot = '0' @@ -425,6 +426,10 @@ $proxy_zabbix_server_host = undef $proxy_zabbix_server_port = '10051' $proxy_zbx_templates = ['Template App Zabbix Proxy'] + $proxy_socketdir = versioncmp($zabbix_version, '5.0') ? { + -1 => '/tmp', + default => '/var/run/zabbix', + } # Java Gateway specific params $javagateway_listenip = '0.0.0.0' diff --git a/manifests/proxy.pp b/manifests/proxy.pp index 2095ae783..0e1cd7ad9 100644 --- a/manifests/proxy.pp +++ b/manifests/proxy.pp @@ -264,6 +264,10 @@ # [*loadmodule*] # Module to load at server startup. # +# [*socketdir*] +# IPC socket directory. +# Directory to store IPC sockets used by internal Zabbix services. +# # === Example # # When you want to run everything on one machine, you can use the following @@ -423,6 +427,7 @@ $loadmodulepath = $zabbix::params::proxy_loadmodulepath, $loadmodule = $zabbix::params::proxy_loadmodule, Boolean $manage_selinux = $zabbix::params::manage_selinux, + Stdlib::Absolutepath $socketdir = $zabbix::params::proxy_socketdir, ) inherits zabbix::params { # check osfamily, Arch is currently not supported for web if $facts['os']['family'] == 'Archlinux' { diff --git a/manifests/server.pp b/manifests/server.pp index 271aec107..4cc696fac 100644 --- a/manifests/server.pp +++ b/manifests/server.pp @@ -261,6 +261,10 @@ # [*manage_startup_script*] # If the init script should be managed by this module. Attention: This might cause problems with some config options of this module (e.g server_configfile_path) # +# [*socketdir*] +# IPC socket directory. +# Directory to store IPC sockets used by internal Zabbix services. +# # === Example # # When running everything on a single node, please check @@ -383,6 +387,7 @@ String $additional_service_params = $zabbix::params::additional_service_params, Optional[String[1]] $zabbix_user = $zabbix::params::server_zabbix_user, Boolean $manage_startup_script = $zabbix::params::manage_startup_script, + Stdlib::Absolutepath $socketdir = $zabbix::params::server_socketdir, ) inherits zabbix::params { # the following codeblock is a bit blargh. The correct default value for # $real_additional_service_params changes based on the value of $zabbix_version diff --git a/spec/classes/proxy_spec.rb b/spec/classes/proxy_spec.rb index 2bdf4ecd1..ed8a85e7a 100644 --- a/spec/classes/proxy_spec.rb +++ b/spec/classes/proxy_spec.rb @@ -367,6 +367,17 @@ it { is_expected.to contain_file('/etc/zabbix/zabbix_proxy.conf').with_content %r{^EnableRemoteCommands=1$} } it { is_expected.to contain_file('/etc/zabbix/zabbix_proxy.conf').with_content %r{^LogRemoteCommands=1$} } end + + context 'with zabbix_proxy.conf and version 5.0' do + let :params do + { + socketdir: '/var/run/zabbix', + zabbix_version: '5.0' + } + end + + it { is_expected.to contain_file('/etc/zabbix/zabbix_proxy.conf').with_content %r{^SocketDir=/var/run/zabbix} } + end end end end diff --git a/spec/classes/server_spec.rb b/spec/classes/server_spec.rb index ff81fa04c..4f10a3b14 100644 --- a/spec/classes/server_spec.rb +++ b/spec/classes/server_spec.rb @@ -385,6 +385,17 @@ it { is_expected.to contain_file('/etc/zabbix/zabbix_server.conf').with_content %r{^HistoryIndexCacheSize=4M} } end + context 'with zabbix_server.conf and version 5.0' do + let :params do + { + socketdir: '/var/run/zabbix', + zabbix_version: '5.0' + } + end + + it { is_expected.to contain_file('/etc/zabbix/zabbix_server.conf').with_content %r{^SocketDir=/var/run/zabbix} } + end + context 'with zabbix_server.conf and system as logtype' do let :params do { diff --git a/templates/zabbix_proxy.conf.erb b/templates/zabbix_proxy.conf.erb index fc647726c..c2cb73557 100644 --- a/templates/zabbix_proxy.conf.erb +++ b/templates/zabbix_proxy.conf.erb @@ -95,6 +95,17 @@ DebugLevel=<%= @debuglevel %> # PidFile=<%= @pidfile %> +<% if @zabbix_version.to_f >= 5.0 %> +### Option: SocketDir +# IPC socket directory. +# Directory to store IPC sockets used by internal Zabbix services. +# +# Mandatory: no +# Default: + +SocketDir=<%= @socket_dir %> +<% end %> + ### Option: DBHost # Database host name. # If set to localhost, socket is used for MySQL. diff --git a/templates/zabbix_server.conf.erb b/templates/zabbix_server.conf.erb index 732c9acbe..fed2da32b 100644 --- a/templates/zabbix_server.conf.erb +++ b/templates/zabbix_server.conf.erb @@ -77,6 +77,17 @@ DebugLevel=<%= @debuglevel %> # PidFile=<%= @pidfile %> +<% if @zabbix_version.to_f >= 3.4 %> +### Option: SocketDir +# IPC socket directory. +# Directory to store IPC sockets used by internal Zabbix services. +# +# Mandatory: no +# Default: + +SocketDir=<%= @socket_dir %> +<% end %> + ### Option: DBHost # Database host name. # If set to localhost, socket is used for MySQL. @@ -516,3 +527,4 @@ LoadModulePath=<%= @loadmodulepath %> <% if @tlskeyfile %>TLSKeyFile=<%= @tlskeyfile %><% end %> <% end %> + From b003d5a8cc0fd8777811655e5125727018610be5 Mon Sep 17 00:00:00 2001 From: Will Berry <73126355+wdberry@users.noreply.github.com> Date: Mon, 26 Oct 2020 09:47:48 -0400 Subject: [PATCH 2/3] Correct variable names in templates Removes extra newline at end of zabbix_proxy.conf and zabbix_server.conf --- templates/zabbix_proxy.conf.erb | 3 +-- templates/zabbix_server.conf.erb | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/templates/zabbix_proxy.conf.erb b/templates/zabbix_proxy.conf.erb index c2cb73557..c6ed2d222 100644 --- a/templates/zabbix_proxy.conf.erb +++ b/templates/zabbix_proxy.conf.erb @@ -103,7 +103,7 @@ PidFile=<%= @pidfile %> # Mandatory: no # Default: -SocketDir=<%= @socket_dir %> +SocketDir=<%= @socketdir %> <% end %> ### Option: DBHost @@ -545,4 +545,3 @@ LoadModulePath=<%= @loadmodulepath %> <% if @tlspskfile %>TLSPSKFile=<%= @tlspskfile %><% end %> <% end %> - diff --git a/templates/zabbix_server.conf.erb b/templates/zabbix_server.conf.erb index fed2da32b..f159363e2 100644 --- a/templates/zabbix_server.conf.erb +++ b/templates/zabbix_server.conf.erb @@ -85,7 +85,7 @@ PidFile=<%= @pidfile %> # Mandatory: no # Default: -SocketDir=<%= @socket_dir %> +SocketDir=<%= @socketdir %> <% end %> ### Option: DBHost @@ -527,4 +527,3 @@ LoadModulePath=<%= @loadmodulepath %> <% if @tlskeyfile %>TLSKeyFile=<%= @tlskeyfile %><% end %> <% end %> - From 9a31243ea75f308724f68955cef37e75923b219e Mon Sep 17 00:00:00 2001 From: Will Berry <73126355+wdberry@users.noreply.github.com> Date: Mon, 26 Oct 2020 10:29:57 -0400 Subject: [PATCH 3/3] Change default value of socketdir to undef from explicit default. I realized, after the fact, that the better code pattern rather than explicitly configuring the default value to the implied default is to omit it from the configuration file by the default by using a default of undef and conditional statements. --- manifests/init.pp | 2 +- manifests/params.pp | 4 +- manifests/proxy.pp | 184 +++++++++++++++---------------- manifests/server.pp | 2 +- templates/zabbix_proxy.conf.erb | 2 +- templates/zabbix_server.conf.erb | 2 +- 6 files changed, 98 insertions(+), 98 deletions(-) diff --git a/manifests/init.pp b/manifests/init.pp index a81e22da4..f7b60a7b1 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -176,7 +176,7 @@ $include_dir = $zabbix::params::server_include, $loadmodulepath = $zabbix::params::server_loadmodulepath, $loadmodule = $zabbix::params::server_loadmodule, - Stdlib::Absolutepath $socketdir = $zabbix::params::server_socketdir, + Optional[Stdlib::Absolutepath] $socketdir = $zabbix::params::server_socketdir, Boolean $manage_selinux = $zabbix::params::manage_selinux, String $additional_service_params = $zabbix::params::additional_service_params, Optional[String[1]] $zabbix_user = $zabbix::params::server_zabbix_user, diff --git a/manifests/params.pp b/manifests/params.pp index 6743eedfc..4ff8d7090 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -284,7 +284,7 @@ $server_vmwarecachesize = '8M' $server_vmwarefrequency = '60' $server_vmwaretimeout = undef - $server_socketdir = '/tmp' + $server_socketdir = undef # Agent specific params $agent_allowroot = '0' @@ -427,7 +427,7 @@ $proxy_zabbix_server_port = '10051' $proxy_zbx_templates = ['Template App Zabbix Proxy'] $proxy_socketdir = versioncmp($zabbix_version, '5.0') ? { - -1 => '/tmp', + -1 => undef, default => '/var/run/zabbix', } diff --git a/manifests/proxy.pp b/manifests/proxy.pp index 0e1cd7ad9..e95985601 100644 --- a/manifests/proxy.pp +++ b/manifests/proxy.pp @@ -336,98 +336,98 @@ # Copyright 2014 Werner Dijkerman # class zabbix::proxy ( - Zabbix::Databases $database_type = $zabbix::params::database_type, - $database_path = $zabbix::params::database_path, - $zabbix_version = $zabbix::params::zabbix_version, - $zabbix_package_state = $zabbix::params::zabbix_package_state, - Boolean $manage_database = $zabbix::params::manage_database, - Boolean $manage_firewall = $zabbix::params::manage_firewall, - Boolean $manage_repo = $zabbix::params::manage_repo, - Boolean $manage_resources = $zabbix::params::manage_resources, - Boolean $manage_service = $zabbix::params::manage_service, - $zabbix_proxy = $zabbix::params::zabbix_proxy, - $zabbix_proxy_ip = $zabbix::params::zabbix_proxy_ip, - $use_ip = $zabbix::params::proxy_use_ip, - $zbx_templates = $zabbix::params::proxy_zbx_templates, - $proxy_configfile_path = $zabbix::params::proxy_configfile_path, - $proxy_service_name = $zabbix::params::proxy_service_name, - $mode = $zabbix::params::proxy_mode, - $zabbix_server_host = $zabbix::params::proxy_zabbix_server_host, - $zabbix_server_port = $zabbix::params::proxy_zabbix_server_port, - $hostname = $zabbix::params::proxy_hostname, - $listenport = $zabbix::params::proxy_listenport, - $sourceip = $zabbix::params::proxy_sourceip, - Integer[0] $enableremotecommands = $zabbix::params::proxy_enableremotecommands, - Integer[0] $logremotecommands = $zabbix::params::proxy_logremotecommands, - $logfile = $zabbix::params::proxy_logfile, - $logfilesize = $zabbix::params::proxy_logfilesize, - $debuglevel = $zabbix::params::proxy_debuglevel, - $pidfile = $zabbix::params::proxy_pidfile, - $database_schema_path = $zabbix::params::database_schema_path, - $database_host = $zabbix::params::proxy_database_host, - $database_name = $zabbix::params::proxy_database_name, - $database_schema = $zabbix::params::proxy_database_schema, - $database_user = $zabbix::params::proxy_database_user, - $database_password = $zabbix::params::proxy_database_password, - $database_socket = $zabbix::params::proxy_database_socket, - $database_port = $zabbix::params::proxy_database_port, - $localbuffer = $zabbix::params::proxy_localbuffer, - $offlinebuffer = $zabbix::params::proxy_offlinebuffer, - $heartbeatfrequency = $zabbix::params::proxy_heartbeatfrequency, - $configfrequency = $zabbix::params::proxy_configfrequency, - $datasenderfrequency = $zabbix::params::proxy_datasenderfrequency, - $startpollers = $zabbix::params::proxy_startpollers, - $startipmipollers = $zabbix::params::proxy_startipmipollers, - $startpollersunreachable = $zabbix::params::proxy_startpollersunreachable, - $starttrappers = $zabbix::params::proxy_starttrappers, - $startpingers = $zabbix::params::proxy_startpingers, - $startdiscoverers = $zabbix::params::proxy_startdiscoverers, - $starthttppollers = $zabbix::params::proxy_starthttppollers, - $javagateway = $zabbix::params::proxy_javagateway, - $javagatewayport = $zabbix::params::proxy_javagatewayport, - $startjavapollers = $zabbix::params::proxy_startjavapollers, - $startvmwarecollectors = $zabbix::params::proxy_startvmwarecollectors, - $vmwarefrequency = $zabbix::params::proxy_vmwarefrequency, - $vmwareperffrequency = $zabbix::params::proxy_vmwareperffrequency, - $vmwarecachesize = $zabbix::params::proxy_vmwarecachesize, - $vmwaretimeout = $zabbix::params::proxy_vmwaretimeout, - $enablesnmpbulkrequests = $zabbix::params::proxy_enablesnmpbulkrequests, - $snmptrapperfile = $zabbix::params::proxy_snmptrapperfile, - $snmptrapper = $zabbix::params::proxy_snmptrapper, - $listenip = $zabbix::params::proxy_listenip, - $housekeepingfrequency = $zabbix::params::proxy_housekeepingfrequency, - $cachesize = $zabbix::params::proxy_cachesize, - $startdbsyncers = $zabbix::params::proxy_startdbsyncers, - $historycachesize = $zabbix::params::proxy_historycachesize, - $historyindexcachesize = $zabbix::params::proxy_historyindexcachesize, - $historytextcachesize = $zabbix::params::proxy_historytextcachesize, - $timeout = $zabbix::params::proxy_timeout, - $tlsaccept = $zabbix::params::proxy_tlsaccept, - $tlscafile = $zabbix::params::proxy_tlscafile, - $tlscertfile = $zabbix::params::proxy_tlscertfile, - $tlsconnect = $zabbix::params::proxy_tlsconnect, - $tlscrlfile = $zabbix::params::proxy_tlscrlfile, - $tlskeyfile = $zabbix::params::proxy_tlskeyfile, - $tlspskfile = $zabbix::params::proxy_tlspskfile, - $tlspskidentity = $zabbix::params::proxy_tlspskidentity, - $tlsservercertissuer = $zabbix::params::proxy_tlsservercertissuer, - $tlsservercertsubject = $zabbix::params::proxy_tlsservercertsubject, - $trappertimeout = $zabbix::params::proxy_trappertimeout, - $unreachableperiod = $zabbix::params::proxy_unreachableperiod, - $unavaliabledelay = $zabbix::params::proxy_unavaliabledelay, - $unreachabedelay = $zabbix::params::proxy_unreachabedelay, - $externalscripts = $zabbix::params::proxy_externalscripts, - $fpinglocation = $zabbix::params::proxy_fpinglocation, - $fping6location = $zabbix::params::proxy_fping6location, - $sshkeylocation = $zabbix::params::proxy_sshkeylocation, - $logslowqueries = $zabbix::params::proxy_logslowqueries, - $tmpdir = $zabbix::params::proxy_tmpdir, - $allowroot = $zabbix::params::proxy_allowroot, - $include_dir = $zabbix::params::proxy_include, - $loadmodulepath = $zabbix::params::proxy_loadmodulepath, - $loadmodule = $zabbix::params::proxy_loadmodule, - Boolean $manage_selinux = $zabbix::params::manage_selinux, - Stdlib::Absolutepath $socketdir = $zabbix::params::proxy_socketdir, + Zabbix::Databases $database_type = $zabbix::params::database_type, + $database_path = $zabbix::params::database_path, + $zabbix_version = $zabbix::params::zabbix_version, + $zabbix_package_state = $zabbix::params::zabbix_package_state, + Boolean $manage_database = $zabbix::params::manage_database, + Boolean $manage_firewall = $zabbix::params::manage_firewall, + Boolean $manage_repo = $zabbix::params::manage_repo, + Boolean $manage_resources = $zabbix::params::manage_resources, + Boolean $manage_service = $zabbix::params::manage_service, + $zabbix_proxy = $zabbix::params::zabbix_proxy, + $zabbix_proxy_ip = $zabbix::params::zabbix_proxy_ip, + $use_ip = $zabbix::params::proxy_use_ip, + $zbx_templates = $zabbix::params::proxy_zbx_templates, + $proxy_configfile_path = $zabbix::params::proxy_configfile_path, + $proxy_service_name = $zabbix::params::proxy_service_name, + $mode = $zabbix::params::proxy_mode, + $zabbix_server_host = $zabbix::params::proxy_zabbix_server_host, + $zabbix_server_port = $zabbix::params::proxy_zabbix_server_port, + $hostname = $zabbix::params::proxy_hostname, + $listenport = $zabbix::params::proxy_listenport, + $sourceip = $zabbix::params::proxy_sourceip, + Integer[0] $enableremotecommands = $zabbix::params::proxy_enableremotecommands, + Integer[0] $logremotecommands = $zabbix::params::proxy_logremotecommands, + $logfile = $zabbix::params::proxy_logfile, + $logfilesize = $zabbix::params::proxy_logfilesize, + $debuglevel = $zabbix::params::proxy_debuglevel, + $pidfile = $zabbix::params::proxy_pidfile, + $database_schema_path = $zabbix::params::database_schema_path, + $database_host = $zabbix::params::proxy_database_host, + $database_name = $zabbix::params::proxy_database_name, + $database_schema = $zabbix::params::proxy_database_schema, + $database_user = $zabbix::params::proxy_database_user, + $database_password = $zabbix::params::proxy_database_password, + $database_socket = $zabbix::params::proxy_database_socket, + $database_port = $zabbix::params::proxy_database_port, + $localbuffer = $zabbix::params::proxy_localbuffer, + $offlinebuffer = $zabbix::params::proxy_offlinebuffer, + $heartbeatfrequency = $zabbix::params::proxy_heartbeatfrequency, + $configfrequency = $zabbix::params::proxy_configfrequency, + $datasenderfrequency = $zabbix::params::proxy_datasenderfrequency, + $startpollers = $zabbix::params::proxy_startpollers, + $startipmipollers = $zabbix::params::proxy_startipmipollers, + $startpollersunreachable = $zabbix::params::proxy_startpollersunreachable, + $starttrappers = $zabbix::params::proxy_starttrappers, + $startpingers = $zabbix::params::proxy_startpingers, + $startdiscoverers = $zabbix::params::proxy_startdiscoverers, + $starthttppollers = $zabbix::params::proxy_starthttppollers, + $javagateway = $zabbix::params::proxy_javagateway, + $javagatewayport = $zabbix::params::proxy_javagatewayport, + $startjavapollers = $zabbix::params::proxy_startjavapollers, + $startvmwarecollectors = $zabbix::params::proxy_startvmwarecollectors, + $vmwarefrequency = $zabbix::params::proxy_vmwarefrequency, + $vmwareperffrequency = $zabbix::params::proxy_vmwareperffrequency, + $vmwarecachesize = $zabbix::params::proxy_vmwarecachesize, + $vmwaretimeout = $zabbix::params::proxy_vmwaretimeout, + $enablesnmpbulkrequests = $zabbix::params::proxy_enablesnmpbulkrequests, + $snmptrapperfile = $zabbix::params::proxy_snmptrapperfile, + $snmptrapper = $zabbix::params::proxy_snmptrapper, + $listenip = $zabbix::params::proxy_listenip, + $housekeepingfrequency = $zabbix::params::proxy_housekeepingfrequency, + $cachesize = $zabbix::params::proxy_cachesize, + $startdbsyncers = $zabbix::params::proxy_startdbsyncers, + $historycachesize = $zabbix::params::proxy_historycachesize, + $historyindexcachesize = $zabbix::params::proxy_historyindexcachesize, + $historytextcachesize = $zabbix::params::proxy_historytextcachesize, + $timeout = $zabbix::params::proxy_timeout, + $tlsaccept = $zabbix::params::proxy_tlsaccept, + $tlscafile = $zabbix::params::proxy_tlscafile, + $tlscertfile = $zabbix::params::proxy_tlscertfile, + $tlsconnect = $zabbix::params::proxy_tlsconnect, + $tlscrlfile = $zabbix::params::proxy_tlscrlfile, + $tlskeyfile = $zabbix::params::proxy_tlskeyfile, + $tlspskfile = $zabbix::params::proxy_tlspskfile, + $tlspskidentity = $zabbix::params::proxy_tlspskidentity, + $tlsservercertissuer = $zabbix::params::proxy_tlsservercertissuer, + $tlsservercertsubject = $zabbix::params::proxy_tlsservercertsubject, + $trappertimeout = $zabbix::params::proxy_trappertimeout, + $unreachableperiod = $zabbix::params::proxy_unreachableperiod, + $unavaliabledelay = $zabbix::params::proxy_unavaliabledelay, + $unreachabedelay = $zabbix::params::proxy_unreachabedelay, + $externalscripts = $zabbix::params::proxy_externalscripts, + $fpinglocation = $zabbix::params::proxy_fpinglocation, + $fping6location = $zabbix::params::proxy_fping6location, + $sshkeylocation = $zabbix::params::proxy_sshkeylocation, + $logslowqueries = $zabbix::params::proxy_logslowqueries, + $tmpdir = $zabbix::params::proxy_tmpdir, + $allowroot = $zabbix::params::proxy_allowroot, + $include_dir = $zabbix::params::proxy_include, + $loadmodulepath = $zabbix::params::proxy_loadmodulepath, + $loadmodule = $zabbix::params::proxy_loadmodule, + Boolean $manage_selinux = $zabbix::params::manage_selinux, + Optional[Stdlib::Absolutepath] $socketdir = $zabbix::params::proxy_socketdir, ) inherits zabbix::params { # check osfamily, Arch is currently not supported for web if $facts['os']['family'] == 'Archlinux' { diff --git a/manifests/server.pp b/manifests/server.pp index 4cc696fac..2cb81d1c7 100644 --- a/manifests/server.pp +++ b/manifests/server.pp @@ -387,7 +387,7 @@ String $additional_service_params = $zabbix::params::additional_service_params, Optional[String[1]] $zabbix_user = $zabbix::params::server_zabbix_user, Boolean $manage_startup_script = $zabbix::params::manage_startup_script, - Stdlib::Absolutepath $socketdir = $zabbix::params::server_socketdir, + Optional[Stdlib::Absolutepath] $socketdir = $zabbix::params::server_socketdir, ) inherits zabbix::params { # the following codeblock is a bit blargh. The correct default value for # $real_additional_service_params changes based on the value of $zabbix_version diff --git a/templates/zabbix_proxy.conf.erb b/templates/zabbix_proxy.conf.erb index c6ed2d222..78cf17066 100644 --- a/templates/zabbix_proxy.conf.erb +++ b/templates/zabbix_proxy.conf.erb @@ -103,7 +103,7 @@ PidFile=<%= @pidfile %> # Mandatory: no # Default: -SocketDir=<%= @socketdir %> +<% if @socketdir %>SocketDir=<%= @socketdir %><% end %> <% end %> ### Option: DBHost diff --git a/templates/zabbix_server.conf.erb b/templates/zabbix_server.conf.erb index f159363e2..e577cc0b5 100644 --- a/templates/zabbix_server.conf.erb +++ b/templates/zabbix_server.conf.erb @@ -85,7 +85,7 @@ PidFile=<%= @pidfile %> # Mandatory: no # Default: -SocketDir=<%= @socketdir %> +<% if @socketdir %>SocketDir=<%= @socketdir %><% end %> <% end %> ### Option: DBHost