From 0649759c5ec61130ee1605834cd5f3a7ec24e3d9 Mon Sep 17 00:00:00 2001 From: "Danilo G. Baio (dbaio)" Date: Fri, 15 May 2015 14:32:41 -0300 Subject: zabbix_lts - drop restart_command from xml files --- config/zabbix-agent-lts/zabbix-agent-lts.xml | 1 - config/zabbix-proxy-lts/zabbix-proxy-lts.xml | 1 - 2 files changed, 2 deletions(-) diff --git a/config/zabbix-agent-lts/zabbix-agent-lts.xml b/config/zabbix-agent-lts/zabbix-agent-lts.xml index b24e2aa2..94a98596 100644 --- a/config/zabbix-agent-lts/zabbix-agent-lts.xml +++ b/config/zabbix-agent-lts/zabbix-agent-lts.xml @@ -45,7 +45,6 @@ /usr/local/pkg/zabbix-agent-lts.inc Zabbix Agent LTS has been created/modified. Zabbix Agent LTS has been deleted. - /usr/local/etc/rc.d/zabbix_agentd_lts.sh restart https://packages.pfsense.org/packages/config/zabbix-agent-lts/zabbix-agent-lts.inc /usr/local/pkg/ diff --git a/config/zabbix-proxy-lts/zabbix-proxy-lts.xml b/config/zabbix-proxy-lts/zabbix-proxy-lts.xml index 089ccb0a..440c41b1 100644 --- a/config/zabbix-proxy-lts/zabbix-proxy-lts.xml +++ b/config/zabbix-proxy-lts/zabbix-proxy-lts.xml @@ -45,7 +45,6 @@ /usr/local/pkg/zabbix-proxy-lts.inc Zabbix Proxy has been created/modified. Zabbix Proxy has been deleted. - /usr/local/etc/rc.d/zabbix_proxy_lts.sh restart https://packages.pfsense.org/packages/config/zabbix-proxy-lts/zabbix-proxy-lts.inc /usr/local/pkg/ -- cgit v1.2.3 From f9326e8846142610efd6e3e617685834e607e405 Mon Sep 17 00:00:00 2001 From: "Danilo G. Baio (dbaio)" Date: Fri, 15 May 2015 16:00:16 -0300 Subject: zabbix_proxy_lts - check if zabbix_proxy is still running after execution of killall command --- config/zabbix-proxy-lts/zabbix-proxy-lts.inc | 59 ++++++++++++++++------------ 1 file changed, 34 insertions(+), 25 deletions(-) diff --git a/config/zabbix-proxy-lts/zabbix-proxy-lts.inc b/config/zabbix-proxy-lts/zabbix-proxy-lts.inc index 3fc71a84..bc9864f4 100644 --- a/config/zabbix-proxy-lts/zabbix-proxy-lts.inc +++ b/config/zabbix-proxy-lts/zabbix-proxy-lts.inc @@ -174,38 +174,47 @@ EOF; exec("/bin/mkdir -p " . ZABBIX_PROXY_BASE . "/etc/zabbix22"); $dir_checks = <<< EOF -if [ ! -d /var/log/zabbix-proxy-lts ] - then - /bin/mkdir -p /var/log/zabbix-proxy-lts - /usr/sbin/chmod 755 /var/log/zabbix-proxy-lts - fi -/usr/sbin/chown -R zabbix:zabbix /var/log/zabbix-proxy-lts - -if [ ! -d /var/run/zabbix-proxy-lts ] - then - /bin/mkdir -p /var/run/zabbix-proxy-lts - /usr/sbin/chmod 755 /var/run/zabbix-proxy-lts - fi -/usr/sbin/chown -R zabbix:zabbix /var/run/zabbix-proxy-lts - -if [ ! -d /var/db/zabbix-proxy-lts ] - then - /bin/mkdir -p /var/db/zabbix-proxy-lts - /usr/sbin/chmod 755 /var/db/zabbix-proxy-lts - fi -/usr/sbin/chown -R zabbix:zabbix /var/db/zabbix-proxy-lts + + if [ ! -d /var/log/zabbix-proxy-lts ]; then + /bin/mkdir -p /var/log/zabbix-proxy-lts + /usr/sbin/chmod 755 /var/log/zabbix-proxy-lts + fi + /usr/sbin/chown -R zabbix:zabbix /var/log/zabbix-proxy-lts + + if [ ! -d /var/run/zabbix-proxy-lts ]; then + /bin/mkdir -p /var/run/zabbix-proxy-lts + /usr/sbin/chmod 755 /var/run/zabbix-proxy-lts + fi + /usr/sbin/chown -R zabbix:zabbix /var/run/zabbix-proxy-lts + + if [ ! -d /var/db/zabbix-proxy-lts ]; then + /bin/mkdir -p /var/db/zabbix-proxy-lts + /usr/sbin/chmod 755 /var/db/zabbix-proxy-lts + fi + /usr/sbin/chown -R zabbix:zabbix /var/db/zabbix-proxy-lts + +EOF; + + $pid_check = <<< EOF + + /bin/pgrep -anx zabbix_proxy 2>/dev/null + if [ "\$?" -eq "0" ]; then + /usr/bin/killall -9 zabbix_proxy + /bin/rm -f /var/run/zabbix-proxy-lts/zabbix_proxy_lts.pid + fi EOF; $zproxy_rcfile="/usr/local/etc/rc.d/zabbix_proxy_lts.sh"; if (is_array($zbproxy_config) && $zbproxy_config['proxyenabled']=="on"){ - $zproxy_start= strtr($dir_checks, array("\r" => "")). "\necho \"Starting Zabbix Proxy LTS\"...\n"; - /* start zabbix proxy */ - $zproxy_start .= ZABBIX_PROXY_BASE . "/sbin/zabbix_proxy\n"; + $zproxy_start = strtr($dir_checks, array("\r" => "")); + $zproxy_start .= "\techo \"Starting Zabbix Proxy LTS\"...\n"; + $zproxy_start .= "\t" . ZABBIX_PROXY_BASE . "/sbin/zabbix_proxy\n"; $zproxy_stop = "echo \"Stopping Zabbix Proxy LTS\"\n"; - $zproxy_stop .= "/usr/bin/killall zabbix_proxy\n"; - $zproxy_stop .= "/bin/sleep 5\n"; + $zproxy_stop .= "\t/usr/bin/killall zabbix_proxy\n"; + $zproxy_stop .= "\t/bin/sleep 5\n"; + $zproxy_stop .= strtr($pid_check, array("\r" => "")); /* write out rc.d start/stop file */ write_rcfile(array( -- cgit v1.2.3 From 6d90f354c42b77d74a4ef7271acffcaec8dcabb2 Mon Sep 17 00:00:00 2001 From: "Danilo G. Baio (dbaio)" Date: Fri, 15 May 2015 16:02:24 -0300 Subject: zabbix_lts - bump version --- config/zabbix-agent-lts/zabbix-agent-lts.xml | 2 +- config/zabbix-proxy-lts/zabbix-proxy-lts.xml | 2 +- pkg_config.10.xml | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/config/zabbix-agent-lts/zabbix-agent-lts.xml b/config/zabbix-agent-lts/zabbix-agent-lts.xml index 94a98596..c58ac04c 100644 --- a/config/zabbix-agent-lts/zabbix-agent-lts.xml +++ b/config/zabbix-agent-lts/zabbix-agent-lts.xml @@ -41,7 +41,7 @@ zabbixagentlts Services: Zabbix Agent LTS Monitoring - 0.8.4 + 0.8.5 /usr/local/pkg/zabbix-agent-lts.inc Zabbix Agent LTS has been created/modified. Zabbix Agent LTS has been deleted. diff --git a/config/zabbix-proxy-lts/zabbix-proxy-lts.xml b/config/zabbix-proxy-lts/zabbix-proxy-lts.xml index 440c41b1..15111aa5 100644 --- a/config/zabbix-proxy-lts/zabbix-proxy-lts.xml +++ b/config/zabbix-proxy-lts/zabbix-proxy-lts.xml @@ -41,7 +41,7 @@ zabbixproxylts Services: Zabbix Proxy LTS Monitoring - 0.8.4 + 0.8.5 /usr/local/pkg/zabbix-proxy-lts.inc Zabbix Proxy has been created/modified. Zabbix Proxy has been deleted. diff --git a/pkg_config.10.xml b/pkg_config.10.xml index cb805980..7058f4dc 100644 --- a/pkg_config.10.xml +++ b/pkg_config.10.xml @@ -1461,7 +1461,7 @@ will result in change of the first version number. More info in http://www.zabbix.com/life_cycle_and_release_policy.php Services https://packages.pfsense.org/packages/config/zabbix-agent-lts/zabbix-agent-lts.xml - 0.8.4 + 0.8.5 BETA 2.2 zabbix-agent-lts.xml @@ -1483,7 +1483,7 @@ will result in change of the first version number. More info in http://www.zabbix.com/life_cycle_and_release_policy.php Services https://packages.pfsense.org/packages/config/zabbix-proxy-lts/zabbix-proxy-lts.xml - 0.8.4 + 0.8.5 BETA 2.2 zabbix-proxy-lts.xml -- cgit v1.2.3