Open joschi99 opened 2 years ago
You don't have that error with connector 3.2.2 ? It's the host discovery ?
With version 3.2.2 there is no error. Problem occurs launching the discovery mode, but occasionaly. On a internal ESXi standalone host we have found another issue on version 3.2.3 (with 3.2.2 works without any problem):
perl centreon_plugins.pl --plugin=apps::vmware::connector::plugin --mode=discovery --connector-hostname=127.0.0.1 --container='esxi_2_central' --resource-type=esx --prettify
2022-04-20 09:10:14 - vpshere 'esxi_2_central' handler asking: {"vsphere_username":null,"case_insensitive":null,"prettify":1,"timeout":null,"vsphere_password":null,"warning_connector_status":null,"resource_type":"esx","command":"discovery","connector_port":"5700","sampling_period":null,"container":"esxi_2_central","unknown_connector_status":null,"vsphere_address":null,"time_shift":0,"identity":"client-c4d9ee4a25a14c4fbd32a21c86bc369d","connector_hostname":"127.0.0.1","critical_connector_status":null}
2022-04-20 09:10:14 - 'esxi_2_central' Can't call method "type" on an undefined value at /usr/local/share/perl5/VMware/VICommon.pm line 1694.
I have added custom attributes. Maybe it's not available on a ESXI:
my $customFields = {};
my $entries = centreon::vmware::common::get_view($self->{connector}, $self->{connector}->{session1}->get_service_content()->customFieldsManager);
if (defined($entries->{field})) {
foreach (@{$entries->{field}}) {
$customFields->{ $_->{key} } = $_->{name};
}
}
Yes, could be that a standalone ESXi has no custom attributes. The first error occurs on a cluster (tested on different clusters), but randomly.
Could you patch your version 3.2.3 and test again ? https://github.com/centreon/centreon-vmware/pull/105/files
The fix seems solving the problem on standalone hosts. The sporadic problem remains
The problem should be on previous version also ? If you have that error, do you have a real issue ? or only a log.
I have found a way to reproduce the problem:
systemctl restart centreon_vmware.service
centreon_plugins.pl --connector-hostname=127.0.0.1 --connector-port=5700 --container=sama-vcenter --plugin=apps::vmware::connector::plugin --custommode=connector --mode=discovery --resource-type=esx --prettify
centreon_plugins.pl --connector-hostname=127.0.0.1 --connector-port=5700 --container=sama-vcenter --plugin=apps::vmware::connector::plugin --custommode=connector --mode=discovery --resource-type=vm --prettify --debug
UNKNOWN: VMWare error (verbose mode for more details)
{"identity":"client-c23731f71a184a7096a112ffd0d9fa15","data":{"end_time":1650523785,"start_time":1650523785,"duration":0,"discovered_items":66,
....
},"short_message":"VMWare error (verbose mode for more details)","extra_message":"SOAP request error - possibly a protocol issue: Status read failed: at /usr/local/share/perl5/Net/HTTP/Methods.pm line 282.\n\n","vmware_connector_version":"3.2.2","code":-1}
SOAP request error - possibly a protocol issue: Status read failed: at /usr/local/share/perl5/Net/HTTP/Methods.pm line 282.
But its not related to version 3.2.3, same problem also on 3.2.2
The error comes from the sdk or the lwp library (too old maybe). Maybe you should try to update the perl sdk vmware.
At the moment we have installed: perl-VMware-vSphere.x86_64 6.5.0-4566394.1.el7.centos @centreon-stable
Are the any newer version available?
You should try the sdk 6.7 or 7.0.
After updating to connector version 3.2.3 we have randomly this error launching the discovery command - Details: UNKNOWN: VMWare error (verbose mode for more details)
VMware connector log shows in this case this error