Question

Centreon API V2

  • 16 March 2023
  • 3 replies
  • 248 views

Badge +9

Hi

Is it possible to get in centreon api v2 the services that correspond to these parameters: dowtime=true, enabled=true, notification=true, service type hard?

On the Centreon documentation, I only see downtime and acknowledged

I am using Centreon 22.04

Cordially

Francis


3 replies

Badge +9

I found state_type for soft and hard service.

Does exist for notification service?

Userlevel 5
Badge +14

as you can see on the documentation 

service Centreon Web RestAPI

ressource Centreon Web RestAPI

there are lists of available search fields, and there is no “notification” field

 

however, if you get Ressources with the API and not services or host, you have a field in the output 

copy of a postman result

(I tried putting “notification_enable eq false” in my search query, it was ignored and I still don’t understand the code for the “centreon” application on the github to check more in depth)

 

you could filter the query with a search of resources with

  • downtime
  • state_type
  • type=service 

(I don’t see the point of “enabled=true”, you won’t get disabled service in the Rest API output but in CLAPI output on the shell of the central server; or api v1, wich is more oriented to get the admin configuration. api v2 will only return enabled objects) 

Then when you get your result add filter in your code to filter on this “notification_enabled” 

Badge +9

Hi,

I see the paramter state_type in my result but whe I make get request I have 500 code error:

'code': 500, 'message': "Le paramètre state_type n'est pas autorisé"}

 

Is it possible to enable this parameter?

 

@

Reply