diff --git a/security/wazuh-agent/Makefile b/security/wazuh-agent/Makefile index d30039151..cd1e3dbcc 100644 --- a/security/wazuh-agent/Makefile +++ b/security/wazuh-agent/Makefile @@ -1,5 +1,6 @@ PLUGIN_NAME= wazuh-agent PLUGIN_VERSION= 1.0 +PLUGIN_REVISION= 1 PLUGIN_COMMENT= Agent for the open source security platform Wazuh PLUGIN_DEPENDS= wazuh-agent PLUGIN_MAINTAINER= ad@opnsense.org diff --git a/security/wazuh-agent/src/etc/inc/plugins.inc.d/wazuhagent.inc b/security/wazuh-agent/src/etc/inc/plugins.inc.d/wazuhagent.inc index 0907f052d..132dfd5dc 100644 --- a/security/wazuh-agent/src/etc/inc/plugins.inc.d/wazuhagent.inc +++ b/security/wazuh-agent/src/etc/inc/plugins.inc.d/wazuhagent.inc @@ -30,7 +30,13 @@ function wazuhagent_services() { $services = []; - if ((new \OPNsense\WazuhAgent\WazuhAgent())->general->enabled == '1') { + $cnf = \OPNsense\Core\Config::getInstance()->object(); + $is_enabled = false; + if ($cnf->OPNsense && $cnf->OPNsense->WazuhAgent && $cnf->OPNsense->WazuhAgent->general){ + $is_enabled = $cnf->OPNsense->WazuhAgent->general->enabled == '1'; + } + + if ($is_enabled) { $service = [ 'description' => gettext('Wazuh Agent'), 'configd' => [