diff options
author | jim-p <jimp@pfsense.org> | 2012-07-05 14:08:43 -0400 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2012-07-05 14:08:43 -0400 |
commit | 5646e58426ba1c9c372e1b2ade450c6a70d5cd66 (patch) | |
tree | 9ddb5293e3c24c6f6517934b80b564653b2e7edc | |
parent | 7e69acd64c9d39de18d8edd60661e5bbda3c4764 (diff) | |
download | pfsense-packages-5646e58426ba1c9c372e1b2ade450c6a70d5cd66.tar.gz pfsense-packages-5646e58426ba1c9c372e1b2ade450c6a70d5cd66.tar.bz2 pfsense-packages-5646e58426ba1c9c372e1b2ade450c6a70d5cd66.zip |
Zabbix proxy fixes for 2.1
-rw-r--r-- | config/zabbix-proxy/zabbix-proxy.xml | 34 |
1 files changed, 27 insertions, 7 deletions
diff --git a/config/zabbix-proxy/zabbix-proxy.xml b/config/zabbix-proxy/zabbix-proxy.xml index 551c42b5..c5e810c4 100644 --- a/config/zabbix-proxy/zabbix-proxy.xml +++ b/config/zabbix-proxy/zabbix-proxy.xml @@ -75,6 +75,16 @@ <![CDATA[ global $config, $g; + $pfs_version = substr(trim(file_get_contents("/etc/version")),0,3); + switch ($pfs_version) { + case "1.2": + case "2.0": + define('ZABBIX_PROXY_BASE', '/usr/local'); + break; + default: + define('ZABBIX_PROXY_BASE', '/usr/pbi/zabbix-proxy-' . php_uname("m")); + } + mwexec("mkdir -p /var/log/zabbix/"); mwexec("mkdir -p /var/run/zabbix/"); mwexec("mkdir -p /var/db/zabbix/"); @@ -82,12 +92,12 @@ conf_mount_rw(); /* create a few directories and ensure the sample files are in place */ - exec("/bin/mkdir -p /usr/local/etc/zabbix"); + exec("/bin/mkdir -p " . ZABBIX_PROXY_BASE . "/etc/zabbix"); exec("/bin/mkdir -p /var/log/zabbix"); exec("/bin/mkdir -p /var/run/zabbix"); exec("/bin/mkdir -p /var/db/zabbix"); - exec("/bin/rm -f /usr/local/etc/rc.d/zabbix_proxy"); + exec("/bin/rm -f " . ZABBIX_PROXY_BASE . "/etc/rc.d/zabbix_proxy"); $start = "/bin/mkdir -p /var/log/zabbix\n"; $start .= "/usr/sbin/chown -R zabbix:zabbix /var/log/zabbix\n"; @@ -101,7 +111,7 @@ $start .= "echo \"Starting Zabbix Proxy\"...\n"; /* start zabbix proxy */ - $start .= "/usr/local/sbin/zabbix_proxy\n"; + $start .= ZABBIX_PROXY_BASE . "/sbin/zabbix_proxy\n"; $stop = "echo \"Stopping Zabbix Proxy\"\n"; $stop .= "kill `cat /var/run/zabbix/zabbix_proxy.pid`\n"; @@ -139,8 +149,18 @@ <custom_php_resync_config_command> <![CDATA[ conf_mount_rw(); - global $config; - global $g; + global $config, $g; + + $pfs_version = substr(trim(file_get_contents("/etc/version")),0,3); + switch ($pfs_version) { + case "1.2": + case "2.0": + define('ZABBIX_PROXY_BASE', '/usr/local'); + break; + default: + define('ZABBIX_PROXY_BASE', '/usr/pbi/zabbix-proxy-' . php_uname("m")); + } + $zabbixproxy_config = $config['installedpackages']['zabbixproxy']['config'][0]; $Server=$zabbixproxy_config['server']; @@ -166,7 +186,7 @@ $conf .= "Fping6Location=/usr/local/sbin/fping6\n"; $conf .= "ProxyMode=$Mode\n"; - file_put_contents("/usr/local/etc/zabbix/zabbix_proxy.conf", $conf); + file_put_contents(ZABBIX_PROXY_BASE . "/etc/zabbix/zabbix_proxy.conf", $conf); $want_sysctls = array( 'kern.ipc.shmall' => '2097152', @@ -219,7 +239,7 @@ <![CDATA[ exec("kill `cat /var/run/zabbix/zabbix_proxy.pid`"); - exec("/bin/rm /usr/local/etc/rc.d/zabbix_proxy.sh"); + exec("/bin/rm " . ZABBIX_PROXY_BASE . "/etc/rc.d/zabbix_proxy.sh"); exec("/bin/rm -r /var/log/zabbix/"); exec("/bin/rm -r /var/run/zabbix/"); |