Skip to content

Commit

Permalink
add support for ODBC pollers in Zabbix >= 6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
fraenki committed Oct 23, 2023
1 parent 1aa215e commit 01833a5
Show file tree
Hide file tree
Showing 9 changed files with 74 additions and 0 deletions.
27 changes: 27 additions & 0 deletions REFERENCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ The following parameters are available in the `zabbix` class:
* [`startpollers`](#-zabbix--startpollers)
* [`startpreprocessors`](#-zabbix--startpreprocessors)
* [`startipmipollers`](#-zabbix--startipmipollers)
* [`startodbcpollers`](#-zabbix--startodbcpollers)
* [`startpollersunreachable`](#-zabbix--startpollersunreachable)
* [`starttrappers`](#-zabbix--starttrappers)
* [`startpingers`](#-zabbix--startpingers)
Expand Down Expand Up @@ -740,6 +741,14 @@ Number of pre-forked instances of ipmi pollers.

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

##### <a name="-zabbix--startodbcpollers"></a>`startodbcpollers`

Data type: `Integer[0, 1000]`

Number of pre-forked instances of ODBC pollers.

Default value: `$zabbix::params::server_startodbcpollers`

##### <a name="-zabbix--startpollersunreachable"></a>`startpollersunreachable`

Data type: `Any`
Expand Down Expand Up @@ -2548,6 +2557,7 @@ The following parameters are available in the `zabbix::proxy` class:
* [`startpollers`](#-zabbix--proxy--startpollers)
* [`startpreprocessors`](#-zabbix--proxy--startpreprocessors)
* [`startipmipollers`](#-zabbix--proxy--startipmipollers)
* [`startodbcpollers`](#-zabbix--proxy--startodbcpollers)
* [`startpollersunreachable`](#-zabbix--proxy--startpollersunreachable)
* [`starttrappers`](#-zabbix--proxy--starttrappers)
* [`startpingers`](#-zabbix--proxy--startpingers)
Expand Down Expand Up @@ -3034,6 +3044,14 @@ Number of pre-forked instances of ipmi pollers.

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

##### <a name="-zabbix--proxy--startodbcpollers"></a>`startodbcpollers`

Data type: `Integer[0, 1000]`

Number of pre-forked instances of ODBC pollers.

Default value: `$zabbix::params::proxy_startodbcpollers`

##### <a name="-zabbix--proxy--startpollersunreachable"></a>`startpollersunreachable`

Data type: `Any`
Expand Down Expand Up @@ -3947,6 +3965,7 @@ The following parameters are available in the `zabbix::server` class:
* [`startpollers`](#-zabbix--server--startpollers)
* [`startpreprocessors`](#-zabbix--server--startpreprocessors)
* [`startipmipollers`](#-zabbix--server--startipmipollers)
* [`startodbcpollers`](#-zabbix--server--startodbcpollers)
* [`startpollersunreachable`](#-zabbix--server--startpollersunreachable)
* [`starttrappers`](#-zabbix--server--starttrappers)
* [`startpingers`](#-zabbix--server--startpingers)
Expand Down Expand Up @@ -4330,6 +4349,14 @@ Number of pre-forked instances of ipmi pollers.

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

##### <a name="-zabbix--server--startodbcpollers"></a>`startodbcpollers`

Data type: `Integer[0, 1000]`

Number of pre-forked instances of ODBC pollers.

Default value: `$zabbix::params::server_startodbcpollers`

##### <a name="-zabbix--server--startpollersunreachable"></a>`startpollersunreachable`

Data type: `Any`
Expand Down
2 changes: 2 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@
# @param startpollers Number of pre-forked instances of pollers.
# @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 starttrappers Number of pre-forked instances of trappers.
# @param startpingers Number of pre-forked instances of icmp pingers.
Expand Down Expand Up @@ -274,6 +275,7 @@
Optional[Stdlib::Absolutepath] $database_tlscafile = $zabbix::params::server_database_tlscafile,
$startpollers = $zabbix::params::server_startpollers,
$startipmipollers = $zabbix::params::server_startipmipollers,
Integer[0, 1000] $startodbcpollers = $zabbix::params::server_startodbcpollers,
$startpollersunreachable = $zabbix::params::server_startpollersunreachable,
Integer[1, 1000] $startpreprocessors = $zabbix::params::server_startpreprocessors,
$starttrappers = $zabbix::params::server_starttrappers,
Expand Down
2 changes: 2 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@
$server_startipmipollers = '0'
$server_startjavapollers = '5'
$server_startlldprocessors = 2
$server_startodbcpollers = 1
$server_startpingers = '1'
$server_startpollers = '5'
$server_startpollersunreachable = '1'
Expand Down Expand Up @@ -422,6 +423,7 @@
$proxy_startipmipollers = '0'
$proxy_startjavapollers = '5'
$proxy_startpingers = '1'
$proxy_startodbcpollers = 1
$proxy_startpollers = '5'
$proxy_startpollersunreachable = '1'
$proxy_startpreprocessors = 3
Expand Down
2 changes: 2 additions & 0 deletions manifests/proxy.pp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
# @param startpollers Number of pre-forked instances of pollers.
# @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 starttrappers Number of pre-forked instances of trappers.
# @param startpingers Number of pre-forked instances of icmp pingers.
Expand Down Expand Up @@ -237,6 +238,7 @@
$datasenderfrequency = $zabbix::params::proxy_datasenderfrequency,
$startpollers = $zabbix::params::proxy_startpollers,
$startipmipollers = $zabbix::params::proxy_startipmipollers,
Integer[0, 1000] $startodbcpollers = $zabbix::params::proxy_startodbcpollers,
$startpollersunreachable = $zabbix::params::proxy_startpollersunreachable,
Integer[1, 1000] $startpreprocessors = $zabbix::params::proxy_startpreprocessors,
$starttrappers = $zabbix::params::proxy_starttrappers,
Expand Down
2 changes: 2 additions & 0 deletions manifests/server.pp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
# @param startpollers Number of pre-forked instances of pollers.
# @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 starttrappers Number of pre-forked instances of trappers.
# @param startpingers Number of pre-forked instances of icmp pingers.
Expand Down Expand Up @@ -202,6 +203,7 @@
Optional[String[1]] $database_tlscipher13 = $zabbix::params::server_database_tlscipher13,
$startpollers = $zabbix::params::server_startpollers,
$startipmipollers = $zabbix::params::server_startipmipollers,
Integer[0, 1000] $startodbcpollers = $zabbix::params::server_startodbcpollers,
$startpollersunreachable = $zabbix::params::server_startpollersunreachable,
Integer[1, 1000] $startpreprocessors = $zabbix::params::server_startpreprocessors,
$starttrappers = $zabbix::params::server_starttrappers,
Expand Down
15 changes: 15 additions & 0 deletions spec/classes/proxy_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -366,11 +366,26 @@
let :params do
{
socketdir: '/var/run/zabbix',
startodbcpollers: 1,
zabbix_version: '5.0'
}
end

it { is_expected.to contain_file('/etc/zabbix/zabbix_proxy.conf').with_content %r{^SocketDir=/var/run/zabbix} }
it { is_expected.to contain_file('/etc/zabbix/zabbix_proxy.conf').without_content %r{^StartODBCPollers=1$} }
end

context 'with zabbix_proxy.conf and version 6.0' do
let :params do
{
socketdir: '/var/run/zabbix',
startodbcpollers: 1,
zabbix_version: '6.0'
}
end

it { is_expected.to contain_file('/etc/zabbix/zabbix_proxy.conf').with_content %r{^SocketDir=/var/run/zabbix} }
it { is_expected.to contain_file('/etc/zabbix/zabbix_proxy.conf').with_content %r{^StartODBCPollers=1$} }
end

context 'with zabbix_proxy.conf and logtype declared' do
Expand Down
2 changes: 2 additions & 0 deletions spec/classes/server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -367,11 +367,13 @@
let :params do
{
socketdir: '/var/run/zabbix',
startodbcpollers: 1,
zabbix_version: '5.0'
}
end

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

context 'with zabbix_server.conf and logtype declared' do
Expand Down
11 changes: 11 additions & 0 deletions templates/zabbix_proxy.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,17 @@ UnavailableDelay=<%= @unavaliabledelay %>
#
UnreachableDelay=<%= @unreachabedelay %>

## Option: StartODBCPollers
# Number of pre-forked ODBC poller instances.
#
# Mandatory: no
# Range: 0-1000
# Default:
# StartODBCPollers=1
<% if @zabbix_version.to_f >= 6.0 %>
StartODBCPollers=<%= @startodbcpollers %>
<% end %>

### Option: ExternalScripts
# Full path to location of external scripts.
# Default depends on compilation options.
Expand Down
11 changes: 11 additions & 0 deletions templates/zabbix_server.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,17 @@ StartIPMIPollers=<%= @startipmipollers %>
#
StartPollersUnreachable=<%= @startpollersunreachable %>

## Option: StartODBCPollers
# Number of pre-forked ODBC poller instances.
#
# Mandatory: no
# Range: 0-1000
# Default:
# StartODBCPollers=1
<% if @zabbix_version.to_f >= 6.0 %>
StartODBCPollers=<%= @startodbcpollers %>
<% end %>

### Option: StartTrappers
# Number of pre-forked instances of trappers.
# Trappers accept incoming connections from Zabbix sender, active agents and active proxies.
Expand Down

0 comments on commit 01833a5

Please sign in to comment.