centreon / centreon-vmware

Centreon VMWare connector to check ESX server, VCenter and VMWare guest resources
Apache License 2.0
28 stars 16 forks source link

plugin=apps::vmware::connector::plugin - mode='datastore-usage' - value incorrect #96

Closed MCO-SSTI closed 2 years ago

MCO-SSTI commented 3 years ago

Hello,

We have a plugin mode='datastore-usage that is use in mode "datastore-usage" but the result on usage vmfs (vmware) is not correct

In the centreon, the plugins goes up 110 Go for free in the vmfs but by the powershell command, the result is 290 Go We have use a update (command "git pull") without change

The plugin command with verbose : /usr/lib/centreon/centreon-plugins/centreon_plugins.pl --plugin=apps::vmware::connector::plugin --connector-hostname=127.0.0.1 --mode='datastore-usage' --vsphere-address='10.122.0.1' --vsphere-username=superunified --vsphere-password=whatelse --datastore-name '^(?!(VMFS_PRD_INFRA_BDDZABBIX|DTS-21-SAUVEGARDE|DTS-22-SAUVEGARDE|VMFS_PRDPRD960WINF015|local_prd970vesx073_MSA2040|NFS_IMAGES_ISO|NFSTEMPLATES|VMFS(R)?[A-Z]{3}([0-9A-ZB]*)([[:xdigit:]]{4}).)).$' --filter --filter-perfdata=used --warning-usage-prct=80 --critical-usage-prct=92 --verbose --debug

and the result : CRITICAL: Datastore 'VMFS_DEV_0CE7' Usage Total: 1.56 TB Used: 1.45 TB (93.06%) Free: 110.95 GB (6.94%) | 'used_VMFS_DEV_0232'=1360940498944B;;;0;1717718482944 'used_prct_VMFS_DEV_0232'=79.23%;0:80;0:92;0;100 'used_VMFS_DEV_09D5'=1188795777024B;;;0;1717718482944 'used_prct_VMFS_DEV_09D5'=69.21%;0:80;0:92;0;100 'used_VMFS_DEV_09D7'=1369404604416B;;;0;1717718482944 'used_prct_VMFS_DEV_09D7'=79.72%;0:80;0:92;0;100 'used_VMFS_DEV_0CE7'=1598588715008B;;;0;1717718482944 'used_prct_VMFS_DEV_0CE7'=93.06%;0:80;0:92;0;100 'used_VMFS_DEV_0D2D'=2638588411904B;;;0;3435705401344 'used_prct_VMFS_DEV_0D2D'=76.80%;0:80;0:92;0;100 'used_VMFS_DEV_0E92'=1368299405312B;;;0;1717718482944 'used_prct_VMFS_DEV_0E92'=79.66%;0:80;0:92;0;100 'used_VMFS_DPL_002B'=56203673600B;;;0;429228294144 'used_prct_VMFS_DPL_002B'=13.09%;0:80;0:92;0;100 'used_local_prd960vesx036'=1019215872B;;;0;138781130752 'used_prct_local_prd960vesx036'=0.73%;0:80;0:92;0;100 {"identity":"client-b27693b1df9d46d3816f867927a469c6","data":{"56bafe56-2721ef8e-8a52-ac162d733518":{"hosts":["prd960vesx036.ilc.eic.intra"],"free":"356777984000","name":"VMFS_DEV_0232","accessible":"1","uncommitted":"159445421239","size":"1717718482944"},"59d4cae8-e44156a4-5ce8-ac162d733518":{"hosts":["prd960vesx036.ilc.eic.intra"],"free":"119129767936","name":"VMFS_DEV_0CE7","accessible":"1","uncommitted":"38570823295","size":"1717718482944"},"5a72f275-cf7d8c95-281c-1402ec87d61c":{"hosts":["prd960vesx036.ilc.eic.intra"],"free":"797116989440","name":"VMFS_DEV_0D2D","accessible":"1","uncommitted":"488494868059","size":"3435705401344"},"53a3f1f5-4717249f-c4e7-ac162d733518":{"hosts":["prd960vesx036.ilc.eic.intra"],"free":"373024620544","name":"VMFS_DPL_002B","accessible":"1","uncommitted":"0","size":"429228294144"},"56b9b043-e2a09795-4d3b-ac162d733518":{"hosts":["prd960vesx036.ilc.eic.intra"],"free":"528922705920","name":"VMFS_DEV_09D5","accessible":"1","uncommitted":"156218958479","size":"1717718482944"},"5d2f3f4e-3f49af69-70be-1402ec8321b8":{"hosts":["prd960vesx036.ilc.eic.intra"],"free":"137761914880","name":"local_prd960vesx036","accessible":"1","uncommitted":"0","size":"138781130752"},"5bb4c50a-6032a194-b942-1402ec87d61c":{"hosts":["prd960vesx036.ilc.eic.intra"],"free":"349419077632","name":"VMFS_DEV_0E92","accessible":"1","uncommitted":"0","size":"1717718482944"},"56bae123-29a6c3d5-a9e9-ac162d733518":{"hosts":["prd960vesx036.ilc.eic.intra"],"free":"348313878528","name":"VMFS_DEV_09D7","accessible":"1","uncommitted":"0","size":"1717718482944"}},"short_message":"OK","extra_message":"","vmware_connector_version":"3.2.1","code":0} Datastore 'VMFS_DEV_0232' accessible 1, Usage Total: 1.56 TB Used: 1.24 TB (79.23%) Free: 332.28 GB (20.77%), Provisioned: 1.38 TB (88.51%) Datastore 'VMFS_DEV_09D5' accessible 1, Usage Total: 1.56 TB Used: 1.08 TB (69.21%) Free: 492.60 GB (30.79%), Provisioned: 1.22 TB (78.30%) Datastore 'VMFS_DEV_09D7' accessible 1, Usage Total: 1.56 TB Used: 1.25 TB (79.72%) Free: 324.39 GB (20.28%), Provisioned: 1.25 TB (79.72%) Datastore 'VMFS_DEV_0CE7' accessible 1, Usage Total: 1.56 TB Used: 1.45 TB (93.06%) Free: 110.95 GB (6.94%), Provisioned: 1.49 TB (95.31%) Datastore 'VMFS_DEV_0D2D' accessible 1, Usage Total: 3.12 TB Used: 2.40 TB (76.80%) Free: 742.37 GB (23.20%), Provisioned: 2.84 TB (91.02%) Datastore 'VMFS_DEV_0E92' accessible 1, Usage Total: 1.56 TB Used: 1.24 TB (79.66%) Free: 325.42 GB (20.34%), Provisioned: 1.24 TB (79.66%) Datastore 'VMFS_DPL_002B' accessible 1, Usage Total: 399.75 GB Used: 52.34 GB (13.09%) Free: 347.41 GB (86.91%), Provisioned: 52.34 GB (13.09%) Datastore 'local_prd960vesx036' accessible 1, Usage Total: 129.25 GB Used: 972.00 MB (0.73%) Free: 128.30 GB (99.27%), Provisioned: 972.00 MB (0.73%)

