From b0a99c5d8120276377705684564aed8af40465bf Mon Sep 17 00:00:00 2001 From: Daniel Berteaud Date: Thu, 14 Jun 2012 12:32:10 +0200 Subject: [PATCH] Nettoyage des templates, et compat version 2.0 --- .../configuration/defaults/zabbix-agent/ServerPort | 1 - .../db/configuration/defaults/zabbix-agent/active | 1 - .../db/configuration/defaults/zabbix-agent/passive | 1 - .../templates/etc/zabbix/zabbix_agentd.conf/00header | 6 ------ .../etc/zabbix/zabbix_agentd.conf/10zabbixServers | 10 ---------- .../templates/etc/zabbix/zabbix_agentd.conf/20listen | 15 +++++++-------- .../templates/etc/zabbix/zabbix_agentd.conf/30fork | 6 ------ .../etc/zabbix/zabbix_agentd.conf/40ActiveBuffers | 2 ++ .../templates/etc/zabbix/zabbix_agentd.conf/40freq | 20 -------------------- .../etc/zabbix/zabbix_agentd.conf/50ActiveServer | 5 +++++ .../etc/zabbix/zabbix_agentd.conf/50active_passive | 8 -------- .../etc/zabbix/zabbix_agentd.conf/60remoteCommands | 4 ---- .../templates/etc/zabbix/zabbix_agentd.conf/70logs | 16 ---------------- 13 files changed, 14 insertions(+), 81 deletions(-) delete mode 100644 root/etc/e-smith/db/configuration/defaults/zabbix-agent/ServerPort delete mode 100644 root/etc/e-smith/db/configuration/defaults/zabbix-agent/active delete mode 100644 root/etc/e-smith/db/configuration/defaults/zabbix-agent/passive delete mode 100644 root/etc/e-smith/templates/etc/zabbix/zabbix_agentd.conf/00header create mode 100644 root/etc/e-smith/templates/etc/zabbix/zabbix_agentd.conf/40ActiveBuffers delete mode 100644 root/etc/e-smith/templates/etc/zabbix/zabbix_agentd.conf/40freq create mode 100644 root/etc/e-smith/templates/etc/zabbix/zabbix_agentd.conf/50ActiveServer delete mode 100644 root/etc/e-smith/templates/etc/zabbix/zabbix_agentd.conf/50active_passive diff --git a/root/etc/e-smith/db/configuration/defaults/zabbix-agent/ServerPort b/root/etc/e-smith/db/configuration/defaults/zabbix-agent/ServerPort deleted file mode 100644 index f02a806..0000000 --- a/root/etc/e-smith/db/configuration/defaults/zabbix-agent/ServerPort +++ /dev/null @@ -1 +0,0 @@ -10051 diff --git a/root/etc/e-smith/db/configuration/defaults/zabbix-agent/active b/root/etc/e-smith/db/configuration/defaults/zabbix-agent/active deleted file mode 100644 index 86981e6..0000000 --- a/root/etc/e-smith/db/configuration/defaults/zabbix-agent/active +++ /dev/null @@ -1 +0,0 @@ -enabled diff --git a/root/etc/e-smith/db/configuration/defaults/zabbix-agent/passive b/root/etc/e-smith/db/configuration/defaults/zabbix-agent/passive deleted file mode 100644 index 7a68b11..0000000 --- a/root/etc/e-smith/db/configuration/defaults/zabbix-agent/passive +++ /dev/null @@ -1 +0,0 @@ -disabled diff --git a/root/etc/e-smith/templates/etc/zabbix/zabbix_agentd.conf/00header b/root/etc/e-smith/templates/etc/zabbix/zabbix_agentd.conf/00header deleted file mode 100644 index e083849..0000000 --- a/root/etc/e-smith/templates/etc/zabbix/zabbix_agentd.conf/00header +++ /dev/null @@ -1,6 +0,0 @@ -# This is config file for zabbix_agentd -# To get more information about ZABBIX, go http://www.zabbix.com - -############ GENERAL PARAMETERS ################# - - diff --git a/root/etc/e-smith/templates/etc/zabbix/zabbix_agentd.conf/10zabbixServers b/root/etc/e-smith/templates/etc/zabbix/zabbix_agentd.conf/10zabbixServers index f61cb61..d4463fe 100644 --- a/root/etc/e-smith/templates/etc/zabbix/zabbix_agentd.conf/10zabbixServers +++ b/root/etc/e-smith/templates/etc/zabbix/zabbix_agentd.conf/10zabbixServers @@ -1,12 +1,2 @@ -# List of comma delimited IP addresses (or hostnames) of ZABBIX servers. -# No spaces allowed. First entry is used for sending active checks. -# Note that hostnames must resolve hostname->IP address and -# IP address->hostname. - Server={ (${'zabbix-agent'}{'Servers'} || '127.0.0.1'); } -# Server port for sending active checks - -ServerPort={ (${'zabbix-agent'}{'ServerPort'} || '10051'); } - - diff --git a/root/etc/e-smith/templates/etc/zabbix/zabbix_agentd.conf/20listen b/root/etc/e-smith/templates/etc/zabbix/zabbix_agentd.conf/20listen index 5a3ce59..9b4f07e 100644 --- a/root/etc/e-smith/templates/etc/zabbix/zabbix_agentd.conf/20listen +++ b/root/etc/e-smith/templates/etc/zabbix/zabbix_agentd.conf/20listen @@ -1,12 +1,11 @@ -# Listen port. Default is 10050 - ListenPort={ (${'zabbix-agent'}{'TCPPort'} || '10050'); } +{ +my $access = ${'zabbix-agent'}{'access'} || 'private'; +my $listen = '127.0.0.1'; -# IP address to bind agent -# If missing, bind to all available IPs - -#ListenIP=127.0.0.1 +$listen = $LocalIP if ($access eq 'private'); +$listen = '' if ($access eq 'public'); -# Source IP address for outgouing connections -#SourceIP= +$OUT .= "ListenIP=$listen\n" if ($listen ne ''); +} diff --git a/root/etc/e-smith/templates/etc/zabbix/zabbix_agentd.conf/30fork b/root/etc/e-smith/templates/etc/zabbix/zabbix_agentd.conf/30fork index e27e849..39c503e 100644 --- a/root/etc/e-smith/templates/etc/zabbix/zabbix_agentd.conf/30fork +++ b/root/etc/e-smith/templates/etc/zabbix/zabbix_agentd.conf/30fork @@ -1,7 +1 @@ -# Number of pre-forked instances of zabbix_agentd. -# Default value is 5 -# This parameter must be between 1 and 16 - StartAgents=5 - - diff --git a/root/etc/e-smith/templates/etc/zabbix/zabbix_agentd.conf/40ActiveBuffers b/root/etc/e-smith/templates/etc/zabbix/zabbix_agentd.conf/40ActiveBuffers new file mode 100644 index 0000000..2fefc76 --- /dev/null +++ b/root/etc/e-smith/templates/etc/zabbix/zabbix_agentd.conf/40ActiveBuffers @@ -0,0 +1,2 @@ +BufferSend=30 +BufferSize=100 diff --git a/root/etc/e-smith/templates/etc/zabbix/zabbix_agentd.conf/40freq b/root/etc/e-smith/templates/etc/zabbix/zabbix_agentd.conf/40freq deleted file mode 100644 index 9a391f5..0000000 --- a/root/etc/e-smith/templates/etc/zabbix/zabbix_agentd.conf/40freq +++ /dev/null @@ -1,20 +0,0 @@ -# How often refresh list of active checks. 2 minutes by default. - -#RefreshActiveChecks=120 - -# Buffers parameters - -# Do not keep data longer than -# N seconds in buffer. -# Number of seconds, 1-3600. - -BufferSend=30 - -# Maximum number of values -# in a buffer. The agent will -# send all collected data to -# ZABBIX Server or Proxy if -# the buffer is full. - -BufferSize=100 - diff --git a/root/etc/e-smith/templates/etc/zabbix/zabbix_agentd.conf/50ActiveServer b/root/etc/e-smith/templates/etc/zabbix/zabbix_agentd.conf/50ActiveServer new file mode 100644 index 0000000..c8d174e --- /dev/null +++ b/root/etc/e-smith/templates/etc/zabbix/zabbix_agentd.conf/50ActiveServer @@ -0,0 +1,5 @@ +{ +if ((${'zabbix-agent'}{'ServerActive'} || '') ne ''){ + $OUT .= "ServerActive=${'zabbix-agent'}{'ServerActive'}\n"; +} +} diff --git a/root/etc/e-smith/templates/etc/zabbix/zabbix_agentd.conf/50active_passive b/root/etc/e-smith/templates/etc/zabbix/zabbix_agentd.conf/50active_passive deleted file mode 100644 index 6bc1000..0000000 --- a/root/etc/e-smith/templates/etc/zabbix/zabbix_agentd.conf/50active_passive +++ /dev/null @@ -1,8 +0,0 @@ -# Disable active checks. The agent will work in passive mode listening server. - -DisableActive={ ((${'zabbix-agent'}{'active'} || 'enabled') eq 'disabled' ? '1':'0'); } - -# Disable passive checks. The agent wont listen TCP port -# Set this to 1 if you use only active checks -DisablePassive={ ((${'zabbix-agent'}{'passive'} || 'enabled') eq 'disabled' ? '1':'0'); } - diff --git a/root/etc/e-smith/templates/etc/zabbix/zabbix_agentd.conf/60remoteCommands b/root/etc/e-smith/templates/etc/zabbix/zabbix_agentd.conf/60remoteCommands index 70b8e55..218d353 100644 --- a/root/etc/e-smith/templates/etc/zabbix/zabbix_agentd.conf/60remoteCommands +++ b/root/etc/e-smith/templates/etc/zabbix/zabbix_agentd.conf/60remoteCommands @@ -1,5 +1 @@ -# Enable remote commands for ZABBIX agent. By default remote commands disabled. - EnableRemoteCommands={ (${'zabbix-agent'}{'RemoteCommands'} || 'disabled') eq 'enabled' ? '1':'0'; } - - diff --git a/root/etc/e-smith/templates/etc/zabbix/zabbix_agentd.conf/70logs b/root/etc/e-smith/templates/etc/zabbix/zabbix_agentd.conf/70logs index 9683db7..d483ea0 100644 --- a/root/etc/e-smith/templates/etc/zabbix/zabbix_agentd.conf/70logs +++ b/root/etc/e-smith/templates/etc/zabbix/zabbix_agentd.conf/70logs @@ -1,21 +1,5 @@ -# Specifies debug level -# 0 - debug is not created -# 1 - critical information -# 2 - error information -# 3 - warnings (default) -# 4 - for debugging (produces lots of information) - DebugLevel=3 - -# Name of PID file - PidFile=/var/run/zabbix/zabbix_agentd.pid - -# Name of log file. -# If not set, syslog will be used - LogFile=/var/log/zabbix/zabbix_agentd.log - -# Maximum size of log file in MB. Set to 0 to disable automatic log rotation. LogFileSize=10