Skip to main content
In Backlog

create jobs discovery with API rest

Related products:Infra Monitoring - API
  • November 17, 2023
  • 2 replies
  • 94 views

Forum|alt.badge.img+3

Hello,

Could you configure with your api the functionnality :

-Create discovery jobs with parameters by API

 

2 replies

Forum|alt.badge.img+3
  • Author
  • Steward *
  • November 17, 2023

get all discoveries
curl 'https://hostname/centreon/api/latest/auto-discovery/jobs?page=1&limit=30&sort_by=%7B%22creation_date%22%3A%22DESC%22%7D&search=%7B%22%24and%22%3A%5B%7B%22status%22%3A%7B%22%24in%22%3A%5B3%2C4%2C0%2C2%2C6%2C1%2C5%5D%7D%7D%5D%7D'  -H 'Accept: application/json, text/plain, */*'  -H 'Referer: https://hostname/centreon/configuration/hosts/discovery/jobs' -H 'Cookie: PHPSESSID=UNCOOKIEBIENSUCCULANT' 

 

when creating: get all providers to select one
curl 'https://hostname/centreon/api/latest/auto-discovery/providers?page=1&limit=6&search=%7B%22%24or%22%3A%5B%7B%22name%22%3A%7B%22%24rg%22%3A%22%22%7D%7D%2C%7B%22description%22%3A%7B%22%24rg%22%3A%22%22%7D%7D%5D%7D' -H 'Accept: application/json, text/plain, */*' -H 'Referer: https://hostname/centreon/configuration/hosts/discovery/jobs' -H 'Cookie: PHPSESSID=UNCOOKIEBIENSUCCULANT' 
curl 'https://hostname/centreon/api/latest/auto-discovery/providers?page=2&limit=6&search=%7B%22%24or%22%3A%5B%7B%22name%22%3A%7B%22%24rg%22%3A%22%22%7D%7D%2C%7B%22description%22%3A%7B%22%24rg%22%3A%22%22%7D%7D%5D%7D' -H 'Accept: application/json, text/plain, */*' -H 'Referer: https://hostname/centreon/configuration/hosts/discovery/jobs' -H 'Cookie: PHPSESSID=UNCOOKIEBIENSUCCULANT' 

 

select snmpv3 provider

get monitoring pollers
curl 'https://hostname/centreon/api/latest/configuration/monitoring-servers?sort_by=%7B%22name%22%3A%22ASC%22%7D&search=%7B%22is_localhost%22%3A%7B%22%24eq%22%3A%221%22%7D%7D' -H 'Accept: application/json, text/plain, */*' -H 'Referer: https://hostname/centreon/configuration/hosts/discovery/jobs' -H 'Cookie: PHPSESSID=UNCOOKIEBIENSUCCULANT' 
curl 'https://hostname/centreon/api/latest/configuration/monitoring-servers?page=1&sort_by=%7B%22name%22%3A%22ASC%22%7D&search=%7B%22%24and%22%3A%5B%7B%22is_activate%22%3A%7B%22%24eq%22%3A%221%22%7D%7D%2C%7B%22id%22%3A%7B%22%24ni%22%3A%5B1%5D%7D%7D%5D%7D' -H 'Accept: application/json, text/plain, */*' -H 'Referer: https://hostname/centreon/configuration/hosts/discovery/jobs' -H 'Cookie: PHPSESSID=UNCOOKIEBIENSUCCULANT' 

 

get creds
curl 'https://hostname/centreon/api/latest/auto-discovery/provider-types/{provider_type_ID}/credentials?page=1' -H 'Accept: application/json, text/plain, */*' -H 'Referer: https://hostname/centreon/configuration/hosts/discovery/jobs' -H 'Cookie: PHPSESSID=UNCOOKIEBIENSUCCULANT'

Allready exist but not documented


Forum|alt.badge.img+5
  • Centreonian
  • November 27, 2023
NewIn Backlog