Runtime - Performance Metrics
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}
.
URL: /rest/runtime/performancemetric
.
Requires authentication - requires VIEWALL or VIEWSOME permission.
GET
— returns available performance metric objects.POST
,PUT
,DELETE
— not implemented.
Access Control Copied
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 Copied
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 keyword and hostgroup. 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.htid
— search for performance metrics on services by this host template id. Can be repeated.keyword
— search metrics related to this keyword name. Can be repeated.hostgroupid
— search metrics where its host is contained anywhere in this host group hierarchy. Can be repeated.bcid
— search metrics based on this business component id. Can be repeated. If the user does not have BSM access, no performance metrics will be matched. Only business components that this user has access to will be searched. If the system does not have the BSM feature, an error will be returned.rows
— returns back this number of rows. Defaults to all rows.order
— orders results based. Can be repeated. Valid values are host, service, metric, hostgroup.format
— if set to object and type=hostgroup or keyword, will return the list of data in an object format. This is required for host groups because they are uniquely identified by their id.collapse_multiple_services
— this reduces multiple services into a single response. For instance, the response with collapse_multiple_services=0 would be[“Disk: /”, “Disk: /var”, “Disk: /home”, “Interface: eth1”, “Interface: eth0”]
, but the response with collapse_multiple_services=1 would be['Disk:', 'Interface:']
. This only applies where type=service. Default is 0.hsm
— if set, will filter by this particular hsm. Can be repeated.
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=hostgroup&format=object
:
{
"list" : [
{
"id" : "4",
"name" : "Opsview,UK,Leaf,"
},
{
"id" : "2",
"name" : "Opsview,UK,Monitoring Servers,"
},
{
"id" : "5",
"name" : "Opsview,UK2,Leaf2,"
}
],
"rows" : "3",
"total" : "3"
}
Example response for type not set (ie, the fully qualified metric name):
{
"list" : [
"opcollector::/::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"
}