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