Skip to main content
Question

want to monitor wazuh agent using plugin get UNKNOWN: 401 Unauthorized. help please.

  • 13 June 2024
  • 4 replies
  • 70 views

we want to monitor wazhu agetent and manager using Wazuh Rest API 

host template:App-Wazuh-Restapi-custom we used and getting error 

UNKNOWN: 401 Unauthorized

/usr/lib/centreon/plugins/centreon_wazuh_restapi.pl --plugin=apps::wazuh::restapi::plugin --mode=manager --hostname='****' --username='****' --password='***' --port='55000' --proto='https' --insecure --filter-process='' --filter-log='' --warning-processes-stopped='' --critical-processes-stopped='' --warning-processes-running='' --critical-processes-running='' --warning-log-error='' --critical-log-error='' --warning-log-critical='' --critical-log-critical='' --warning-log-warning='' --critical-log-warning='' --warning-process-status='' --critical-process-status='' --verbose

Thanks You
Best Regard

4 replies

Badge +3

Hi,

Same error here, did you find something ?

Regards,

Userlevel 5
Badge +14

hello

could you try running the command you are getting from the Centreon UI (from the service detail) in a ssh shell on your poller, 

use “su - centreon-engine” first, to be sure you are running the in the same context.

if you can, try to add “ --debug” to your command, as it may give debugging information

401 is pretty explicit, wrong user/password, or no access to a requested url ressource. but with just the short output, no way to see.

Badge +3

Hello,

I just found that the token is now mandatory, but the Centreon documentation doesn’t seems up to date.

 

As well as the “agent” service, who keeps telling me that there is no active agent despite that the answer from the API gave me the right number of active agent.

 

The whole Wazuh template seems out-of-date due to the fact that the token has an expiration time.

 

Sadly, it is unusable as it is.

 

Kinds regards,

Userlevel 3
Badge +6

Hello :)

The problem with the token usage has been taken into account and will be handled as soon as possible. Thanks for the feedback.

Reply