Centreon documentation

Centreon documentation

  • Documentation

›API

Getting Started

  • Installation & first steps
  • Tutorials

    • Introduction
    • Create a custom view
    • Create a graphical view
    • Model your IT services
    • Analyze resources availability

Installation

  • Introduction
  • Prerequisites
  • Architectures
  • Download
  • Installation of a Central server

    • Using Centreon ISO
    • Using packages
    • Using virtual machines (VMs)
    • Using sources
  • Web And Post Installation
  • Installation of a Poller

    • Using Centreon ISO
    • Using packages

    Installation of a Remote server

    • Using Centreon ISO
    • Using packages
  • What is Centreon CEIP?

Secure your platform

  • Secure your platform
  • Secure your MAP platform

Monitoring

  • About Monitoring
  • Generic actions
  • Basic Objects

    • Macros
    • Commands
    • Time periods
    • Contacts
    • Hosts
    • Services
    • Meta Services
  • Templates
  • Plugin Packs
  • Monitoring Servers

    • Add a Poller to configuration
    • Add a Remote Server to configuration
    • Communications
    • Deploying a configuration
    • Advanced configuration
  • Groups & Categories
  • Passive Monitoring

    • Enable SNMP Traps
    • Create SNMP Traps definitions
    • Monitoring with SNMP Traps
    • Debug SNMP Traps management
    • Dynamic Service Management
  • Anomaly detection
  • Discovery

    • Introduction
    • Installation
    • Hosts Discovery
    • Services Discovery
    • Administration
  • Auto Remediation
  • Import/Export

Alerts & Notifications

  • Concepts
  • Resources Status
  • Events consoles
  • Manage alerts
  • Notification

    • Concept
    • Configuration
    • Dependencies
    • Escalation
    • Flapping
    • To go further
  • Ticketing
  • Event Logs

Performance graphs

  • Charts managment
  • Graph template
  • Curves
  • Virtual metrics

Service Mapping

  • Introduction to Centreon BAM
  • Guide

    • Manage Business Activities
    • Monitor Business Activities
    • Report Business Activities
    • Settings
    • Widgets

    Administrate

    • Install Centreon BAM extension
    • Update the extension
    • Upgrade the extension
    • Migrate the extension
    • Install on a Remote Server

Graphical views

  • Introduction to Centreon MAP
  • Guide

    • Create a standard view
    • Create a geo view
    • Display views
    • Share a view

    Administrate

    • Install Centreon MAP extension
    • Update the extension
    • Upgrade the extension
    • Migrate the extension
    • Configure
    • Install on a Remote server
    • Advanced configuration
    • Known issues
    • Troubleshooter

Reporting

  • Introduction to Centreon MBI
  • Guide

    • Generate reports
    • Available reports
    • Widgets
    • Configure
    • Concepts
    • Report development

    Administrate

    • Install Centreon MBI extension
    • Update the extension
    • Upgrade the extension
    • Migrate the extension
    • Backup & restore

Administration

    Parameters

    • Centreon UI
    • Monitoring
    • Gorgone
    • LDAP
    • RRDTool
    • Debug
    • Data management
    • Medias
  • Access Control Lists
  • Extensions
  • Database partitioning
  • Centreon HA

    • Architectures
    • Installing a Centreon HA 2-nodes cluster
    • Installing a Centreon HA 4-nodes cluster
    • Monitoring Centreon-HA
    • Operating guide
    • Updating Centreon-HA platform
    • Upgrade from Centreon-Failover to Centreon-HA
    • Troubleshooting guide
  • Backup
  • Knowledge Base
  • Logging configuration changes
  • Platform statistics

Update, Upgrade & Migrate

    Update

    • Update a Centreon 20.10 platform

    Upgrade

    • Introduction to upgrade
    • Upgrade from Centreon 20.04
    • Upgrade from Centreon 19.10
    • Upgrade from Centreon 19.04
    • Upgrade from Centreon 18.10
    • Upgrade from Centreon 3.4

    Migrate

    • Introduction
    • Migrate from a Centreon 20.x platform
    • Migrate from a Centreon 3.4 platform
    • Nagios Reader to Centreon CLAPI
    • Migrate a platform with Poller Display module

