Skip to main content

Centreon

This Integration is part of the Centreon Pack.#

Overview

Use Centreon to check the status of hosts and services.

This integration was integrated and tested with Centreon v2.8.20.

NOTE : Cortex XSOAR only works for Centreon v2.8.14 and later.


Use Cases

  • Check the status of hosts.
  • Check the status of services.

Configure Centreon on Cortex XSOAR

  1. Navigate to Settings > Integrations > Servers & Services .
  2. Search for Centreon.
  3. Click Add instance to create and configure a new integration instance.
    • Name: a textual name for the integration instance
    • Server URL (http://147.75.33.100:20016/)
    • Username
    • Do not validate server certificate (not secure)
  4. Click Test to validate the URLs and connection.

Commands

You can execute these commands from the Cortex XSOAR CLI, as part of an automation, or in a playbook. After you successfully execute a command, a DBot message appears in the War Room with the command details.


Get host status: centreon-get-host-status

Command Example

!centreon-get-host-status viewType=all fields=id,name limit=10

Inputs

Parameter Description
viewType

Predefined filter (like in the monitoring view).

  • all
  • unhandled
  • problems
fields

List of fields that you want to get. Fields are separated from each other with a comma.

For example: fields=id,name,alias,address.

status

Status of the host you want to get.

  • up
  • down
  • unreachable
  • pending
  • all
hostgroup

Hostgroup ID filter.

For example: hostgroup=2.

instance

Instance ID filter.

For example: instance=2.

search

Search pattern applied on host name.

For example: search="localhost".

criticality A specific criticality.
sortType

Sorting method.

  • Ascending: asc
  • Descending: desc
limit Number of lines that you want.
number Page number.

Context Output

Path Description
Centreon.Host.Output Host output
Centreon.Host.Name Host name
Centreon.Host.State Host state
Centreon.Host.Address Host address
Centreon.Host.Id Host ID


Raw Output

{  
    "Host":[  
               {  
               "Acknowledged":"0",
               "Address":"127.0.0.1",
               "Alias":"Localhost",
               "CheckAttempt":"1",
               "Criticality":"",
               "Id":"17",
               "InstanceName":"Central",
               "LastCheck":"1524487617",
               "LastHardStateChange":"",
               "LastStateChange":"",
               "MaxCheckAttempts":"3",
               "Name":"Localhost",
               "Output":"OK - 127.0.0.1: rta 0.076ms, lost 0%",
               "State":"0",
              "StateType":"1"            
      },
               {  
               "Acknowledged":"0",
               "Address":"192.168.1.22",
               "Alias":"jumphost",
               "CheckAttempt":"1",
               "Criticality":"",
               "Id":"37",
               "InstanceName":"Central",
               "LastCheck":"1524487822",
               "LastHardStateChange":"1523986444",
               "LastStateChange":"1523986444",
               "MaxCheckAttempts":"3",
               "Name":"jumphost",
               "Output":"OK - 192.168.1.22: rta 0.379ms, lost 0%",
               "State":"0",
               "StateType":"1"            
      },
               {  
               "Acknowledged":"0",
               "Address":"192.168.1.22",
               "Alias":"jumphost",
               "CheckAttempt":"1",
               "Criticality":"",
               "Id":"38",
               "InstanceName":"Central",
               "LastCheck":"1524487722",
               "LastHardStateChange":"1523987517",
               "LastStateChange":"1523987517",
               "MaxCheckAttempts":"3",
               "Name":"jumphost_1",
               "Output":"OK - 192.168.1.22: rta 0.389ms, lost 0%",
               "State":"0",
               "StateType":"1"            
      }       
   ]
}

Get service status: centreon-get-service-status

Command Example

!centreon-get-service-status status=ok fields=id,host_id limit=5 sortType=asc

Inputs

Parameter Description
viewType

Predefined filter (like in the monitoring view).

  • all
  • unhandled
  • problems
fields

The list of fields that you want to get, each field separated by a comma.

For example: fields=id,name,alias,address.

status

Status of the host you want to get.

  • ok
  • warning
  • critical
  • unknown
  • pending
  • all
hostgroup

Hostgroup ID filter.

For example: hostgroup=2.

servicegroup Servicegroup ID filter.
instance

Instance ID filter.

For example: instance=2.

search Search pattern applied on service.
searchHost Search pattern applied on host.
searchOutput Search pattern applied on output.
criticality A specific criticality.
sortType

Sorting method.

  • Ascending: asc
  • Descending: desc
limit Number of lines that you want.
number Page number.

Context Output

Path Description
Centreon.Service.Output Service output
Centreon.Service.Name Service name
Centreon.Service.State Service state
Centreon.Service.Description Service description
Centreon.Service.Id Service ID

Raw Output

{
  "Service": [
    {
      "Acknowledged": "0",
      "CheckAttempt": "1",
      "Criticality": "",
      "Description": "Ping",
      "HostId": "37",
      "LastCheck": "1524487467",
      "LastHardStateChange": "1523986444",
      "LastStateChange": "1523986444",
      "MaxCheckAttempts": "3",
      "Name": "jumphost",
      "Output": "OK - 192.168.1.22: rta 0.185ms, lost 0%",
      "Perfdata": "rta=0.185ms;200.000;400.000;0; pl=0%;20;50;; rtmax=0.398ms;;;; rtmin=0.106ms;;;;",
      "ServiceId": "132",
      "State": "0",
      "StateType": "1"
    },
    {
      "Acknowledged": "0",
      "CheckAttempt": "1",
      "Criticality": "",
      "Description": "Ping",
      "HostId": "38",
      "LastCheck": "1524487617",
      "LastHardStateChange": "1523987517",
      "LastStateChange": "1523987517",
      "MaxCheckAttempts": "3",
      "Name": "jumphost_1",
      "Output": "OK - 192.168.1.22: rta 0.235ms, lost 0%",
      "Perfdata": "rta=0.235ms;200.000;400.000;0; pl=0%;20;50;; rtmax=0.514ms;;;; rtmin=0.134ms;;;;",
      "ServiceId": "133",
      "State": "0",
      "StateType": "1"
    }
  ]
}