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
309 stars 273 forks source link

database::mssql::plugin --mode=sql: need to handle "no values #4109

Open joschi99 opened 1 year ago

joschi99 commented 1 year ago

we have some situation, where a custom SQL could return no values. It should be nice if we can set thresholds not only on the numeric values but also on NULL or missing SQL returns.

garnier-quentin commented 1 year ago

Have you tried the collection mode ?

joschi99 commented 1 year ago

How it works? Did you have an example?

garnier-quentin commented 1 year ago

You have an example here: https://github.com/centreon/centreon-plugins/pull/3112

lucie-dubrunfaut commented 1 month ago

Hello :)

This question seems old, but can you tell us if the example given by Quentin help you to do what you expected? Thank you for your understanding.

joschi99 commented 2 weeks ago

Hi @lucie-dubrunfaut, I don't think that the example from Quentin is the right solution. Using the mode=sql allows to send a custom SQL and to define numeric thresholds for the returned values. But if the returned value is "empty", then a error (maybe UNKNOWN) should be raised, because you cannot deal with numeric thresholds and empty value

lucie-dubrunfaut commented 1 day ago

Hello :)

Can you give us some examples of commands and returns with the --debug option to illustrate the situations described above? When you talk about thresholds on NULL or missing SQL returns, you mean WARNING/CRITICAL choices?