Skip to content

Commit e9b96c8

Browse files
authored
Merge pull request #881 from markt-de/odbc_pollers
Add support for ODBC pollers in Zabbix >= 6.0
2 parents aa8bf21 + 24479d6 commit e9b96c8

File tree

9 files changed

+74
-0
lines changed

9 files changed

+74
-0
lines changed

REFERENCE.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ The following parameters are available in the `zabbix` class:
147147
* [`startpollers`](#-zabbix--startpollers)
148148
* [`startpreprocessors`](#-zabbix--startpreprocessors)
149149
* [`startipmipollers`](#-zabbix--startipmipollers)
150+
* [`startodbcpollers`](#-zabbix--startodbcpollers)
150151
* [`startpollersunreachable`](#-zabbix--startpollersunreachable)
151152
* [`starttrappers`](#-zabbix--starttrappers)
152153
* [`startpingers`](#-zabbix--startpingers)
@@ -741,6 +742,14 @@ Number of pre-forked instances of ipmi pollers.
741742

742743
Default value: `$zabbix::params::server_startipmipollers`
743744

745+
##### <a name="-zabbix--startodbcpollers"></a>`startodbcpollers`
746+
747+
Data type: `Integer[0, 1000]`
748+
749+
Number of pre-forked instances of ODBC pollers.
750+
751+
Default value: `$zabbix::params::server_startodbcpollers`
752+
744753
##### <a name="-zabbix--startpollersunreachable"></a>`startpollersunreachable`
745754

746755
Data type: `Any`
@@ -2540,6 +2549,7 @@ The following parameters are available in the `zabbix::proxy` class:
25402549
* [`startpollers`](#-zabbix--proxy--startpollers)
25412550
* [`startpreprocessors`](#-zabbix--proxy--startpreprocessors)
25422551
* [`startipmipollers`](#-zabbix--proxy--startipmipollers)
2552+
* [`startodbcpollers`](#-zabbix--proxy--startodbcpollers)
25432553
* [`startpollersunreachable`](#-zabbix--proxy--startpollersunreachable)
25442554
* [`starttrappers`](#-zabbix--proxy--starttrappers)
25452555
* [`startpingers`](#-zabbix--proxy--startpingers)
@@ -3026,6 +3036,14 @@ Number of pre-forked instances of ipmi pollers.
30263036

30273037
Default value: `$zabbix::params::proxy_startipmipollers`
30283038

3039+
##### <a name="-zabbix--proxy--startodbcpollers"></a>`startodbcpollers`
3040+
3041+
Data type: `Integer[0, 1000]`
3042+
3043+
Number of pre-forked instances of ODBC pollers.
3044+
3045+
Default value: `$zabbix::params::proxy_startodbcpollers`
3046+
30293047
##### <a name="-zabbix--proxy--startpollersunreachable"></a>`startpollersunreachable`
30303048

30313049
Data type: `Any`
@@ -3930,6 +3948,7 @@ The following parameters are available in the `zabbix::server` class:
39303948
* [`startpollers`](#-zabbix--server--startpollers)
39313949
* [`startpreprocessors`](#-zabbix--server--startpreprocessors)
39323950
* [`startipmipollers`](#-zabbix--server--startipmipollers)
3951+
* [`startodbcpollers`](#-zabbix--server--startodbcpollers)
39333952
* [`startpollersunreachable`](#-zabbix--server--startpollersunreachable)
39343953
* [`starttrappers`](#-zabbix--server--starttrappers)
39353954
* [`startpingers`](#-zabbix--server--startpingers)
@@ -4313,6 +4332,14 @@ Number of pre-forked instances of ipmi pollers.
43134332

43144333
Default value: `$zabbix::params::server_startipmipollers`
43154334

4335+
##### <a name="-zabbix--server--startodbcpollers"></a>`startodbcpollers`
4336+
4337+
Data type: `Integer[0, 1000]`
4338+
4339+
Number of pre-forked instances of ODBC pollers.
4340+
4341+
Default value: `$zabbix::params::server_startodbcpollers`
4342+
43164343
##### <a name="-zabbix--server--startpollersunreachable"></a>`startpollersunreachable`
43174344

43184345
Data type: `Any`

manifests/init.pp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@
105105
# @param startpollers Number of pre-forked instances of pollers.
106106
# @param startpreprocessors Number of pre-forked instances of preprocessing workers
107107
# @param startipmipollers Number of pre-forked instances of ipmi pollers.
108+
# @param startodbcpollers Number of pre-forked instances of ODBC pollers.
108109
# @param startpollersunreachable Number of pre-forked instances of pollers for unreachable hosts (including ipmi).
109110
# @param starttrappers Number of pre-forked instances of trappers.
110111
# @param startpingers Number of pre-forked instances of icmp pingers.
@@ -274,6 +275,7 @@
274275
Optional[Stdlib::Absolutepath] $database_tlscafile = $zabbix::params::server_database_tlscafile,
275276
$startpollers = $zabbix::params::server_startpollers,
276277
$startipmipollers = $zabbix::params::server_startipmipollers,
278+
Integer[0, 1000] $startodbcpollers = $zabbix::params::server_startodbcpollers,
277279
$startpollersunreachable = $zabbix::params::server_startpollersunreachable,
278280
Integer[1, 1000] $startpreprocessors = $zabbix::params::server_startpreprocessors,
279281
$starttrappers = $zabbix::params::server_starttrappers,

manifests/params.pp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,7 @@
250250
$server_startipmipollers = '0'
251251
$server_startjavapollers = '5'
252252
$server_startlldprocessors = 2
253+
$server_startodbcpollers = 1
253254
$server_startpingers = '1'
254255
$server_startpollers = '5'
255256
$server_startpollersunreachable = '1'
@@ -418,6 +419,7 @@
418419
$proxy_startipmipollers = '0'
419420
$proxy_startjavapollers = '5'
420421
$proxy_startpingers = '1'
422+
$proxy_startodbcpollers = 1
421423
$proxy_startpollers = '5'
422424
$proxy_startpollersunreachable = '1'
423425
$proxy_startpreprocessors = 3

manifests/proxy.pp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@
6363
# @param startpollers Number of pre-forked instances of pollers.
6464
# @param startpreprocessors Number of pre-forked instances of preprocessing workers
6565
# @param startipmipollers Number of pre-forked instances of ipmi pollers.
66+
# @param startodbcpollers Number of pre-forked instances of ODBC pollers.
6667
# @param startpollersunreachable Number of pre-forked instances of pollers for unreachable hosts (including ipmi).
6768
# @param starttrappers Number of pre-forked instances of trappers.
6869
# @param startpingers Number of pre-forked instances of icmp pingers.
@@ -237,6 +238,7 @@
237238
$datasenderfrequency = $zabbix::params::proxy_datasenderfrequency,
238239
$startpollers = $zabbix::params::proxy_startpollers,
239240
$startipmipollers = $zabbix::params::proxy_startipmipollers,
241+
Integer[0, 1000] $startodbcpollers = $zabbix::params::proxy_startodbcpollers,
240242
$startpollersunreachable = $zabbix::params::proxy_startpollersunreachable,
241243
Integer[1, 1000] $startpreprocessors = $zabbix::params::proxy_startpreprocessors,
242244
$starttrappers = $zabbix::params::proxy_starttrappers,

manifests/server.pp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
# @param startpollers Number of pre-forked instances of pollers.
5151
# @param startpreprocessors Number of pre-forked instances of preprocessing workers
5252
# @param startipmipollers Number of pre-forked instances of ipmi pollers.
53+
# @param startodbcpollers Number of pre-forked instances of ODBC pollers.
5354
# @param startpollersunreachable Number of pre-forked instances of pollers for unreachable hosts (including ipmi).
5455
# @param starttrappers Number of pre-forked instances of trappers.
5556
# @param startpingers Number of pre-forked instances of icmp pingers.
@@ -202,6 +203,7 @@
202203
Optional[String[1]] $database_tlscipher13 = $zabbix::params::server_database_tlscipher13,
203204
$startpollers = $zabbix::params::server_startpollers,
204205
$startipmipollers = $zabbix::params::server_startipmipollers,
206+
Integer[0, 1000] $startodbcpollers = $zabbix::params::server_startodbcpollers,
205207
$startpollersunreachable = $zabbix::params::server_startpollersunreachable,
206208
Integer[1, 1000] $startpreprocessors = $zabbix::params::server_startpreprocessors,
207209
$starttrappers = $zabbix::params::server_starttrappers,

spec/classes/proxy_spec.rb

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,11 +356,26 @@
356356
let :params do
357357
{
358358
socketdir: '/var/run/zabbix',
359+
startodbcpollers: 1,
359360
zabbix_version: '5.0'
360361
}
361362
end
362363

363364
it { is_expected.to contain_file('/etc/zabbix/zabbix_proxy.conf').with_content %r{^SocketDir=/var/run/zabbix} }
365+
it { is_expected.to contain_file('/etc/zabbix/zabbix_proxy.conf').without_content %r{^StartODBCPollers=1$} }
366+
end
367+
368+
context 'with zabbix_proxy.conf and version 6.0' do
369+
let :params do
370+
{
371+
socketdir: '/var/run/zabbix',
372+
startodbcpollers: 1,
373+
zabbix_version: '6.0'
374+
}
375+
end
376+
377+
it { is_expected.to contain_file('/etc/zabbix/zabbix_proxy.conf').with_content %r{^SocketDir=/var/run/zabbix} }
378+
it { is_expected.to contain_file('/etc/zabbix/zabbix_proxy.conf').with_content %r{^StartODBCPollers=1$} }
364379
end
365380

366381
context 'with zabbix_proxy.conf and logtype declared' do

spec/classes/server_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,11 +363,13 @@
363363
let :params do
364364
{
365365
socketdir: '/var/run/zabbix',
366+
startodbcpollers: 1,
366367
zabbix_version: '5.0'
367368
}
368369
end
369370

370371
it { is_expected.to contain_file('/etc/zabbix/zabbix_server.conf').with_content %r{^SocketDir=/var/run/zabbix} }
372+
it { is_expected.to contain_file('/etc/zabbix/zabbix_server.conf').without_content %r{^StartODBCPollers=1} }
371373
end
372374

373375
context 'with zabbix_server.conf and logtype declared' do

templates/zabbix_proxy.conf.erb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,17 @@ UnavailableDelay=<%= @unavaliabledelay %>
354354
#
355355
UnreachableDelay=<%= @unreachabedelay %>
356356

357+
<% if @zabbix_version.to_f >= 6.0 %>
358+
## Option: StartODBCPollers
359+
# Number of pre-forked ODBC poller instances.
360+
#
361+
# Mandatory: no
362+
# Range: 0-1000
363+
# Default:
364+
# StartODBCPollers=1
365+
StartODBCPollers=<%= @startodbcpollers %>
366+
<% end %>
367+
357368
### Option: ExternalScripts
358369
# Full path to location of external scripts.
359370
# Default depends on compilation options.

templates/zabbix_server.conf.erb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,17 @@ StartIPMIPollers=<%= @startipmipollers %>
133133
#
134134
StartPollersUnreachable=<%= @startpollersunreachable %>
135135

136+
<% if @zabbix_version.to_f >= 6.0 %>
137+
## Option: StartODBCPollers
138+
# Number of pre-forked ODBC poller instances.
139+
#
140+
# Mandatory: no
141+
# Range: 0-1000
142+
# Default:
143+
# StartODBCPollers=1
144+
StartODBCPollers=<%= @startodbcpollers %>
145+
<% end %>
146+
136147
### Option: StartTrappers
137148
# Number of pre-forked instances of trappers.
138149
# Trappers accept incoming connections from Zabbix sender, active agents and active proxies.

0 commit comments

Comments
 (0)