Skip to main content
Question

Behavior of centreon_protocol_http.pl

  • July 22, 2026
  • 1 reply
  • 8 views

Hi,

I don’t know if it changed recently or if it has always be like that, but I noticed the following: if --expected-content has a value, then --critical-content is ignored. It means, if one want to check both a return code and the presence of a string in the page content, one should not use --critical-content=’ %{code} != 200 and %{code} != 401’ --expected-string=foo (because then only the presence of “foo” would be checked!), but what must be used is  --critical-content=’ %{code} != 200 and %{code} != 401 or %{content} !~ /foo/mi’.

Is it something that changed recently? Is this something reliable (ie: it won’t change in the futur) ?

 

1 reply

Forum|alt.badge.img+3
  • Centreonian
  • July 27, 2026

Hello ​@Stéphane 
 

This behaviour is documented on our website : https://docs.centreon.com/pp/integrations/plugin-packs/procedures/applications-protocol-http/
 

Define the expected expression, where --expected-string='mypattern' 
is actually a shortcut for --critical-content='%{content} !~ /mypattern/mi'.
It is recommended to use --critical-content directly

As it is a shortcut for --critical-content, using it will override any value set in the parameter --critical-content

 

So this behaviour is not expected to change anytime soon, you can safely use it.

 

Have a great day,

Evan