1. Home
  2. API Reference
  3. Device Service Checks API

Device Service Checks API

OmniCenter’s API system must be enabled to use this API. See, How to Enable OmniCenter API Access.

Calls to this API are made using HTTP/HTTPS and must be sent as key/value pairs in a POST request.

Resource

The resource accessed by this API is a specific managed device’s current list of service checks and their associated data.

This resource offers the following endpoints:

  • Service Check List

Resource URL

{your.omnicenter.ip.or.name}/fw/index.php?r=restful

Endpoints

Service Check List

POST
/devices/services
Retrieves a list of service checks and their associated information for the device specified in the parameters.

Parameters

The parameters for this endpoint must be included as request body parameters in a POST request.

password
String/Required if authentication is enabled.
The API key set in OmniCenter’s API Administration. Case-sensitive.

dev_name
String/Required
The name of the device for which you wish to retrieve the list of service checks, as it appears in the OmniCenter UI.

Request Examples

Curl using POST with API Authentication Disabled

curl -X POST \
  'http://38.2.11.62/fw/index.php?r=restful/devices/services' \
  -H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \
  -F dev_name=Dallas-S1.dallass1.netreo.net

Curl using POST with API Authentication Enabled

curl -X POST \
  'http://38.2.11.62/fw/index.php?r=restful/devices/services' \
  -H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \
  -F password=pass123 \
  -F dev_name=Dallas-S1.dallass1.netreo.net

Response

Supplying an incorrect password, or no password with API authentication enabled, will return an “Incorrect password” error.

A successful call to this API will return a standard JSON object array.

Note: The output will be returned as standard JSON without indentation or line breaks. It is formatted here to make the example easier to read.

Response Examples

Successful list retrieval.

[
    {
        "service_id": 47,
        "state": "OK",
        "duration": "2017-12-08 14:25:10",
        "name": "Authentication",
        "description": "OK"
    },
    {
        "service_id": 362,
        "state": "OK",
        "duration": "2018-05-30 01:15:11",
        "name": "Check Interface Status on FastEthernet1/0/14",
        "description": "Interface 10014 is UP."
    },
    {
        "service_id": 437,
        "state": "OK",
        "duration": "2018-12-11 09:00:20",
        "name": "Check Interface Status on FastEthernet1/0/24",
        "description": "Interface 10024 is UP."
    },
    {
        "service_id": 361,
        "state": "OK",
        "duration": "2018-05-30 01:15:10",
        "name": "Check Interface Status on Vlan1",
        "description": "Interface 1 is UP."
    },
    {
        "service_id": 52,
        "state": "OK",
        "duration": "2018-11-08 11:10:40",
        "name": "Cisco Hardware Check",
        "description": "No alarms.\n"
    },
    {
        "service_id": 51,
        "state": "CRITICAL",
        "duration": "2018-12-10 15:14:00",
        "name": "Configuration Save Check",
        "description": "CRITICAL: Configuration has been changed but not saved!\n\n"
    },
    {
        "service_id": 48,
        "state": "OK",
        "duration": "2018-11-21 14:25:30",
        "name": "Device Polling Status",
        "description": "Polling successful."
    },
    {
        "service_id": 49,
        "state": "OK",
        "duration": "2019-01-23 13:46:40",
        "name": "PING",
        "description": "Ping OK: Packet Loss 0% | RTA = 2.045 ms"
    }
]

Response Schema

Output Type Description
service_id string The OmniCenter internal ID for the service check.
state string The current alarm status of the service check.
duration string The check has been in the state specified above since this timestamp.
name string The name of the service service check as supplied in its “DESCRIPTION” configuration field.
description string The output of the service check for the state returned above, as seen in the SERVICES STATE HISTORY on the “Services” tab of the device dashboard.
Updated on July 1, 2019

Was this article helpful?

Need Support?
Can’t find the answer you’re looking for? Don’t worry we’re here to help!
Contact Support

Leave a Reply