Plugin Packs

  • Introduction to Plugin Packs
  • Tutorials

    • Collect OpenMetrics

    Applications

    • 3CX
    • Active Directory API
    • ActiveMQ JMX
    • Alyvix Server
    • Ansible
    • Ansible Tower
    • Antivirus ClamAV
    • Apache Server
    • Asterisk VoIP Server
    • Asterisk VoIP SNMP
    • Bind9 Web
    • BlueMind SSH
    • Cassandra
    • Cisco CMS
    • Cisco ISE
    • Cisco SSMS
    • Commvault CommServe Rest API
    • DRBD SSH
    • Dynatrace Rest API
    • EMC PPMA Rest API
    • Exchange 2010 API
    • Github
    • Github
    • Google Gsuite
    • Haproxy SNMP
    • Hibernate
    • IBM Tivoli Storage M
    • Microsoft DHCP SNMP
    • Microsoft IIS Server Restapi
    • Microsoft IIS Server NSClient API (Deprecated)
    • JBoss Server
    • Jenkins
    • Kafka
    • Kaspersky
    • Keepalived SNMP
    • Lync 2013
    • Maltem Insight Rest API
    • IP-Label datametrie API
    • IP-Label Newtest Rest API
    • McAfee Web Gateway
    • Microsoft Cluster Se
    • Microsoft IIS Server NRPE (Deprecated)
    • Microsoft SCCM
    • Microsoft WSUS
    • MS Active Directory
    • MS Biztalk
    • Graylog
    • MS Exchange 2K10
    • BlueMind
    • Mulesoft Anypoint
    • Netbackup Rest API
    • Netdata RestAPI
    • Nginx Server
    • Nginx Plus Restapi
    • OpenHeadend
    • OpenLDAP
    • OpenMetrics
    • OpenVPN OMI
    • OpenWeatherMap
    • Oracle GoldenGate SSH
    • Oracle VM Manager API
    • Pacemaker
    • Peoplesoft
    • Pfsense Fauxapi
    • PHP APC
    • PHP FPM
    • PVX
    • Quadstor
    • RabbitMQ RestAPI
    • Rapid Recovery SNMP
    • Redis Cli
    • Redis Restapi
    • Rubrik Rest API
    • Rudder
    • Salesforce
    • SAP HANA
    • SCOM Rest API
    • Gorgone Restapi
    • Selenium
    • Sendmail
    • Skype 2015
    • Smartermail Server
    • Solr
    • Squid SNMP
    • Symantec Netbackup
    • Tomcat JMX
    • Tomcat Webmanager
    • TrendMicro Iwsva
    • Varnish NRPE
    • Veeam
    • Veeam API
    • VerneMQ Restapi
    • VMware VCSA RestAPI
    • VTOM
    • Wazuh Rest API
    • Weblogic Server
    • ZIXI
    • Zookeeper

    Centreon

    • Centreon Central
    • Centreon Database
    • Centreon-HA
    • Centreon Map
    • Centreon Map4
    • Centreon MBI
    • Centreon Poller

    Cloud

    • Amazon API Gateway
    • Amazon CloudFront
    • Amazon CloudWatch
    • Amazon CloudWatch Logs
    • Amazon EBS
    • Amazon EC2
    • Amazon ElastiCache
    • Amazon EFS
    • Amazon Kinesis
    • Amazon RDS
    • Amazon S3
    • Amazon SNS
    • Amazon SQS
    • AWS Billing
    • AWS ELB
    • AWS Health
    • AWS Lambda
    • AWS Transit Gateway
    • AWS VPN
    • Amazon SES
    • Azure Automation
    • Azure Elastic Pool
    • Azure Event Grid
    • Azure ExpressRoute
    • Azure Firewall
    • Azure Key Vault
    • Azure Load Balancer
    • Azure Log Analytics
    • Azure Monitor
    • Azure Network Interface
    • Azure Public IP
    • Azure Recovery
    • Azure Resource
    • Azure ServiceBus
    • Azure SignalR
    • Azure SQL Database
    • Azure SQL Server
    • Azure Storage Account
    • Azure Virtual Machine
    • Azure Virtual Network
    • Azure VPN Gateway
    • Google CloudSQL MySQL
    • Google Compute Engine
    • Google Stackdriver
    • Google Storage
    • cAdvisor
    • Cloud Foundry
    • Docker
    • IBM Softlayer
    • Kubernetes API
    • Kubernetes w/ Prometheus
    • Office 365
    • Office365 Exchange
    • Office365 OneDrive
    • Office365 SharePoint
    • Office365 Skype
    • Office365 Teams
    • OVH
    • Prometheus Server
    • Node Exporter
    • VMware VeloCloud

    Database

    • CouchDB Rest API
    • Elasticsearch
    • Elasticsearch (Deprecated)
    • Firebird
    • InfluxDB
    • Informix DB
    • Informix DB SNMP
    • Microsoft SQL Server
    • MongoDB
    • MySQL/MariaDB
    • Oracle Database
    • PostgreSQL DB
    • RRDtool
    • Sybase
    • Warp10 Sensision

    Hardware Server

    • Adder AIM SNMP
    • AEG ACM
    • Avocent ACS 6000
    • Axis Video
    • Cisco Collaboration Endpoint Rest API
    • Cisco UCS
    • Dell CMC
    • Dell iDRAC
    • Dell OpenManage
    • Eltek eNexus SNMP
    • Fujitsu Server SNMP
    • Hanwha camera SNMP
    • Hikvision camera SNMP
    • HMS Ewon SNMP
    • Timelinkmicro Tms6001
    • HP Blade Chassis
    • HP Ilo Rest API
    • HP Ilo XMLAPI
    • HP OneView Rest API
    • HP Proliant
    • Huawei HMM
    • Huawei iBMC
    • IBM BladeCenter
    • IBM HMC SSH
    • IBM IMM
    • Lenovo XCC SNMP
    • Cisco Telepresence System SNMP
    • Masterclock NTP100GP
    • Pexip Infinity ManagementAPI
    • Polycom GroupSeries SNMP
    • Polycom Trio Rest API
    • Safenet Keysecure
    • Sun MgmtCard
    • Sun Mseries
    • Sun SFxxK
    • Supermicro

    Network

    • 3com Network
    • A10 AX
    • Acme Packet
    • Adva FSP 150 SNMP
    • Adva FSP 3000 SNMP
    • Aerohive
    • Alcatel Omniswitch
    • Allied Telesis SNMP
    • Alvarion BreezeACCESS SNMP
    • Arista Switch
    • Arkoon
    • Aruba Instant SNMP
    • Aruba Standard
    • Atrica Routeur
    • Athonet ePC SNMP
    • Atto Fibrebridge SNMP
    • Barracuda Cloudgen SNMP
    • Bee Ware
    • BGP Protocol SNMP
    • Bluecoat generic
    • Brocade Switch
    • CheckPoint firewall
    • Cisco Apic
    • Cisco ASA
    • Cisco Call Manager
    • Cisco Callmanager SXML
    • Cisco ESA XMLAPI
    • Cisco Firepower Management Console Rest API
    • Cisco Firepower SNMP
    • Cisco IronPort
    • Cisco Meraki Rest API
    • Cisco Meraki
    • Cisco Prime
    • Cisco Small Business
    • Cisco Standard
    • Cisco Standard SSH
    • Cisco VCS
    • Cisco Voice Gateway
    • Cisco Waas
    • Cisco WLC
    • Citrix Acceleration
    • Citrix Netscaler
    • Citrix SDX
    • Colubris SNMP
    • Cyberoam
    • D-Link DGS 3100
    • D-Link standard SNMP
    • Dell 6200
    • Dell 6200 SNMP
    • Dell N4000
    • Dell OS10 SNMP
    • Dell S-series
    • DenyAll SNMP
    • Dell Xseries
    • Digi Anywhere USB
    • Digi PortServers TS
    • Digi PortServers TS
    • Digi Sarian
    • Efficienti IP
    • Evertz FC7800
    • Extreme Network
    • F5 BigIP
    • Lenovo Flex System Switch
    • Fiberstore SNMP
    • Fortinet FortiAuthenticator SNMP
    • Fortinet Fortigate
    • Fortinet Fortimanage
    • Freebox
    • FritzBox
    • Gorgy NTP Server
    • H3C Network
    • Hirschmann switch
    • HP Procurve
    • HP Standard Network
    • HP Virtual Connect
    • Huawei
    • Infoblox SNMP
    • Juniper EX Series
    • Juniper GGSN
    • Juniper ISG
    • Juniper M-Series
    • Juniper Mag
    • Juniper SA
    • Juniper SRX
    • Juniper SSG
    • Juniper Trapeze
    • Kemp Loadbalancer
    • Meru SNMP
    • Mikrotik SNMP
    • Mitel 3300ICP
    • Moxa Switch
    • Mrv Optiswitch
    • NetASQ Network
    • Netgear MSeries
    • Netscaler MPX 8000
    • Nokia TiMos
    • Nortel Standard
    • Omniswitch 6850
    • OneAccess Network
    • Oracle Infiniband
    • Palo Alto firewall SNMP
    • Palo Alto firewall SSH
    • Peplink Balance
    • Peplink Pepwave SNMP
    • Perle IDS SNMP
    • pfSense
    • Rad Airmux SNMP
    • Radware Alteon
    • Raisecom
    • RedBack Router
    • Riverbed Interceptor
    • Riverbed SteelHead
    • Ruckus
    • Ruckus Zonedirector
    • Ruckus ICX
    • Ruckus SCG
    • Ruckus Smartzone
    • Ruggedcom Network
    • Silverpeak
    • Sonicwall
    • Sophos ES
    • Stonesoft
    • Stormshield SNMP
    • Stormshield SSH
    • Teltonika SNMP
    • Ubiquiti AirFiber SNMP
    • Traffic Director
    • Ucopia
    • Watchguard
    • Zyxel
    • Versa SNMP
    • Versa Director Restapi

    Operating System

    • AIX SNMP
    • Base Pack
    • FreeBSD SNMP
    • HP-UX
    • IBM AS400
    • Linux NRPE
    • Linux NRPE3
    • Linux SNMP
    • Linux SSH
    • Mac SNMP
    • Solaris SNMP
    • Windows NRPE
    • Windows NRPE 0.5
    • Windows NSClient API
    • Windows SNMP

    Printer

    • Printer standard

    Protocol

    • BGP Protocol
    • DHCP Server
    • DNS Service
    • FTP Server
    • Generic SNMP
    • HTTP Server
    • IMAP Server
    • JMX value
    • LDAP Server
    • Modbus
    • NTP Server
    • OSPF Protocol
    • POP Server
    • Protocol DHCP
    • Protocol SSH
    • Protocol TCP
    • Protocol UDP
    • Radius Service
    • SMTP Server
    • Telnet Scenario
    • TFTP Server
    • X509 Certificat

    Sensor

    • ABB CMS-700
    • AKCP Sensor
    • Geist p8000 sensor SNMP
    • Geist Sensor SNMP
    • HWg-STE Sensor
    • Jacarta Sensor
    • LM Sensors
    • Netbotz Sensor
    • Sensor IP
    • SensorGateway
    • Sensormetrix

    Storage

    • Adic Tape SNMP
    • Avid Isis
    • Buffalo TeraStation SNMP
    • Dell Compellent
    • Dell Compellent API
    • Dell Equallogic
    • Dell FluidFS
    • Dell MD3000
    • Dell Me4 Rest API
    • Dell ML6000
    • Dell TL2000
    • EMC Celerra
    • EMC Clariion
    • EMC Data Domain
    • EMC Isilon
    • EMC RecoveryPoint
    • EMC Symmetrix API
    • EMC Symmetrix NRPE
    • EMC Unisphere Rest API
    • EMC Vplex
    • EMC Xtremio
    • Exagrid
    • Fujitsu Eternus DX
    • Hitachi HCP SNMP
    • Hitachi NAS
    • Hitachi Standard
    • HP 3PAR 7000
    • HP 3PAR SSH
    • HP EVA
    • HP Lefthand
    • HP MSA2000
    • HP MSL
    • HP P2000
    • HP StoreOnce
    • HP StoreOnce SSH
    • IBM DS3000
    • IBM DS4000
    • IBM DS5000
    • IBM FlashSystem 900
    • IBM Storwize
    • IBM TS2900
    • IBM TS3100
    • IBM TS3200
    • IBM TS3500
    • Kaminario RestAPI
    • Lenovo S Series
    • NetApp Ontap OnCommand API
    • NetApp Ontap Rest API
    • NetApp Ontap SNMP
    • Netapp Santricity Restapi
    • Netgear Readynas SNMP
    • Nimble Storage
    • Nimble Storage Rest API
    • Oracle ZFS
    • Oracle ZS
    • Overland Neo
    • Panzura
    • Pure Storage RestAPI
    • Qnap
    • QSAN NAS
    • Quantum DXi Series
    • Quantum Scalar
    • Storagetek SL
    • Synology
    • Violin Memory 3000

    Toip Voip

    • Alcatel OXE
    • Asterisk VoIP Server
    • AudioCodes
    • Avaya AES SNMP
    • Avaya Media Gateway SNMP
    • Polycom DMA SNMP
    • Polycom HDX SNMP
    • Polycom RMX
    • Polycom RPRM SNMP
    • Sonus SBC
    • XiVO VoIP Server

    Ups Pdu

    • Alpha UPS SNMP
    • APC ATS
    • APC PDU
    • APC UPS
    • Clever PDU
    • CyberPower Systems PDU SNMP
    • Eaton ATS SNMP
    • Eaton PDU SNMP
    • Emerson PDU
    • HP UPS SNMP
    • MGE UPS System
    • Nitram UPS SNMP
    • Powerware UPS
    • Raritan PDU
    • Schleifenbauer Gateway SNMP
    • UPS Socomec Net Vision SNMP
    • UPS Standard

    Virtualization

    • Hyper-V 2012
    • Nutanix
    • Proxmox VE
    • VMware ESX
    • VMware ESX WS-MAN
    • VMware vCenter
    • VMware vCenter v4
    • VMware vCenter v5
    • VMware vCenter v6
    • VMware VM

