Question

problem to get services parameters with CLAPI when service name contains brackets

  • 21 July 2023
  • 1 reply
  • 51 views

Badge

Hello,

 

as stated in the subject it seems getting parameters parameters for service when service name contains bracketsis not working ?

 

When I do : 

centreon -u admin -p 'MYPASSWORD' -o SERVICE -a getparam -v 'MYHOST;Test_Service4;notes_url'

I get : 

PHP Warning:  Undefined variable $paramString in /usr/share/centreon/www/class/centreon-clapi/centreonService.class.php on line 579
notes_url
mynotesurltesttext

 

So there is an error but I get the data

Now if I try with any other service with brackets in the name like this : 

centreon -u admin -p 'MYPASSWORD' -o SERVICE -a getparam -v 'MYHOST;[PRIO] Test Service5;notes_url'
I get : 

Object not found:MYHOST/[PRIO] Test Service5

 

I tried a lot of things like using quotes, double-quotes, escape characters and so on and I could not get my results.

 

And of course 90% of our services have brackets in their names… :-(

 

using Centreon 23.04.0


1 reply

Userlevel 1
Badge +4

Hello @Frank76, they are so many fixes since 23.04.0… it’s 23.04.12 currently.
Could you update in order to see if it’s correctly resolved ?

Works without problems on my 23.10 :

Test CLAPI getparam on host & service with brackets works

 

Reply