aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDanilo G. Baio (dbaio) <dbaio@bsd.com.br>2013-01-26 19:17:56 -0200
committerDanilo G. Baio (dbaio) <dbaio@bsd.com.br>2013-01-26 19:17:56 -0200
commit80e506c7404cae861835a38aca4cf25d02aada69 (patch)
tree2fae37776f9d767aae2272898129b59a6d4562fb
parente4c607906898d259f5e2163cb9e9303c7a83c436 (diff)
downloadpfsense-packages-80e506c7404cae861835a38aca4cf25d02aada69.tar.gz
pfsense-packages-80e506c7404cae861835a38aca4cf25d02aada69.tar.bz2
pfsense-packages-80e506c7404cae861835a38aca4cf25d02aada69.zip
Fix deinstall command and bump version.
-rw-r--r--config/zabbix2-agent/zabbix2-agent.xml24
-rw-r--r--config/zabbix2-proxy/zabbix2-proxy.xml27
-rw-r--r--pkg_config.8.xml4
-rw-r--r--pkg_config.8.xml.amd644
4 files changed, 48 insertions, 11 deletions
diff --git a/config/zabbix2-agent/zabbix2-agent.xml b/config/zabbix2-agent/zabbix2-agent.xml
index 4394b5ef..3c86763c 100644
--- a/config/zabbix2-agent/zabbix2-agent.xml
+++ b/config/zabbix2-agent/zabbix2-agent.xml
@@ -3,7 +3,7 @@
<name>zabbixagent</name>
<title>Services: Zabbix-2 Agent</title>
<category>Monitoring</category>
- <version>0.4</version>
+ <version>0.5</version>
<addedit_string>Zabbix Agent has been created/modified.</addedit_string>
<delete_string>Zabbix Agent has been deleted.</delete_string>
<restart_command>/usr/local/etc/rc.d/zabbix2_agentd.sh restart</restart_command>
@@ -226,12 +226,30 @@
</custom_php_resync_config_command>
<custom_php_deinstall_command>
<![CDATA[
+ $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');
+ define('ZABBIX_AGENT_BASE','/usr/local');
+ break;
+ default:
+ define('ZABBIX_PROXY_BASE', '/usr/pbi/zabbix2-proxy-' . php_uname("m"));
+ define('ZABBIX_AGENT_BASE', '/usr/pbi/zabbix2-agent-' . php_uname("m"));
+ }
+
exec("/usr/bin/killall zabbix_agentd");
exec("/bin/rm " . ZABBIX_AGENT_BASE . "/etc/rc.d/zabbix2_agentd.sh");
- exec("/bin/rm -r /var/log/zabbix2/");
- exec("/bin/rm -r /var/run/zabbix2/");
+ // Check if Zabbix-2 Proxy exists
+ if(file_exists(ZABBIX_PROXY_BASE . "/etc/zabbix2/zabbix_proxy.conf")) {
+ exec("/bin/rm /var/log/zabbix2/zabbix2_agentd.log");
+ exec("/bin/rm /var/run/zabbix2/zabbix2_agentd.pid");
+ } else {
+ exec("/bin/rm -r /var/log/zabbix2/");
+ exec("/bin/rm -r /var/run/zabbix2/");
+ }
]]>
</custom_php_deinstall_command>
</packagegui>
diff --git a/config/zabbix2-proxy/zabbix2-proxy.xml b/config/zabbix2-proxy/zabbix2-proxy.xml
index 7575fbc9..f4d05173 100644
--- a/config/zabbix2-proxy/zabbix2-proxy.xml
+++ b/config/zabbix2-proxy/zabbix2-proxy.xml
@@ -3,7 +3,7 @@
<name>zabbixproxy</name>
<title>Services: Zabbix-2 Proxy</title>
<category>Monitoring</category>
- <version>0.3</version>
+ <version>0.5</version>
<addedit_string>Zabbix Proxy has been created/modified.</addedit_string>
<delete_string>Zabbix Proxy has been deleted.</delete_string>
<restart_command>/usr/local/etc/rc.d/zabbix2_proxy.sh restart</restart_command>
@@ -242,12 +242,31 @@
</custom_php_resync_config_command>
<custom_php_deinstall_command>
<![CDATA[
- exec("kill `cat /var/run/zabbix2/zabbix2_proxy.pid`");
+ $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');
+ define('ZABBIX_PROXY_BASE', '/usr/local');
+ break;
+ default:
+ define('ZABBIX_AGENT_BASE', '/usr/pbi/zabbix2-agent-' . php_uname("m"));
+ define('ZABBIX_PROXY_BASE', '/usr/pbi/zabbix2-proxy-' . php_uname("m"));
+ }
+
+ exec("/usr/bin/killall zabbix_proxy");
exec("/bin/rm " . ZABBIX_PROXY_BASE . "/etc/rc.d/zabbix2_proxy.sh");
- exec("/bin/rm -r /var/log/zabbix2/");
- exec("/bin/rm -r /var/run/zabbix2/");
+ // Check if Zabbix-2 Agent exists
+ if(file_exists(ZABBIX_AGENT_BASE . "/etc/zabbix2/zabbix_agentd.conf")) {
+ exec("/bin/rm /var/log/zabbix2/zabbix_proxy.log");
+ exec("/bin/rm /var/run/zabbix2/zabbix2_proxy.pid");
+ } else {
+ exec("/bin/rm -r /var/log/zabbix2/");
+ exec("/bin/rm -r /var/run/zabbix2/");
+ }
+
exec("/bin/rm -r /var/db/zabbix2/");
]]>
</custom_php_deinstall_command>
diff --git a/pkg_config.8.xml b/pkg_config.8.xml
index 20e89768..5017630b 100644
--- a/pkg_config.8.xml
+++ b/pkg_config.8.xml
@@ -1793,7 +1793,7 @@
<descr>Monitoring agent.</descr>
<category>Services</category>
<config_file>http://www.pfsense.org/packages/config/zabbix2-agent/zabbix2-agent.xml</config_file>
- <version>zabbix2-agent-2.0.4 pkg v0.4</version>
+ <version>zabbix2-agent-2.0.4 pkg v0.5</version>
<status>BETA</status>
<required_version>2.0</required_version>
<configurationfile>zabbix2-agent.xml</configurationfile>
@@ -1812,7 +1812,7 @@
<descr>Monitoring agent proxy.</descr>
<category>Services</category>
<config_file>http://www.pfsense.org/packages/config/zabbix2-proxy/zabbix2-proxy.xml</config_file>
- <version>zabbix2-proxy-2.0.4 pkg v0.3</version>
+ <version>zabbix2-proxy-2.0.4 pkg v0.5</version>
<status>BETA</status>
<required_version>2.0</required_version>
<configurationfile>zabbix2-proxy.xml</configurationfile>
diff --git a/pkg_config.8.xml.amd64 b/pkg_config.8.xml.amd64
index 5c18ebdc..dbcc0081 100644
--- a/pkg_config.8.xml.amd64
+++ b/pkg_config.8.xml.amd64
@@ -1780,7 +1780,7 @@
<descr>Monitoring agent.</descr>
<category>Services</category>
<config_file>http://www.pfsense.org/packages/config/zabbix2-agent/zabbix2-agent.xml</config_file>
- <version>zabbix2-agent-2.0.4 pkg v0.3</version>
+ <version>zabbix2-agent-2.0.4 pkg v0.5</version>
<status>BETA</status>
<required_version>2.0</required_version>
<configurationfile>zabbix2-agent.xml</configurationfile>
@@ -1799,7 +1799,7 @@
<descr>Monitoring agent proxy.</descr>
<category>Services</category>
<config_file>http://www.pfsense.org/packages/config/zabbix2-proxy/zabbix2-proxy.xml</config_file>
- <version>zabbix2-proxy-2.0.4 pkg v0.4</version>
+ <version>zabbix2-proxy-2.0.4 pkg v0.5</version>
<status>BETA</status>
<required_version>2.0</required_version>
<configurationfile>zabbix2-proxy.xml</configurationfile>