Integrations

    External

    • Accedian PVX Skylight
    • Maltem Insight Performances Rest API

    Notifications

    • Notify with Telegram bot

    Open Tickets

    • BMC Footprints
    • BMC Remedy
    • EasyVista
    • GLPI
    • GLPI RestAPI
    • iTop
    • IWS Isilog
    • Jira
    • Mail
    • OTRS RestAPI
    • Request Tracker RestAPI
    • Serena
    • ServiceNow

    Stream Connectors

    • BSM
    • Elasticsearch events
    • Elasticsearch metrics
    • NDO
    • Opsgenie integration
    • HP OMI
    • PagerDuty Service integration
    • ServiceNow Event Manager
    • ServiceNow MID Server
    • Splunk Metrics
    • Splunk Events
    • Warp10

Mobile App.

  • Introduction

API

  • Introduction
  • Command Line API (v1)
  • Rest API (v1)
  • Rest API (v2)
  • Graphical views API (beta)

Developer resources

  • About developer resources
  • How to write a module
  • How to write a Stream Connector
  • How to translate Centreon
  • How to write a widget
  • Centreon Broker

    • Stream connectors
    • The BBDO protocol
    • Centreon Broker Event Mapping

Releases

  • Centreon Platform 20.10.0
  • Products lifecycle policy
  • Release notes by component

    • Centreon Core
    • Commercial Extensions
    • Open Source Extensions
Edit

Rest API (v1)

Overview

This documentation is for developers familiar with HTTP requests and JSON. It explains various API operations, related requests and responses structure, and error codes. If you are not familiar with the JSON API, we recommend you to use the Centreon command line API documentation.

Permissions

To perform API calls using a specific Centreon user, you need permissions to do so.

There are two types of permission:

You can give access to the configuration for a specific Centreon user. To do so you have to edit user settings on the menu Configuration > Users > Contacts/Users, edit user and on second tab check box Reach API Configuration.

You can give access to the realtime for a specific Centreon user. To do so you have to edit user settings on the menu Configuration > Users > Contacts/Users, edit user and on second tab check box Reach API Realtime.

If you want both then check both checkboxes

Authentication

Using POST method and the URL below:

api.domain.tld/centreon/api/index.php?action=authenticate

Body form-data:

ParameterTypeValue
usernameTextThe user name you use to login on Centreon
passwordTextYour Centreon password

The response is a json flow getting back the authentication token :

{
    "authToken": "NTc1MDU3MGE3M2JiODIuMjA4OTA2OTc="
}

This token will be used later on the other API actions.

Error codes

CodeMessage
200Successful
400Missing parameter / Missing name parameter / Unknown parameter / Objects are not linked
401Unauthorized
404Object not found / Method not implemented into Centreon API
409Object already exists / Name is already in use / Objects already linked
500Internal server error (custom message)

Configuration

Getting started

Most of the actions available (about 95%) in the command line API is available in the rest API.

Here is an example for listing hosts using rest API.

Using POST method and the URL below:

api.domain.tld/centreon/api/index.php?action=action&object=centreon_clapi

Header:

KeyValue
Content-Typeapplication/json
centreon-auth-tokenThe value of authToken you got on the authentication response

Body:

{
    "action": "show",
    "object": "HOST"
}
  • The key action corresponds to the option -a in Centreon CLAPI, the value show corresponds to the -a option value.
  • The key object corresponds to the option -o in Centreon CLAPI, the value HOST corresponds to the -o option value.

The equivalent action using Centreon CLAPI is:

centreon -u admin -p centreon -o HOST -a show

Response: The response is a json flow listing all hosts and formated as below:

{
    "result": [
        {
            "id": "12",
            "name": "mail-uranus-frontend",
            "alias": "mail-uranus-frontend",
            "address": "mail-uranus-frontend",
            "activate": "1"
        },
        {
            "id": "13",
            "name": "mail-neptune-frontend",
            "alias": "mail-neptune-frontend",
            "address": "mail-neptune-frontend",
            "activate": "1"
        },
        {
            "id": "14",
            "name": "srvi-mysql01",
            "alias": "srvi-mysql01",
            "address": "srvi-mysql01",
            "activate": "1"
        }
    ]
}

Some actions need the values key (the option -v in Centreon CLAPI). Depending on the called action, the body can contain values key. We will see that in detail later.

API Calls

All API calls you can do on objects are described below. Note that you need to be authenticate before each call.

API calls on the Host object are fully-detailed below. For the next objects, only the actions available are listed, so just follow the same approach as for the host object for an API call.

Host

List hosts

POST

api.domain.tld/centreon/api/index.php?action=action&object=centreon_clapi

Header

KeyValue
Content-Typeapplication/json
centreon-auth-tokenThe value of authToken you got on the authentication response

Body

{
    "action": "show",
    "object": "host"
}

Response

{
    "result": [
        {
        "id": "79",
        "name": "mail-uranus-frontend",
        "alias": "mail-uranus-frontend",
        "address": "mail-uranus-frontend",
        "activate": "1"
        },
        {
        "id": "80",
        "name": "mail-neptune-frontend",
        "alias": "mail-neptune-frontend",
        "address": "mail-neptune-frontend",
        "activate": "1"
        },
        {
        "id": "81",
        "name": "mail-earth-frontend",
        "alias": "mail-earth-frontend",
        "address": "mail-earth-frontend",
        "activate": "1"
        }
    ]
}

