From cdec7fda104b1641e8bccc4e4ac362d7f8a6869a Mon Sep 17 00:00:00 2001 From: jim-p Date: Fri, 2 Jul 2010 10:29:18 -0400 Subject: Contributed changes from Maxim Strukov. Fixes ticket #711 --- config/zabbix-agent/zabbix-agent.xml | 50 +++++++++++++++++++++++++++++++++--- 1 file changed, 46 insertions(+), 4 deletions(-) diff --git a/config/zabbix-agent/zabbix-agent.xml b/config/zabbix-agent/zabbix-agent.xml index 8a0e57cc..667b0051 100644 --- a/config/zabbix-agent/zabbix-agent.xml +++ b/config/zabbix-agent/zabbix-agent.xml @@ -62,6 +62,34 @@ true Listen port for sending active check (generally 10050) + + Refresh Active Checks + refreshactchecks + 120 + input + 60 + false + The agent will refresh list of active checks once per 120 (default) seconds. + + + Timeout + timeout + 3 + input + 60 + true + Timeout (default 3). Do not spend more that Timeout seconds on getting requested value (1-255). The agent does not kill timeouted User Parameters processes! + + + User Parameters + userparams + + textarea + 5 + 50 + false + User-defined parameter to monitor. There can be several user-defined parameters. Value has form, example: UserParameter=users,who|wc -l + "zabbix_agentd.sh", "start" => "{$start}", - "restart" => "$stop\nsleep 5\n{$start}", + "restart" => "$stop\n" . "sleep 5\n" . "{$start}", "stop" => "$stop" ) ); @@ -121,6 +148,16 @@ if (!preg_match("/^\d+$/", $ServerPort)) { $input_errors[]='Server Port is not numeric.'; } + + $RefreshActiveChecks=$_POST['refreshactchecks']; + if (!preg_match("/^\d+$/", $RefreshActiveChecks)) { + $input_errors[]='Refresh Active Checks is not numeric.'; + } + + $Timeout=$_POST['timeout']; + if (!preg_match("/^\d+$/", $Timeout)) { + $input_errors[]='Timeout is not numeric.'; + } ]]> @@ -134,6 +171,9 @@ $ServerPort=$config['installedpackages']['zabbixagent']['config'][0]['serverport']; $Hostname=$config['installedpackages']['zabbixagent']['config'][0]['hostname']; $ListenPort=$config['installedpackages']['zabbixagent']['config'][0]['listenport']; + $RefreshActChecks=$config['installedpackages']['zabbixagent']['config'][0]['refreshactchecks']; + $Timeout=$config['installedpackages']['zabbixagent']['config'][0]['timeout']; + $UserParams=$config['installedpackages']['zabbixagent']['config'][0]['userparams']; $conf = "Server=$Server\n"; $conf .= "ServerPort=$ServerPort\n"; @@ -141,18 +181,19 @@ $conf .= "ListenIP=0.0.0.0\n"; $conf .= "ListenPort=$ListenPort\n"; $conf .= "StartAgents=5\n"; + $conf .= "RefreshActiveChecks=$RefreshActChecks\n"; $conf .= "DebugLevel=3\n"; $conf .= "PidFile=/var/run/zabbix/zabbix_agentd.pid\n"; $conf .= "LogFile=/var/log/zabbix/zabbix_agentd.log\n"; $conf .= "LogFileSize=1\n"; - $conf .= "Timeout=3\n"; + $conf .= "Timeout=$Timeout\n"; + $conf .= "$UserParams\n"; file_put_contents("/usr/local/etc/zabbix/zabbix_agentd.conf", $conf); conf_mount_ro(); ]]> - + -- cgit v1.2.3