Welcome to docs.opsview.com

REST API: Runtime

This will be available from Opsview 3.13.1.

This section is for searching for live objects being monitored by Opsview. This is in the Runtime database, hence the URL path is /rest/runtime/{objecttype}.

Host and Services

URL: /rest/runtime/service. Requires authentication - requires VIEWALL or VIEWSOME permission

  • GET - returns available objects, either grouped by host or grouped by service
  • POST, PUT, DELETE - not implemented

Access Control

VIEWALL allows all objects to be returned.

VIEWSOME allows objects to be returned where permission has been granted based on the access object selection.

Retrieving Host or Service Lists

The same parameters as searching based on service filtering can be used.

Additional parameters:

  • rows - returns back this number of rows. Defaults to 50 rows
  • group_by - returns results based on either host or service. Defaults to host
  • distinct - if set to 1, then only a distinct list of hosts or services are returned. This means you are searching for host names or service names rather than a host+service combination

Response:

  • rows - the number of actual rows returned
  • allrows - the total number of rows based on filtering parameters
  • total - the total number of rows if filtering is not applied
  • list - an array of the results

Example response, if group_by=host and distinct=0:

{
   "allrows" : "30",
   "list" : [
      {
         "list" : [
            "Another exception",
            "Coldstart",
            "Test exceptions"
         ],
         "name" : "cisco"
      },
      {
         "list" : [
            "Another exception",
            "Coldstart"
         ],
         "name" : "cisco1"
      }
   ],
   "rows" : "5",
   "total" : "50"
}

Example response if group_by=service and distinct=0:

{
   "allrows" : "30",
   "list" : [
      {
         "list" : [
            "cisco",
            "cisco1",
            "cisco2",
            "cisco3",
            "cisco4"
         ],
         "name" : "Another exception"
      }
   ],
   "rows" : "5",
   "total" : "50"
}

Example response if group_by=host and distinct=1:

{
   "allrows" : "12",
   "list" : [
      {
         "name" : "cisco"
      },
      {
         "name" : "cisco1"
      },
      {
         "name" : "cisco2"
      },
      {
         "name" : "cisco3"
      },
      {
         "name" : "cisco4"
      }
   ],
   "rows" : "5",
   "total" : "15"
}

Example response if group_by=service and distinct=1:

{
   "allrows" : "12",
   "list" : [
      {
         "name" : "Another exception"
      },
      {
         "name" : "Check Loadavg"
      },
      {
         "name" : "Check Memory"
      },
      {
         "name" : "Coldstart"
      },
      {
         "name" : "faked ok service"
      }
   ],
   "rows" : "5",
   "total" : "19"
}

Performance Metrics

URL: /rest/runtime/performancemetric. Requires authentication - requires VIEWALL or VIEWSOME permission

  • GET - returns available performance metric objects
  • POST, PUT, DELETE - not implemented

Access Control

VIEWALL allows all performance data to be returned.

VIEWSOME allows performance data to be returned for objects where permission has been granted for the service based on the access object selection.

Requesting Performance Metrics

Performance metrics consist of a name of the format:

{hostname}::{servicename}::{metricname}

For example, a fully qualified metric name is opsview::Opsview NDO::ndo_file_backlog.

Parameters:

  • type - this determines the type of results returned. If host is selected, then a set of unique host names will be returned where metrics exist based on the search parameters. Other possible values are: service, metric. If this value is not set, then the fully qualified metric names will be returned
  • host - search host name based on these filters. Can use % as a wildcard. Can be repeated
  • service - search service name based on these filters. Can use % as a wildcard. Can be repeated
  • metric - search metric name based on these filters. Can use % as a wildcard. Can be repeated
  • rows - returns back this number of rows. Defaults to all rows
  • order - orders results based. Can be repeated. Valid values are host, service, metric

Response:

  • rows - be the number of actual rows returned
  • total - the total number of rows if filtering is not applied
  • list - an array of the results

Note: This will only return items that have performance data. If you want to search for all hosts, use /rest/runtime/host.

Example response for type=host:

{
   "rows" : "13",
   "list" : [
      "build-sol10-amd64",
      "build-sol10-i386",
      "ov-build-centos4-32",
      "ov-build-centos4-64",
      "ov-build-centos5-32",
      "ov-build-centos5-64",
      "ov-build-etch-32",
      "ov-build-etch-64",
      "ov-build-hardy-32",
      "ov-build-hardy-64",
      "ov-build-lenny-64",
      "ov-build-rhel5-32",
      "ov-build-rhel5-64"
   ],
   "total" : "41"
}

Example response for type=service:

{
   "rows" : "6",
   "list" : [
      "/",
      "/backup",
      "/boot",
      "/home",
      "/srv/vms",
      "/var"
   ],
   "total" : "48"
}

Example response for type=metric:

{
   "rows" : "2",
   "list" : [
      "boot",
      "root"
   ],
   "total" : "279"
}

Example response for type not set (ie, the fully qualified metric name):

{
   "list" : [
      "opslave::/::root",
      "opsview::/::root",
      "ov-build-centos5-64::/::root",
      "ov-build-hardy-32::/::root",
      "ov-build-hardy-64::/::root",
      "ov-build-rhel5-64::/::root",
      "prodservice1::/boot::boot",
      "prodservice1::/::root",
      "prodweb3::/::root",
      "vmhost1::/boot::boot",
      "vmhost1::/::root",
      "vmhost2::/::root",
      "vmhost3::/::root",
      "vmhost3::/srv/vms::root"
   ],
   "rows" : "14",
   "total" : "455"
}
Navigation
Print/export
Toolbox