From d2a898880f6cae1d39e7ef089cadc45fe1cc2e96 Mon Sep 17 00:00:00 2001 From: Franco Fichtner Date: Mon, 26 Mar 2018 06:33:26 +0000 Subject: [PATCH] net-mgmt/zabbix-agent: improved/fixed service controls; closes #551 --- net-mgmt/zabbix-agent/Makefile | 11 ++++++----- .../src/etc/inc/plugins.inc.d/zabbixagent.inc | 6 +++--- .../mvc/app/views/OPNsense/ZabbixAgent/index.volt | 9 ++------- .../zabbix-agent/src/www/diag_logs_zabbixagent.php | 2 ++ 4 files changed, 13 insertions(+), 15 deletions(-) diff --git a/net-mgmt/zabbix-agent/Makefile b/net-mgmt/zabbix-agent/Makefile index d41d2a106..a1d26a724 100644 --- a/net-mgmt/zabbix-agent/Makefile +++ b/net-mgmt/zabbix-agent/Makefile @@ -1,7 +1,8 @@ -PLUGIN_NAME= zabbix-agent -PLUGIN_VERSION= 1.2 -PLUGIN_COMMENT= Enterprise-class open source distributed monitoring agent -PLUGIN_DEPENDS= zabbix34-agent -PLUGIN_MAINTAINER= opnsense@moov.de +PLUGIN_NAME= zabbix-agent +PLUGIN_VERSION= 1.2 +PLUGIN_REVISION= 1 +PLUGIN_COMMENT= Enterprise-class open source distributed monitoring agent +PLUGIN_DEPENDS= zabbix34-agent +PLUGIN_MAINTAINER= opnsense@moov.de .include "../../Mk/plugins.mk" diff --git a/net-mgmt/zabbix-agent/src/etc/inc/plugins.inc.d/zabbixagent.inc b/net-mgmt/zabbix-agent/src/etc/inc/plugins.inc.d/zabbixagent.inc index 4fd006a4f..0ebd6d2ae 100644 --- a/net-mgmt/zabbix-agent/src/etc/inc/plugins.inc.d/zabbixagent.inc +++ b/net-mgmt/zabbix-agent/src/etc/inc/plugins.inc.d/zabbixagent.inc @@ -61,9 +61,9 @@ function zabbixagent_services() 'description' => gettext('Zabbix Agent'), 'pidfile' => '/var/run/zabbix/zabbix_agentd.pid', 'configd' => array( - 'restart' => array('zabbix_agentd restart'), - 'start' => array('zabbix_agentd start'), - 'stop' => array('zabbix_agentd stop'), + 'restart' => array('zabbixagent restart'), + 'start' => array('zabbixagent start'), + 'stop' => array('zabbixagent stop'), ), 'name' => 'zabbix_agentd', ); diff --git a/net-mgmt/zabbix-agent/src/opnsense/mvc/app/views/OPNsense/ZabbixAgent/index.volt b/net-mgmt/zabbix-agent/src/opnsense/mvc/app/views/OPNsense/ZabbixAgent/index.volt index 556325c11..5721a8a96 100644 --- a/net-mgmt/zabbix-agent/src/opnsense/mvc/app/views/OPNsense/ZabbixAgent/index.volt +++ b/net-mgmt/zabbix-agent/src/opnsense/mvc/app/views/OPNsense/ZabbixAgent/index.volt @@ -33,10 +33,7 @@ $( document ).ready(function() { mapDataToFormUI(data_get_map).done(function(){ formatTokenizersUI(); $('.selectpicker').selectpicker('refresh'); - // request service status on load and update status box - ajaxCall(url="/api/zabbixagent/service/status", sendData={}, callback=function(data,status) { - updateServiceStatusUI(data['status']); - }); + updateServiceControlUI('zabbixagent'); }); /*********************************************************************** @@ -67,9 +64,7 @@ $( document ).ready(function() { draggable: true }); } else { - ajaxCall(url="/api/zabbixagent/service/status", sendData={}, callback=function(data,status) { - updateServiceStatusUI(data['status']); - }); + updateServiceControlUI('zabbixagent'); } }); }); diff --git a/net-mgmt/zabbix-agent/src/www/diag_logs_zabbixagent.php b/net-mgmt/zabbix-agent/src/www/diag_logs_zabbixagent.php index 93cd817d2..495569d9f 100644 --- a/net-mgmt/zabbix-agent/src/www/diag_logs_zabbixagent.php +++ b/net-mgmt/zabbix-agent/src/www/diag_logs_zabbixagent.php @@ -3,4 +3,6 @@ $logfile = '/var/log/zabbix/zabbix_agentd.log'; $logclog = false; +$service_hook = 'zabbix_agentd'; + require_once 'diag_logs_template.inc';