Skip to main content
Question

Collecting monitoring data via rest api

  • Jan 27, 2023 2:53 PM UTC
  • 1 reply
  • 224 views

Forum|alt.badge.img+2

Hi everyone,

Trying to collect monitoring data for some services in servers using REST API but the parent property value returns “null”, however when collecting monitoring data for servers the property value is returned

Can anyone help?

Have a blessed day 

1 reply

Forum|alt.badge.img+1
  • Steward *
  • Jan 31, 2023 10:04 AM UTC

Hello,

You get monitoring data for services by calling first the id of their parent host(server) as seen bellow

$response = Http::withHeaders([
'X-AUTH-TOKEN' => "$token"
])->get("$protocol://$server:$port/centreon/api/$apiVersion/monitoring/hosts/$idHost/services"