Add host

POST

api.domain.tld/centreon/api/index.php?action=action&object=centreon_clapi

Header

KeyValue
Content-Typeapplication/json
centreon-auth-tokenThe value of authToken you got on the authentication response

Body

{
    "action": "add",
    "object": "host",
    "values": "test;Test host;127.0.0.1;generic-host;central;Linux-SerVers"
}

Response

{
    "result": []
}

Delete host

POST

api.domain.tld/centreon/api/index.php?action=action&object=centreon_clapi

Header

KeyValue
Content-Typeapplication/json
centreon-auth-tokenThe value of authToken you got on the authentication response

Body

{
    "action": "del",
    "object": "host",
    "values": "test"
}

Response

{
    "result": []
}

Set parameters

POST

api.domain.tld/centreon/api/index.php?action=action&object=centreon_clapi

Header

KeyValue
Content-Typeapplication/json
centreon-auth-tokenThe value of authToken you got on the authentication response

Body

{
    "action": "setparam",
    "object": "host",
    "values": "test;ParameterToSet;NewParameter"
}

Available parameters

ParameterDescription
2d_coords2D coordinates (used by statusmap)
3d_coords3D coordinates (used by statusmap)
geo_coordsGeo coordinates (used by Centreon MAP)
action_urlAction URL
activateWhether or not host is enabled
active_checks_enabledWhether or not active checks are enabled
acknowledgement_timeoutAcknowledgement timeout (in seconds)
addressHost IP Address
aliasAlias
check_commandCheck command
check_command_argumentsCheck command arguments
check_intervalNormal check interval
check_freshnessCheck freshness (in seconds)
check_periodCheck period
checks_enabledWhether or not checks are enabled
contact_additive_inheritanceEnables contact additive inheritance
cg_additive_inheritanceEnables contactgroup additive inheritance
event_handlerEvent handler command
event_handler_argumentsEvent handler command arguments
event_handler_enabledWhether or not event handler is enabled
first_notification_delayFirst notification delay (in seconds)
flap_detection_enabledWhether or not flap detection is enabled
flap_detection_optionsFlap detection options
icon_imageIcon image
icon_image_altIcon image text
max_check_attemptsMaximum number of attempt before a HARD state is declared
nameHost name
notesNotes
notes_urlNotes URL
notifications_enabledWhether or not notification is enabled
notification_intervalNotification interval
notification_optionsNotification options
notification_periodNotification period
obsess_over_hostWhether or not obsess over host option is enabled
passive_checks_enabledWhether or not passive checks are enabled
process_perf_dataProcess performance data command
retain_nonstatus_informationWhether or not there is non-status retention
retain_status_informationWhether or not there is status retention
retry_check_intervalRetry check interval
snmp_communitySnmp Community
snmp_versionSnmp version
stalking_optionsComma separated options: 'o' for OK, 'd' for Down, 'u' for Unreachable
statusmap_imageStatus map image (used by statusmap
host_notification_optionsNotification options (d,u,r,f,s)
timezoneTimezone

Response

{
    "result": []
}

Get parameters

POST

api.domain.tld/centreon/api/index.php?action=action&object=centreon_clapi

Header

KeyValue
Content-Typeapplication/json
centreon-auth-tokenThe value of authToken you got on the authentication response

Body

{
    "action": "getparam",
    "object": "host",
    "values": "test;ParameterToGet|ParameterToGet"
}

Available parameters

ParameterDescription
2d_coords2D coordinates (used by statusmap)
3d_coords3D coordinates (used by statusmap)
geo_coordsGeo coordinates (used by Centreon MAP)
action_urlAction URL
activateWhether or not host is enabled
active_checks_enabledWhether or not active checks are enabled
addressHost IP Address
aliasAlias
check_commandCheck command
check_command_argumentsCheck command arguments
check_intervalNormal check interval
check_freshnessCheck freshness (in seconds)
check_periodCheck period
checks_enabledWhether or not checks are enabled
contact_additive_inheritanceEnables contact additive inheritance
cg_additive_inheritanceEnables contactgroup additive inheritance
event_handlerEvent handler command
event_handler_argumentsEvent handler command arguments
event_handler_enabledWhether or not event handler is enabled
first_notification_delayFirst notification delay (in seconds)
flap_detection_enabledWhether or not flap detection is enabled
flap_detection_optionsFlap detection options
icon_imageIcon image
icon_image_altIcon image text
max_check_attemptsMaximum number of attempt before a HARD state is declared
nameHost name
notesNotes
notes_urlNotes URL
notifications_enabledWhether or not notification is enabled
notification_intervalNotification interval
notification_optionsNotification options
notification_periodNotification period
obsess_over_hostWhether or not obsess over host option is enabled
passive_checks_enabledWhether or not passive checks are enabled
process_perf_dataProcess performance data command
retain_nonstatus_informationWhether or not there is non-status retention
retain_status_informationWhether or not there is status retention
retry_check_intervalRetry check interval
snmp_communitySnmp Community
snmp_versionSnmp version
stalking_optionsComma separated options: 'o' for OK, 'd' for Down, 'u' for Unreachable
statusmap_imageStatus map image (used by statusmap
host_notification_optionsNotification options (d,u,r,f,s)
timezoneTimezone

Response

{
    "result": [
        {
            "alias": "test",
            "address": "192.168.56.101",
            "timezone": "Europe/Berlin"
        }
    ]
}

Set instance poller

POST

api.domain.tld/centreon/api/index.php?action=action&object=centreon_clapi

Header

KeyValue
Content-Typeapplication/json
centreon-auth-tokenThe value of authToken you got on the authentication response

Body

{
    "action": "setinstance",
    "object": "host",
    "values": "test;Poller-2"
}

Response

{
    "result": []
}

Get macro

POST

api.domain.tld/centreon/api/index.php?action=action&object=centreon_clapi

Header

KeyValue
Content-Typeapplication/json
centreon-auth-tokenThe value of authToken you got on the authentication response

Body

{
    "action": "getmacro",
    "object": "host",
    "values": "mail-uranus-frontend"
}

Response Here is a response example :

{
    "result": [
        {
            "macro name": "ALIVENUM",
            "macro value": "1",
            "is_password": "",
            "description": "",
            "source": "generic-host-bench"
        },
        {
            "macro name": "ALIVEWARNING",
            "macro value": "3000,80",
            "is_password": "",
            "description": "",
            "source": "generic-host-bench"
        },
        {
            "macro name": "ALIVECRITICAL",
            "macro value": "5000,100",
            "is_password": "",
            "description": "",
            "source": "generic-host-bench"
        }
    ]
}

Set macro

POST

api.domain.tld/centreon/api/index.php?action=action&object=centreon_clapi

Header

KeyValue
Content-Typeapplication/json
centreon-auth-tokenThe value of authToken you got on the authentication response

Body

{
    "action": "setmacro",
    "object": "host",
    "values": "mail-uranus-frontend;MacroName;NewValue"
}

To edit an existing custom macro, The MacroName used on the body should be defined on the Custom Marco of the chosen host. If the marco doesn't exist, it will be created.

Response

{
    "result": []
}

Delete macro

POST

api.domain.tld/centreon/api/index.php?action=action&object=centreon_clapi

Header

KeyValue
Content-Typeapplication/json
centreon-auth-tokenThe value of authToken you got on the authentication response

Body

{
    "action": "delmacro",
    "object": "host",
    "values": "mail-uranus-frontend;MacroName"
}

The MacroName used on the body is the macro to delete. It should be defined on the Custom Marco of the chosen host.

Response

{
    "result": []
}

Get template

POST

api.domain.tld/centreon/api/index.php?action=action&object=centreon_clapi

Header

KeyValue
Content-Typeapplication/json
centreon-auth-tokenThe value of authToken you got on the authentication response

Body

{
    "action": "gettemplate",
    "object": "host",
    "values": "mail-uranus-frontend"
}

Response Here is a response example :

{
    "result": [
        {
            "id": "3",
            "name": "Servers-Linux"
        },
        {
            "id": "62",
            "name": "Postfix-frontend"
        },
        {
            "id": "59",
            "name": "Cyrus-murder-frontend"
        }
    ]
}

Set template

POST

api.domain.tld/centreon/api/index.php?action=action&object=centreon_clapi

Header

KeyValue
Content-Typeapplication/json
centreon-auth-tokenThe value of authToken you got on the authentication response

Body

{
    "action": "settemplate",
    "object": "host",
    "values": "mail-uranus-frontend;MyHostTemplate"
}

The MyHostTemplate used on the body should exist as a host template. The new template erase templates already exist.

Response

{
    "result": []
}

Add template

POST

api.domain.tld/centreon/api/index.php?action=action&object=centreon_clapi

Header

KeyValue
Content-Typeapplication/json
centreon-auth-tokenThe value of authToken you got on the authentication response

Body

{
    "action": "addtemplate",
    "object": "host",
    "values": "mail-uranus-frontend;MyHostTemplate"
}

The MyHostTemplate used on the body should exist as a host template. The new template is added without erasing template already linked

Response

{
    "result": []
}

Delete template

POST

api.domain.tld/centreon/api/index.php?action=action&object=centreon_clapi

Header

KeyValue
Content-Typeapplication/json
centreon-auth-tokenThe value of authToken you got on the authentication response

Body

{
    "action": "deltemplate",
    "object": "host",
    "values": "mail-uranus-frontend;MyHostTemplate"
}

The MyHostTemplate used on the body should exist as a host template.

Response

{
    "result": []
}

Apply template

POST

api.domain.tld/centreon/api/index.php?action=action&object=centreon_clapi

Header

KeyValue
Content-Typeapplication/json
centreon-auth-tokenThe value of authToken you got on the authentication response

Body

{
    "action": "applytpl",
    "object": "host",
    "values": "mail-uranus-frontend"
}

Response

{
    "result": []
}

Get parent

POST

api.domain.tld/centreon/api/index.php?action=action&object=centreon_clapi

Header

KeyValue
Content-Typeapplication/json
centreon-auth-tokenThe value of authToken you got on the authentication response

Body

{
    "action": "getparent",
    "object": "host",
    "values": "mail-uranus-frontend"
}

Response

{
    "result": [
        {
            "id": "219",
            "name": "mail-uranus-frontdad"
        }
    ]
}

Add parent

POST

api.domain.tld/centreon/api/index.php?action=action&object=centreon_clapi

Header

KeyValue
Content-Typeapplication/json
centreon-auth-tokenThe value of authToken you got on the authentication response

Body

{
    "action": "addparent",
    "object": "host",
    "values": "mail-uranus-frontend;fw-berlin"
}

Response

{
    "result": []
}

To add more than one parent to a host, use the character '|'. Ex:

"values": "mail-uranus-frontend;fw-berlin|fw-dublin"

The add action add the parent without overwriting he previous configuration.

Set parent

POST

api.domain.tld/centreon/api/index.php?action=action&object=centreon_clapi

Header

KeyValue
Content-Typeapplication/json
centreon-auth-tokenThe value of authToken you got on the authentication response

Body

{
    "action": "setparent",
    "object": "host",
    "values": "mail-uranus-frontend;fw-berlin"
}

Response

{
    "result": []
}

To set more than one parent to a host, use the character '|'. Ex:

"values": "mail-uranus-frontend;fw-berlin|fw-dublin"

The set action overwrite the previous configuration before setting the new parent.

Delete parent

POST

api.domain.tld/centreon/api/index.php?action=action&object=centreon_clapi

Header

KeyValue
Content-Typeapplication/json
centreon-auth-tokenThe value of authToken you got on the authentication response

Body

{
    "action": "delparent",
    "object": "host",
    "values": "mail-uranus-frontend;fw-berlin"
}

Response

{
    "result": []
}

To delete more than one parent, use the character '|'. Ex:

"values": "mail-uranus-frontend;fw-berlin|fw-dublin"

Get child

POST

api.domain.tld/centreon/api/index.php?action=action&object=centreon_clapi

Header

KeyValue
Content-Typeapplication/json
centreon-auth-tokenThe value of authToken you got on the authentication response

Body

  {
    "action": "getchild",
    "object": "host",
    "values": "mail-uranus-frontdad"
  }

Response

 {
  "result": [
    {
      "id": "219",
      "name": "mail-uranus-frontchild"
    }
  ]
 }

Add child

POST

api.domain.tld/centreon/api/index.php?action=action&object=centreon_clapi

Header

KeyValue
Content-Typeapplication/json
centreon-auth-tokenThe value of authToken you got on the authentication response

Body

  {
    "action": "addchild",
    "object": "host",
    "values": "fw-berlin;mail-uranus-frontend"
  }

Response

 {
  "result": []
 }

To add more than one child to a host, use the character '|'. Ex:

"values": "fw-berlin;mail-uranus-frontend|mail-neptune-frontend"

The add action add the child without overwriting the previous configuration.

Set child

POST

api.domain.tld/centreon/api/index.php?action=action&object=centreon_clapi

Header

KeyValue
Content-Typeapplication/json
centreon-auth-tokenThe value of authToken you got on the authentication response

Body

  {
    "action": "setchild",
    "object": "host",
    "values": "fw-berlin;mail-uranus-frontend"
  }

Response

 {
  "result": []
 }

To set more than one child to a host, use the character '|'. Ex:

"values": "fw-berlin;mail-uranus-frontend|mail-neptune-frontend"

The set action overwrite the previous configuration before setting the new child.

Delete child

POST

api.domain.tld/centreon/api/index.php?action=action&object=centreon_clapi

Header

KeyValue
Content-Typeapplication/json
centreon-auth-tokenThe value of authToken you got on the authentication response

Body

  {
    "action": "delchild",
    "object": "host",
    "values": "fw-berlin;mail-uranus-frontend"
  }

Response

 {
  "result": []
 }

To delete more than one child, use the character '|'. Ex:

"values": "fw-berlin;mail-uranus-frontend|mail-neptune-frontend"

Get contact group

POST

api.domain.tld/centreon/api/index.php?action=action&object=centreon_clapi

Header

KeyValue
Content-Typeapplication/json
centreon-auth-tokenThe value of authToken you got on the authentication response

Body

{
    "action": "getcontactgroup",
    "object": "host",
    "values": "mail-uranus-frontend"
}

Response

{
    "result": [
        {
            "id": "6",
            "name": "Mail-Operators"
        }
    ]
}

Add contact group

POST

api.domain.tld/centreon/api/index.php?action=action&object=centreon_clapi

Header

KeyValue
Content-Typeapplication/json
centreon-auth-tokenThe value of authToken you got on the authentication response

Body

{
    "action": "addcontactgroup",
    "object": "host",
    "values": "mail-uranus-frontend;Supervisors"
}

Response

{
    "result": []
}

To add more than one contactgroup to a host, use the character '|'. Ex:

"values": "mail-uranus-frontend;Supervisors|Guest"

The add action add the contact without overwriting he previous configuration.

Set contact group

POST

api.domain.tld/centreon/api/index.php?action=action&object=centreon_clapi

Header

KeyValue
Content-Typeapplication/json
centreon-auth-tokenThe value of authToken you got on the authentication response

Body

{
    "action": "setcontactgroup",
    "object": "host",
    "values": "mail-uranus-frontend;Supervisors"
}

Response

{
    "result": []
}

To set more than one contactgroup to a host, use the character '|'. Ex:

"values": "mail-uranus-frontend;Supervisors|Guest"

The set action overwrite the previous configuration before setting the new contactgroup.

Delete contact group

POST

api.domain.tld/centreon/api/index.php?action=action&object=centreon_clapi

Header

KeyValue
Content-Typeapplication/json
centreon-auth-tokenThe value of authToken you got on the authentication response

Body

{
    "action": "delcontactgroup",
    "object": "host",
    "values": "mail-uranus-frontend;Guest"
}

Response

{
    "result": []
}

To delete more than one contactgroup, use the character '|'. Ex:

"values": "mail-uranus-frontend;Guest|Supervisors"

Get contact

POST

api.domain.tld/centreon/api/index.php?action=action&object=centreon_clapi

Header

KeyValue
Content-Typeapplication/json
centreon-auth-tokenThe value of authToken you got on the authentication response

Body

{
    "action": "getcontact",
    "object": "host",
    "values": "mail-uranus-frontend"
}

Response

{
    "result": [
        {
            "id": "20",
            "name": "user-mail"
        }
    ]
}

Add contact

POST

api.domain.tld/centreon/api/index.php?action=action&object=centreon_clapi

Header

KeyValue
Content-Typeapplication/json
centreon-auth-tokenThe value of authToken you got on the authentication response

Body

{
    "action": "addcontact",
    "object": "host",
    "values": "mail-uranus-frontend;admin"
}

Response

{
    "result": []
}

To add more than one contact to a host, use the character '|'. Ex:

"values": "mail-uranus-frontend;admin|SuperAdmin"

The add action add the contact without overwriting he previous configuration.

Set contact

POST

api.domain.tld/centreon/api/index.php?action=action&object=centreon_clapi

Header

KeyValue
Content-Typeapplication/json
centreon-auth-tokenThe value of authToken you got on the authentication response

Body

{
    "action": "setcontact",
    "object": "host",
    "values": "mail-uranus-frontend;admin"
}

Response

{
    "result": []
}

To set more than one contact to a host, use the character '|'. Ex:

"values": "mail-uranus-frontend;admin|SuperAdmin"

The set action overwrite the previous configuration before setting the new contact.

Delete contact

POST

api.domain.tld/centreon/api/index.php?action=action&object=centreon_clapi

Header

KeyValue
Content-Typeapplication/json
centreon-auth-tokenThe value of authToken you got on the authentication response

Body

{
    "action": "delcontact",
    "object": "host",
    "values": "mail-uranus-frontend;Guest"
}

Response

{
    "result": []
}

To delete more than one contact, use the character '|'. Ex:

"values": "mail-uranus-frontend;admin|SuperAdmin"

Get hostgroup

POST

api.domain.tld/centreon/api/index.php?action=action&object=centreon_clapi

Header

KeyValue
Content-Typeapplication/json
centreon-auth-tokenThe value of authToken you got on the authentication response

Body

{
    "action": "gethostgroup",
    "object": "host",
    "values": "mail-uranus-frontend"
}

Response

{
    "result": [
        {
            "id": "53",
            "name": "Linux-Servers"
        },
        {
            "id": "63",
            "name": "Mail-Cyrus-Frontend"
        }
    ]
}

Add hostgroup

POST

api.domain.tld/centreon/api/index.php?action=action&object=centreon_clapi

Header

KeyValue
Content-Typeapplication/json
centreon-auth-tokenThe value of authToken you got on the authentication response

Body

{
    "action": "addhostgroup",
    "object": "host",
    "values": "mail-uranus-frontend;Mail-Postfix-Frontend"
}

Response

{
    "result": []
}

To add more than one hostgroup to a host, use the character '|'. Ex:

"values": "mail-uranus-frontend;Mail-Postfix-Frontend|Linux-Servers"

The add action add the hostgroup without overwriting he previous configuration.

Set hostgroup

POST

api.domain.tld/centreon/api/index.php?action=action&object=centreon_clapi

Header

KeyValue
Content-Typeapplication/json
centreon-auth-tokenThe value of authToken you got on the authentication response

Body

{
    "action": "sethostgroup",
    "object": "host",
    "values": "mail-uranus-frontend;Linux-Servers"
}

Response

{
    "result": []
}

To set more than one hostgroup to a host, use the character '|'. Ex:

"values": "mail-uranus-frontend;Linux-Servers|Mail-Postfix-Frontend"

The set action overwrite the previous configuration before setting the new hostgroup.

Delete hostgroup

POST

api.domain.tld/centreon/api/index.php?action=action&object=centreon_clapi

Header

KeyValue
Content-Typeapplication/json
centreon-auth-tokenThe value of authToken you got on the authentication response

Body

{
    "action": "delhostgroup",
    "object": "host",
    "values": "mail-uranus-frontend;Linux-Servers"
}

Response

{
    "result": []
}

To delete more than one hostgroup, use the character '|'. Ex:

"values": "mail-uranus-frontend;Linux-Servers|Mail-Postfix-Frontend"

Enable

POST

api.domain.tld/centreon/api/index.php?action=action&object=centreon_clapi

Header

KeyValue
Content-Typeapplication/json
centreon-auth-tokenThe value of authToken you got on the authentication response

Body

{
    "action": "enable",
    "object": "host",
    "values": "mail-uranus-frontend"
}

Response

{
    "result": []
}

Disable

POST

api.domain.tld/centreon/api/index.php?action=action&object=centreon_clapi

Header

KeyValue
Content-Typeapplication/json
centreon-auth-tokenThe value of authToken you got on the authentication response

Body

{
    "action": "disable",
    "object": "host",
    "values": "mail-uranus-frontend"
}

Response

{
    "result": []
}

ACL

  • Object

    • ACL

Actions

- reload
- lastreload

Action ACL

  • Object

    • ACLACTION

Actions

- show
- add
- del
- setparam
- getaclgroup
- grant
- revoke

ACL groups

  • Object

    • ACLGROUP

Actions

- show
- add
- del
- setparam
- getmenu
- getaction
- getresource
- getcontact
- getcontactgroup
- setmenu
- setaction
- setresource
- addmenu
- addaction
- addresource
- delmenu
- delaction
- delresource
- setcontact
- setcontactgroup
- addcontact
- addcontactgroup
- delcontact
- delcontactgroup

Menu ACL

  • Object

    • ACLMENU

Actions

- show
- add
- del
- setparam
- getaclgroup
- grant
- revoke

Resource ACL

  • Object

    • ACLRESOURCE

Actions

- show
- add
- del
- setparam
- getaclgroup
- grant
- revoke

Centreon Broker

  • Object

    • CENTBROKERCFG

Actions

- show
- add
- del
- setparam
- listinput, listoutput, listlogger, listcorrelation, listtemporary,
liststats
- getinput , getoutput, getlogger, getcorrelation, gettemporary, getstats
- addinput, addoutput, addlogger, addcorrelation, addtemporary, addstats
- delinput, deloutput, dellogger, delcorrelation, deltemporary, delstats
- setinput, setoutput, setlogger, setcorrelation, settemporary, setstats

CGI CFG

  • Object

    • CGICFG

Actions

- show
- add
- del
- setparam

Commands

  • Object

    • CMD

Actions

- show
- add
- del
- setparam

Contacts

  • Object

    • CONTACT

Actions

- show
- add
- del
- setparam
- enable
- disable

Contact templates

  • Object

    • CONTACTTPL

Actions

- show
- add
- del
- setparam
- enable
- disable

Contact groups

  • Object

    • CG

Actions

- show
- add
- del
- setparam
- enable
- disable
- getcontact
- addcontact
- setcontact
- delcontact

Dependencies

  • Object

    • DEP

Actions

- show
- add
- del
- setparam
- listdep
- addparent
- addchild
- delparent
- delchild

Downtimes

  • Object

    • DOWNTIME

Actions

- show
- add
- del
- listperiods
- addweeklyperiod
- addmonthlyperiod
- addspecificperiod
- addhost, addhostgroup, addservice, addservicegroup
- delhost, delhostgroup, delservice, delservicegroup
- sethost, sethostgroup, setservice, setservicegroup

Host template

  • Object

    • HTPL

Actions APPLYTPL and SETINSTANCE actions on HTPL

- show
- add
- del
- setparam
- getmacro
- setmacro
- delmacro
- getparent
- addparent
- setparent
- delparent
- getcontactgroup
- addcontactgroup
- setcontactgroup
- delcontactgroup
- getcontact
- addcontact
- setcontact
- delcontact
- gethostgroup
- addhostgroup
- sethostgroup
- delhostgroup
- setseverity
- unsetseverity
- enable
- disable

Host categories

  • Object

    • HC

Actions

- show
- add
- del
- getmember
- addmember
- setmember
- setseverity
- unsetseverity
- delmember

Hostgroups

  • Object

    • HG

Actions

- show
- add
- del
- setparam
- getmember
- addmember
- setmember
- delmember

Instances ( Pollers)

  • Object

    • INSTANCE

Actions

- show
- add
- del
- setparam
- gethosts

Service templates

  • Object

    • STPL

Actions

- show
- add
- del
- setparam
- addhosttemplate
- sethosttemplate
- delhosttemplate
- getmacro
- setmacro
- delmacro
- getcontact
- addcontact
- setcontact
- delcontact
- getcontactgroup
- setcontactgroup
- delcontactgroup
- gettrap
- settrap
- deltrap

Services

  • Object

    • SERVICE

Actions

- show
- add
- del
- setparam
- addhost
- sethost
- delhost
- getmacro
- setmacro
- delmacro
- setseverity
- unsetseverity
- getcontact
- addcontact
- setcontact
- delcontact
- getcontactgroup
- setcontactgroup
- delcontactgroup
- gettrap
- settrap
- deltrap

Service groups

  • Object

    • SG

Actions

- show
- add
- del
- setparam
- getservice
- gethostgroupservice
- addservice
- setservice
- addhostgroupservice
- sethostgroupservice
- delservice
- delhostgroupservice

Service categories

  • Object

    • SC

Actions

- show
- add
- del
- setparam
- getservice
- getservicetemplate
- addservice
- setservice
- addservicetemplate
- setservicetemplate
- delservice
- delservicetemplate
- setseverity
- unsetseverity

Time periods

  • Object

    • TIMEPERIOD

Actions

- show
- add
- del
- setparam
- getexception
- setexception
- delexception

Traps

  • Object

    • TRAP

Actions

- show
- add
- del
- setparam
- getmatching
- addmatching
- delmatching
- updatematching

Vendors

  • Object

    • VENDOR

Actions

- show
- add
- del
- setparam
- generatetraps

Get business views

POST

api.domain.tld/centreon/api/index.php?action=action&object=centreon_clapi

Header

KeyValue
Content-Typeapplication/json
centreon-auth-tokenThe value of authToken you got on the authentication response

Body

{
    "action":"show",
    "object":"bv"
}

Response

The response is a JSON flow listing all hosts, formated as follows: :

{
    "result": [
        {
            "id_ba_group": "1",
            "name": "BA-Mail-View",
            "description": "BA Mail View"
        },
        {
            "id_ba_group": "2",
            "name": "BA-CIO-View",
            "description": "BA CIO View"
        }
    ]
}

Realtime information

Host Status

All monitoring information regarding hosts are available in throw the Centreon API.

Using GET method and the URL below:

api.domain.tld/centreon/api/index.php?object=centreon_realtime_hosts&action=list

Header

KeyValue
Content-Typeapplication/json
centreon-auth-tokenThe value of authToken you got on the authentication response

Parameters

You can pass a list of parameters in order to select the data you want.

Parametersvalues
viewTypeselect the predefined filter like in the monitoring view: all, unhandled, problems
fieldsthe fields list that you want to get separated by a ","
statusthe status of hosts that you want to get (up, down, unreachable, pending, all)
hostgrouphostgroup id filter
instanceinstance id filter
searchsearch pattern applyed on host name
criticalitya specific criticity
sortTypethe sortType (selected in the field list)
orderASC ou DESC
limitnumber of line you want
numberpage number

Field list :

FieldsDescription
idhost id
namehost name
aliashost alias (description of the host)
addresshost address (domain name or ip)
statehost state (UP = 0, DOWN = 2, UNREA = 3)
state_typehost state type (SOFT = 0, HARD = 1)
outputPlugin output - state message
max_check_attemptsmaximum check attempts
check_attemptcurrent attempts
last_checklast check time
last_state_changelast time the state change
last_hard_state_changelast time the state change in hard type
acknowledgedacknowledged flag
instancename of the instance who check this host
instance_idid of the instance who check this host
criticalitycriticality fo this host
passive_checksaccept passive results
active_checksactive checks are enabled
notifynotification is enabled
action_urlshortcut for action URL
notes_urlshortcut for note URL
notesnote
icon_imageicone image for this host
icon_image_alttitle of the image
scheduled_downtime_depthscheduled_downtime_depth
flappingis the host flapping ?

Using GET method and the URL below:

api.domain.tld/centreon/api/index.php?object=centreon_realtime_hosts&action=list&limit=60&viewType=all&sortType=name&order=desc&fields=id,name,alias,address,state,output,next_check

Service Status

All monitoring information regarding services are available in throw the Centreon API. With this call, you can also get host informations in the same time that service information. This web service provide the same possibility that the service monitoring view.

Using GET method and the URL below:

api.domain.tld/centreon/api/index.php?object=centreon_realtime_services&action=list

Header

KeyValue
Content-Typeapplication/json
centreon-auth-tokenThe value of authToken you got on the authentication response

Parameters

You can pass a list of parameters in order to select the data you want.

Parametersvalues
viewTypeselect the predefined filter like in the monitoring view: all, unhandled, problems
fieldsthe fields list that you want to get separated by a ","
statusthe status of services that you want to get (ok, warning, critical, unknown, pending, all)
hostgrouphostgroup id filter
servicegroupservicegroup id filter
instanceinstance id filter
searchsearch pattern applied on service
searchHostsearch pattern applied on host
searchOutputsearch pattern applied on output
criticalitya specific criticity
sortTypethe sortType (selected in the field list)
orderASC ou DESC
limitnumber of line you want
numberpage number

Field list :

FieldsDescription
host_idhost id
host_namehost name
host_aliashost alias (description of the host)
host_addresshost address (domain name or ip)
host_statehost state (UP = 0, DOWN = 2, UNREA = 3)
host_state_typehost state type (SOFT = 0, HARD = 1)
host_outputPlugin output - state message
host_max_check_attemptsmaximum check attempts for host
host_check_attemptcurrent attempts
host_last_checklast check time
host_acknowledgedacknowledged flag
instancename of the instance who check this host
instance_idid of the instance who check this host
host_action_urlshortcut for action URL
host_notes_urlshortcut for note URL
host_notesnote
descriptionservice description - service name
display_nameservice display name
service_idservice id
stateservice state
state_typeservice state type (SOFT = 0, HARD = 1)
outputservice output returned by plugins
perfdataservice perfdata returned by plugins
current_attemptmaximum check attempts for the service
last_updatelast update date for service
last_state_changelast time the state change
last_hard_state_changelast time the state change in hard type
next_checknext check time for service
max_check_attemptsmaximum check attempts for service
action_urlshortcut for action URL
notes_urlshortcut for note URL
notesnotes
icone_imageicone image for service
passive_checksaccept passive results
active_checksactive checks are enabled
acknowledgedacknowledged flag
notifynotification is enabled
scheduled_downtime_depthscheduled_downtime_depth
flappingis the host flapping ?
event_handler_enabledis the event-handfler enabled
criticalitycriticality fo this service

Example:

Using GET method and the URL below:

api.domain.tld/centreon/api/index.php?action=list&object=centreon_realtime_services&limit=60&viewType=all&sortType=name&order=desc&fields=id,description,host_id,host_name,state,output

Submit results

You can use the centreon API to submit information to the monitoring engine. All information that you submit will be forwarded to the centreon engine poller that host the configuration.

To provide information, Centreon need to have specific and mandatory information.

The user must be admin or have access to "Reach API Configuration".

For the service submission please provide the following information :

FieldsDescription
hosthost name
serviceservice description
statusstatus id (0, 1, 2, 3) or ok, warning, critical, unknown
outputa specific message
perfdata (optional)all performance metric following the nagios plugin API
updatetimethe check time (timestamp)

For the host submission please provide the following information :

FieldsDescription
hosthost name
statusstatus id (0, 1, 2, 3)
outputa specific message
updatetimethe check time (timestamp)

To send status, please use the following URL using POST method:

api.domain.tld/centreon/api/index.php?action=submit&object=centreon_submit_results

Header

KeyValue
Content-Typeapplication/json
centreon-auth-tokenThe value of authToken you got on the authentication response

Example of service body submit: The body is a json with the parameters provided above formated as below:

{
    "results": [
        {
            "updatetime": "1528884076",
            "host": "Centreon-Central",
            "service": "Memory",
            "status": "2",
            "output": "The service is in CRITICAL state",
            "perfdata": "perf=20"
        },
        {
            "updatetime": "1528884076",
            "host": "Centreon-Central",
            "service": "fake-service",
            "status": "1",
            "output": "The service is in WARNING state",
            "perfdata": "perf=10"
        }
    ]
}

Example of body response The response body is a json with the HTTP return code and a message for each submit

{
    "results": [
        {
            "code": 202,
            "message": "The status send to the engine"
        },
        {
            "code": 404,
            "message": "The service is not present."
        }
    ]
}

Business activity

All monitoring information on Business Activites are available through the Centreon API. The BA list is sorted by impact.

Use the GET method and URL below: :

api.domain.tld/centreon/api/index.php?object=centreon_bam_realtime_ba&action=list

Header

KeyValue
Content-Typeapplication/json
centreon-auth-tokenThe value of authToken you got on the authentication response

Parameters

You can pass a number of parameters to select the data you want.

Parametersvalues
ba_idfilter on BA ID
searchfilter pattern on BA name
business_viewfilter pattern on business view name
statusfilter on BA status (OK, Warning, Critical, Unknown); multiple statuses separated by commas
limitnumber of desired lines
numberpage number

Use the GET method and URL below: :

api.domain.tld/centreon/api/index.php?object=centreon_bam_ba_realtime&action=list&status=ok&number=0&limit=2

Response

[
    {
        "id": "49",
        "name": "Africa Office Availability",
        "description": "Africa Office Availability",
        "level_w": "12",
        "level_c": "12",
        "current_level": "100",
        "acknowledged": "0",
        "last_state_change": "1518663959",
        "current_status": "0",
        "in_downtime": "0",
        "kpis": [
            "372",
            "373",
            "401",
            "402"
        ]
    },
    {
        "id": "50",
        "name": "Asia Office Availability",
        "description": "Asia Office Availability",
        "level_w": "12",
        "level_c": "12",
        "current_level": "100",
        "acknowledged": "0",
        "last_state_change": "1519029327",
        "current_status": "0",
        "in_downtime": "0",
        "kpis": [
            "374",
            "375",
            "376"
        ]
    }
]

Additionnal information:

  • current_status: 0 = OK, 1 = warning, 2 = Critical, 3 = Unknown
  • current_impact: impact on linked BA in %
  • number: page number (first page is 0)
  • limit: page limit (default= 30)

KPI

All monitoring information for Key Performance Indicators(KPI) is available through the Centreon API. The kpi list is sorted by impact.

Use the GET method and URL below: :

api.domain.tld/centreon/api/index.php?object=centreon_bam_realtime_kpi&action=list

Header

KeyValue
Content-Typeapplication/json
centreon-auth-tokenThe value of authToken you got on the authentication response

Parameters

You can pass a number of parameters to select the data you want:

Parametersvalues
kpi_idfilter on KPI ID
kpi_searchfilter pattern on KPI name
ba_searchfilter pattern on BA name
is_impactingfilter on impacting KPI (false, true)
kpi_statusfilter on KPI status (ok, warning, critical, unknown) multiple statuses can be set separated by commas
ba_statusfilter on BA status (OK, Warning, Critical, Unknown) multiple status separated by commas
limitnumber of desired lines
numberpage number

Use the GET method and URL below: :

api.domain.tld/centreon/api/index.php?object=centreon_bam_realtime_kpi&action=list&kpi_status=ok,warning&number=0&limit=2

Response

[
    {
        "id": "366",
        "activate": "1",
        "ba_id": "47",
        "ba_name": "DB-Oracle-Accounting",
        "ba_activate": "1",
        "type": "0",
        "kpi_host": "srv-oracle-accounting",
        "kpi_host_id": "149",
        "kpi_service": "Query -Stores-",
        "kpi_service_id": "1172",
        "kpi_ba": "",
        "kpi_ba_id": "",
        "kpi_meta": "",
        "kpi_meta_id": "",
        "kpi_boolean": "",
        "kpi_boolean_id": "",
        "last_state_change": "1517297343",
        "current_impact": "0",
        "in_downtime": "0",
        "acknowledged": "0",
        "warning_impact": "0",
        "critical_impact": "30",
        "unknown_impact": "10",
        "name": "srv-oracle-accounting / Query -Stores-",
        "type_label": "Service",
        "output": "Query <Stores> executed on 0.021 second",
        "current_status": "0",
        "current_status_label": "OK",
        "ba_current_status": "0",
        "ba_current_status_label": "OK"
    },
    {
        "id": "365",
        "activate": "1",
        "ba_id": "47",
        "ba_name": "DB-Oracle-Accounting",
        "ba_activate": "1",
        "type": "0",
        "kpi_host": "srv-oracle-accounting",
        "kpi_host_id": "149",
        "kpi_service": "Query -Stock-",
        "kpi_service_id": "1171",
        "kpi_ba": "",
        "kpi_ba_id": "",
        "kpi_meta": "",
        "kpi_meta_id": "",
        "kpi_boolean": "",
        "kpi_boolean_id": "",
        "last_state_change": "1511356592",
        "current_impact": "0",
        "in_downtime": "0",
        "acknowledged": "0",
        "warning_impact": "0",
        "critical_impact": "30",
        "unknown_impact": "10",
        "name": "srv-oracle-accounting / Query -Stock-",
        "type_label": "Service",
        "output": "Query <Stock> executed on 0.786 second",
        "current_status": "0",
        "current_status_label": "OK",
        "ba_current_status": "0",
        "ba_current_status_label": "OK"
    }
]

Additionnal information:

  • kpi_type: 0 = service, 1 = metaservice, 2 = BA, 3 = boolean rule
  • kpi_name: name of the kpi (<host> / <service> or <metaservice> or <ba_name> or <boolean_rule>)
  • kpi_current_status: 0 = OK, 1 = Warning, 2 = Critical, 3 = Unknown
  • ba_current_status: 0 = OK, 1 = Warning, 2 = Critical, 3 = Unknown
  • current_impact: impact on linked BA in %
  • number: page number (first page is 0)
  • limit: page limit (default= 30)
← Command Line API (v1)Rest API (v2) →
  • Overview
  • Permissions
  • Authentication
  • Error codes
  • Configuration
    • Getting started
    • API Calls
    • Host
    • Set child
    • Delete child
    • ACL
    • Centreon Broker
    • CGI CFG
    • Commands
    • Contacts
    • Dependencies
    • Downtimes
    • Host template
    • Host categories
    • Hostgroups
    • Instances ( Pollers)
    • Service templates
    • Services
    • Service groups
    • Service categories
    • Time periods
    • Traps
  • Realtime information
    • Host Status
    • Service Status
    • Submit results
    • Business activity
    • KPI
Centreon documentation
Documentation
Getting StartedAPI ReferencesReleases
Resources
Centreon WebsiteBlogDownload
Follow us
centreon
Follow @Centreon
Copyright © 2005 - 2021 Centreon