centreon / centreon-plugins

Collection of standard plugins to discover and gather cloud-to-edge metrics and status across your whole IT infrastructure.
https://www.centreon.com
Apache License 2.0
310 stars 273 forks source link

[apps::vmware::connector::plugin] --mode=vsan-cluster-usage: wrong unit for cluster.vsan.backend.latency #4894

Open joschi99 opened 7 months ago

joschi99 commented 7 months ago

Latest plugins. The backend latency unit returned from VSAN is not ms but µs. Please consider this for graphs (where unit will displayed with ms) and also for the thresholds.

omercier commented 7 months ago

Hi @joschi99 can you send an example of your command result in debug mode?

joschi99 commented 7 months ago

Hi @omercier, here you can find a debug output

OK: Cluster 'XXXX' vsan backend read IOPS: 16599, write IOPS: 8232, congestions: 0, outstanding IO: 150.5 | 'cluster.vsan.backend.read.usage.iops'=16599iops;;;0; 'cluster.vsan.backend.write.usage.iops'=8232iops;;;0; 'cluster.vsan.backend.congestions.count'=0;;;0; 'cluster.vsan.backend.outstanding.io.count'=150.5;;;0; 'cluster.vsan.backend.throughput.read.bytespersecond'=641991025B/s;;;0; 'cluster.vsan.backend.throughput.write.bytespersecond'=159102785.5B/s;;;0; 'cluster.vsan.backend.latency.read.milliseconds'=4873ms;;;0; 'cluster.vsan.backend.latency.write.milliseconds'=287ms;;;0;
{"identity":"client-7067a6e354644fe7b207793b02417569","data":{"domain-c1053263":{"name":"XXXX","cluster_domcompmgr":{"latencyAvgRead":4873,"throughputRead":641991025,"iopsRead":16599,"iopsWrite":8232,"congestion":0,"oio":150.5,"latencyAvgWrite":287,"throughputWrite":159102785.5}}},"short_message":"OK","extra_message":"","vmware_connector_version":"3.2.5","code":0}
Cluster 'XXXX' vsan backend read IOPS: 16599, write IOPS: 8232, congestions: 0, outstanding IO: 150.5

As you can see the values for a returned but are not in ms but us

joschi99 commented 4 months ago

any news on this?

lucie-dubrunfaut commented 2 months ago

Hello :)

I took the request into account and generated the associated ticket internally. We will discuss it with dev team soon.

omercier commented 1 month ago

Hi @joschi99, I'm working on this issue. I'll keep the value in its original unit, and display the same value as µs in both output and perfdata.

While rewriting the help section, I noticed that none of the filtering options below seem actually implemented.

=item B<--cluster-name>

cluster to check.
If not set, we check all clusters.

=item B<--filter>

Cluster name is a regexp.

=item B<--scope-datacenter>

Search in following datacenter(s) (can be a regexp).

I'm implementing the first one as a regular expression and remove the --filter that will become useless. Do you think the --scope-datacenter option has to be implemented or may it be just removed from the help?

Thanks in advance for your feedback!

omercier commented 1 month ago

Hi @joschi99, Can you also test this version of the plugin?

joschi99 commented 1 month ago

Hi @omercier, done a test with following results:

OK: Cluster 'vsan-lab' vsan backend read IOPS: 19, write IOPS: 305, congestions: 0, outstanding IO: 7 | 'cluster.vsan.backend.read.usage.iops'=19iops;;;0; 'cluster.vsan.backend.write.usage.iops'=305iops;;;0; 'cluster.vsan.backend.congestions.count'=0;0:200;0:220;0; 'cluster.vsan.backend.outstanding.io.count'=7;0:500;0:2000;0; 'cluster.vsan.backend.throughput.read.bytespersecond'=231846B/s;;;0; 'cluster.vsan.backend.throughput.write.bytespersecond'=2811573B/s;;;0; 'cluster.vsan.backend.latency.read.milliseconds'=378µs;0:100000;0:250000;0; 'cluster.vsan.backend.latency.write.milliseconds'=275µs;0:100000;0:250000;0;
Cluster 'vsan-lab' vsan backend read IOPS: 19, write IOPS: 305, congestions: 0, outstanding IO: 7
  1. The unit is now µs but the description is still milliseconds and not microseconds
  2. We should have both filter possibilities to filter for datacenters and clusters, because on a vCenter you can have more then 1 datacenter and a single datacenter can contains more the 1 cluster
omercier commented 1 week ago

Hi @joschi99, Thanks for the feedback!

  1. I'll fix this omission.
  2. I think I was wrong about the filtering options, they are apparently passed to the connector itself and included in the query. I won't remove the options, then.
omercier commented 1 week ago

@joschi99 I have:

joschi99 commented 1 week ago

thanks, can you send me a limk to test the modified version?

omercier commented 1 week ago

The work in progress is in this branch.

joschi99 commented 1 week ago

Have done a test, output seem's know ok and will be shown in microseconds: OK: Cluster 'vsan-lab' vsan backend read IOPS: 28, write IOPS: 344, congestions: 0, outstanding IO: 6 | 'cluster.vsan.backend.read.usage.iops'=28iops;;;0; 'cluster.vsan.backend.write.usage.iops'=344iops;;;0; 'cluster.vsan.backend.congestions.count'=0;;;0; 'cluster.vsan.backend.outstanding.io.count'=6;;;0; 'cluster.vsan.backend.throughput.read.bytespersecond'=344244B/s;;;0; 'cluster.vsan.backend.throughput.write.bytespersecond'=3499904B/s;;;0; 'cluster.vsan.backend.latency.read.microseconds'=401µs;;;0; 'cluster.vsan.backend.latency.write.microseconds'=312µs;0:1000;;0;

Filter for datacenter (--scope-datacenter) is working as expected (with regexp). Filter for cluster (--cluster-name) have some problem: when defined like --cluster-name='.*' (every cluster name/wildcard shoud be ok), then we will have back this error: UNKNOWN: Cannot find 'ComputeResource' object Same error will happen also when clustername is defined like --cluster-name='^vsan-lab$'