Solved

Regex in critical-string on App-DB-MSSQL-Sql-Statement-String does not work

  • 14 February 2024
  • 1 reply
  • 33 views

Userlevel 2
Badge +5

Hi,

I need to deal with this kind of return  from my MSSQL query:

 

“IDF - OK”

i tried to use a regex expression, of course i have read this:

How to play with Regex - Part I | Community (centreon.com)

How to play with Regex - Part II | Community (centreon.com)

 

so i tried : --critical-string='%{value_field} ne "^(.*OK.*)" '

it’s seem to be ok there: regex101: build, test, and debug regex

 

so for now i got a wrong return:

CRITICAL: IDF - OK
 

I also try to return multiple rows with a single query but I did not achieve to print a key_field and a value_field in a same return.

 

 

any idea are welcome.

icon

Best answer by Jumulus 14 February 2024, 16:02

View original

1 reply

Userlevel 2
Badge +5

Finaly,

I put my blabla string in the value field wich is print by default.

in the Key_field , I put only ‘OK’ or ‘KO’ then no problem on the test in the critical statement.

then it’s work.

Reply