Config

Hosts

POST /v2/config/hosts

Returns all hosts. :type data: LiveQuery

Return type:list(Host)
PUT /v2/config/hosts

Create a new host.

Parameters:
  • data (Host) – a host within the request body.
Return type:

Host

GET /v2/config/hosts/(host_name)

Returns a specific host.

Return type:Host
PUT /v2/config/hosts/(host_name)

Modify this host.

Parameters:
  • data (Host) – a host within the request body.
DELETE /v2/config/hosts/(host_name)

Delete this host.

GET /v2/config/hosts/(host_name)/services

Returns all services assocaited with this host.

Return type:list(Service)
GET /v2/config/hosts/(host_name)/services/(service_name)/(service_description)

Returns a specific service.

Return type:Service
DELETE /v2/config/hosts/(host_name)/services/(service_name)/(service_description)

Delete a specific service.

Services

POST /v2/config/services

Returns all services. :type data: LiveQuery

Return type:list(Service)
PUT /v2/config/services

Create a new service.

Parameters:
  • data (Service) – a service within the request body.
Return type:

Service

type Service

Data samples:

Json
{
    "check_command": "check-disk!/dev/sdb1", 
    "check_interval": 5, 
    "check_period": "24x7", 
    "contact_groups": [
        "linux-admins"
    ], 
    "contacts": [
        "surveil-ptl", 
        "surveil-bob"
    ], 
    "host_name": [
        "sample-server"
    ], 
    "max_check_attempts": 5, 
    "notification_interval": 3, 
    "notification_period": "24x7", 
    "passive_checks_enabled": "1", 
    "retry_interval": 3, 
    "service_description": "check-disk-sdb"
}
XML
<value>
  <host_name>
    <item>sample-server</item>
  </host_name>
  <service_description>check-disk-sdb</service_description>
  <check_command>check-disk!/dev/sdb1</check_command>
  <max_check_attempts>5</max_check_attempts>
  <check_interval>5</check_interval>
  <retry_interval>3</retry_interval>
  <check_period>24x7</check_period>
  <notification_interval>3</notification_interval>
  <notification_period>24x7</notification_period>
  <contacts>
    <item>surveil-ptl</item>
    <item>surveil-bob</item>
  </contacts>
  <contact_groups>
    <item>linux-admins</item>
  </contact_groups>
  <passive_checks_enabled>1</passive_checks_enabled>
</value>

Commands

POST /v2/config/commands

Returns all commands. :type data: LiveQuery

Return type:list(Command)
PUT /v2/config/commands

Create a new command.

Parameters:
  • data (Command) – a command within the request body.
Return type:

Command

GET /v2/config/commands/(command_name)

Returns a specific command.

Return type:Command
PUT /v2/config/commands/(command_name)

Modify this command.

Parameters:
  • data (Command) – a command within the request body.
DELETE /v2/config/commands/(command_name)

Delete this command.

Business impact modulations

POST /v2/config/businessimpactmodulations

Returns all business impact modulations. :type data: LiveQuery

Return type:list(BusinessImpactModulation)
PUT /v2/config/businessimpactmodulations

Create a new business impact modulation.

Parameters:
  • data (BusinessImpactModulation) – a business impact modulation within the request body.
Return type:

BusinessImpactModulation

Check modulations

POST /v2/config/checkmodulations

Returns all check modulations. :type data: LiveQuery

Return type:list(CheckModulation)
PUT /v2/config/checkmodulations

Create a new check modulation.

Parameters:

Notification ways

POST /v2/config/notificationways

Returns all notification ways. :type data: LiveQuery

Return type:list(NotificationWay)
PUT /v2/config/notificationways

Create a new notification way.

Parameters:

types documentation

type Command

Data samples:

Json
{
    "command_line": "/bin/check_http", 
    "command_name": "check_http"
}
XML
<value>
  <command_name>check_http</command_name>
  <command_line>/bin/check_http</command_line>
