aboutsummaryrefslogtreecommitdiffstats
path: root/config/zabbix2
diff options
context:
space:
mode:
authordoktornotor <notordoktor@gmail.com>2015-12-14 19:29:26 +0100
committerdoktornotor <notordoktor@gmail.com>2015-12-14 19:29:26 +0100
commit17218ec6e0f3d9e43b0a08e123aad01ea064866d (patch)
treea2a670af081ce9efe1e42f90e44c7bee25b06575 /config/zabbix2
parent1973d4067b831bfb61417ef999a3096e9c689081 (diff)
downloadpfsense-packages-17218ec6e0f3d9e43b0a08e123aad01ea064866d.tar.gz
pfsense-packages-17218ec6e0f3d9e43b0a08e123aad01ea064866d.tar.bz2
pfsense-packages-17218ec6e0f3d9e43b0a08e123aad01ea064866d.zip
Remove BS functions
Diffstat (limited to 'config/zabbix2')
-rw-r--r--config/zabbix2/zabbix2-proxy.inc43
1 files 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'])) {