1115 lines
45 KiB
YAML
1115 lines
45 KiB
YAML
zabbix_export:
|
|
version: '7.0'
|
|
template_groups:
|
|
- uuid: c2c162144c2d4c5491c8801193af4945
|
|
name: Templates/Cloud
|
|
templates:
|
|
- uuid: 8afa1796d280425b99c7ea36900dac24
|
|
template: 'Oracle Cloud Block Volume by HTTP'
|
|
name: 'Oracle Cloud Block Volume by HTTP'
|
|
description: |
|
|
This template monitors Oracle Cloud Infrastructure (OCI) block volume resources.
|
|
|
|
This template is not meant to be used independently, but together with Oracle Cloud by HTTP as a template for
|
|
LLD host prototypes.
|
|
|
|
Read the template documentation prior to using this template.
|
|
|
|
You can discuss this template or leave feedback on our forum https://www.zabbix.com/forum/zabbix-suggestions-and-feedback
|
|
|
|
Generated by official Zabbix template tool "Templator"
|
|
vendor:
|
|
name: Zabbix
|
|
version: 7.0-3
|
|
groups:
|
|
- name: Templates/Cloud
|
|
items:
|
|
- uuid: dc2887a2b954406db8588c0ead37411f
|
|
name: 'Volume guaranteed IOPS'
|
|
type: DEPENDENT
|
|
key: oci.block.volume.iops
|
|
delay: '0'
|
|
value_type: FLOAT
|
|
units: '!IOPS'
|
|
description: |
|
|
Rate of change for guaranteed IOPS per SLA.
|
|
Expressed as the average of guaranteed IOPS during a given time interval.
|
|
preprocessing:
|
|
- type: JSONPATH
|
|
parameters:
|
|
- $.VolumeGuaranteedIOPS
|
|
- type: DISCARD_UNCHANGED_HEARTBEAT
|
|
parameters:
|
|
- 1h
|
|
master_item:
|
|
key: oci.block.volume.metrics.get
|
|
tags:
|
|
- tag: component
|
|
value: storage
|
|
- uuid: 5c1d0fd1686e4c74b33dbe12956d7b7c
|
|
name: 'Get metrics'
|
|
type: SCRIPT
|
|
key: oci.block.volume.metrics.get
|
|
history: '0'
|
|
value_type: TEXT
|
|
trends: '0'
|
|
params: |
|
|
const CTlsConfig = function (raw_value) {
|
|
raw_value = String(raw_value).trim().toLowerCase();
|
|
|
|
if (['none', 'peer', 'full'].indexOf(raw_value) === -1) {
|
|
raw_value = 'full';
|
|
}
|
|
|
|
this.options = {
|
|
SSLVerifyPeer: (raw_value === 'peer' || raw_value === 'full'),
|
|
SSLVerifyHost: (raw_value === 'full')
|
|
};
|
|
|
|
this.enabled = (raw_value !== 'none');
|
|
|
|
this.checkURL = function (url) {
|
|
if (this.enabled && !/^https:\/\//i.test(url)) {
|
|
throw 'TLS certificate verification is enabled by {$' + 'HTTP.TLS.VERIFY}, but the URL uses plain HTTP: ' + url +
|
|
'. Use an "https://" URL, or set {$' + 'HTTP.TLS.VERIFY} to `none` to disable verification.';
|
|
}
|
|
|
|
return url;
|
|
};
|
|
}
|
|
|
|
|
|
function validateZabbixParams(requiredParams, allParams) {
|
|
requiredParams.forEach(function (field) {
|
|
if (typeof allParams !== 'object' || typeof allParams[field] === 'undefined' || allParams[field] === '') {
|
|
throw 'Required param is not set: ' + field + '.';
|
|
}
|
|
});
|
|
}
|
|
|
|
function OCI(service, action, params) {
|
|
this.zabbixLogPrefix = '[ OCI ] [ ' + service + ' ] [ ' + action + ' ]';
|
|
this.tls = new CTlsConfig(params.tls_verify);
|
|
this.request = new HttpRequest(this.tls.options);
|
|
|
|
this.hash = function (string) {
|
|
return sha256(string);
|
|
};
|
|
|
|
this.sign = function (string) {
|
|
return sign('sha256', params['private_key'], string);
|
|
};
|
|
|
|
this.encode = function (hash) {
|
|
const hexArr = hash.match(/.{1,2}/g);
|
|
var uInt8Array = new Uint8Array(hexArr.length);
|
|
hexArr.forEach(function (hex, idx) {
|
|
uInt8Array[idx] = parseInt(hex, 16);
|
|
});
|
|
return btoa(uInt8Array);
|
|
};
|
|
|
|
this.getDate = function () {
|
|
const weekdayShortList = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
|
|
const monthShortList = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'];
|
|
const today = new Date();
|
|
return weekdayShortList[today.getUTCDay()] + ', ' + today.getUTCDate() + ' ' + monthShortList[today.getUTCMonth()] + ' ' + today.getUTCFullYear() + ' ' + today.getUTCHours() + ':' + today.getUTCMinutes() + ':' + today.getUTCSeconds() + ' GMT';
|
|
};
|
|
|
|
this.executeRequest = function (httpMethod, apiPath, apiParams, mql, namespace) {
|
|
var headers = '(request-target) date host';
|
|
const contentTypeHeader = 'content-type: application/json';
|
|
const dateHeader = 'date: ' + this.getDate();
|
|
const hostHeader = 'host: ' + params['api_host'];
|
|
const requestTarget = '(request-target): ' + httpMethod + ' ' + apiPath + apiParams;
|
|
var signingString = requestTarget + '\n' + dateHeader + '\n' + hostHeader;
|
|
var reqHeaders = [contentTypeHeader, dateHeader];
|
|
|
|
if (httpMethod === 'post') {
|
|
var body = JSON.stringify({
|
|
'namespace': namespace,
|
|
'query': mql
|
|
});
|
|
headers = headers + ' x-content-sha256 content-type content-length';
|
|
const bodyHeader = 'x-content-sha256: ' + this.encode(this.hash(body));
|
|
const bodyLengthHeader = 'content-length: ' + body.length;
|
|
signingString = signingString + '\n' + bodyHeader + '\n' + contentTypeHeader + '\n' + bodyLengthHeader;
|
|
reqHeaders.push(bodyHeader, bodyLengthHeader);
|
|
}
|
|
|
|
const signature = this.encode(this.sign(signingString));
|
|
|
|
reqHeaders.push('Authorization: Signature version="1",keyId="' + params['tenancy_ocid'] + '/' + params['user_ocid'] + '/' + params['fingerprint'] + '",algorithm="rsa-sha256",headers="' + headers + '",signature="' + signature + '"');
|
|
for (var header = 0, headerLength = reqHeaders.length; header < headerLength; header++) {
|
|
this.request.addHeader(reqHeaders[header]);
|
|
}
|
|
|
|
if (params['http_proxy']) {
|
|
this.request.setProxy(params['http_proxy']);
|
|
Zabbix.log(4, this.zabbixLogPrefix + ' Using http proxy: ' + params['http_proxy']);
|
|
}
|
|
|
|
if (httpMethod === 'post') {
|
|
var apiRateLimitExceeded = false;
|
|
do {
|
|
const response = this.request.post('https://' + params['api_host'] + apiPath + apiParams, body);
|
|
|
|
try {
|
|
if (JSON.parse(response)['code'] === 'TooManyRequests') {
|
|
|
|
apiRateLimitExceeded = true;
|
|
Zabbix.sleep(1000);
|
|
} else {
|
|
apiRateLimitExceeded = false;
|
|
}
|
|
} catch (error) {
|
|
Zabbix.log(3, this.zabbixLogPrefix + ' Could not parse the response: ' + JSON.stringify(response));
|
|
throw 'Could not parse the response. See logs for more information.';
|
|
}
|
|
} while (apiRateLimitExceeded);
|
|
} else {
|
|
const response = this.request.get('https://' + params['api_host'] + apiPath + apiParams);
|
|
}
|
|
|
|
this.request.clearHeader();
|
|
|
|
if (this.request.getStatus() === parseInt(params['http_status_code'])) {
|
|
return response;
|
|
} else {
|
|
Zabbix.log(3, this.zabbixLogPrefix + ' Unexpected HTTP response code: ' + this.request.getStatus());
|
|
throw 'Unexpected HTTP response code: ' + this.request.getStatus();
|
|
}
|
|
};
|
|
|
|
this.extractData = function (httpMethod, data, keys, compartment) {
|
|
try {
|
|
data = JSON.parse(data);
|
|
} catch (error) {
|
|
Zabbix.log(3, this.zabbixLogPrefix + ' Could not parse the received JSON object: ' + data);
|
|
throw 'Could not parse received JSON object. See logs for more information.';
|
|
}
|
|
|
|
if (typeof keys == 'object') {
|
|
var returnBuffer = [];
|
|
for (var dataObj = 0, dataLength = data.length; dataObj < dataLength; dataObj++) {
|
|
|
|
var objectBuffer = {};
|
|
for (var key = 0, keysLength = keys.length; key < keysLength; key++) {
|
|
if (data[dataObj][keys[key]] || data[dataObj][keys[key]] == null) {
|
|
objectBuffer[keys[key].match(/^[a-z]+$|[A-Z][a-z]+$/)[0].toLowerCase()] = data[dataObj][keys[key]];
|
|
} else {
|
|
Zabbix.log(3, this.zabbixLogPrefix + ' Received an unexpected JSON object. Could not get value for key "' + keys[key] + '" in JSON: ' + JSON.stringify(data[dataObj]));
|
|
throw 'Received an unexpected JSON object. See logs for more information.';
|
|
}
|
|
}
|
|
if (typeof compartment != 'undefined' && compartment != '') objectBuffer['compartment'] = compartment;
|
|
returnBuffer.push(objectBuffer);
|
|
}
|
|
return returnBuffer;
|
|
}
|
|
|
|
try {
|
|
if (httpMethod === 'get') {
|
|
return data[keys];
|
|
} else {
|
|
if (data.length === 0) {
|
|
return 0;
|
|
}
|
|
data = data[0][keys];
|
|
return data[data.length - 1]['value'];
|
|
}
|
|
} catch (error) {
|
|
Zabbix.log(3, this.zabbixLogPrefix + ' Could not find key "' + keys + '" in JSON: ' + JSON.stringify(data));
|
|
throw 'Could not find required key in JSON object. See logs for more information.';
|
|
}
|
|
};
|
|
}
|
|
|
|
function buildMql(id, metrics, defaultStatistic, resourceType) {
|
|
resourceType = resourceType === '' || resourceType === undefined ? 'resourceId' : resourceType;
|
|
this.query = '[' + params['req_interval'] + 'm]{' + resourceType + '=' + id + '}.';
|
|
|
|
for (var i = 0, metricsLength = metrics.length; i < metricsLength; i++) {
|
|
const metric = ((Array.isArray(metrics[i]) ? metrics[i] : [metrics[i], defaultStatistic]));
|
|
metrics[i] = [metric[0], this.query + metric[1]];
|
|
}
|
|
}
|
|
|
|
|
|
const params = JSON.parse(value);
|
|
validateZabbixParams(['tenancy_ocid', 'user_ocid', 'private_key', 'fingerprint', 'api_host', 'volume_id', 'http_status_code', 'req_interval', 'compartment_id'], params);
|
|
var oci = new OCI('Block volume', 'Get metrics', params);
|
|
|
|
const metrics = [
|
|
'VolumeReadThroughput',
|
|
'VolumeWriteThroughput',
|
|
'VolumeReadOps',
|
|
'VolumeWriteOps',
|
|
['VolumeThrottledIOs', 'sum'],
|
|
'VolumeGuaranteedVPUsPerGB',
|
|
'VolumeGuaranteedIOPS',
|
|
'VolumeGuaranteedThroughput'
|
|
];
|
|
buildMql(params['volume_id'], metrics, 'mean');
|
|
|
|
var result = {};
|
|
for (var i = 0, metricsLength = metrics.length; i < metricsLength; i++) {
|
|
result[metrics[i][0]] = oci.extractData('post', oci.executeRequest('post', '/20180401/metrics/actions/summarizeMetricsData', '?compartmentId=' + encodeURIComponent(params['compartment_id']), metrics[i][0] + metrics[i][1] + '()', 'oci_blockstore'), 'aggregatedDatapoints');
|
|
}
|
|
return JSON.stringify(result);
|
|
description: 'Gets block volume metrics.'
|
|
timeout: 30s
|
|
parameters:
|
|
- name: api_host
|
|
value: '{$OCI.API.TELEMETRY.HOST}'
|
|
- name: compartment_id
|
|
value: '{$OCI.VOLUME.BLOCK.COMPARTMENT.ID}'
|
|
- name: fingerprint
|
|
value: '{$OCI.API.FINGERPRINT}'
|
|
- name: http_proxy
|
|
value: '{$OCI.HTTP.PROXY}'
|
|
- name: http_status_code
|
|
value: '{$OCI.HTTP.RETURN.CODE.OK}'
|
|
- name: private_key
|
|
value: '{$OCI.API.PRIVATE.KEY}'
|
|
- name: req_interval
|
|
value: '1'
|
|
- name: tenancy_ocid
|
|
value: '{$OCI.API.TENANCY}'
|
|
- name: tls_verify
|
|
value: '{$HTTP.TLS.VERIFY:"Oracle Cloud Block Volume"}'
|
|
- name: user_ocid
|
|
value: '{$OCI.API.USER}'
|
|
- name: volume_id
|
|
value: '{$OCI.VOLUME.BLOCK.ID}'
|
|
tags:
|
|
- tag: component
|
|
value: raw
|
|
- uuid: 680f9e8c96d34c099533adc99c33a48f
|
|
name: 'Volume read throughput'
|
|
type: DEPENDENT
|
|
key: oci.block.volume.read
|
|
delay: '0'
|
|
value_type: FLOAT
|
|
units: Bps
|
|
description: 'Read throughput. Expressed as bytes read per interval.'
|
|
preprocessing:
|
|
- type: JSONPATH
|
|
parameters:
|
|
- $.VolumeReadThroughput
|
|
- type: DISCARD_UNCHANGED_HEARTBEAT
|
|
parameters:
|
|
- 1h
|
|
master_item:
|
|
key: oci.block.volume.metrics.get
|
|
tags:
|
|
- tag: component
|
|
value: storage
|
|
- uuid: 6b8060ce122142968e73da9a3e0813a1
|
|
name: 'Volume read operations'
|
|
type: DEPENDENT
|
|
key: oci.block.volume.read.ops
|
|
delay: '0'
|
|
value_type: FLOAT
|
|
units: '!reads'
|
|
description: 'Activity level from I/O reads. Expressed as reads per interval.'
|
|
preprocessing:
|
|
- type: JSONPATH
|
|
parameters:
|
|
- $.VolumeReadOps
|
|
- type: DISCARD_UNCHANGED_HEARTBEAT
|
|
parameters:
|
|
- 1h
|
|
master_item:
|
|
key: oci.block.volume.metrics.get
|
|
tags:
|
|
- tag: component
|
|
value: storage
|
|
- uuid: 4fdab3067ada41219c8208862e7c8b14
|
|
name: State
|
|
type: SCRIPT
|
|
key: oci.block.volume.state
|
|
params: |
|
|
const CTlsConfig = function (raw_value) {
|
|
raw_value = String(raw_value).trim().toLowerCase();
|
|
|
|
if (['none', 'peer', 'full'].indexOf(raw_value) === -1) {
|
|
raw_value = 'full';
|
|
}
|
|
|
|
this.options = {
|
|
SSLVerifyPeer: (raw_value === 'peer' || raw_value === 'full'),
|
|
SSLVerifyHost: (raw_value === 'full')
|
|
};
|
|
|
|
this.enabled = (raw_value !== 'none');
|
|
|
|
this.checkURL = function (url) {
|
|
if (this.enabled && !/^https:\/\//i.test(url)) {
|
|
throw 'TLS certificate verification is enabled by {$' + 'HTTP.TLS.VERIFY}, but the URL uses plain HTTP: ' + url +
|
|
'. Use an "https://" URL, or set {$' + 'HTTP.TLS.VERIFY} to `none` to disable verification.';
|
|
}
|
|
|
|
return url;
|
|
};
|
|
}
|
|
|
|
|
|
function validateZabbixParams(requiredParams, allParams) {
|
|
requiredParams.forEach(function (field) {
|
|
if (typeof allParams !== 'object' || typeof allParams[field] === 'undefined' || allParams[field] === '') {
|
|
throw 'Required param is not set: ' + field + '.';
|
|
}
|
|
});
|
|
}
|
|
|
|
function OCI(service, action, params) {
|
|
this.zabbixLogPrefix = '[ OCI ] [ ' + service + ' ] [ ' + action + ' ]';
|
|
this.tls = new CTlsConfig(params.tls_verify);
|
|
this.request = new HttpRequest(this.tls.options);
|
|
|
|
this.hash = function (string) {
|
|
return sha256(string);
|
|
};
|
|
|
|
this.sign = function (string) {
|
|
return sign('sha256', params['private_key'], string);
|
|
};
|
|
|
|
this.encode = function (hash) {
|
|
const hexArr = hash.match(/.{1,2}/g);
|
|
var uInt8Array = new Uint8Array(hexArr.length);
|
|
hexArr.forEach(function (hex, idx) {
|
|
uInt8Array[idx] = parseInt(hex, 16);
|
|
});
|
|
return btoa(uInt8Array);
|
|
};
|
|
|
|
this.getDate = function () {
|
|
const weekdayShortList = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
|
|
const monthShortList = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'];
|
|
const today = new Date();
|
|
return weekdayShortList[today.getUTCDay()] + ', ' + today.getUTCDate() + ' ' + monthShortList[today.getUTCMonth()] + ' ' + today.getUTCFullYear() + ' ' + today.getUTCHours() + ':' + today.getUTCMinutes() + ':' + today.getUTCSeconds() + ' GMT';
|
|
};
|
|
|
|
this.executeRequest = function (httpMethod, apiPath, apiParams, mql, namespace) {
|
|
var headers = '(request-target) date host';
|
|
const contentTypeHeader = 'content-type: application/json';
|
|
const dateHeader = 'date: ' + this.getDate();
|
|
const hostHeader = 'host: ' + params['api_host'];
|
|
const requestTarget = '(request-target): ' + httpMethod + ' ' + apiPath + apiParams;
|
|
var signingString = requestTarget + '\n' + dateHeader + '\n' + hostHeader;
|
|
var reqHeaders = [contentTypeHeader, dateHeader];
|
|
|
|
if (httpMethod === 'post') {
|
|
var body = JSON.stringify({
|
|
'namespace': namespace,
|
|
'query': mql
|
|
});
|
|
headers = headers + ' x-content-sha256 content-type content-length';
|
|
const bodyHeader = 'x-content-sha256: ' + this.encode(this.hash(body));
|
|
const bodyLengthHeader = 'content-length: ' + body.length;
|
|
signingString = signingString + '\n' + bodyHeader + '\n' + contentTypeHeader + '\n' + bodyLengthHeader;
|
|
reqHeaders.push(bodyHeader, bodyLengthHeader);
|
|
}
|
|
|
|
const signature = this.encode(this.sign(signingString));
|
|
|
|
reqHeaders.push('Authorization: Signature version="1",keyId="' + params['tenancy_ocid'] + '/' + params['user_ocid'] + '/' + params['fingerprint'] + '",algorithm="rsa-sha256",headers="' + headers + '",signature="' + signature + '"');
|
|
for (var header = 0, headerLength = reqHeaders.length; header < headerLength; header++) {
|
|
this.request.addHeader(reqHeaders[header]);
|
|
}
|
|
|
|
if (params['http_proxy']) {
|
|
this.request.setProxy(params['http_proxy']);
|
|
Zabbix.log(4, this.zabbixLogPrefix + ' Using http proxy: ' + params['http_proxy']);
|
|
}
|
|
|
|
if (httpMethod === 'post') {
|
|
var apiRateLimitExceeded = false;
|
|
do {
|
|
const response = this.request.post('https://' + params['api_host'] + apiPath + apiParams, body);
|
|
|
|
try {
|
|
if (JSON.parse(response)['code'] === 'TooManyRequests') {
|
|
|
|
apiRateLimitExceeded = true;
|
|
Zabbix.sleep(1000);
|
|
} else {
|
|
apiRateLimitExceeded = false;
|
|
}
|
|
} catch (error) {
|
|
Zabbix.log(3, this.zabbixLogPrefix + ' Could not parse the response: ' + JSON.stringify(response));
|
|
throw 'Could not parse the response. See logs for more information.';
|
|
}
|
|
} while (apiRateLimitExceeded);
|
|
} else {
|
|
const response = this.request.get('https://' + params['api_host'] + apiPath + apiParams);
|
|
}
|
|
|
|
this.request.clearHeader();
|
|
|
|
if (this.request.getStatus() === parseInt(params['http_status_code'])) {
|
|
return response;
|
|
} else {
|
|
Zabbix.log(3, this.zabbixLogPrefix + ' Unexpected HTTP response code: ' + this.request.getStatus());
|
|
throw 'Unexpected HTTP response code: ' + this.request.getStatus();
|
|
}
|
|
};
|
|
|
|
this.extractData = function (httpMethod, data, keys, compartment) {
|
|
try {
|
|
data = JSON.parse(data);
|
|
} catch (error) {
|
|
Zabbix.log(3, this.zabbixLogPrefix + ' Could not parse the received JSON object: ' + data);
|
|
throw 'Could not parse received JSON object. See logs for more information.';
|
|
}
|
|
|
|
if (typeof keys == 'object') {
|
|
var returnBuffer = [];
|
|
for (var dataObj = 0, dataLength = data.length; dataObj < dataLength; dataObj++) {
|
|
|
|
var objectBuffer = {};
|
|
for (var key = 0, keysLength = keys.length; key < keysLength; key++) {
|
|
if (data[dataObj][keys[key]] || data[dataObj][keys[key]] == null) {
|
|
objectBuffer[keys[key].match(/^[a-z]+$|[A-Z][a-z]+$/)[0].toLowerCase()] = data[dataObj][keys[key]];
|
|
} else {
|
|
Zabbix.log(3, this.zabbixLogPrefix + ' Received an unexpected JSON object. Could not get value for key "' + keys[key] + '" in JSON: ' + JSON.stringify(data[dataObj]));
|
|
throw 'Received an unexpected JSON object. See logs for more information.';
|
|
}
|
|
}
|
|
if (typeof compartment != 'undefined' && compartment != '') objectBuffer['compartment'] = compartment;
|
|
returnBuffer.push(objectBuffer);
|
|
}
|
|
return returnBuffer;
|
|
}
|
|
|
|
try {
|
|
if (httpMethod === 'get') {
|
|
return data[keys];
|
|
} else {
|
|
if (data.length === 0) {
|
|
return 0;
|
|
}
|
|
data = data[0][keys];
|
|
return data[data.length - 1]['value'];
|
|
}
|
|
} catch (error) {
|
|
Zabbix.log(3, this.zabbixLogPrefix + ' Could not find key "' + keys + '" in JSON: ' + JSON.stringify(data));
|
|
throw 'Could not find required key in JSON object. See logs for more information.';
|
|
}
|
|
};
|
|
}
|
|
|
|
|
|
const params = JSON.parse(value);
|
|
validateZabbixParams(['tenancy_ocid', 'user_ocid', 'private_key', 'fingerprint', 'api_host', 'volume_id', 'http_status_code'], params);
|
|
var oci = new OCI('Block volume', 'Get volume state', params);
|
|
|
|
return oci.extractData('get', oci.executeRequest('get', '/20160918/volumes/' + encodeURIComponent(params['volume_id']), ''), 'lifecycleState');
|
|
description: 'Gets the block volume state.'
|
|
valuemap:
|
|
name: 'Block volume state'
|
|
preprocessing:
|
|
- type: JAVASCRIPT
|
|
parameters:
|
|
- |
|
|
const idx = {
|
|
'PROVISIONING': 1,
|
|
'RESTORING': 2,
|
|
'AVAILABLE': 3,
|
|
'TERMINATING': 4,
|
|
'TERMINATED': 5,
|
|
'FAULTY': 6
|
|
};
|
|
|
|
return typeof idx[value] === 'undefined' ? 0 : idx[value];
|
|
- type: DISCARD_UNCHANGED_HEARTBEAT
|
|
parameters:
|
|
- 1h
|
|
timeout: 10s
|
|
parameters:
|
|
- name: api_host
|
|
value: '{$OCI.API.CORE.HOST}'
|
|
- name: fingerprint
|
|
value: '{$OCI.API.FINGERPRINT}'
|
|
- name: http_proxy
|
|
value: '{$OCI.HTTP.PROXY}'
|
|
- name: http_status_code
|
|
value: '{$OCI.HTTP.RETURN.CODE.OK}'
|
|
- name: private_key
|
|
value: '{$OCI.API.PRIVATE.KEY}'
|
|
- name: tenancy_ocid
|
|
value: '{$OCI.API.TENANCY}'
|
|
- name: tls_verify
|
|
value: '{$HTTP.TLS.VERIFY:"Oracle Cloud Block Volume"}'
|
|
- name: user_ocid
|
|
value: '{$OCI.API.USER}'
|
|
- name: volume_id
|
|
value: '{$OCI.VOLUME.BLOCK.ID}'
|
|
tags:
|
|
- tag: component
|
|
value: storage
|
|
triggers:
|
|
- uuid: 4ea859d86e29455aa4bdd2f3667894f6
|
|
expression: 'min(/Oracle Cloud Block Volume by HTTP/oci.block.volume.state,5m) = 0'
|
|
name: 'OCI Block Volume: Block volume state unknown'
|
|
priority: WARNING
|
|
description: 'Block volume state is unknown.'
|
|
dependencies:
|
|
- name: 'OCI Block Volume: Block volume terminated or faulty'
|
|
expression: 'min(/Oracle Cloud Block Volume by HTTP/oci.block.volume.state,5m) >= 4'
|
|
tags:
|
|
- tag: scope
|
|
value: availability
|
|
- uuid: b8d9491d762f40c58fb1094fa0468d9e
|
|
expression: 'min(/Oracle Cloud Block Volume by HTTP/oci.block.volume.state,5m) >= 4'
|
|
name: 'OCI Block Volume: Block volume terminated or faulty'
|
|
priority: HIGH
|
|
description: 'Block volume state is "terminated"/"terminating" or "faulty".'
|
|
tags:
|
|
- tag: scope
|
|
value: availability
|
|
- uuid: cc9ef37437b04a40a4b48a9f21e36ff1
|
|
name: 'Volume throttled operations'
|
|
type: DEPENDENT
|
|
key: oci.block.volume.throttled.ops
|
|
delay: '0'
|
|
description: 'Total sum of all the I/O operations that were throttled during a given time interval.'
|
|
preprocessing:
|
|
- type: JSONPATH
|
|
parameters:
|
|
- $.VolumeThrottledIOs
|
|
- type: DISCARD_UNCHANGED_HEARTBEAT
|
|
parameters:
|
|
- 1h
|
|
master_item:
|
|
key: oci.block.volume.metrics.get
|
|
tags:
|
|
- tag: component
|
|
value: storage
|
|
- uuid: d1b199adc996404db814ba7568b054df
|
|
name: 'Volume guaranteed throughput'
|
|
type: DEPENDENT
|
|
key: oci.block.volume.throughput
|
|
delay: '0'
|
|
value_type: FLOAT
|
|
units: Bps
|
|
description: 'Rate of change for guaranteed throughput per SLA. Expressed as megabytes per interval.'
|
|
preprocessing:
|
|
- type: JSONPATH
|
|
parameters:
|
|
- $.VolumeGuaranteedThroughput
|
|
- type: MULTIPLIER
|
|
parameters:
|
|
- '1048576'
|
|
- type: DISCARD_UNCHANGED_HEARTBEAT
|
|
parameters:
|
|
- 1h
|
|
master_item:
|
|
key: oci.block.volume.metrics.get
|
|
tags:
|
|
- tag: component
|
|
value: storage
|
|
- uuid: 607f3c4a8197473bb1872e4ed45edd26
|
|
name: 'Volume guaranteed VPUs/GB'
|
|
type: DEPENDENT
|
|
key: oci.block.volume.vpu
|
|
delay: '0'
|
|
value_type: FLOAT
|
|
units: '!VPUs'
|
|
description: |
|
|
Rate of change for currently active VPUs/GB.
|
|
Expressed as the average of active VPUs/GB during a given time interval.
|
|
preprocessing:
|
|
- type: JSONPATH
|
|
parameters:
|
|
- $.VolumeGuaranteedVPUsPerGB
|
|
- type: DISCARD_UNCHANGED_HEARTBEAT
|
|
parameters:
|
|
- 1h
|
|
master_item:
|
|
key: oci.block.volume.metrics.get
|
|
tags:
|
|
- tag: component
|
|
value: storage
|
|
- uuid: 9ec2ce2d21154028a5623b5d0ac9c082
|
|
name: 'Volume write throughput'
|
|
type: DEPENDENT
|
|
key: oci.block.volume.write
|
|
delay: '0'
|
|
value_type: FLOAT
|
|
units: Bps
|
|
description: 'Write throughput. Expressed as bytes read per interval.'
|
|
preprocessing:
|
|
- type: JSONPATH
|
|
parameters:
|
|
- $.VolumeWriteThroughput
|
|
- type: DISCARD_UNCHANGED_HEARTBEAT
|
|
parameters:
|
|
- 1h
|
|
master_item:
|
|
key: oci.block.volume.metrics.get
|
|
tags:
|
|
- tag: component
|
|
value: storage
|
|
- uuid: e55fee2db439493992a80e39ca647e9a
|
|
name: 'Volume write operations'
|
|
type: DEPENDENT
|
|
key: oci.block.volume.write.ops
|
|
delay: '0'
|
|
value_type: FLOAT
|
|
units: '!writes'
|
|
description: 'Activity level from I/O writes. Expressed as writes per interval.'
|
|
preprocessing:
|
|
- type: JSONPATH
|
|
parameters:
|
|
- $.VolumeWriteOps
|
|
- type: DISCARD_UNCHANGED_HEARTBEAT
|
|
parameters:
|
|
- 1h
|
|
master_item:
|
|
key: oci.block.volume.metrics.get
|
|
tags:
|
|
- tag: component
|
|
value: storage
|
|
tags:
|
|
- tag: class
|
|
value: cloud
|
|
- tag: target
|
|
value: oci
|
|
- tag: target
|
|
value: oracle-cloud-infrastructure
|
|
macros:
|
|
- macro: '{$HTTP.TLS.VERIFY}'
|
|
value: full
|
|
description: 'TLS certificate verification for script items: "none" - disabled, "peer" - verify the certificate chain and expiration, "full" - full verification. Any other value enables full verification. To override the setting for this template only, define the macro with the context "Oracle Cloud Block Volume", e.g. {$HTTP.TLS.VERIFY:"Oracle Cloud Block Volume"}.'
|
|
- macro: '{$OCI.HTTP.PROXY}'
|
|
description: 'Set an HTTP proxy for OCI API requests if needed.'
|
|
- macro: '{$OCI.HTTP.RETURN.CODE.OK}'
|
|
value: '200'
|
|
description: 'Set the HTTP return code that represents an OK response from the API. The default is "200", but can vary, for example, if a proxy is used.'
|
|
dashboards:
|
|
- uuid: f87041e2902c4286a648b0f53daee03f
|
|
name: 'OCI Block Volume: Overview'
|
|
pages:
|
|
- name: Overview
|
|
display_period: '30'
|
|
widgets:
|
|
- type: item
|
|
name: Availability
|
|
width: '27'
|
|
height: '3'
|
|
hide_header: 'YES'
|
|
fields:
|
|
- type: STRING
|
|
name: bg_color
|
|
value: 6C00D9
|
|
- type: ITEM
|
|
name: itemid.0
|
|
value:
|
|
host: 'Oracle Cloud Block Volume by HTTP'
|
|
key: oci.block.volume.state
|
|
- type: INTEGER
|
|
name: show.0
|
|
value: '2'
|
|
- type: INTEGER
|
|
name: units_show
|
|
value: '0'
|
|
- type: STRING
|
|
name: value_color
|
|
value: FFFFFF
|
|
- type: item
|
|
name: 'Volume read operations'
|
|
'y': '3'
|
|
width: '18'
|
|
height: '3'
|
|
hide_header: 'YES'
|
|
fields:
|
|
- type: STRING
|
|
name: bg_color
|
|
value: 2196F3
|
|
- type: INTEGER
|
|
name: decimal_size
|
|
value: '45'
|
|
- type: STRING
|
|
name: description
|
|
value: 'Volume Read Operations'
|
|
- type: STRING
|
|
name: desc_color
|
|
value: FFFFFF
|
|
- type: INTEGER
|
|
name: desc_v_pos
|
|
value: '0'
|
|
- type: ITEM
|
|
name: itemid.0
|
|
value:
|
|
host: 'Oracle Cloud Block Volume by HTTP'
|
|
key: oci.block.volume.read.ops
|
|
- type: INTEGER
|
|
name: show.0
|
|
value: '2'
|
|
- type: INTEGER
|
|
name: show.1
|
|
value: '1'
|
|
- type: STRING
|
|
name: units_color
|
|
value: FFFFFF
|
|
- type: INTEGER
|
|
name: units_size
|
|
value: '25'
|
|
- type: STRING
|
|
name: value_color
|
|
value: FFFFFF
|
|
- type: graph
|
|
name: Operations
|
|
'y': '6'
|
|
width: '36'
|
|
height: '5'
|
|
fields:
|
|
- type: GRAPH
|
|
name: graphid.0
|
|
value:
|
|
host: 'Oracle Cloud Block Volume by HTTP'
|
|
name: 'OCI Block Volume: Operations'
|
|
- type: STRING
|
|
name: reference
|
|
value: AAAAA
|
|
- type: item
|
|
name: 'Volume write operations'
|
|
x: '18'
|
|
'y': '3'
|
|
width: '18'
|
|
height: '3'
|
|
hide_header: 'YES'
|
|
fields:
|
|
- type: STRING
|
|
name: bg_color
|
|
value: 2196F3
|
|
- type: INTEGER
|
|
name: decimal_size
|
|
value: '45'
|
|
- type: STRING
|
|
name: description
|
|
value: 'Volume Write Operations'
|
|
- type: STRING
|
|
name: desc_color
|
|
value: FFFFFF
|
|
- type: INTEGER
|
|
name: desc_v_pos
|
|
value: '0'
|
|
- type: ITEM
|
|
name: itemid.0
|
|
value:
|
|
host: 'Oracle Cloud Block Volume by HTTP'
|
|
key: oci.block.volume.write.ops
|
|
- type: INTEGER
|
|
name: show.0
|
|
value: '2'
|
|
- type: INTEGER
|
|
name: show.1
|
|
value: '1'
|
|
- type: STRING
|
|
name: units_color
|
|
value: FFFFFF
|
|
- type: INTEGER
|
|
name: units_size
|
|
value: '25'
|
|
- type: STRING
|
|
name: value_color
|
|
value: FFFFFF
|
|
- type: item
|
|
name: 'Guaranteed IOPS'
|
|
x: '27'
|
|
width: '15'
|
|
height: '3'
|
|
hide_header: 'YES'
|
|
fields:
|
|
- type: STRING
|
|
name: bg_color
|
|
value: 00D936
|
|
- type: INTEGER
|
|
name: decimal_places
|
|
value: '0'
|
|
- type: STRING
|
|
name: description
|
|
value: 'Guaranteed IOPS'
|
|
- type: STRING
|
|
name: desc_color
|
|
value: FFFFFF
|
|
- type: INTEGER
|
|
name: desc_v_pos
|
|
value: '0'
|
|
- type: ITEM
|
|
name: itemid.0
|
|
value:
|
|
host: 'Oracle Cloud Block Volume by HTTP'
|
|
key: oci.block.volume.iops
|
|
- type: INTEGER
|
|
name: show.0
|
|
value: '2'
|
|
- type: INTEGER
|
|
name: show.1
|
|
value: '1'
|
|
- type: STRING
|
|
name: units_color
|
|
value: FFFFFF
|
|
- type: INTEGER
|
|
name: units_size
|
|
value: '25'
|
|
- type: STRING
|
|
name: value_color
|
|
value: FFFFFF
|
|
- type: item
|
|
name: 'Volume read throughput'
|
|
x: '36'
|
|
'y': '3'
|
|
width: '18'
|
|
height: '3'
|
|
hide_header: 'YES'
|
|
fields:
|
|
- type: STRING
|
|
name: bg_color
|
|
value: 2196F3
|
|
- type: INTEGER
|
|
name: decimal_size
|
|
value: '45'
|
|
- type: STRING
|
|
name: description
|
|
value: 'Volume Read Throughput'
|
|
- type: STRING
|
|
name: desc_color
|
|
value: FFFFFF
|
|
- type: INTEGER
|
|
name: desc_v_pos
|
|
value: '0'
|
|
- type: ITEM
|
|
name: itemid.0
|
|
value:
|
|
host: 'Oracle Cloud Block Volume by HTTP'
|
|
key: oci.block.volume.read
|
|
- type: INTEGER
|
|
name: show.0
|
|
value: '2'
|
|
- type: INTEGER
|
|
name: show.1
|
|
value: '1'
|
|
- type: STRING
|
|
name: units_color
|
|
value: FFFFFF
|
|
- type: INTEGER
|
|
name: units_size
|
|
value: '25'
|
|
- type: STRING
|
|
name: value_color
|
|
value: FFFFFF
|
|
- type: graph
|
|
name: Throughput
|
|
x: '36'
|
|
'y': '6'
|
|
width: '36'
|
|
height: '5'
|
|
fields:
|
|
- type: GRAPH
|
|
name: graphid.0
|
|
value:
|
|
host: 'Oracle Cloud Block Volume by HTTP'
|
|
name: 'OCI Block Volume: Throughput'
|
|
- type: STRING
|
|
name: reference
|
|
value: AAAAB
|
|
- type: item
|
|
name: 'Guaranteed throughput'
|
|
x: '42'
|
|
width: '15'
|
|
height: '3'
|
|
hide_header: 'YES'
|
|
fields:
|
|
- type: STRING
|
|
name: bg_color
|
|
value: 00D936
|
|
- type: INTEGER
|
|
name: decimal_size
|
|
value: '45'
|
|
- type: STRING
|
|
name: description
|
|
value: 'Guaranteed Throughput'
|
|
- type: STRING
|
|
name: desc_color
|
|
value: FFFFFF
|
|
- type: INTEGER
|
|
name: desc_v_pos
|
|
value: '0'
|
|
- type: ITEM
|
|
name: itemid.0
|
|
value:
|
|
host: 'Oracle Cloud Block Volume by HTTP'
|
|
key: oci.block.volume.throughput
|
|
- type: INTEGER
|
|
name: show.0
|
|
value: '2'
|
|
- type: INTEGER
|
|
name: show.1
|
|
value: '1'
|
|
- type: STRING
|
|
name: units_color
|
|
value: FFFFFF
|
|
- type: INTEGER
|
|
name: units_size
|
|
value: '25'
|
|
- type: STRING
|
|
name: value_color
|
|
value: FFFFFF
|
|
- type: item
|
|
name: 'Volume write throughput'
|
|
x: '54'
|
|
'y': '3'
|
|
width: '18'
|
|
height: '3'
|
|
hide_header: 'YES'
|
|
fields:
|
|
- type: STRING
|
|
name: bg_color
|
|
value: 2196F3
|
|
- type: INTEGER
|
|
name: decimal_size
|
|
value: '45'
|
|
- type: STRING
|
|
name: description
|
|
value: 'Volume Write Throughput'
|
|
- type: STRING
|
|
name: desc_color
|
|
value: FFFFFF
|
|
- type: INTEGER
|
|
name: desc_v_pos
|
|
value: '0'
|
|
- type: ITEM
|
|
name: itemid.0
|
|
value:
|
|
host: 'Oracle Cloud Block Volume by HTTP'
|
|
key: oci.block.volume.write
|
|
- type: INTEGER
|
|
name: show.0
|
|
value: '2'
|
|
- type: INTEGER
|
|
name: show.1
|
|
value: '1'
|
|
- type: STRING
|
|
name: units_color
|
|
value: FFFFFF
|
|
- type: INTEGER
|
|
name: units_size
|
|
value: '25'
|
|
- type: STRING
|
|
name: value_color
|
|
value: FFFFFF
|
|
- type: item
|
|
name: 'Guaranteed VPUs/GB'
|
|
x: '57'
|
|
width: '15'
|
|
height: '3'
|
|
hide_header: 'YES'
|
|
fields:
|
|
- type: STRING
|
|
name: bg_color
|
|
value: 00D936
|
|
- type: INTEGER
|
|
name: decimal_size
|
|
value: '45'
|
|
- type: STRING
|
|
name: description
|
|
value: 'Guaranteed VPUs/GB'
|
|
- type: STRING
|
|
name: desc_color
|
|
value: FFFFFF
|
|
- type: INTEGER
|
|
name: desc_v_pos
|
|
value: '0'
|
|
- type: ITEM
|
|
name: itemid.0
|
|
value:
|
|
host: 'Oracle Cloud Block Volume by HTTP'
|
|
key: oci.block.volume.vpu
|
|
- type: INTEGER
|
|
name: show.0
|
|
value: '2'
|
|
- type: INTEGER
|
|
name: show.1
|
|
value: '1'
|
|
- type: STRING
|
|
name: units_color
|
|
value: FFFFFF
|
|
- type: INTEGER
|
|
name: units_size
|
|
value: '25'
|
|
- type: STRING
|
|
name: value_color
|
|
value: FFFFFF
|
|
valuemaps:
|
|
- uuid: 780a56fd95474839943cbd2f8be2fc18
|
|
name: 'Block volume state'
|
|
mappings:
|
|
- value: '0'
|
|
newvalue: Unknown
|
|
- value: '1'
|
|
newvalue: Provisioning
|
|
- value: '2'
|
|
newvalue: Restoring
|
|
- value: '3'
|
|
newvalue: Available
|
|
- value: '4'
|
|
newvalue: Terminating
|
|
- value: '5'
|
|
newvalue: Terminated
|
|
- value: '6'
|
|
newvalue: Faulty
|
|
graphs:
|
|
- uuid: 68f6c72e67f947b29f879b89a205d59c
|
|
name: 'OCI Block Volume: Operations'
|
|
graph_items:
|
|
- color: 199C0D
|
|
item:
|
|
host: 'Oracle Cloud Block Volume by HTTP'
|
|
key: oci.block.volume.read.ops
|
|
- sortorder: '1'
|
|
color: F63100
|
|
item:
|
|
host: 'Oracle Cloud Block Volume by HTTP'
|
|
key: oci.block.volume.write.ops
|
|
- sortorder: '2'
|
|
color: 00611C
|
|
item:
|
|
host: 'Oracle Cloud Block Volume by HTTP'
|
|
key: oci.block.volume.throttled.ops
|
|
- sortorder: '3'
|
|
color: F7941D
|
|
yaxisside: RIGHT
|
|
item:
|
|
host: 'Oracle Cloud Block Volume by HTTP'
|
|
key: oci.block.volume.iops
|
|
- uuid: 16076dfa25244b5093e8985ca2e3f18c
|
|
name: 'OCI Block Volume: Throughput'
|
|
graph_items:
|
|
- color: 199C0D
|
|
item:
|
|
host: 'Oracle Cloud Block Volume by HTTP'
|
|
key: oci.block.volume.read
|
|
- sortorder: '1'
|
|
color: F63100
|
|
item:
|
|
host: 'Oracle Cloud Block Volume by HTTP'
|
|
key: oci.block.volume.write
|
|
- sortorder: '2'
|
|
color: 00611C
|
|
yaxisside: RIGHT
|
|
item:
|
|
host: 'Oracle Cloud Block Volume by HTTP'
|
|
key: oci.block.volume.throughput
|
|
- uuid: 6078da9c1eb249548536663e57e7743c
|
|
name: 'OCI Block Volume: VPUs/GB'
|
|
graph_items:
|
|
- color: 199C0D
|
|
item:
|
|
host: 'Oracle Cloud Block Volume by HTTP'
|
|
key: oci.block.volume.vpu
|