Skip to content

Commit

Permalink
Merge pull request #811 from Heidistein/arjen/reports
Browse files Browse the repository at this point in the history
add zabbix-server options StartReportWriters and WebServiceURL.
  • Loading branch information
bastelfreak authored Jan 14, 2022
2 parents 2632336 + 2fae217 commit 37f1a58
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 0 deletions.
4 changes: 4 additions & 0 deletions manifests/server.pp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@
# @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.
# @param startreportwriters Number of pre-forked report writer instances.
# @param webserviceurl URL to Zabbix web service, used to perform web related tasks.
# @param vmwarefrequency How often zabbix will connect to vmware service to obtain a new datan.
# @param vaultdbpath Vault path from where credentials for database will be retrieved by keys 'password' and 'username'.
# @param vaulttoken
Expand Down Expand Up @@ -213,6 +215,7 @@
$javagatewayport = $zabbix::params::server_javagatewayport,
$startjavapollers = $zabbix::params::server_startjavapollers,
Integer[1, 100] $startlldprocessors = $zabbix::params::server_startlldprocessors,
Optional[Integer[1, 100]] $startreportwriters = undef,
$startvmwarecollectors = $zabbix::params::server_startvmwarecollectors,
Optional[String[1]] $vaultdbpath = $zabbix::params::server_vaultdbpath,
Optional[String[1]] $vaulttoken = $zabbix::params::server_vaulttoken,
Expand Down Expand Up @@ -268,6 +271,7 @@
Optional[String[1]] $zabbix_user = $zabbix::params::server_zabbix_user,
Boolean $manage_startup_script = $zabbix::params::manage_startup_script,
Optional[Stdlib::Absolutepath] $socketdir = $zabbix::params::server_socketdir,
Optional[Stdlib::HTTPUrl] $webserviceurl = undef,
) inherits zabbix::params {
# zabbix server 5.2 and 5.4 is not supported on RHEL 7.
# https://www.zabbix.com/documentation/current/manual/installation/install_from_packages/rhel_centos
Expand Down
13 changes: 13 additions & 0 deletions spec/classes/server_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -414,6 +414,19 @@
it { is_expected.to contain_file('/etc/zabbix/zabbix_server.conf').with_content %r{^VaultToken=FKTYPEGL156DK$} }
it { is_expected.to contain_file('/etc/zabbix/zabbix_server.conf').with_content %r{^VaultURL=https://127.0.0.1:8200$} }
end

describe 'with zabbix_version 5.4 and report parameters defined' do
let :params do
{
zabbix_version: '5.4',
startreportwriters: 1,
webserviceurl: 'http://localhost:10053/report',
}
end

it { is_expected.to contain_file('/etc/zabbix/zabbix_server.conf').with_content %r{^StartReportWriters=1} }
it { is_expected.to contain_file('/etc/zabbix/zabbix_server.conf').with_content %r{^WebServiceURL=http://localhost:10053/report} }
end
end
end
end
Expand Down
21 changes: 21 additions & 0 deletions templates/zabbix_server.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -650,3 +650,24 @@ LoadModulePath=<%= @loadmodulepath %>
# VaultDBPath=
<% if @vaultdbpath %>VaultDBPath=<%= @vaultdbpath -%><% end %>
<% end %>


<% if @zabbix_version.to_f >= 5.4 %>
### Option: StartReportWriters
# Number of pre-forked report writer instances.
#
# Mandatory: no
# Range: 0-100
# Default:
# StartReportWriters=0
<% if @startreportwriters %>StartReportWriters=<%= @startreportwriters -%><% end %>

### Option: WebServiceURL
# URL to Zabbix web service, used to perform web related tasks.
# Example: http://localhost:10053/report
#
# Mandatory: no
# Default:
# WebServiceURL=
<% if @webserviceurl %>WebServiceURL=<%= @webserviceurl -%><% end %>
<% end %>

0 comments on commit 37f1a58

Please sign in to comment.