diff --git a/manifests/client.pp b/manifests/client.pp index 084c8db..45f2972 100644 --- a/manifests/client.pp +++ b/manifests/client.pp @@ -35,8 +35,11 @@ class xymon::client ( $service_default_tpl = $xymon::params::cli_service_default_tpl, $service_path = $xymon::params::cli_service_path, $service_tpl = $xymon::params::cli_service_tpl, + $list_server = $xymon::params::list_server, ) inherits xymon::params { + validate_array($list_server) + include '::xymon::client::preconfig' include '::xymon::client::install' include '::xymon::client::config' diff --git a/manifests/params.pp b/manifests/params.pp index e7e1474..511e771 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -22,6 +22,7 @@ class xymon::params { $cli_service_path = '/etc/init.d/xymon-client' $cli_service_tpl = 'xymon/client/xymon-client.deb_service.erb' + $list_server = [ '127.0.0.1' ] } default: { diff --git a/templates/client/default.service.erb b/templates/client/default.service.erb index e69de29..e42fbdd 100644 --- a/templates/client/default.service.erb +++ b/templates/client/default.service.erb @@ -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') %>"