Skip to main content
Question

UNKNOWN: Cannot encode result error in plugin centreon vmware.

  • February 13, 2025
  • 1 reply
  • 58 views

dagabard
Forum|alt.badge.img+5

hi, 

i work with the plugin centreon vmware.

in test my result is OK with a vcenter, 
/usr/lib/centreon/plugins/centreon_vmware_connector_client.pl --plugin=apps::vmware::connector::plugin --mode=swap-vm -custommode=connector --connector-hostname='localhost'     --connector-port='5700' --container='***********’

 

i have installed the connector in the same os, but in a highest release (centos 7.4 vs centos 7.9) , the same command return : 

UNKNOWN: Cannot encode result
with debug :
{ "code": -1, "short_message": "Cannot encode result" }


the pb is not the .pm, this is ok on the test platform , and when i ask it with curl in the prod server , it’s ok ...


is anyone has (or had) the same problem and have resolved it ? 
do you have the same problem with another plugin ? 

1 reply

omercier
Centreonian
Forum|alt.badge.img+13
  • Centreonian
  • December 12, 2025

Hi ​@dagabard,

In file /usr/share/perl5/vendor_perl/centreon/vmware/common.pm, at line 79, you should find $response_str = '{ "code": -1, "short_message": "Cannot encode result" }';
 

Can you add:

print STDERR "ERROR: " . $@ . "\n";

In order to get:

 

        if ($@) {
warn "ERROR: " . $@ . "\n";
$response_str = '{ "code": -1, "short_message": "Cannot encode result" }';
}

Then force a new check of Swap-Vm and have a look at the systemd service’s status:

systemctl status centreon_vmware

A message begining with ERROR: should appear within the next seconds.

Can you display it here?