</value>
command_line
Type:unicode

This directive is used to define what is actually executed by Shinken

command_name
Type:unicode

The name of the command

type Host

Data samples:

Json
{
    "address": "192.168.1.254", 
    "check_period": "24x7", 
    "contact_groups": [
        "router-admins"
    ], 
    "contacts": [
        "admin", 
        "carl"
    ], 
    "custom_fields": {
        "OS_AUTH_URL": "http://localhost:8080/v2"
    }, 
    "host_name": "bogus-router", 
    "max_check_attempts": 5, 
    "notification_interval": 30, 
    "notification_period": "24x7", 
    "use": [
        "generic-host"
    ]
}
XML
<value>
  <host_name>bogus-router</host_name>
  <address>192.168.1.254</address>
  <max_check_attempts>5</max_check_attempts>
  <check_period>24x7</check_period>
  <contacts>
    <item>admin</item>
    <item>carl</item>
  </contacts>
  <contact_groups>
    <item>router-admins</item>
  </contact_groups>
  <notification_interval>30</notification_interval>
  <notification_period>24x7</notification_period>
  <use>
    <item>generic-host</item>
  </use>
  <custom_fields>
    <item>
      <key>OS_AUTH_URL</key>
      <value>http://localhost:8080/v2</value>
    </item>
  </custom_fields>
</value>
address
Type:unicode

The address of the host. Normally, this is an IP address.

check_period
Type:unicode

The time period during which active checks of this host can be made.

contact_groups
Type:list(unicode)

List of the short names of contact groups that should be notified

contacts
Type:list(unicode)

A list of the short names of the contacts that should be notified.

custom_fields
Type:dict(unicode: unicode)

Custom fields for the host

host_name
Type:unicode

The name of the host

use
Type:list(unicode)

The template to use for this host

type CheckResult

Data samples:

Json
{
    "output": "CPU Usage 98%|c[cpu]=98%;80;95;0;100", 
    "return_code": 0, 
    "time_stamp": "1409087486"
}
XML
<value>
  <time_stamp>1409087486</time_stamp>
  <return_code>0</return_code>
  <output>CPU Usage 98%|c[cpu]=98%;80;95;0;100</output>
</value>
output
Type:unicode

The output of the check.

return_code
Type:int

The return code of the check.

time_stamp
Type:unicode

The time the check was executed. Defaults to now.

type CheckModulation

Data samples:

Json
{
    "check_command": "check_ping_night", 
    "check_period": "night", 
    "checkmodulation_name": "ping_night"
}
XML
<value>
  <checkmodulation_name>ping_night</checkmodulation_name>
  <check_command>check_ping_night</check_command>
  <check_period>night</check_period>
</value>
type NotificationWay

Data samples:

Json
{
    "host_notification_commands": [
        "notify-host"
    ], 
    "host_notification_options": [
        "d", 
        "u", 
        "r", 
        "f", 
        "s"
    ], 
    "host_notification_period": "24x7", 
    "notificationway_name": "email_in_day", 
    "service_notification_commands": [
        "notify-service"
    ], 
    "service_notification_options": [
        "w", 
        "u", 
        "c", 
        "r", 
        "f"
    ], 
    "service_notification_period": "24x7"
}
XML
<value>
  <notificationway_name>email_in_day</notificationway_name>
  <host_notification_period>24x7</host_notification_period>
  <service_notification_period>24x7</service_notification_period>
  <host_notification_options>
    <item>d</item>
    <item>u</item>
    <item>r</item>
    <item>f</item>
    <item>s</item>
  </host_notification_options>
  <service_notification_options>
    <item>w</item>
    <item>u</item>
    <item>c</item>
    <item>r</item>
    <item>f</item>
  </service_notification_options>
  <host_notification_commands>
    <item>notify-host</item>
  </host_notification_commands>
  <service_notification_commands>
    <item>notify-service</item>
  </service_notification_commands>
</value>