The problem is in Datastore 'VMFS_DEV_0CE7' accessible 1, Usage Total: 1.56 TB Used: 1.45 TB (93.06%) Free: 110.95 GB (6.94%), Provisioned: 1.49 TB (95.31%)

The command power-shell and result : PS C:\windows> get-datastore VMFS_DEV_0CE7

Name FreeSpaceGB CapacityGB


VMFS_DEV_0CE7 295,890 1 599,750

Can you help us please ?

Thanks

Regards

Maekess commented 3 years ago

Hello,

Is there any cache for connector, one server is getting wrong information but 2 others with the same datastore are getting the right ones.

Thanks

garnier-quentin commented 3 years ago

Could you provide the result with --debug ?

Maekess commented 3 years ago

Debug is provided on first post.

garnier-quentin commented 3 years ago

The connector doesn't have a cache. vmware connector checks 'freeSpace': https://www.vmware.com/support/developer/vc-sdk/visdk41pubs/ApiReference/vim.Datastore.Summary.html

Maekess commented 3 years ago

So the issue may be on esx side ? All 3 esx have same patch version.

Maekess commented 3 years ago

Do you have the "refresh" flag available on the command ? "The server periodically updates this value. It can be explicitly refreshed with the Refresh operation. This property is guaranteed to be valid only if accessible is true. "

https://www.vmware.com/support/developer/vc-sdk/visdk41pubs/ApiReference/vim.Datastore.html#refreshStorageInfo

garnier-quentin commented 3 years ago

It could come from vmware (maybe).

garnier-quentin commented 2 years ago

We don't want to refresh it. But maybe i can add an option to refresh it

Maekess commented 2 years ago

Hello, would be usefull yes please.

garnier-quentin commented 2 years ago

Available in version 3.2.2