Skip to content

Commit 4b23e9d

Browse files
Add configuration parameters to Server and Agent
- Server: - making StartHistoryPollers configurable - adding TrendFunctionCacheSize parameter to config file
1 parent 0c2853d commit 4b23e9d

File tree

5 files changed

+37
-0
lines changed

5 files changed

+37
-0
lines changed

REFERENCE.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4013,6 +4013,7 @@ The following parameters are available in the `zabbix::server` class:
40134013
* [`startalerters`](#-zabbix--server--startalerters)
40144014
* [`startdiscoverers`](#-zabbix--server--startdiscoverers)
40154015
* [`startescalators`](#-zabbix--server--startescalators)
4016+
* [`starthistorypollers`](#-zabbix--server--starthistorypollers)
40164017
* [`starthttppollers`](#-zabbix--server--starthttppollers)
40174018
* [`starttimers`](#-zabbix--server--starttimers)
40184019
* [`javagateway`](#-zabbix--server--javagateway)
@@ -4040,6 +4041,7 @@ The following parameters are available in the `zabbix::server` class:
40404041
* [`historycachesize`](#-zabbix--server--historycachesize)
40414042
* [`historyindexcachesize`](#-zabbix--server--historyindexcachesize)
40424043
* [`trendcachesize`](#-zabbix--server--trendcachesize)
4044+
* [`trendfunctioncachesize`](#-zabbix--server--trendfunctioncachesize)
40434045
* [`valuecachesize`](#-zabbix--server--valuecachesize)
40444046
* [`timeout`](#-zabbix--server--timeout)
40454047
* [`tlscafile`](#-zabbix--server--tlscafile)
@@ -4450,6 +4452,14 @@ Number of pre-forked instances of escalators.
44504452

44514453
Default value: `$zabbix::params::server_startescalators`
44524454

4455+
##### <a name="-zabbix--server--starthistorypollers"></a>`starthistorypollers`
4456+
4457+
Data type: `Optional[Integer[0, 100]]`
4458+
4459+
Number of pre-forked instances of history pollers.
4460+
4461+
Default value: `$zabbix::params::server_starthistorypollers`
4462+
44534463
##### <a name="-zabbix--server--starthttppollers"></a>`starthttppollers`
44544464

44554465
Data type: `Any`
@@ -4672,6 +4682,14 @@ Size of trend cache, in bytes.
46724682

46734683
Default value: `$zabbix::params::server_trendcachesize`
46744684

4685+
##### <a name="-zabbix--server--trendfunctioncachesize"></a>`trendfunctioncachesize`
4686+
4687+
Data type: `Optional[String[1]]`
4688+
4689+
Size of trend function cache, in bytes.
4690+
4691+
Default value: `$zabbix::params::server_trendfunctioncachesize`
4692+
46754693
##### <a name="-zabbix--server--valuecachesize"></a>`valuecachesize`
46764694

46774695
Data type: `Any`

manifests/params.pp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -248,6 +248,7 @@
248248
$server_startalerters = 3
249249
$server_startdiscoverers = '1'
250250
$server_startescalators = 1
251+
$server_starthistorypollers = 5
251252
$server_starthttppollers = '1'
252253
$server_startipmipollers = '0'
253254
$server_startjavapollers = '5'
@@ -283,6 +284,7 @@
283284
$server_tmpdir = '/tmp'
284285
$server_trappertimeout = '300'
285286
$server_trendcachesize = '4M'
287+
$server_trendfunctioncachesize = undef
286288
$server_unavailabledelay = '60'
287289
$server_unreachabledelay = '15'
288290
$server_unreachableperiod = '45'

manifests/server.pp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
# @param startalerters Number of pre-forked instances of alerters.
5858
# @param startdiscoverers Number of pre-forked instances of discoverers.
5959
# @param startescalators Number of pre-forked instances of escalators.
60+
# @param starthistorypollers Number of pre-forked instances of history pollers.
6061
# @param starthttppollers Number of pre-forked instances of http pollers.
6162
# @param starttimers Number of pre-forked instances of timers.
6263
# @param javagateway IP address (or hostname) of zabbix java gateway.
@@ -92,6 +93,7 @@
9293
# @param historycachesize Size of history cache, in bytes.
9394
# @param historyindexcachesize Size of history index cache, in bytes.
9495
# @param trendcachesize Size of trend cache, in bytes.
96+
# @param trendfunctioncachesize Size of trend function cache, in bytes.
9597
# @param valuecachesize Size of history value cache, in bytes.
9698
# @param timeout Specifies how long we wait for agent, snmp device or external check (in seconds).
9799
# @param tlscafile Full pathname of a file containing the top-level CA(s) certificates for peer certificate verification.
@@ -216,6 +218,7 @@
216218
Integer[1, 100] $startalerters = $zabbix::params::server_startalerters,
217219
$startdiscoverers = $zabbix::params::server_startdiscoverers,
218220
Integer[1, 100] $startescalators = $zabbix::params::server_startescalators,
221+
Optional[Integer[0, 100]] $starthistorypollers = $zabbix::params::server_starthistorypollers,
219222
$starthttppollers = $zabbix::params::server_starthttppollers,
220223
$starttimers = $zabbix::params::server_starttimers,
221224
$javagateway = $zabbix::params::server_javagateway,
@@ -241,6 +244,7 @@
241244
$historycachesize = $zabbix::params::server_historycachesize,
242245
$historyindexcachesize = $zabbix::params::server_historyindexcachesize,
243246
$trendcachesize = $zabbix::params::server_trendcachesize,
247+
Optional[String[1]] $trendfunctioncachesize = $zabbix::params::server_trendfunctioncachesize,
244248
$valuecachesize = $zabbix::params::server_valuecachesize,
245249
$timeout = $zabbix::params::server_timeout,
246250
$tlscafile = $zabbix::params::server_tlscafile,

spec/classes/server_spec.rb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,7 @@
261261
tmpdir: '/tmp',
262262
trappertimeout: '30',
263263
trendcachesize: '4M',
264+
trendfunctioncachesize: '4M',
264265
unavailabledelay: '30',
265266
unreachabledelay: '30',
266267
unreachableperiod: '30',
@@ -338,6 +339,7 @@
338339
it { is_expected.to contain_file('/etc/zabbix/zabbix_server.conf').with_content %r{^TmpDir=/tmp} }
339340
it { is_expected.to contain_file('/etc/zabbix/zabbix_server.conf').with_content %r{^TrapperTimeout=30} }
340341
it { is_expected.to contain_file('/etc/zabbix/zabbix_server.conf').with_content %r{^TrendCacheSize=4M} }
342+
it { is_expected.to contain_file('/etc/zabbix/zabbix_server.conf').with_content %r{^TrendFunctionCacheSize=4M} }
341343
it { is_expected.to contain_file('/etc/zabbix/zabbix_server.conf').with_content %r{^UnavailableDelay=30} }
342344
it { is_expected.to contain_file('/etc/zabbix/zabbix_server.conf').with_content %r{^UnreachableDelay=30} }
343345
it { is_expected.to contain_file('/etc/zabbix/zabbix_server.conf').with_content %r{^UnreachablePeriod=30} }
@@ -371,11 +373,13 @@
371373
let :params do
372374
{
373375
smsdevices: ['/dev/ttyS0'],
376+
starthistorypollers: 5,
374377
zabbix_version: '7.0'
375378
}
376379
end
377380

378381
it { is_expected.to contain_file('/etc/zabbix/zabbix_server.conf').with_content %r{^SMSDevices=/dev/ttyS0} }
382+
it { is_expected.to contain_file('/etc/zabbix/zabbix_server.conf').with_content %r{^StartHistoryPollers=5} }
379383
end
380384

381385
context 'with zabbix_server.conf and version 7.2' do

templates/zabbix_server.conf.erb

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ StartPollersUnreachable=<%= @startpollersunreachable %>
251251
# Range: 0-1000
252252
# Default:
253253
# StartHistoryPollers=5
254+
<% if @starthistorypollers %>StartHistoryPollers=<%= @starthistorypollers %><% end %>
254255

255256
<% end %>
256257
<% if @zabbix_version.to_f >= 6.0 %>
@@ -472,6 +473,14 @@ HistoryCacheSize=<%= @historycachesize %>
472473
# Range: 128K-2G
473474
TrendCacheSize=<%= @trendcachesize %>
474475

476+
### Option: TrendFunctionCacheSize
477+
# Size of trend function cache, in bytes.
478+
# Shared memory size for caching calculated trend function data
479+
#
480+
# Mandatory: no
481+
# Range: 128K-2G
482+
<% if @trendfunctioncachesize %>TrendFunctionCacheSize=<%= @trendfunctioncachesize %><% end %>
483+
475484
### Option: ValueCacheSize
476485
# Size of history value cache, in bytes.
477486
# Shared memory size for caching item history data requests.

0 commit comments

Comments
 (0)