diff options
-rw-r--r-- | config/zabbix2/zabbix2.inc | 25 | ||||
-rw-r--r-- | pkg_config.8.xml | 2 | ||||
-rw-r--r-- | pkg_config.8.xml.amd64 | 4 |
3 files changed, 15 insertions, 16 deletions
diff --git a/config/zabbix2/zabbix2.inc b/config/zabbix2/zabbix2.inc index 1de2a34b..af5b3545 100644 --- a/config/zabbix2/zabbix2.inc +++ b/config/zabbix2/zabbix2.inc @@ -185,31 +185,30 @@ EOF; if (is_array($config['installedpackages']['zabbixagent'])){ $zbagent_config = $config['installedpackages']['zabbixagent']['config'][0]; if ($zbagent_config['agentenabled']=="on"){ - $RefreshActChecks=($zbagent_config['refreshactchecks'] ? $zbagent_config['refreshactchecks'] : 120); - $BufferSend=($zbagent_config['buffersend'] ? $zbagent_config['buffersend'] : 5); - $BufferSize=($zbagent_config['buffersize'] ? $zbagent_config['buffersize'] : 100); - $StartAgents=($zbagent_config['startagents'] != '' ? $zbagent_config['startagents'] : 3); + $RefreshActChecks=(preg_match("/(\d+)/",$zbagent_config['refreshactchecks'],$matches)? $matches[1] : "120"); + $BufferSend=(preg_match("/(\d+)/",$zbagent_config['buffersend'],$matches)? $matches[1] : "5" ); + $BufferSize=(preg_match("/(\d+)/",$zbagent_config['buffersize'],$matches)? $matches[1] : "100"); + $StartAgents=(preg_match("/(\d+)/",$zbagent_config['startagents'],$matches)? $matches[1] :"3" ); $UserParams=base64_decode($zbagent_config['userparams']); $zbagent_conf_file = <<< EOF Server={$zbagent_config['server']} -ServerActive={$zbagent_config['serveractive']}] +ServerActive={$zbagent_config['serveractive']} Hostname={$zbagent_config['hostname']} ListenIP={$zbagent_config['listenip']} ListenPort={$zbagent_config['listenport']} -RefreshActiveChecks={$StartAgents}; -DebugLevel=3\n"; -PidFile=/var/run/zabbix2/zabbix2_agentd.pid\n"; -LogFile=/var/log/zabbix2/zabbix2_agentd.log\n"; -LogFileSize=1\n"; +RefreshActiveChecks={$RefreshActChecks} +DebugLevel=3 +PidFile=/var/run/zabbix2/zabbix2_agentd.pid +LogFile=/var/log/zabbix2/zabbix2_agentd.log +LogFileSize=1 Timeout={$zbagent_config['timeout']} BufferSend={$BufferSend} BufferSize={$BufferSize} -StartAgents={$zbagent_config['server']} -$UserParams\n"; +StartAgents={$StartAgents} +{$UserParams} EOF; - file_put_contents(ZABBIX_AGENT_BASE . "/etc/zabbix2/zabbix_agentd.conf", strtr($zbagent_conf_file, array("\r" => ""))); } } diff --git a/pkg_config.8.xml b/pkg_config.8.xml index 0912a439..6bc556d3 100644 --- a/pkg_config.8.xml +++ b/pkg_config.8.xml @@ -1798,7 +1798,7 @@ <descr>Monitoring agent.</descr> <category>Services</category> <config_file>http://www.pfsense.org/packages/config/zabbix2/zabbix2-agent.xml</config_file> - <version>zabbix2-agent-2.0.4 pkg v0.6_1</version> + <version>zabbix2-agent-2.0.4 pkg v0.6_2</version> <status>BETA</status> <required_version>2.0</required_version> <configurationfile>zabbix2-agent.xml</configurationfile> diff --git a/pkg_config.8.xml.amd64 b/pkg_config.8.xml.amd64 index c5573b2c..cb577350 100644 --- a/pkg_config.8.xml.amd64 +++ b/pkg_config.8.xml.amd64 @@ -1785,7 +1785,7 @@ <descr>Monitoring agent.</descr> <category>Services</category> <config_file>http://www.pfsense.org/packages/config/zabbix2/zabbix2-agent.xml</config_file> - <version>zabbix2-agent-2.0.4 pkg v0.6</version> + <version>zabbix2-agent-2.0.4 pkg v0.6_2</version> <status>BETA</status> <required_version>2.0</required_version> <configurationfile>zabbix2-agent.xml</configurationfile> @@ -1804,7 +1804,7 @@ <descr>Monitoring agent proxy.</descr> <category>Services</category> <config_file>http://www.pfsense.org/packages/config/zabbix2/zabbix2-proxy.xml</config_file> - <version>zabbix2-proxy-2.0.4 pkg v0.5</version> + <version>zabbix2-proxy-2.0.4 pkg v0.6_1</version> <status>BETA</status> <required_version>2.0</required_version> <configurationfile>zabbix2-proxy.xml</configurationfile> |