Category 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 the list of OmniCenter categories.

This resource offers the following endpoints:

  • Category ID List
  • Category Device List

Resource URL

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

Endpoints

Category ID List

POST
/category/list
Retrieves the current list of OmniCenter categories and their ID numbers.

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.

Request Examples

Curl using POST with API Authentication Disabled

curl -X POST
  "http://38.2.11.62/fw/index.php?r=restful/category/list"

Curl using POST with API Authentication Enabled

curl -X POST
  "http://38.2.11.62/fw/index.php?r=restful/category/list"
  -F password=pass123

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.

[
    {
        "id": "1",
        "name": "Core Routers"
    },
    {
        "id": "15",
        "name": "Database Servers"
    },
    {
        "id": "10",
        "name": "Development Servers"
    },
    {
        "id": "18",
        "name": "New Devices"
    },
    {
        "id": "6",
        "name": "New Routers"
    },
    {
        "id": "7",
        "name": "New Servers"
    },
    {
        "id": "13",
        "name": "Power Devices"
    },
    {
        "id": "21",
        "name": "Test_Host Devices"
    },
    {
        "id": "14",
        "name": "VM_Host Servers"
    },
    {
        "id": "19",
        "name": "Window Servers"
    }
]

Response Schema

Output Type Description
id string The OmniCenter internal identification number for the category name returned below. Use this number with other APIs to identify a specific category.
name string The name of the category as seen in OmniCenter.

Category Device List

POST
/category/device-list
Retrieves the list of devices and associated information from the category ID 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.

id
String/Required
The ID number of an OmniCenter category. Retrieve the list of category IDs using the “Category List” endpoint (above).

Request Examples

Curl using POST with API Authentication Disabled

curl -X POST \
  'http://38.2.11.62/fw/index.php?r=restful/category/device-list' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \
  -F id=15

Curl using POST with API Authentication Enabled

curl -X POST \
  'http://38.2.11.62/fw/index.php?r=restful/category/device-list' \
  -H 'Content-Type: application/x-www-form-urlencoded' \
  -H 'content-type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW' \
  -F password=pass123 \
  -F id=15

Response

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

Supplying an incorrect password, or no password with API authentication enabled, will return an “Incorrect password” error. Failing to specify a correct category ID will return an empty 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.

[
    {
        "dev_index": "11",
        "name": "Oracle",
        "ip": "39.1.12.235",
        "description": "",
        "category": "15",
        "site": "3",
        "model": "",
        "poll": "1",
        "report": "1",
        "monitor": "0",
        "poll_intvl": "5",
        "template_persist": "1",
        "template": "0",
        "create_time": "1512771445",
        "snmp_version": null,
        "auto_config": "0"
    },
    {
        "dev_index": "23",
        "name": "WinSQL",
        "ip": "10.200.36.3",
        "description": "",
        "category": "15",
        "site": "3",
        "model": "",
        "poll": "1",
        "report": "1",
        "monitor": "1",
        "poll_intvl": "5",
        "template_persist": "1",
        "template": "0",
        "create_time": "1513882312",
        "snmp_version": null,
        "auto_config": "0"
    }
]

Response Schema

 

Output Type Description
dev_index string The OmniCenter internal identification number for the device.
name string The name of the device as seen in OmniCenter.
ip string The IP address of the device.
description string This is the contents of the “Note” field seen in the HOST INFORMATION section of the device dashboard for this device.
category string The ID number of the category to which this device belongs.
site string The ID number of the site to which this device belongs.
model string The device model designation as supplied by the device. This information is not found in the OmniCenter UI.
poll string Indicates if the device is currently being polled for performance data. Treat as a boolean.
report string Indicates whether or not the device will be included in reports. Treat as a boolean.
monitor string Indicates if the device is being monitored for host and service alarms. Treat as a boolean.
poll_intvl string The delay between performance polls for the device, in minutes.
template_persist string Indicates if the device is set to use device templates. Treat as a boolean.
template string The ID number of the device template assigned directly to this device in its “Main” device administration page.
create_time string The time this device was added to OmniCenter, as a UNIX timestamp.
snmp_version string The version of SNMP being used to communicate with this device, as set in its “Authentication” administration page.
auto_config string Indicates whether or not autoconfiguration rules will be run on the device during a repoll. If set to 1, the rules will be run on the next repoll and the flag set back to 0.
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