Config

Hosts

GET /v2/config/hosts

Returns all hosts.

Return type:list(Host)
POST /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

GET /v2/config/services

Returns all services.

Return type:list(Service)
POST /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>sample-server</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>surveil-ptl,surveil-bob</contacts>
  <contact_groups>linux-admins</contact_groups>
  <passive_checks_enabled>1</passive_checks_enabled>
</value>

Commands

GET /v2/config/commands

Returns all commands.

Return type:list(Command)
POST /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

GET /v2/config/businessimpactmodulations

Returns all business impact modulations.

Return type:list(BusinessImpactModulation)
GET /v2/config/businessimpactmodulations/(modulation_name)

Returns a specific business impact modulation. :type modulation_name: unicode

Return type:BusinessImpactModulation
POST /v2/config/businessimpactmodulations

Create a new business impact modulation.

Parameters:
  • data (BusinessImpactModulation) – a business impact modulation within the request body.
PUT /v2/config/businessimpactmodulations

Update a specific business impact modulation. :type modulaion_name: unicode :type modulation: BusinessImpactModulation

Return type:BusinessImpactModulation
DELETE /v2/config/businessimpactmodulations

Returns a specific business impact modulation. :type modulation_name: unicode

Return type:BusinessImpactModulation

Check modulations

GET /v2/config/checkmodulations

Returns all check modulations.

Return type:list(CheckModulation)
GET /v2/config/checkmodulations/(checkmodulation_name)

Returns a specific check modulation. :type checkmodulation_name: unicode

Return type:CheckModulation
POST /v2/config/checkmodulations

Create a new check modulation.

Parameters:
PUT /v2/config/checkmodulations

Update a specific check modulation. :type checkmodulation_name: unicode :type checkmodulation: CheckModulation

Return type:CheckModulation
DELETE /v2/config/checkmodulations

Returns a specific check modulation. :type checkmodulation_name: unicode

Return type:CheckModulation

Notification ways

GET /v2/config/notificationways

Returns all notification ways.

Return type:list(NotificationWay)
GET /v2/config/notificationways/(notificationway_name)

Returns a specific notification way. :type notificationway_name: unicode

Return type:NotificationWay
POST /v2/config/notificationways

Create a new notification way.

Parameters:
PUT /v2/config/notificationways

Update a specific notification way. :type notificationway_name: unicode :type notificationway: NotificationWay

Return type:NotificationWay
DELETE /v2/config/notificationways

Returns a specific notification way. :type notificationway_name: unicode

Return type:NotificationWay

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>admin,carl</contacts>
  <contact_groups>router-admins</contact_groups>
  <notification_interval>30</notification_interval>
  <notification_period>24x7</notification_period>
  <use>generic-host</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:unicode

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

contacts
Type: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: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>d,u,r,f,s</host_notification_options>
  <service_notification_options>w,u,c,r,f</service_notification_options>
  <host_notification_commands>notify-host</host_notification_commands>
  <service_notification_commands>notify-service</service_notification_commands>
</value>