Manage the list of servers to send the informations. Add a test to
validate the passed value is an array.
This commit is contained in:
parent
de5393d777
commit
84573c1ccb
|
@ -35,8 +35,11 @@ class xymon::client (
|
||||||
$service_default_tpl = $xymon::params::cli_service_default_tpl,
|
$service_default_tpl = $xymon::params::cli_service_default_tpl,
|
||||||
$service_path = $xymon::params::cli_service_path,
|
$service_path = $xymon::params::cli_service_path,
|
||||||
$service_tpl = $xymon::params::cli_service_tpl,
|
$service_tpl = $xymon::params::cli_service_tpl,
|
||||||
|
$list_server = $xymon::params::list_server,
|
||||||
) inherits xymon::params {
|
) inherits xymon::params {
|
||||||
|
|
||||||
|
validate_array($list_server)
|
||||||
|
|
||||||
include '::xymon::client::preconfig'
|
include '::xymon::client::preconfig'
|
||||||
include '::xymon::client::install'
|
include '::xymon::client::install'
|
||||||
include '::xymon::client::config'
|
include '::xymon::client::config'
|
||||||
|
|
|
@ -22,6 +22,7 @@ class xymon::params {
|
||||||
$cli_service_path = '/etc/init.d/xymon-client'
|
$cli_service_path = '/etc/init.d/xymon-client'
|
||||||
$cli_service_tpl = 'xymon/client/xymon-client.deb_service.erb'
|
$cli_service_tpl = 'xymon/client/xymon-client.deb_service.erb'
|
||||||
|
|
||||||
|
$list_server = [ '127.0.0.1' ]
|
||||||
|
|
||||||
}
|
}
|
||||||
default: {
|
default: {
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
#file generated by puppet
|
||||||
|
#Don't edit, please see https://forge.puppetlabs.com/gardouille/xymon
|
||||||
|
|
||||||
|
# Configure the Xymon client settings.
|
||||||
|
|
||||||
|
# You MUST set the list of Xymon servers that this
|
||||||
|
# client reports to.
|
||||||
|
# It is good to use IP-adresses here instead of DNS
|
||||||
|
# names - DNS might not work if there's a problem.
|
||||||
|
# (Internally this will be translated to XYMSRV and XYMSERVERS
|
||||||
|
# variables in /var/run/xymon/bbdisp-include.cfg)
|
||||||
|
#
|
||||||
|
# E.g. (a single Xymon server)
|
||||||
|
# XYMONSERVERS="192.168.1.1"
|
||||||
|
# or (multiple servers)
|
||||||
|
# XYMONSERVERS="10.0.0.1 192.168.1.1"
|
||||||
|
|
||||||
|
XYMONSERVERS="<% @list_server.each do |val| -%><%= val -%> <% end -%>"
|
||||||
|
|
||||||
|
# Hostname used by the client for its reports.
|
||||||
|
# Must match the name for this host in the Xymon servers'
|
||||||
|
# hosts.cfg file.
|
||||||
|
|
||||||
|
CLIENTHOSTNAME="<%= scope.lookupvar('::fqdn') %>"
|
Loading…
Reference in New Issue