From df3bd743e2cfa5026da65fe5b2ee5222f9729da4 Mon Sep 17 00:00:00 2001 From: jim-p Date: Thu, 5 Jul 2012 13:31:28 -0400 Subject: Zabbix agent fixes for 2.1 & cleanup. --- config/zabbix-agent/zabbix-agent.xml | 448 ++++++++++++++++++----------------- pkg_config.8.xml | 2 +- pkg_config.8.xml.amd64 | 2 +- 3 files changed, 235 insertions(+), 217 deletions(-) diff --git a/config/zabbix-agent/zabbix-agent.xml b/config/zabbix-agent/zabbix-agent.xml index 9714e6ea..ce0e2339 100644 --- a/config/zabbix-agent/zabbix-agent.xml +++ b/config/zabbix-agent/zabbix-agent.xml @@ -1,158 +1,168 @@ - zabbixagent - Services: Zabbix Agent - Monitoring - 1.0 - Zabbix Agent has been created/modified. - Zabbix Agent has been deleted. - /usr/local/etc/rc.d/zabbix_agentd.sh restart - - Zabbix Agent - Setup Zabbix Agent specific settings -
Services
- /pkg_edit.php?xml=zabbix-agent.xml&id=0 -
- - zabbix_agentd - zabbix_agentd.sh - zabbix_agentd - Zabbix Agent runs on a host being monitored. The agent provides host's performance and availability information for Zabbix Server. - - - - Settings - /pkg_edit.php?xml=zabbix-agent.xml&id=0 - - - - - - Server - server - List of comma delimited IP addresses (or hostnames) of ZABBIX servers - 127.0.0.1 - input - 60 - true - - - Server Port - serverport - Server port for sending active check (generally 10051) - 10051 - input - 60 - true - - - Hostname - hostname - Unique hostname. Required for active checks and must match hostname as configured on the Zabbix server (case sensitive). - localhost - input - 60 - true - - - Listen IP - listenip - 0.0.0.0 - input - 60 - true - Listen IP for connections from the server (generally 0.0.0.0 for all interfaces) - - - Listen Port - listenport - 10050 - input - 60 - true - Listen port for connections from the server (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! - - - Disable active checks - disableactive - checkbox - The agent will work only in passive mode listening for server. (generally net set) - - - Disable passive checks - disablepassive - checkbox - The agent will not listen on any TCP port. Only active checks will be processed. (generally not set) - - - User Parameters - userparams - base64 - - 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 - - + zabbixagent + Services: Zabbix Agent + Monitoring + 1.1 + Zabbix Agent has been created/modified. + Zabbix Agent has been deleted. + /usr/local/etc/rc.d/zabbix_agentd.sh restart + + Zabbix Agent + Setup Zabbix Agent specific settings +
Services
+ /pkg_edit.php?xml=zabbix-agent.xml&id=0 +
+ + zabbix_agentd + zabbix_agentd.sh + zabbix_agentd + Zabbix Agent runs on a host being monitored. The agent provides host's performance and availability information for Zabbix Server. + + + + Settings + /pkg_edit.php?xml=zabbix-agent.xml&id=0 + + + + + + Server + server + List of comma delimited IP addresses (or hostnames) of ZABBIX servers + 127.0.0.1 + input + 60 + true + + + Server Port + serverport + Server port for sending active check (generally 10051) + 10051 + input + 60 + true + + + Hostname + hostname + Unique hostname. Required for active checks and must match hostname as configured on the Zabbix server (case sensitive). + localhost + input + 60 + true + + + Listen IP + listenip + 0.0.0.0 + input + 60 + true + Listen IP for connections from the server (generally 0.0.0.0 for all interfaces) + + + Listen Port + listenport + 10050 + input + 60 + true + Listen port for connections from the server (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! + + + Disable active checks + disableactive + checkbox + The agent will work only in passive mode listening for server. (generally net set) + + + Disable passive checks + disablepassive + checkbox + The agent will not listen on any TCP port. Only active checks will be processed. (generally not set) + + + User Parameters + userparams + base64 + + 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\n" . "sleep 5\n" . "{$start}", - "stop" => "$stop" - ) - ); + /* start zabbix agent */ + $start .= ZABBIX_AGENT_BASE . "/sbin/zabbix_agentd\n"; - conf_mount_ro(); + $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\n" . "sleep 5\n" . "{$start}", + "stop" => "$stop" + ) + ); + + conf_mount_ro(); ]]> @@ -160,86 +170,94 @@ + global $_POST; + $pfs_version = substr(trim(file_get_contents("/etc/version")),0,3); + switch ($pfs_version) { + case "1.2": + case "2.0": + define('ZABBIX_AGENT_BASE','/usr/local'); + break; + default: + define('ZABBIX_AGENT_BASE', '/usr/pbi/zabbix-agent-' . php_uname("m")); + } + + $ListenIP=$_POST['listenip']; + if (!preg_match("/^(?:\d{1,3}\.){3}\d{1,3}$/", $ListenIP)) { + $input_errors[]='Listen IP is not ip-adress.'; + } + + $ListenPort=$_POST['listenport']; + if (!preg_match("/^\d+$/", $ListenPort)) { + $input_errors[]='Listen Port is not numeric.'; + } + + $ServerPort=$_POST['serverport']; + 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.'; + } + ]]> - + - -
- + \ No newline at end of file diff --git a/pkg_config.8.xml b/pkg_config.8.xml index a6b9e4c0..bcac2874 100644 --- a/pkg_config.8.xml +++ b/pkg_config.8.xml @@ -1284,7 +1284,7 @@ Monitoring agent. Services http://www.pfsense.com/packages/config/zabbix-agent/zabbix-agent.xml - 1.8.10,2 + 1.8.10,2 pkg v1.1 FINAL 1.2.3 zabbix-agent.xml diff --git a/pkg_config.8.xml.amd64 b/pkg_config.8.xml.amd64 index befcf9b8..27070177 100644 --- a/pkg_config.8.xml.amd64 +++ b/pkg_config.8.xml.amd64 @@ -1271,7 +1271,7 @@ Monitoring agent. Services http://www.pfsense.com/packages/config/zabbix-agent/zabbix-agent.xml - 1.8.10,2 + 1.8.10,2 pkg v1.1 FINAL 1.2.3 zabbix-agent.xml -- cgit v1.2.3