aboutsummaryrefslogtreecommitdiffstats
path: root/config/zabbix-agent
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2010-07-02 10:29:18 -0400
committerjim-p <jimp@pfsense.org>2010-07-02 10:29:18 -0400
commitcdec7fda104b1641e8bccc4e4ac362d7f8a6869a (patch)
tree3590f39497f598ebe18f1a465eb19cc04ccd6e78 /config/zabbix-agent
parented371abadcf98d42e136fc801918cc82b22d73cf (diff)
downloadpfsense-packages-cdec7fda104b1641e8bccc4e4ac362d7f8a6869a.tar.gz
pfsense-packages-cdec7fda104b1641e8bccc4e4ac362d7f8a6869a.tar.bz2
pfsense-packages-cdec7fda104b1641e8bccc4e4ac362d7f8a6869a.zip
Contributed changes from Maxim Strukov. Fixes ticket #711
Diffstat (limited to 'config/zabbix-agent')
-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>
+