aboutsummaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
Diffstat (limited to 'config')
-rw-r--r--config/zabbix-agent/zabbix-agent.xml50
1 files 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 @@
<required>true</required>
<description>Listen port for sending active check (generally 10050)</description>
</field>
+ <field>
+ <fielddescr>Refresh Active Checks</fielddescr>
+ <fieldname>refreshactchecks</fieldname>
+ <value>120</value>
+ <type>input</type>
+ <size>60</size>
+ <required>false</required>
+ <description>The agent will refresh list of active checks once per 120 (default) seconds.</description>
+ </field>
+ <field>
+ <fielddescr>Timeout</fielddescr>
+ <fieldname>timeout</fieldname>
+ <value>3</value>
+ <type>input</type>
+ <size>60</size>
+ <required>true</required>
+ <description>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!</description>
+ </field>
+ <field>
+ <fielddescr>User Parameters</fielddescr>
+ <fieldname>userparams</fieldname>
+ <value></value>
+ <type>textarea</type>
+ <rows>5</rows>
+ <cols>50</cols>
+ <required>false</required>
+ <description>User-defined parameter to monitor. There can be several user-defined parameters. Value has form, example: UserParameter=users,who|wc -l</description>
+ </field>
</fields>
<custom_php_install_command>
<![CDATA[
@@ -92,12 +120,11 @@
$stop = "echo \"Stopping Zabbix Agent\"\n";
$stop .= "/usr/bin/killall zabbix_agentd\n";
-
/* write out rc.d start/stop file */
write_rcfile(array(
"file" => "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.';
+ }
]]>
</custom_php_validation_command>
<custom_add_php_command></custom_add_php_command>
@@ -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();
]]>
</custom_php_resync_config_command>
- <custom_php_resync_command></custom_php_resync_command>
<custom_php_deinstall_command>
<![CDATA[
exec("/usr/bin/killall zabbix_agentd");
@@ -164,3 +205,4 @@
]]>
</custom_php_deinstall_command>
</packagegui>
+