Skip to main content
Solved

Fetching the content of an HTTP call

  • November 26, 2024
  • 2 replies
  • 105 views

Forum|alt.badge.img+6

I want to add monitoring of Ciphermail gateways to my Centreon instance. Reading the documentation, Ciphermail provides HTTP endpoints that returns a {OK|Warning|Critical|Unknown}report.

 

I thought I could use the HTTP Server connector but this seems to force you to test the content of the response in one way or another. Is there a way to just use the content as-is?

Best answer by christophe.niel-ACT

hello

centreon works by executing command, and that command must provide a “return code”

so simply getting the text from a web page is not sufficient to make a centreon check

 

you have a specific http check included in centreon with this service template

where you can say you expect “OK” in the content

 

doing more would need you to code your own command (bash, perl, python, whatever) that would query the web page, interpret the output and return the correct code to centreon

Plugins development guidelines | Centreon Documentation 

2 replies

Forum|alt.badge.img+17

hello

centreon works by executing command, and that command must provide a “return code”

so simply getting the text from a web page is not sufficient to make a centreon check

 

you have a specific http check included in centreon with this service template

where you can say you expect “OK” in the content

 

doing more would need you to code your own command (bash, perl, python, whatever) that would query the web page, interpret the output and return the correct code to centreon

Plugins development guidelines | Centreon Documentation 


Forum|alt.badge.img+6
  • Author
  • Steward **
  • November 26, 2024

I was so surprised to not be allowed to set thresholds that I forgot about the return code. I’ve whipped up a shell script that returns the output of the HTTP call but also the appropriate return code.