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::backup::veeam::vbem::restapi::plugin] --mode=jobs: option --unit is not working #5028

Open joschi99 opened 3 months ago

joschi99 commented 3 months ago

The option --unit=h is not working, the value defined with --timeframe is still calculated in seconds, so it's not possible to define thresholds in hours, days or weeks.

lucie-dubrunfaut commented 1 month ago

Hello :)

I took the time to inspect the code of the mode concerned and I don't find where this issue could occures with the option --unit itself. Can you provide us an example output with the --verbose and --debug options to help me understanding the problem? nlabels should contains "hours" if the option --unit=h is handled. Looking at the mode code and I don't find there is any interaction between the --unit option and the --timeframe option. The ---timeframe must be expressed in seconds and is not converted according to the unit provided in the --unit option.

joschi99 commented 1 month ago

Hi @lucie-dubrunfaut, I think this is my error. Probably the option --unit is related only to the threshold job-execution-last and not also to the --timeframe. In this case you can close the ticket

lucie-dubrunfaut commented 3 weeks ago

Hello :)

Yes, from what I've seen, the timeframe option is only expressed in seconds and doesn't take into account the information provided in the unit option. However, this could be a possible enhancement suggestion if it is blocking you, or at least make this more explicit in the help section.

joschi99 commented 2 weeks ago

I think it makes sense to extend the plugin to use the unit also for the timeframe, it's normally much easier to handle hours/days/weeks instead of seconds.

lucie-dubrunfaut commented 2 weeks ago

I'll notice this as an enhancement suggestion :)