xymon::client::config : manage the main config file:

/etc/xymon/xymonclient.cfg
This commit is contained in:
gardouille 2015-02-16 14:09:12 +01:00
parent 84573c1ccb
commit a4ca5541cf
4 changed files with 77 additions and 2 deletions

View File

@ -35,6 +35,8 @@ 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,
$main_cfg_path = $xymon::params::cli_main_cfg_path,
$main_cfg_tpl = $xymon::params::cli_main_cfg_tpl,
$list_server = $xymon::params::list_server,
) inherits xymon::params {

View File

@ -24,5 +24,12 @@ class xymon::client::config {
notify => Service[$xymon::client::service_name],
}
# Client Configuration
file { "${xymon::client::main_cfg_path}":
ensure => present,
content => template($xymon::client::main_cfg_tpl),
notify => Service[$xymon::client::service_name],
}
} # Private class: xymon::client::config

View File

@ -12,7 +12,6 @@ class xymon::params {
$cli_package_name = undef
$cli_pkg_ensure = 'present'
$cli_pkg_provider = 'dpkg'
# Service
$cli_service_enabled = true
$cli_service_managed = true
@ -21,7 +20,9 @@ class xymon::params {
$cli_service_default_tpl = 'xymon/client/default.service.erb'
$cli_service_path = '/etc/init.d/xymon-client'
$cli_service_tpl = 'xymon/client/xymon-client.deb_service.erb'
# Configuration
$cli_main_cfg_path = '/etc/xymon/xymonclient.cfg'
$cli_main_cfg_tpl = 'xymon/client/xymonclient.cfg.erb'
$list_server = [ '127.0.0.1' ]
}

View File

@ -0,0 +1,65 @@
# Environment settings for the Xymon client.
XYMSRV="0.0.0.0" # IP address of the Xymon server
XYMSERVERS="<% @list_server.each do |val| -%><%= val -%> <% end -%>" # IP of multiple Xymon servers. XYMSRV must be "0.0.0.0".
CONFIGCLASS="$SERVEROSTYPE" # Default configuration class for logfiles
PATH="/bin:/usr/bin:/sbin:/usr/sbin:/etc" # PATH setting for the client scripts.
SHELL="/bin/sh" # Shell to use when forking programs
# You normally dont need to modify anything below here
XYMONDPORT="1984" # Portnumber where xymond listens
XYMONHOME="$XYMONCLIENTHOME" # Directory for the Xymon client files
XYMON="$XYMONHOME/bin/xymon" # The Xymon client "xymon" utility
XYMONTMP="$XYMONHOME/tmp" # Where we may store temporary files.
XYMONCLIENTLOGS="$XYMONHOME/logs" # Where we store the client logfiles
# Compatibility settings
HOBBITCLIENTHOME="$XYMONCLIENTHOME"
BBDISP="$XYMSRV"
BBDISPLAYS="$XYMSERVERS"
BBPORT="$XYMONDPORT"
BBHOME="$XYMONHOME"
BB="$XYMON"
BBTMP="$XYMONTMP"
BBCLIENTLOGS="$XYMONCLIENTLOGS"
# The following defines a bunch of commands that BB extensions expect to be present.
# Xymon does not use them, but they are provided here so if you use BB extension
# scripts, then they will hopefully run without having to do a lot of tweaking.
UPTIME="/usr/bin/uptime"
AWK="/usr/bin/awk"
CAT="/bin/cat"
CP="/bin/cp"
CUT="/usr/bin/cut"
DATE="/bin/date"
EGREP="/bin/egrep"
EXPR="/usr/bin/expr"
FIND="/usr/bin/find"
GREP="/bin/grep"
HEAD="/usr/bin/head"
ID="/usr/bin/id"
LN="/bin/ln"
LS="/bin/ls"
MV="/bin/mv"
RM="/bin/rm"
SED="/bin/sed"
SORT="/usr/bin/sort"
TAIL="/usr/bin/tail"
TOP="/usr/bin/top"
TOUCH="/usr/bin/touch"
TR="/usr/bin/tr"
UNIQ="/usr/bin/uniq"
WHO="/usr/bin/who"
WC="/usr/bin/wc -l"
WCC="/usr/bin/wc"
# DF,DFCMD and PS are for compatibility only, NOT USED by the Xymon client
DF="/bin/df -Pk"
DFCMD="/bin/df -Pk"
PS="ps ax"
MAXLINE="32768"