From 328e5b352b9b7c81b7765ad9d382776af1b12ac7 Mon Sep 17 00:00:00 2001 From: Ph0B1uS Date: Wed, 5 Mar 2025 15:30:25 +0100 Subject: [PATCH 1/2] Add zabbix-server smsdevices configuration --- REFERENCE.md | 18 ++++++++++++++++++ manifests/init.pp | 2 ++ manifests/params.pp | 1 + manifests/server.pp | 2 ++ spec/classes/server_spec.rb | 14 ++++++++++++++ templates/zabbix_server.conf.erb | 3 ++- 6 files changed, 39 insertions(+), 1 deletion(-) diff --git a/REFERENCE.md b/REFERENCE.md index 8c0c150c2..8a567e425 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -158,6 +158,7 @@ The following parameters are available in the `zabbix` class: * [`starttimers`](#-zabbix--starttimers) * [`javagateway`](#-zabbix--javagateway) * [`javagatewayport`](#-zabbix--javagatewayport) +* [`smsdevices`](#-zabbix--smsdevices) * [`startjavapollers`](#-zabbix--startjavapollers) * [`startlldprocessors`](#-zabbix--startlldprocessors) * [`startvmwarecollectors`](#-zabbix--startvmwarecollectors) @@ -830,6 +831,14 @@ Port that zabbix java gateway listens on. Default value: `$zabbix::params::server_javagatewayport` +##### `smsdevices` + +Data type: `Optional[Variant[String[1],Array[String[1]]]]` + +Devices to use for sms texting + +Default value: `$zabbix::params::server_smsdevices` + ##### `startjavapollers` Data type: `Any` @@ -4026,6 +4035,7 @@ The following parameters are available in the `zabbix::server` class: * [`maxhousekeeperdelete`](#-zabbix--server--maxhousekeeperdelete) * [`cachesize`](#-zabbix--server--cachesize) * [`cacheupdatefrequency`](#-zabbix--server--cacheupdatefrequency) +* [`smsdevices`](#-zabbix--server--smsdevices) * [`startdbsyncers`](#-zabbix--server--startdbsyncers) * [`historycachesize`](#-zabbix--server--historycachesize) * [`historyindexcachesize`](#-zabbix--server--historyindexcachesize) @@ -4622,6 +4632,14 @@ How often zabbix will perform update of configuration cache, in seconds. Default value: `$zabbix::params::server_cacheupdatefrequency` +##### `smsdevices` + +Data type: `Optional[Variant[String[1],Array[String[1]]]]` + +Devices to use for sms texting + +Default value: `$zabbix::params::server_smsdevices` + ##### `startdbsyncers` Data type: `Any` diff --git a/manifests/init.pp b/manifests/init.pp index 830218ccd..5f7737b48 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -116,6 +116,7 @@ # @param starttimers Number of pre-forked instances of timers. # @param javagateway IP address (or hostname) of zabbix java gateway. # @param javagatewayport Port that zabbix java gateway listens on. +# @param smsdevices Devices to use for sms texting # @param startjavapollers Number of pre-forked instances of java pollers. # @param startlldprocessors Number of pre-forked instances of low-level discovery (LLD) workers. # @param startvmwarecollectors Number of pre-forked vmware collector instances. @@ -304,6 +305,7 @@ $cachesize = $zabbix::params::server_cachesize, $cacheupdatefrequency = $zabbix::params::server_cacheupdatefrequency, $startdbsyncers = $zabbix::params::server_startdbsyncers, + Optional[Variant[String[1],Array[String[1]]]] $smsdevices = $zabbix::params::server_smsdevices, $historycachesize = $zabbix::params::server_historycachesize, Zabbix::Historyics $historyindexcachesize = $zabbix::params::server_historyindexcachesize, $trendcachesize = $zabbix::params::server_trendcachesize, diff --git a/manifests/params.pp b/manifests/params.pp index 5acd9e6b2..561f1a7c2 100755 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -240,6 +240,7 @@ $server_pacemaker_resource = undef $server_snmptrapperfile = '/tmp/zabbix_traps.tmp' $server_sourceip = undef + $server_smsdevices = undef $server_sshkeylocation = undef $server_sslcertlocation = '/usr/lib/zabbix/ssl/certs' $server_sslkeylocation = '/usr/lib/zabbix/ssl/keys' diff --git a/manifests/server.pp b/manifests/server.pp index 1aea87800..aee457d84 100755 --- a/manifests/server.pp +++ b/manifests/server.pp @@ -87,6 +87,7 @@ # if set to 0 then no limit is used at all. in this case you must know what you are doing! # @param cachesize Size of configuration cache, in bytes. # @param cacheupdatefrequency How often zabbix will perform update of configuration cache, in seconds. +# @param smsdevices Devices to use for sms texting # @param startdbsyncers Number of pre-forked instances of db syncers. # @param historycachesize Size of history cache, in bytes. # @param historyindexcachesize Size of history index cache, in bytes. @@ -204,6 +205,7 @@ Optional[Stdlib::Absolutepath] $database_tlskeyfile = $zabbix::params::server_database_tlskeyfile, Optional[String[1]] $database_tlscipher = $zabbix::params::server_database_tlscipher, Optional[String[1]] $database_tlscipher13 = $zabbix::params::server_database_tlscipher13, + Optional[Variant[String[1],Array[String[1]]]] $smsdevices = $zabbix::params::server_smsdevices, $startpollers = $zabbix::params::server_startpollers, $startipmipollers = $zabbix::params::server_startipmipollers, Integer[0, 1000] $startodbcpollers = $zabbix::params::server_startodbcpollers, diff --git a/spec/classes/server_spec.rb b/spec/classes/server_spec.rb index 05ba1ccc2..ebcf516e6 100644 --- a/spec/classes/server_spec.rb +++ b/spec/classes/server_spec.rb @@ -367,6 +367,20 @@ it { is_expected.to contain_file('/etc/zabbix/zabbix_server.conf').without_content %r{^StartODBCPollers=1} } end + context 'with zabbix_server.conf and version 7.0' do + next if facts[:os]['name'] == 'Debian' && facts[:os]['release']['major'].to_i <= 11 + next if facts[:os]['name'] == 'Ubuntu' && facts[:os]['release']['major'].to_i <= 20 + + let :params do + { + smsdevices: 'modem0', + zabbix_version: '7.0' + } + end + + it { is_expected.to contain_file('/etc/zabbix/zabbix_server.conf').with_content %r{^SMSDevices=modem0} } + end + context 'with zabbix_server.conf and logtype declared' do describe 'as system' do let :params do diff --git a/templates/zabbix_server.conf.erb b/templates/zabbix_server.conf.erb index 9aaba7fd3..259a9650a 100755 --- a/templates/zabbix_server.conf.erb +++ b/templates/zabbix_server.conf.erb @@ -962,6 +962,7 @@ LoadModulePath=<%= @loadmodulepath %> # Mandatory: no # Default: # SMSDevices= +<% if @smsdevices %>SMSDevices=<%= @smsdevices.is_a?(Array) ? @smsdevices.join(',') : @smsdevices -%><% end %> <% end %> <% if @zabbix_version.to_f >= 5.4 %> @@ -1017,4 +1018,4 @@ LoadModulePath=<%= @loadmodulepath %> # Default: # StartBrowserPollers=1 -<% end %> \ No newline at end of file +<% end %> From 34dea4a0248e4bb823914ac9978ee2210cbda5a0 Mon Sep 17 00:00:00 2001 From: trenta <> Date: Wed, 5 Mar 2025 16:34:01 +0100 Subject: [PATCH 2/2] Add zabbix-server/proxy Pollers settings --- REFERENCE.md | 148 ++++++++++++++++++++-- manifests/init.pp | 205 +++++++++++++++++-------------- manifests/params.pp | 21 +++- manifests/proxy.pp | 14 ++- manifests/server.pp | 19 ++- templates/zabbix_proxy.conf.erb | 12 +- templates/zabbix_server.conf.erb | 14 +-- 7 files changed, 302 insertions(+), 131 deletions(-) diff --git a/REFERENCE.md b/REFERENCE.md index 8a567e425..05e2f2cdb 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -145,10 +145,15 @@ The following parameters are available in the `zabbix` class: * [`database_tlsconnect`](#-zabbix--database_tlsconnect) * [`database_tlscafile`](#-zabbix--database_tlscafile) * [`startpollers`](#-zabbix--startpollers) +* [`startagentpollers`](#-zabbix--startagentpollers) +* [`starthttpagentpollers`](#-zabbix--starthttpagentpollers) +* [`startsnmppollers`](#-zabbix--startsnmppollers) +* [`maxconcurrentchecksperpoller`](#-zabbix--maxconcurrentchecksperpoller) * [`startpreprocessors`](#-zabbix--startpreprocessors) * [`startipmipollers`](#-zabbix--startipmipollers) * [`startodbcpollers`](#-zabbix--startodbcpollers) * [`startpollersunreachable`](#-zabbix--startpollersunreachable) +* [`starthistorypollers`](#-zabbix--starthistorypollers) * [`starttrappers`](#-zabbix--starttrappers) * [`startpingers`](#-zabbix--startpingers) * [`startalerters`](#-zabbix--startalerters) @@ -721,12 +726,44 @@ Default value: `$zabbix::params::server_database_tlscafile` ##### `startpollers` -Data type: `Any` +Data type: `Integer[0, 1000]` Number of pre-forked instances of pollers. Default value: `$zabbix::params::server_startpollers` +##### `startagentpollers` + +Data type: `Integer[0, 1000]` + +Number of pre-forked instances of asynchronous Zabbix agent pollers. Also see MaxConcurrentChecksPerPoller. + +Default value: `$zabbix::params::server_startagentpollers` + +##### `starthttpagentpollers` + +Data type: `Integer[0, 1000]` + +Number of pre-forked instances of asynchronous HTTP agent pollers. Also see MaxConcurrentChecksPerPoller. + +Default value: `$zabbix::params::server_starthttpagentpollers` + +##### `startsnmppollers` + +Data type: `Integer[0, 1000]` + +Number of pre-forked instances of asynchronous SNMP pollers. Also see MaxConcurrentChecksPerPoller. + +Default value: `$zabbix::params::server_startsnmppollers` + +##### `maxconcurrentchecksperpoller` + +Data type: `Integer[0, 1000]` + +Maximum number of asynchronous checks that can be executed at once by each HTTP agent poller or agent poller. + +Default value: `$zabbix::params::server_maxconcurrentchecksperpoller` + ##### `startpreprocessors` Data type: `Integer[1, 1000]` @@ -737,7 +774,7 @@ Default value: `$zabbix::params::server_startpreprocessors` ##### `startipmipollers` -Data type: `Any` +Data type: `Integer[0, 1000]` Number of pre-forked instances of ipmi pollers. @@ -753,12 +790,22 @@ Default value: `$zabbix::params::server_startodbcpollers` ##### `startpollersunreachable` -Data type: `Any` +Data type: `Integer[0, 1000]` Number of pre-forked instances of pollers for unreachable hosts (including ipmi). Default value: `$zabbix::params::server_startpollersunreachable` +##### `starthistorypollers` + +Data type: `Integer[0, 1000]` + +Number of pre-forked instances of history pollers. +Only required for calculated checks. +A database connection is required for each history poller instance. + +Default value: `$zabbix::params::server_starthistorypollers` + ##### `starttrappers` Data type: `Any` @@ -2570,6 +2617,10 @@ The following parameters are available in the `zabbix::proxy` class: * [`proxyconfigfrequency`](#-zabbix--proxy--proxyconfigfrequency) * [`datasenderfrequency`](#-zabbix--proxy--datasenderfrequency) * [`startpollers`](#-zabbix--proxy--startpollers) +* [`startagentpollers`](#-zabbix--proxy--startagentpollers) +* [`starthttpagentpollers`](#-zabbix--proxy--starthttpagentpollers) +* [`startsnmppollers`](#-zabbix--proxy--startsnmppollers) +* [`maxconcurrentchecksperpoller`](#-zabbix--proxy--maxconcurrentchecksperpoller) * [`startpreprocessors`](#-zabbix--proxy--startpreprocessors) * [`startipmipollers`](#-zabbix--proxy--startipmipollers) * [`startodbcpollers`](#-zabbix--proxy--startodbcpollers) @@ -3046,12 +3097,44 @@ Default value: `$zabbix::params::proxy_datasenderfrequency` ##### `startpollers` -Data type: `Any` +Data type: `Integer[0, 1000]` Number of pre-forked instances of pollers. Default value: `$zabbix::params::proxy_startpollers` +##### `startagentpollers` + +Data type: `Integer[0, 1000]` + +Number of pre-forked instances of asynchronous Zabbix agent pollers. Also see MaxConcurrentChecksPerPoller. + +Default value: `$zabbis::params::proxy_startagentpollers` + +##### `starthttpagentpollers` + +Data type: `Integer[0, 1000]` + +Number of pre-forked instances of asynchronous HTTP agent pollers. Also see MaxConcurrentChecksPerPoller. + +Default value: `$zabbix::params::proxy_starthttpagentpollers` + +##### `startsnmppollers` + +Data type: `Integer[0, 1000]` + +Number of pre-forked instances of asynchronous SNMP pollers. Also see MaxConcurrentChecksPerPoller. + +Default value: `$zabbix::params::proxy_startsnmppollers` + +##### `maxconcurrentchecksperpoller` + +Data type: `Integer[0, 1000]` + +Maximum number of asynchronous checks that can be executed at once by each HTTP agent poller or agent poller. + +Default value: `$zabbix::params::proxy_maxconcurrentchecksperpoller` + ##### `startpreprocessors` Data type: `Integer[1, 1000]` @@ -3062,7 +3145,7 @@ Default value: `$zabbix::params::proxy_startpreprocessors` ##### `startipmipollers` -Data type: `Any` +Data type: `Integer[0, 1000]` Number of pre-forked instances of ipmi pollers. @@ -3078,7 +3161,7 @@ Default value: `$zabbix::params::proxy_startodbcpollers` ##### `startpollersunreachable` -Data type: `Any` +Data type: `Integer[0, 1000]` Number of pre-forked instances of pollers for unreachable hosts (including ipmi). @@ -4004,10 +4087,15 @@ The following parameters are available in the `zabbix::server` class: * [`database_tlscipher`](#-zabbix--server--database_tlscipher) * [`database_tlscipher13`](#-zabbix--server--database_tlscipher13) * [`startpollers`](#-zabbix--server--startpollers) +* [`startagentpollers`](#-zabbix--server--startagentpollers) +* [`starthttpagentpollers`](#-zabbix--server--starthttpagentpollers) +* [`startsnmppollers`](#-zabbix--server--startsnmppollers) +* [`maxconcurrentchecksperpoller`](#-zabbix--server--maxconcurrentchecksperpoller) * [`startpreprocessors`](#-zabbix--server--startpreprocessors) * [`startipmipollers`](#-zabbix--server--startipmipollers) * [`startodbcpollers`](#-zabbix--server--startodbcpollers) * [`startpollersunreachable`](#-zabbix--server--startpollersunreachable) +* [`starthistorypollers`](#-zabbix--server--starthistorypollers) * [`starttrappers`](#-zabbix--server--starttrappers) * [`startpingers`](#-zabbix--server--startpingers) * [`startalerters`](#-zabbix--server--startalerters) @@ -4372,12 +4460,44 @@ Default value: `$zabbix::params::server_database_tlscipher13` ##### `startpollers` -Data type: `Any` +Data type: `Integer[0, 1000]` Number of pre-forked instances of pollers. Default value: `$zabbix::params::server_startpollers` +##### `startagentpollers` + +Data type: `Integer[0, 1000]` + +Number of pre-forked instances of asynchronous Zabbix agent pollers. Also see MaxConcurrentChecksPerPoller. + +Default value: `$zabbis::params::server_startagentpollers` + +##### `starthttpagentpollers` + +Data type: `Integer[0, 1000]` + +Number of pre-forked instances of asynchronous HTTP agent pollers. Also see MaxConcurrentChecksPerPoller. + +Default value: `$zabbix::params::server_starthttpagentpollers` + +##### `startsnmppollers` + +Data type: `Integer[0, 1000]` + +Number of pre-forked instances of asynchronous SNMP pollers. Also see MaxConcurrentChecksPerPoller. + +Default value: `$zabbix::params::server_startsnmppollers` + +##### `maxconcurrentchecksperpoller` + +Data type: `Integer[0, 1000]` + +Maximum number of asynchronous checks that can be executed at once by each HTTP agent poller or agent poller. + +Default value: `$zabbix::params::server_maxconcurrentchecksperpoller` + ##### `startpreprocessors` Data type: `Integer[1, 1000]` @@ -4388,7 +4508,7 @@ Default value: `$zabbix::params::server_startpreprocessors` ##### `startipmipollers` -Data type: `Any` +Data type: `Integer[0, 1000]` Number of pre-forked instances of ipmi pollers. @@ -4404,12 +4524,22 @@ Default value: `$zabbix::params::server_startodbcpollers` ##### `startpollersunreachable` -Data type: `Any` +Data type: `Integer[0, 1000]` Number of pre-forked instances of pollers for unreachable hosts (including ipmi). Default value: `$zabbix::params::server_startpollersunreachable` +##### `starthistorypollers` + +Data type: `Integer[0, 1000]` + +Number of pre-forked instances of history pollers. +Only required for calculated checks. +A database connection is required for each history poller instance. + +Default value: `$zabbix::params::server_starthistorypollers` + ##### `starttrappers` Data type: `Any` diff --git a/manifests/init.pp b/manifests/init.pp index 5f7737b48..c7eddf8c0 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -103,10 +103,18 @@ # * verify_full - connect using TLS, verify certificate and verify that database identity specified by DBHost matches its certificate # @param database_tlscafile Full pathname of a file containing the top-level CA(s) certificates for database certificate verification. # @param startpollers Number of pre-forked instances of pollers. +# @param startagentpollers Number of pre-forked instances of asynchronous Zabbix agent pollers. Also see MaxConcurrentChecksPerPoller. +# @param starthttpagentpollers Number of pre-forked instances of asynchronous HTTP agent pollers. Also see MaxConcurrentChecksPerPoller. +# @param startsnmppollers Number of pre-forked instances of asynchronous SNMP pollers. Also see MaxConcurrentChecksPerPoller. +# @param maxconcurrentchecksperpoller Maximum number of asynchronous checks that can be executed at once by each HTTP agent poller or agent poller. # @param startpreprocessors Number of pre-forked instances of preprocessing workers # @param startipmipollers Number of pre-forked instances of ipmi pollers. # @param startodbcpollers Number of pre-forked instances of ODBC pollers. # @param startpollersunreachable Number of pre-forked instances of pollers for unreachable hosts (including ipmi). +# @param starthistorypollers +# Number of pre-forked instances of history pollers. +# Only required for calculated checks. +# A database connection is required for each history poller instance. # @param starttrappers Number of pre-forked instances of trappers. # @param startpingers Number of pre-forked instances of icmp pingers. # @param startalerters Number of pre-forked instances of alerters. @@ -274,10 +282,15 @@ $database_tablespace = $zabbix::params::server_database_tablespace, Optional[Enum['required', 'verify_ca', 'verify_full']] $database_tlsconnect = $zabbix::params::server_database_tlsconnect, Optional[Stdlib::Absolutepath] $database_tlscafile = $zabbix::params::server_database_tlscafile, - $startpollers = $zabbix::params::server_startpollers, - $startipmipollers = $zabbix::params::server_startipmipollers, + Integer[0, 1000] $startpollers = $zabbix::params::server_startpollers, + Integer[0, 1000] $startagentpollers = $zabbix::params::server_startagentpollers, + Integer[0, 1000] $starthttpagentpollers = $zabbix::params::server_starthttpagentpollers, + Integer[0, 1000] $startsnmppollers = $zabbix::params::server_startsnmppollers, + Integer[0, 1000] $maxconcurrentchecksperpoller = $zabbix::params::server_maxconcurrentchecksperpoller, + Integer[0, 1000] $startipmipollers = $zabbix::params::server_startipmipollers, Integer[0, 1000] $startodbcpollers = $zabbix::params::server_startodbcpollers, - $startpollersunreachable = $zabbix::params::server_startpollersunreachable, + Integer[0, 1000] $startpollersunreachable = $zabbix::params::server_startpollersunreachable, + Integer[0, 1000] $starthistorypollers = $zabbix::params::server_starthistorypollers, Integer[1, 1000] $startpreprocessors = $zabbix::params::server_startpreprocessors, $starttrappers = $zabbix::params::server_starttrappers, $startpingers = $zabbix::params::server_startpingers, @@ -401,96 +414,102 @@ } class { 'zabbix::server': - database_type => $database_type, - database_path => $database_path, - zabbix_version => $zabbix_version, - zabbix_package_state => $zabbix_package_state, - manage_firewall => $manage_firewall, - manage_repo => $manage_repo, - manage_database => $manage_database, - manage_service => $manage_service, - listenport => $listenport, - sourceip => $sourceip, - logfile => $logfile, - logfilesize => $logfilesize, - logtype => $logtype, - debuglevel => $debuglevel, - pidfile => $pidfile, - database_host => $database_host, - database_name => $database_name, - database_schema => $database_schema, - database_user => $database_user, - database_password => $database_password, - database_socket => $database_socket, - database_port => $database_port, - database_tlsconnect => $database_tlsconnect, - database_tlscafile => $database_tlscafile, - startpollers => $startpollers, - startipmipollers => $startipmipollers, - startpollersunreachable => $startpollersunreachable, - startpreprocessors => $startpreprocessors, - starttrappers => $starttrappers, - startpingers => $startpingers, - startalerters => $startalerters, - startdiscoverers => $startdiscoverers, - startescalators => $startescalators, - starthttppollers => $starthttppollers, - starttimers => $starttimers, - javagateway => $javagateway, - javagatewayport => $javagatewayport, - startjavapollers => $startjavapollers, - startlldprocessors => $startlldprocessors, - startvmwarecollectors => $startvmwarecollectors, - vaultdbpath => $vaultdbpath, - vaulttoken => $vaulttoken, - vaulturl => $vaulturl, - vmwarefrequency => $vmwarefrequency, - vmwarecachesize => $vmwarecachesize, - vmwaretimeout => $vmwaretimeout, - snmptrapperfile => $snmptrapperfile, - startsnmptrapper => $startsnmptrapper, - listenip => $listenip, - housekeepingfrequency => $housekeepingfrequency, - maxhousekeeperdelete => $maxhousekeeperdelete, - cachesize => $cachesize, - cacheupdatefrequency => $cacheupdatefrequency, - startdbsyncers => $startdbsyncers, - historycachesize => $historycachesize, - trendcachesize => $trendcachesize, - historyindexcachesize => $historyindexcachesize, - valuecachesize => $valuecachesize, - timeout => $timeout, - tlscafile => $tlscafile, - tlscertfile => $tlscertfile, - tlscrlfile => $tlscrlfile, - tlskeyfile => $tlskeyfile, - tlscipherall => $tlscipherall, - tlscipherall13 => $tlscipherall13, - tlsciphercert => $tlsciphercert, - tlsciphercert13 => $tlsciphercert13, - tlscipherpsk => $tlscipherpsk, - tlscipherpsk13 => $tlscipherpsk13, - trappertimeout => $trappertimeout, - unreachableperiod => $unreachableperiod, - unavailabledelay => $unavailabledelay, - unreachabledelay => $unreachabledelay, - alertscriptspath => $alertscriptspath, - externalscripts => $externalscripts, - fpinglocation => $fpinglocation, - fping6location => $fping6location, - sshkeylocation => $sshkeylocation, - logslowqueries => $logslowqueries, - tmpdir => $tmpdir, - startproxypollers => $startproxypollers, - proxyconfigfrequency => $proxyconfigfrequency, - proxydatafrequency => $proxydatafrequency, - allowroot => $allowroot, - include_dir => $include_dir, - loadmodulepath => $loadmodulepath, - loadmodule => $loadmodule, - manage_selinux => $manage_selinux, - additional_service_params => $additional_service_params, - require => Class['zabbix::database'], + database_type => $database_type, + database_path => $database_path, + zabbix_version => $zabbix_version, + zabbix_package_state => $zabbix_package_state, + manage_firewall => $manage_firewall, + manage_repo => $manage_repo, + manage_database => $manage_database, + manage_service => $manage_service, + listenport => $listenport, + sourceip => $sourceip, + logfile => $logfile, + logfilesize => $logfilesize, + logtype => $logtype, + debuglevel => $debuglevel, + pidfile => $pidfile, + database_host => $database_host, + database_name => $database_name, + database_schema => $database_schema, + database_user => $database_user, + database_password => $database_password, + database_socket => $database_socket, + database_port => $database_port, + database_tlsconnect => $database_tlsconnect, + database_tlscafile => $database_tlscafile, + startpollers => $startpollers, + startagentpollers => $startagentpollers, + starthttpagentpollers => $starthttpagentpollers, + startsnmppollers => $startsnmppollers, + maxconcurrentchecksperpoller => $maxconcurrentchecksperpoller, + startipmipollers => $startipmipollers, + startodbcpollers => $startodbcpollers, + startpollersunreachable => $startpollersunreachable, + starthistorypollers => $starthistorypollers, + startpreprocessors => $startpreprocessors, + starttrappers => $starttrappers, + startpingers => $startpingers, + startalerters => $startalerters, + startdiscoverers => $startdiscoverers, + startescalators => $startescalators, + starthttppollers => $starthttppollers, + starttimers => $starttimers, + javagateway => $javagateway, + javagatewayport => $javagatewayport, + startjavapollers => $startjavapollers, + startlldprocessors => $startlldprocessors, + startvmwarecollectors => $startvmwarecollectors, + vaultdbpath => $vaultdbpath, + vaulttoken => $vaulttoken, + vaulturl => $vaulturl, + vmwarefrequency => $vmwarefrequency, + vmwarecachesize => $vmwarecachesize, + vmwaretimeout => $vmwaretimeout, + snmptrapperfile => $snmptrapperfile, + startsnmptrapper => $startsnmptrapper, + listenip => $listenip, + housekeepingfrequency => $housekeepingfrequency, + maxhousekeeperdelete => $maxhousekeeperdelete, + cachesize => $cachesize, + cacheupdatefrequency => $cacheupdatefrequency, + startdbsyncers => $startdbsyncers, + historycachesize => $historycachesize, + trendcachesize => $trendcachesize, + historyindexcachesize => $historyindexcachesize, + valuecachesize => $valuecachesize, + timeout => $timeout, + tlscafile => $tlscafile, + tlscertfile => $tlscertfile, + tlscrlfile => $tlscrlfile, + tlskeyfile => $tlskeyfile, + tlscipherall => $tlscipherall, + tlscipherall13 => $tlscipherall13, + tlsciphercert => $tlsciphercert, + tlsciphercert13 => $tlsciphercert13, + tlscipherpsk => $tlscipherpsk, + tlscipherpsk13 => $tlscipherpsk13, + trappertimeout => $trappertimeout, + unreachableperiod => $unreachableperiod, + unavailabledelay => $unavailabledelay, + unreachabledelay => $unreachabledelay, + alertscriptspath => $alertscriptspath, + externalscripts => $externalscripts, + fpinglocation => $fpinglocation, + fping6location => $fping6location, + sshkeylocation => $sshkeylocation, + logslowqueries => $logslowqueries, + tmpdir => $tmpdir, + startproxypollers => $startproxypollers, + proxyconfigfrequency => $proxyconfigfrequency, + proxydatafrequency => $proxydatafrequency, + allowroot => $allowroot, + include_dir => $include_dir, + loadmodulepath => $loadmodulepath, + loadmodule => $loadmodule, + manage_selinux => $manage_selinux, + additional_service_params => $additional_service_params, + require => Class['zabbix::database'], } class { 'zabbix::database': diff --git a/manifests/params.pp b/manifests/params.pp index 561f1a7c2..19e6f73f4 100755 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -249,13 +249,18 @@ $server_startdiscoverers = '1' $server_startescalators = 1 $server_starthttppollers = '1' - $server_startipmipollers = '0' + $server_startipmipollers = 0 $server_startjavapollers = '5' $server_startlldprocessors = 2 $server_startodbcpollers = 1 $server_startpingers = '1' - $server_startpollers = '5' - $server_startpollersunreachable = '1' + $server_startpollers = 5 + $server_startagentpollers = 1 + $server_starthttpagentpollers = 1 + $server_startsnmppollers = 1 + $server_maxconcurrentchecksperpoller = 100 + $server_startpollersunreachable = 1 + $server_starthistorypollers = 5 $server_startpreprocessors = 3 $server_startproxypollers = '1' $server_startsnmptrapper = '0' @@ -422,12 +427,16 @@ $proxy_startdbsyncers = '4' $proxy_startdiscoverers = '1' $proxy_starthttppollers = '1' - $proxy_startipmipollers = '0' + $proxy_startipmipollers = 0 $proxy_startjavapollers = '5' $proxy_startpingers = '1' $proxy_startodbcpollers = 1 - $proxy_startpollers = '5' - $proxy_startpollersunreachable = '1' + $proxy_startpollers = 5 + $proxy_startagentpollers = 1 + $proxy_starthttpagentpollers = 1 + $proxy_startsnmppollers = 1 + $proxy_maxconcurrentchecksperpoller = 100 + $proxy_startpollersunreachable = 1 $proxy_startpreprocessors = 3 $proxy_starttrappers = '5' $proxy_startvmwarecollectors = '0' diff --git a/manifests/proxy.pp b/manifests/proxy.pp index f01169989..b7efe7f9e 100755 --- a/manifests/proxy.pp +++ b/manifests/proxy.pp @@ -62,6 +62,10 @@ # @param proxyconfigfrequency How often proxy retrieves configuration data from Zabbix Server in seconds (Zabbix 6.4). # @param datasenderfrequency Proxy will send collected data to the Server every N seconds. # @param startpollers Number of pre-forked instances of pollers. +# @param startagentpollers Number of pre-forked instances of asynchronous Zabbix agent pollers. Also see MaxConcurrentChecksPerPoller. +# @param starthttpagentpollers Number of pre-forked instances of asynchronous HTTP agent pollers. Also see MaxConcurrentChecksPerPoller. +# @param startsnmppollers Number of pre-forked instances of asynchronous SNMP pollers. Also see MaxConcurrentChecksPerPoller. +# @param maxconcurrentchecksperpoller Maximum number of asynchronous checks that can be executed at once by each HTTP agent poller or agent poller. # @param startpreprocessors Number of pre-forked instances of preprocessing workers # @param startipmipollers Number of pre-forked instances of ipmi pollers. # @param startodbcpollers Number of pre-forked instances of ODBC pollers. @@ -239,10 +243,14 @@ $configfrequency = $zabbix::params::proxy_configfrequency, Optional[Integer[1,604800]] $proxyconfigfrequency = $zabbix::params::proxy_proxyconfigfrequency, $datasenderfrequency = $zabbix::params::proxy_datasenderfrequency, - $startpollers = $zabbix::params::proxy_startpollers, - $startipmipollers = $zabbix::params::proxy_startipmipollers, + Integer[0, 1000] $startpollers = $zabbix::params::proxy_startpollers, + Integer[0, 1000] $startagentpollers = $zabbis::params::proxy_startagentpollers, + Integer[0, 1000] $starthttpagentpollers = $zabbix::params::proxy_starthttpagentpollers, + Integer[0, 1000] $startsnmppollers = $zabbix::params::proxy_startsnmppollers, + Integer[0, 1000] $maxconcurrentchecksperpoller = $zabbix::params::proxy_maxconcurrentchecksperpoller, + Integer[0, 1000] $startipmipollers = $zabbix::params::proxy_startipmipollers, Integer[0, 1000] $startodbcpollers = $zabbix::params::proxy_startodbcpollers, - $startpollersunreachable = $zabbix::params::proxy_startpollersunreachable, + Integer[0, 1000] $startpollersunreachable = $zabbix::params::proxy_startpollersunreachable, Integer[1, 1000] $startpreprocessors = $zabbix::params::proxy_startpreprocessors, $starttrappers = $zabbix::params::proxy_starttrappers, $startpingers = $zabbix::params::proxy_startpingers, diff --git a/manifests/server.pp b/manifests/server.pp index aee457d84..40fe07174 100755 --- a/manifests/server.pp +++ b/manifests/server.pp @@ -48,10 +48,18 @@ # @param database_tlscipher The list of encryption ciphers that Zabbix server permits for TLS protocols up through TLSv1.2. # @param database_tlscipher13 The list of encryption ciphersuites that Zabbix server permits for TLSv1.3 protocol. # @param startpollers Number of pre-forked instances of pollers. +# @param startagentpollers Number of pre-forked instances of asynchronous Zabbix agent pollers. Also see MaxConcurrentChecksPerPoller. +# @param starthttpagentpollers Number of pre-forked instances of asynchronous HTTP agent pollers. Also see MaxConcurrentChecksPerPoller. +# @param startsnmppollers Number of pre-forked instances of asynchronous SNMP pollers. Also see MaxConcurrentChecksPerPoller. +# @param maxconcurrentchecksperpoller Maximum number of asynchronous checks that can be executed at once by each HTTP agent poller or agent poller. # @param startpreprocessors Number of pre-forked instances of preprocessing workers # @param startipmipollers Number of pre-forked instances of ipmi pollers. # @param startodbcpollers Number of pre-forked instances of ODBC pollers. # @param startpollersunreachable Number of pre-forked instances of pollers for unreachable hosts (including ipmi). +# @param starthistorypollers +# Number of pre-forked instances of history pollers. +# Only required for calculated checks. +# A database connection is required for each history poller instance. # @param starttrappers Number of pre-forked instances of trappers. # @param startpingers Number of pre-forked instances of icmp pingers. # @param startalerters Number of pre-forked instances of alerters. @@ -206,10 +214,15 @@ Optional[String[1]] $database_tlscipher = $zabbix::params::server_database_tlscipher, Optional[String[1]] $database_tlscipher13 = $zabbix::params::server_database_tlscipher13, Optional[Variant[String[1],Array[String[1]]]] $smsdevices = $zabbix::params::server_smsdevices, - $startpollers = $zabbix::params::server_startpollers, - $startipmipollers = $zabbix::params::server_startipmipollers, + Integer[0, 1000] $startpollers = $zabbix::params::server_startpollers, + Integer[0, 1000] $startagentpollers = $zabbis::params::server_startagentpollers, + Integer[0, 1000] $starthttpagentpollers = $zabbix::params::server_starthttpagentpollers, + Integer[0, 1000] $startsnmppollers = $zabbix::params::server_startsnmppollers, + Integer[0, 1000] $maxconcurrentchecksperpoller = $zabbix::params::server_maxconcurrentchecksperpoller, + Integer[0, 1000] $startipmipollers = $zabbix::params::server_startipmipollers, Integer[0, 1000] $startodbcpollers = $zabbix::params::server_startodbcpollers, - $startpollersunreachable = $zabbix::params::server_startpollersunreachable, + Integer[0, 1000] $startpollersunreachable = $zabbix::params::server_startpollersunreachable, + Integer[0, 1000] $starthistorypollers = $zabbix::params::server_starthistorypollers, Integer[1, 1000] $startpreprocessors = $zabbix::params::server_startpreprocessors, $starttrappers = $zabbix::params::server_starttrappers, $startpingers = $zabbix::params::server_startpingers, diff --git a/templates/zabbix_proxy.conf.erb b/templates/zabbix_proxy.conf.erb index 03c044cb4..6845ead13 100755 --- a/templates/zabbix_proxy.conf.erb +++ b/templates/zabbix_proxy.conf.erb @@ -300,32 +300,28 @@ StartPollers=<%= @startpollers %> # # Mandatory: no # Range: 0-1000 -# Default: -# StartAgentPollers=1 +StartAgentPollers=<%= @startagentpollers %> ### Option: StartHTTPAgentPollers # Number of pre-forked instances of asynchronous HTTP agent pollers. Also see MaxConcurrentChecksPerPoller. # # Mandatory: no # Range: 0-1000 -# Default: -# StartHTTPAgentPollers=1 +StartHTTPAgentPollers=<%= @starthttpagentpollers %> ### Option: StartSNMPPollers # Number of pre-forked instances of asynchronous SNMP pollers. Also see MaxConcurrentChecksPerPoller. # # Mandatory: no # Range: 0-1000 -# Default: -# StartSNMPPollers=1 +StartSNMPPollers=<%= @startsnmpagentpollers %> ### Option: MaxConcurrentChecksPerPoller # Maximum number of asynchronous checks that can be executed at once by each HTTP agent poller or agent poller. # # Mandatory: no # Range: 1-1000 -# Default: -# MaxConcurrentChecksPerPoller=1000 +MaxConcurrentChecksPerPoller=<%= @maxconcurrentchecksperpoller %> <% end %> ### Option: StartIPMIPollers diff --git a/templates/zabbix_server.conf.erb b/templates/zabbix_server.conf.erb index 259a9650a..cdae0b170 100755 --- a/templates/zabbix_server.conf.erb +++ b/templates/zabbix_server.conf.erb @@ -189,32 +189,28 @@ StartPollers=<%= @startpollers %> # # Mandatory: no # Range: 0-1000 -# Default: -# StartAgentPollers=1 +StartAgentPollers=<%= @startagentpollers %> ### Option: StartHTTPAgentPollers # Number of pre-forked instances of asynchronous HTTP agent pollers. Also see MaxConcurrentChecksPerPoller. # # Mandatory: no # Range: 0-1000 -# Default: -# StartHTTPAgentPollers=1 +StartHTTPAgentPollers=<%= @starthttpagentpollers %> ### Option: StartSNMPPollers # Number of pre-forked instances of asynchronous SNMP pollers. Also see MaxConcurrentChecksPerPoller. # # Mandatory: no # Range: 0-1000 -# Default: -# StartSNMPPollers=1 +StartSNMPPollers=<%= @startsnmpagentpollers %> ### Option: MaxConcurrentChecksPerPoller # Maximum number of asynchronous checks that can be executed at once by each HTTP agent poller or agent poller. # # Mandatory: no # Range: 1-1000 -# Default: -# MaxConcurrentChecksPerPoller=1000 +MaxConcurrentChecksPerPoller=<%= @maxconcurrentchecksperpoller %> <% end %> ### Option: StartIPMIPollers @@ -250,7 +246,7 @@ StartPollersUnreachable=<%= @startpollersunreachable %> # Mandatory: no # Range: 0-1000 # Default: -# StartHistoryPollers=5 +StartHistoryPollers=<%= @starthistorypollers %> <% end %> <% if @zabbix_version.to_f >= 6.0 %>