From 1973d4067b831bfb61417ef999a3096e9c689081 Mon Sep 17 00:00:00 2001 From: doktornotor Date: Mon, 14 Dec 2015 19:25:07 +0100 Subject: Remove BS functions --- config/zabbix2/zabbix2-agent.inc | 44 ++++++++++------------------------------ 1 file changed, 11 insertions(+), 33 deletions(-) diff --git a/config/zabbix2/zabbix2-agent.inc b/config/zabbix2/zabbix2-agent.inc index 4aa0d5f7..1d78a6eb 100644 --- a/config/zabbix2/zabbix2-agent.inc +++ b/config/zabbix2/zabbix2-agent.inc @@ -33,33 +33,19 @@ require_once("functions.inc"); require_once("pkg-utils.inc"); require_once("globals.inc"); -function php_zabbix2_pfs_version() { - $pfs_version = substr(trim(file_get_contents("/etc/version")), 0, 3); - return $pfs_version; -} - -function php_zabbix2_pkg_base($pfs_version) { - if ($pfs_version >= 2.2) { - // pfSense 2.2 with zabbix 2.4 - $zabbix2_pkg_base = "zabbix24"; - } else { - // pfSense 2.1 with zabbix 2.2 - $zabbix2_pkg_base = "zabbix22"; - } - return $zabbix2_pkg_base; +global $zabbix2_pkg_base; +$pfs_version = substr(trim(file_get_contents("/etc/version")), 0, 3); +if ($pfs_version == "2.2") { + // pfSense 2.2 with zabbix 2.4 + $zabbix2_pkg_base = "zabbix24"; +} else { + // pfSense 2.1 with zabbix 2.2 + $zabbix2_pkg_base = "zabbix22"; } +define('ZABBIX_AGENT_BASE', '/usr/pbi/' . $zabbix2_pkg_base . '-agent-' . php_uname("m")); function php_deinstall_zabbix2_agent() { - global $config, $g; - - $pfs_version = php_zabbix2_pfs_version(); - $zabbix2_pkg_base = php_zabbix2_pkg_base($pfs_version); - - if ($pfs_version == "2.1" || $pfs_version == "2.2") { - define('ZABBIX_AGENT_BASE', '/usr/pbi/' . $zabbix2_pkg_base . '-agent-' . php_uname("m")); - } else { - define('ZABBIX_AGENT_BASE', '/usr/local'); - } + global $config, $g, $zabbix2_pkg_base; mwexec("/usr/bin/killall zabbix_agentd"); @@ -144,17 +130,9 @@ function validate_input_zabbix2_agent($post, &$input_errors) { } function sync_package_zabbix2_agent() { - global $config, $g; + global $config, $g, $zabbix2_pkg_base; conf_mount_rw(); - $pfs_version = php_zabbix2_pfs_version(); - $zabbix2_pkg_base = php_zabbix2_pkg_base($pfs_version); - - if ($pfs_version == "2.1" || $pfs_version == "2.2") { - define('ZABBIX_AGENT_BASE', '/usr/pbi/' . $zabbix2_pkg_base . '-agent-' . php_uname("m")); - } else { - define('ZABBIX_AGENT_BASE', '/usr/local'); - } // Check zabbix agent settings if (is_array($config['installedpackages']['zabbixagent'])) { -- cgit v1.2.3 From 17218ec6e0f3d9e43b0a08e123aad01ea064866d Mon Sep 17 00:00:00 2001 From: doktornotor Date: Mon, 14 Dec 2015 19:29:26 +0100 Subject: Remove BS functions --- config/zabbix2/zabbix2-proxy.inc | 43 ++++++++++------------------------------ 1 file changed, 10 insertions(+), 33 deletions(-) diff --git a/config/zabbix2/zabbix2-proxy.inc b/config/zabbix2/zabbix2-proxy.inc index aa21b817..16f2d93d 100644 --- a/config/zabbix2/zabbix2-proxy.inc +++ b/config/zabbix2/zabbix2-proxy.inc @@ -33,33 +33,18 @@ require_once("functions.inc"); require_once("pkg-utils.inc"); require_once("globals.inc"); -function php_zabbix2_pfs_version() { - $pfs_version = substr(trim(file_get_contents("/etc/version")), 0, 3); - return $pfs_version; -} - -function php_zabbix2_pkg_base($pfs_version) { - if ($pfs_version >= 2.2) { - // pfSense 2.2 with zabbix 2.4 - $zabbix2_pkg_base = "zabbix24"; - } else { - // pfSense 2.1 with zabbix 2.2 - $zabbix2_pkg_base = "zabbix22"; - } - return $zabbix2_pkg_base; +global $zabbix2_pkg_base; +$pfs_version = substr(trim(file_get_contents("/etc/version")), 0, 3); +if ($pfs_version == "2.2") { + $zabbix2_pkg_base = "zabbix24"; +} else { + // pfSense 2.1 with zabbix 2.2 + $zabbix2_pkg_base = "zabbix22"; } +define('ZABBIX_PROXY_BASE', '/usr/pbi/' . $zabbix2_pkg_base . '-proxy-' . php_uname("m")); function php_deinstall_zabbix2_proxy() { - global $config, $g; - - $pfs_version = php_zabbix2_pfs_version(); - $zabbix2_pkg_base = php_zabbix2_pkg_base($pfs_version); - - if ($pfs_version == "2.1" || $pfs_version == "2.2") { - define('ZABBIX_PROXY_BASE', '/usr/pbi/' . $zabbix2_pkg_base . '-proxy-' . php_uname("m")); - } else { - define('ZABBIX_PROXY_BASE', '/usr/local'); - } + global $config, $g, $zabbix2_pkg_base; exec("/usr/bin/killall zabbix_proxy"); unlink_if_exists(ZABBIX_PROXY_BASE . "/etc/" . $zabbix2_pkg_base . "/zabbix_proxy.conf"); @@ -98,17 +83,9 @@ function validate_input_zabbix2_proxy($post, &$input_errors) { } function sync_package_zabbix2_proxy() { - global $config, $g; + global $config, $g, $zabbix2_pkg_base; conf_mount_rw(); - $pfs_version = php_zabbix2_pfs_version(); - $zabbix2_pkg_base = php_zabbix2_pkg_base($pfs_version); - - if ($pfs_version == "2.1" || $pfs_version == "2.2") { - define('ZABBIX_PROXY_BASE', '/usr/pbi/' . $zabbix2_pkg_base . '-proxy-' . php_uname("m")); - } else { - define('ZABBIX_PROXY_BASE', '/usr/local'); - } // Check zabbix proxy config if (is_array($config['installedpackages']['zabbixproxy'])) { -- cgit v1.2.3 From 58db93f89a96726158b4358cc775fff598d35ae7 Mon Sep 17 00:00:00 2001 From: doktornotor Date: Mon, 14 Dec 2015 19:31:37 +0100 Subject: Bump zabbix2-agent/zabbix2-proxy package version --- pkg_config.10.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg_config.10.xml b/pkg_config.10.xml index b25e68c9..3f567932 100644 --- a/pkg_config.10.xml +++ b/pkg_config.10.xml @@ -1637,7 +1637,7 @@ http://www.zabbix.com/product.php Services https://packages.pfsense.org/packages/config/zabbix2/zabbix2-agent.xml - 0.8.5 + 0.8.6 BETA 2.2 zabbix2-agent.xml @@ -1662,7 +1662,7 @@ http://www.zabbix.com/product.php Services https://packages.pfsense.org/packages/config/zabbix2/zabbix2-proxy.xml - 0.8.5 + 0.8.6 BETA 2.2 zabbix2-proxy.xml -- cgit v1.2.3 From c88682e2fef673f8e1c3956ea59537e7bc7a5106 Mon Sep 17 00:00:00 2001 From: doktornotor Date: Mon, 14 Dec 2015 19:32:20 +0100 Subject: Bump zabbix2-agent/zabbix2-proxy package version --- pkg_config.8.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg_config.8.xml b/pkg_config.8.xml index 743ade9c..8f4b28e7 100644 --- a/pkg_config.8.xml +++ b/pkg_config.8.xml @@ -1643,7 +1643,7 @@ Monitoring agent. Services https://packages.pfsense.org/packages/config/zabbix2/zabbix2-agent.xml - zabbix2-agent-2.2.5 pkg v0.8.5 + zabbix2-agent-2.2.5 pkg v0.8.6 BETA 2.1 zabbix2-agent.xml @@ -1661,7 +1661,7 @@ Monitoring agent proxy. Services https://packages.pfsense.org/packages/config/zabbix2/zabbix2-proxy.xml - zabbix2-proxy-2.2.5 pkg v0.8.5 + zabbix2-proxy-2.2.5 pkg v0.8.6 BETA 2.1 zabbix2-proxy.xml -- cgit v1.2.3