Skip to content

Commit 328e5b3

Browse files
Ph0B1uSValantin
authored andcommitted
Add zabbix-server smsdevices configuration
1 parent 383c15e commit 328e5b3

File tree

6 files changed

+39
-1
lines changed

6 files changed

+39
-1
lines changed

REFERENCE.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ The following parameters are available in the `zabbix` class:
158158
* [`starttimers`](#-zabbix--starttimers)
159159
* [`javagateway`](#-zabbix--javagateway)
160160
* [`javagatewayport`](#-zabbix--javagatewayport)
161+
* [`smsdevices`](#-zabbix--smsdevices)
161162
* [`startjavapollers`](#-zabbix--startjavapollers)
162163
* [`startlldprocessors`](#-zabbix--startlldprocessors)
163164
* [`startvmwarecollectors`](#-zabbix--startvmwarecollectors)
@@ -830,6 +831,14 @@ Port that zabbix java gateway listens on.
830831

831832
Default value: `$zabbix::params::server_javagatewayport`
832833

834+
##### <a name="-zabbix--smsdevices"></a>`smsdevices`
835+
836+
Data type: `Optional[Variant[String[1],Array[String[1]]]]`
837+
838+
Devices to use for sms texting
839+
840+
Default value: `$zabbix::params::server_smsdevices`
841+
833842
##### <a name="-zabbix--startjavapollers"></a>`startjavapollers`
834843

835844
Data type: `Any`
@@ -4026,6 +4035,7 @@ The following parameters are available in the `zabbix::server` class:
40264035
* [`maxhousekeeperdelete`](#-zabbix--server--maxhousekeeperdelete)
40274036
* [`cachesize`](#-zabbix--server--cachesize)
40284037
* [`cacheupdatefrequency`](#-zabbix--server--cacheupdatefrequency)
4038+
* [`smsdevices`](#-zabbix--server--smsdevices)
40294039
* [`startdbsyncers`](#-zabbix--server--startdbsyncers)
40304040
* [`historycachesize`](#-zabbix--server--historycachesize)
40314041
* [`historyindexcachesize`](#-zabbix--server--historyindexcachesize)
@@ -4622,6 +4632,14 @@ How often zabbix will perform update of configuration cache, in seconds.
46224632

46234633
Default value: `$zabbix::params::server_cacheupdatefrequency`
46244634

4635+
##### <a name="-zabbix--server--smsdevices"></a>`smsdevices`
4636+
4637+
Data type: `Optional[Variant[String[1],Array[String[1]]]]`
4638+
4639+
Devices to use for sms texting
4640+
4641+
Default value: `$zabbix::params::server_smsdevices`
4642+
46254643
##### <a name="-zabbix--server--startdbsyncers"></a>`startdbsyncers`
46264644

46274645
Data type: `Any`

manifests/init.pp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@
116116
# @param starttimers Number of pre-forked instances of timers.
117117
# @param javagateway IP address (or hostname) of zabbix java gateway.
118118
# @param javagatewayport Port that zabbix java gateway listens on.
119+
# @param smsdevices Devices to use for sms texting
119120
# @param startjavapollers Number of pre-forked instances of java pollers.
120121
# @param startlldprocessors Number of pre-forked instances of low-level discovery (LLD) workers.
121122
# @param startvmwarecollectors Number of pre-forked vmware collector instances.
@@ -304,6 +305,7 @@
304305
$cachesize = $zabbix::params::server_cachesize,
305306
$cacheupdatefrequency = $zabbix::params::server_cacheupdatefrequency,
306307
$startdbsyncers = $zabbix::params::server_startdbsyncers,
308+
Optional[Variant[String[1],Array[String[1]]]] $smsdevices = $zabbix::params::server_smsdevices,
307309
$historycachesize = $zabbix::params::server_historycachesize,
308310
Zabbix::Historyics $historyindexcachesize = $zabbix::params::server_historyindexcachesize,
309311
$trendcachesize = $zabbix::params::server_trendcachesize,

manifests/params.pp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,7 @@
240240
$server_pacemaker_resource = undef
241241
$server_snmptrapperfile = '/tmp/zabbix_traps.tmp'
242242
$server_sourceip = undef
243+
$server_smsdevices = undef
243244
$server_sshkeylocation = undef
244245
$server_sslcertlocation = '/usr/lib/zabbix/ssl/certs'
245246
$server_sslkeylocation = '/usr/lib/zabbix/ssl/keys'

manifests/server.pp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787
# if set to 0 then no limit is used at all. in this case you must know what you are doing!
8888
# @param cachesize Size of configuration cache, in bytes.
8989
# @param cacheupdatefrequency How often zabbix will perform update of configuration cache, in seconds.
90+
# @param smsdevices Devices to use for sms texting
9091
# @param startdbsyncers Number of pre-forked instances of db syncers.
9192
# @param historycachesize Size of history cache, in bytes.
9293
# @param historyindexcachesize Size of history index cache, in bytes.
@@ -204,6 +205,7 @@
204205
Optional[Stdlib::Absolutepath] $database_tlskeyfile = $zabbix::params::server_database_tlskeyfile,
205206
Optional[String[1]] $database_tlscipher = $zabbix::params::server_database_tlscipher,
206207
Optional[String[1]] $database_tlscipher13 = $zabbix::params::server_database_tlscipher13,
208+
Optional[Variant[String[1],Array[String[1]]]] $smsdevices = $zabbix::params::server_smsdevices,
207209
$startpollers = $zabbix::params::server_startpollers,
208210
$startipmipollers = $zabbix::params::server_startipmipollers,
209211
Integer[0, 1000] $startodbcpollers = $zabbix::params::server_startodbcpollers,

spec/classes/server_spec.rb

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,20 @@
367367
it { is_expected.to contain_file('/etc/zabbix/zabbix_server.conf').without_content %r{^StartODBCPollers=1} }
368368
end
369369

370+
context 'with zabbix_server.conf and version 7.0' do
371+
next if facts[:os]['name'] == 'Debian' && facts[:os]['release']['major'].to_i <= 11
372+
next if facts[:os]['name'] == 'Ubuntu' && facts[:os]['release']['major'].to_i <= 20
373+
374+
let :params do
375+
{
376+
smsdevices: 'modem0',
377+
zabbix_version: '7.0'
378+
}
379+
end
380+
381+
it { is_expected.to contain_file('/etc/zabbix/zabbix_server.conf').with_content %r{^SMSDevices=modem0} }
382+
end
383+
370384
context 'with zabbix_server.conf and logtype declared' do
371385
describe 'as system' do
372386
let :params do

templates/zabbix_server.conf.erb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -962,6 +962,7 @@ LoadModulePath=<%= @loadmodulepath %>
962962
# Mandatory: no
963963
# Default:
964964
# SMSDevices=
965+
<% if @smsdevices %>SMSDevices=<%= @smsdevices.is_a?(Array) ? @smsdevices.join(',') : @smsdevices -%><% end %>
965966

966967
<% end %>
967968
<% if @zabbix_version.to_f >= 5.4 %>
@@ -1017,4 +1018,4 @@ LoadModulePath=<%= @loadmodulepath %>
10171018
# Default:
10181019
# StartBrowserPollers=1
10191020

1020-
<% end %>
1021+
<% end %>

0 commit comments

Comments
 (0)