1083 lines
42 KiB
YAML
1083 lines
42 KiB
YAML
zabbix_export:
|
|
version: '7.0'
|
|
template_groups:
|
|
- uuid: c2c162144c2d4c5491c8801193af4945
|
|
name: Templates/Cloud
|
|
templates:
|
|
- uuid: a93f57ccc68e442da79bf4a20fe46570
|
|
template: 'Azure SQL Managed Instance by HTTP'
|
|
name: 'Azure SQL Managed Instance by HTTP'
|
|
description: |
|
|
This template is designed to monitor Azure SQL Managed Instance by HTTP.
|
|
It works without any external scripts and uses the script item.
|
|
|
|
Setup:
|
|
1. Create an Azure service principal via the Azure command-line interface (Azure CLI) for your subscription.
|
|
`az ad sp create-for-rbac --name zabbix --role reader --scope /subscriptions/<subscription_id>`
|
|
See https://docs.microsoft.com/en-us/cli/azure/create-an-azure-service-principal-azure-cli for more details.
|
|
2. Link the template to a host.
|
|
3. Configure the macros: {$AZURE.APP.ID}, {$AZURE.PASSWORD}, {$AZURE.TENANT.ID}, {$AZURE.SUBSCRIPTION.ID}, and {$AZURE.RESOURCE.ID}.
|
|
|
|
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-4
|
|
groups:
|
|
- name: Templates/Cloud
|
|
items:
|
|
- uuid: dd047204951f449496ab9b4938dd0a3a
|
|
name: 'Availability status detailed'
|
|
type: DEPENDENT
|
|
key: azure.sql_inst.availability.details
|
|
delay: '0'
|
|
value_type: CHAR
|
|
trends: '0'
|
|
description: 'The summary description of the availability status.'
|
|
preprocessing:
|
|
- type: JSONPATH
|
|
parameters:
|
|
- $.health.summary
|
|
error_handler: DISCARD_VALUE
|
|
- type: DISCARD_UNCHANGED_HEARTBEAT
|
|
parameters:
|
|
- 1h
|
|
master_item:
|
|
key: azure.sql_inst.data.get
|
|
tags:
|
|
- tag: component
|
|
value: health
|
|
- uuid: be4a868809374a80a9ed3150e098f470
|
|
name: 'Availability state'
|
|
type: DEPENDENT
|
|
key: azure.sql_inst.availability.state
|
|
delay: '0'
|
|
description: |
|
|
The availability status of the resource.
|
|
0 - Available - no events detected that affect the health of the resource.
|
|
1 - Degraded - your resource detected a loss in performance, although it's still available for use.
|
|
2 - Unavailable - the service detected an ongoing platform or non-platform event that affects the health of the resource.
|
|
3 - Unknown - Resource Health hasn't received information about the resource for more than 10 minutes.
|
|
valuemap:
|
|
name: 'Azure resource health state'
|
|
preprocessing:
|
|
- type: JSONPATH
|
|
parameters:
|
|
- $.health.availabilityState
|
|
error_handler: CUSTOM_VALUE
|
|
error_handler_params: '3'
|
|
- type: STR_REPLACE
|
|
parameters:
|
|
- Available
|
|
- '0'
|
|
- type: STR_REPLACE
|
|
parameters:
|
|
- Degraded
|
|
- '1'
|
|
- type: STR_REPLACE
|
|
parameters:
|
|
- Unavailable
|
|
- '2'
|
|
- type: STR_REPLACE
|
|
parameters:
|
|
- Unknown
|
|
- '3'
|
|
- type: IN_RANGE
|
|
parameters:
|
|
- '0'
|
|
- '3'
|
|
error_handler: CUSTOM_VALUE
|
|
error_handler_params: '3'
|
|
- type: DISCARD_UNCHANGED_HEARTBEAT
|
|
parameters:
|
|
- 1h
|
|
master_item:
|
|
key: azure.sql_inst.data.get
|
|
tags:
|
|
- tag: component
|
|
value: health
|
|
triggers:
|
|
- uuid: 68d6f9d594f64579a7c6be464e126629
|
|
expression: 'last(/Azure SQL Managed Instance by HTTP/azure.sql_inst.availability.state)=1'
|
|
name: 'Azure SQL instance: Azure SQL managed instance is degraded'
|
|
opdata: '{ITEM.LASTVALUE1}'
|
|
priority: AVERAGE
|
|
description: 'The resource is in a degraded state.'
|
|
tags:
|
|
- tag: scope
|
|
value: availability
|
|
- uuid: 9a7ebcccf4684fad8523866fb489e06b
|
|
expression: 'last(/Azure SQL Managed Instance by HTTP/azure.sql_inst.availability.state)=3'
|
|
name: 'Azure SQL instance: Azure SQL managed instance is in unknown state'
|
|
opdata: '{ITEM.LASTVALUE1}'
|
|
priority: WARNING
|
|
description: 'The resource state is unknown.'
|
|
tags:
|
|
- tag: scope
|
|
value: availability
|
|
- uuid: 4a08e72f744e4a0faee2d2e29714d8b8
|
|
expression: 'last(/Azure SQL Managed Instance by HTTP/azure.sql_inst.availability.state)=2'
|
|
name: 'Azure SQL instance: Azure SQL managed instance is unavailable'
|
|
opdata: '{ITEM.LASTVALUE1}'
|
|
priority: HIGH
|
|
description: 'The resource state is unavailable.'
|
|
tags:
|
|
- tag: scope
|
|
value: availability
|
|
- uuid: de4033c537154bf1ae4c33f802f5d923
|
|
name: 'IO bytes read'
|
|
type: DEPENDENT
|
|
key: azure.sql_inst.bytes.read
|
|
delay: '0'
|
|
units: B
|
|
description: 'Bytes read by the managed instance.'
|
|
preprocessing:
|
|
- type: JSONPATH
|
|
parameters:
|
|
- $.metrics.io_bytes_read.average
|
|
error_handler: DISCARD_VALUE
|
|
master_item:
|
|
key: azure.sql_inst.data.get
|
|
tags:
|
|
- tag: component
|
|
value: performance
|
|
- uuid: 230b2e3632274288aa9b4f8667ad5586
|
|
name: 'IO bytes write'
|
|
type: DEPENDENT
|
|
key: azure.sql_inst.bytes.write
|
|
delay: '0'
|
|
units: B
|
|
description: 'Bytes written by the managed instance.'
|
|
preprocessing:
|
|
- type: JSONPATH
|
|
parameters:
|
|
- $.metrics.io_bytes_written.average
|
|
error_handler: DISCARD_VALUE
|
|
master_item:
|
|
key: azure.sql_inst.data.get
|
|
tags:
|
|
- tag: component
|
|
value: performance
|
|
- uuid: 8ef68ff7b24a462b903960a66c5e3acb
|
|
name: 'Instance collation'
|
|
type: DEPENDENT
|
|
key: azure.sql_inst.collation
|
|
delay: '0'
|
|
value_type: CHAR
|
|
trends: '0'
|
|
description: 'Collation of the managed instance.'
|
|
preprocessing:
|
|
- type: JSONPATH
|
|
parameters:
|
|
- $.instance.properties.collation
|
|
error_handler: DISCARD_VALUE
|
|
- type: DISCARD_UNCHANGED_HEARTBEAT
|
|
parameters:
|
|
- 1d
|
|
master_item:
|
|
key: azure.sql_inst.data.get
|
|
tags:
|
|
- tag: component
|
|
value: database
|
|
triggers:
|
|
- uuid: 5c8068386b0a47438713d2b4bd54954a
|
|
expression: 'change(/Azure SQL Managed Instance by HTTP/azure.sql_inst.collation)=1'
|
|
name: 'Azure SQL instance: Instance collation has changed'
|
|
opdata: '{ITEM.LASTVALUE1}'
|
|
priority: AVERAGE
|
|
description: 'Azure SQL managed instance collation has changed.'
|
|
tags:
|
|
- tag: scope
|
|
value: notice
|
|
- uuid: 4020903b19234e7b83b725d0c56caa82
|
|
name: 'Virtual core count'
|
|
type: DEPENDENT
|
|
key: azure.sql_inst.core.count
|
|
delay: '0'
|
|
description: 'Virtual core count available to the managed instance.'
|
|
preprocessing:
|
|
- type: JSONPATH
|
|
parameters:
|
|
- $.metrics.virtual_core_count.average
|
|
error_handler: DISCARD_VALUE
|
|
- type: DISCARD_UNCHANGED_HEARTBEAT
|
|
parameters:
|
|
- 1h
|
|
master_item:
|
|
key: azure.sql_inst.data.get
|
|
tags:
|
|
- tag: component
|
|
value: performance
|
|
- uuid: 62fd264c07fe410ca8f43970c8ecdaef
|
|
name: 'Average CPU utilization'
|
|
type: DEPENDENT
|
|
key: azure.sql_inst.cpu
|
|
delay: '0'
|
|
value_type: FLOAT
|
|
units: '%'
|
|
description: 'Average CPU utilization of the instance.'
|
|
preprocessing:
|
|
- type: JSONPATH
|
|
parameters:
|
|
- $.metrics.avg_cpu_percent.average
|
|
error_handler: DISCARD_VALUE
|
|
master_item:
|
|
key: azure.sql_inst.data.get
|
|
tags:
|
|
- tag: component
|
|
value: cpu
|
|
triggers:
|
|
- uuid: 553333ffdbf142539799e7a7b6e8af2b
|
|
expression: 'min(/Azure SQL Managed Instance by HTTP/azure.sql_inst.cpu, 10m)>={$AZURE.SQL.INST.CPU.CRIT}'
|
|
name: 'Azure SQL instance: Critically high CPU utilization'
|
|
event_name: 'Azure SQL instance: Critically high CPU utilization: (over >= {$AZURE.SQL.INST.CPU.CRIT}% over last 10m)'
|
|
opdata: 'Current utilization: {ITEM.LASTVALUE}'
|
|
priority: AVERAGE
|
|
description: 'CPU utilization is critically high.'
|
|
dependencies:
|
|
- name: 'Azure SQL instance: High CPU utilization'
|
|
expression: 'min(/Azure SQL Managed Instance by HTTP/azure.sql_inst.cpu, 10m)>={$AZURE.SQL.INST.CPU.WARN}'
|
|
tags:
|
|
- tag: scope
|
|
value: performance
|
|
- uuid: 7c5876872c644f8598a1fd275d4763d2
|
|
expression: 'min(/Azure SQL Managed Instance by HTTP/azure.sql_inst.cpu, 10m)>={$AZURE.SQL.INST.CPU.WARN}'
|
|
name: 'Azure SQL instance: High CPU utilization'
|
|
event_name: 'Azure SQL instance: High CPU utilization: (over >= {$AZURE.SQL.INST.CPU.WARN}% over last 10m)'
|
|
opdata: 'Current utilization: {ITEM.LASTVALUE}'
|
|
priority: WARNING
|
|
description: 'CPU utilization is too high.'
|
|
tags:
|
|
- tag: scope
|
|
value: performance
|
|
- uuid: 0d4e2f5863474225a5584fbcbb7e51d1
|
|
name: 'Get errors'
|
|
type: DEPENDENT
|
|
key: azure.sql_inst.data.errors
|
|
delay: '0'
|
|
value_type: TEXT
|
|
trends: '0'
|
|
description: 'A list of errors from API requests.'
|
|
preprocessing:
|
|
- type: JSONPATH
|
|
parameters:
|
|
- $.error
|
|
error_handler: CUSTOM_VALUE
|
|
- type: DISCARD_UNCHANGED_HEARTBEAT
|
|
parameters:
|
|
- 1h
|
|
master_item:
|
|
key: azure.sql_inst.data.get
|
|
tags:
|
|
- tag: component
|
|
value: error
|
|
triggers:
|
|
- uuid: 35ec346076ca4c979897e91389d23eb7
|
|
expression: 'length(last(/Azure SQL Managed Instance by HTTP/azure.sql_inst.data.errors))>0'
|
|
name: 'Azure SQL instance: There are errors in requests to API'
|
|
opdata: '{ITEM.LASTVALUE1}'
|
|
priority: AVERAGE
|
|
description: 'Zabbix has received errors in response to API requests.'
|
|
tags:
|
|
- tag: scope
|
|
value: availability
|
|
- uuid: 4dc91ae07bd048128a34da5b7ba090e8
|
|
name: 'Get data'
|
|
type: SCRIPT
|
|
key: azure.sql_inst.data.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;
|
|
};
|
|
}
|
|
|
|
|
|
var Azure = {
|
|
params: {},
|
|
token: null,
|
|
|
|
setParams: function (params) {
|
|
['app_id', 'password', 'tenant_id', 'subscription_id', 'resource_id'].forEach(function (field) {
|
|
if (typeof params !== 'object' || typeof params[field] === 'undefined' || params[field] === '') {
|
|
throw 'Required param is not set: ' + field + '.';
|
|
}
|
|
});
|
|
|
|
Azure.params = params;
|
|
Azure.tls = new CTlsConfig(params.tls_verify);
|
|
},
|
|
|
|
login: function () {
|
|
var response, login = new HttpRequest(Azure.tls.options);
|
|
|
|
if (typeof Azure.params.proxy !== 'undefined' && Azure.params.proxy !== '') {
|
|
login.setProxy(Azure.params.proxy);
|
|
}
|
|
|
|
login.addHeader('Content-Type: application/x-www-form-urlencoded');
|
|
response = login.post(
|
|
'https://login.microsoftonline.com/' + encodeURIComponent(Azure.params.tenant_id) + '/oauth2/token',
|
|
'grant_type=client_credentials&resource=' + encodeURIComponent('https://management.azure.com/') + '&client_id=' + encodeURIComponent(Azure.params.app_id) + '&client_secret=' + encodeURIComponent(Azure.params.password)
|
|
);
|
|
|
|
if (login.getStatus() !== 200) {
|
|
throw 'Login failed with status code ' + login.getStatus() + ': ' + response;
|
|
}
|
|
|
|
try {
|
|
response = JSON.parse(response);
|
|
}
|
|
catch (error) {
|
|
throw 'Failed to parse login session response.';
|
|
}
|
|
|
|
if (!response.hasOwnProperty('access_token')) {
|
|
throw 'Authentication response does not contain access token.';
|
|
}
|
|
|
|
Azure.token = response['access_token'];
|
|
},
|
|
|
|
request: function (url) {
|
|
var response, request = new HttpRequest(Azure.tls.options);
|
|
|
|
if (typeof Azure.params.proxy !== 'undefined' && Azure.params.proxy !== '') {
|
|
request.setProxy(Azure.params.proxy);
|
|
}
|
|
|
|
if (!Azure.token) {
|
|
throw 'Request does not contain access token.';
|
|
}
|
|
|
|
request.addHeader('Content-Type: application/json');
|
|
request.addHeader('Authorization: Bearer ' + Azure.token);
|
|
Zabbix.log(4, '[ Azure SQL instance ] request url: ' + url);
|
|
|
|
response = request.get(url);
|
|
|
|
if (request.getStatus() !== 200) {
|
|
throw 'Request failed with status code ' + request.getStatus() + ': ' + response;
|
|
}
|
|
|
|
try {
|
|
return JSON.parse(response);
|
|
}
|
|
catch (error) {
|
|
throw 'Failed to parse response received from API.';
|
|
}
|
|
},
|
|
|
|
getField: function (data, path) {
|
|
var steps = path.split('.');
|
|
|
|
for (var i = 0; i < steps.length; i++) {
|
|
var step = steps[i];
|
|
if (typeof data !== 'object' || typeof data[step] === 'undefined') {
|
|
throw 'Required field was not found: ' + path;
|
|
}
|
|
data = data[step];
|
|
}
|
|
|
|
return data;
|
|
},
|
|
|
|
getMetricsData: function () {
|
|
var data = {},
|
|
metric_endpoints = {
|
|
'main_metrics': '/providers/Microsoft.Insights/metrics?metricnames=' + encodeURIComponent('virtual_core_count,avg_cpu_percent,reserved_storage_mb,storage_space_used_mb,io_requests,io_bytes_read,io_bytes_written') + '&api-version=2021-05-01×pan=PT5M',
|
|
};
|
|
|
|
data.metrics = {};
|
|
|
|
Object.keys(metric_endpoints).forEach(function (field) {
|
|
metrics = Azure.getField(Azure.request('https://management.azure.com' + Azure.params.resource_id + metric_endpoints[field]), 'value');
|
|
for (k in metrics) {
|
|
key = Azure.getField(metrics[k], 'name.value').replace(/(\s|\/)+/g, '');
|
|
if (metrics[k].timeseries.length === 0) {
|
|
metrics[k].timeseries.push({ 'data': ['nodata'] })
|
|
}
|
|
values = Azure.getField(metrics[k], 'timeseries.0.data');
|
|
for (var i = values.length - 1; i >= 0; i--) {
|
|
if (typeof (values[i].average) !== 'undefined') {
|
|
data.metrics[key] = values[i];
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
});
|
|
|
|
data.health = Azure.getField(Azure.request('https://management.azure.com' + Azure.params.resource_id + '/providers/Microsoft.ResourceHealth/availabilityStatuses?api-version=2020-05-01'), 'value.0.properties');
|
|
data.instance = Azure.request('https://management.azure.com' + Azure.params.resource_id + '?api-version=2024-05-01-preview');
|
|
|
|
return data
|
|
}
|
|
};
|
|
|
|
try {
|
|
Azure.setParams(JSON.parse(value));
|
|
Azure.login();
|
|
return JSON.stringify(Azure.getMetricsData());
|
|
}
|
|
catch (error) {
|
|
error += (String(error).endsWith('.')) ? '' : '.';
|
|
Zabbix.log(3, '[ Azure SQL instance ] ERROR: ' + error);
|
|
return JSON.stringify({ 'error': error });
|
|
}
|
|
description: 'Gathers data of the Azure SQL managed instance.'
|
|
timeout: '{$AZURE.DATA.TIMEOUT}'
|
|
parameters:
|
|
- name: app_id
|
|
value: '{$AZURE.APP.ID}'
|
|
- name: password
|
|
value: '{$AZURE.PASSWORD}'
|
|
- name: proxy
|
|
value: '{$AZURE.PROXY}'
|
|
- name: resource_id
|
|
value: '{$AZURE.RESOURCE.ID}'
|
|
- name: subscription_id
|
|
value: '{$AZURE.SUBSCRIPTION.ID}'
|
|
- name: tenant_id
|
|
value: '{$AZURE.TENANT.ID}'
|
|
- name: tls_verify
|
|
value: '{$HTTP.TLS.VERIFY:"Azure SQL Managed Instance"}'
|
|
tags:
|
|
- tag: component
|
|
value: raw
|
|
- uuid: 953ba49d81a048dcbed882b955606c96
|
|
name: 'Instance provisioning state'
|
|
type: DEPENDENT
|
|
key: azure.sql_inst.provision
|
|
delay: '0'
|
|
description: 'Provisioning state of the managed instance.'
|
|
valuemap:
|
|
name: 'Azure SQL instance provisioning state'
|
|
preprocessing:
|
|
- type: JSONPATH
|
|
parameters:
|
|
- $.instance.properties.provisioningState
|
|
error_handler: DISCARD_VALUE
|
|
- type: JAVASCRIPT
|
|
parameters:
|
|
- |
|
|
const idx = {
|
|
'Unknown': 0,
|
|
'Accepted': 1,
|
|
'Canceled': 2,
|
|
'Created': 3,
|
|
'Creating': 4,
|
|
'Deleted': 5,
|
|
'Deleting': 6,
|
|
'Failed': 7,
|
|
'NotSpecified': 8,
|
|
'Registering': 9,
|
|
'Running': 10,
|
|
'Succeeded': 11,
|
|
'TimedOut': 12,
|
|
'Unrecognized': 13,
|
|
'Updating': 14
|
|
};
|
|
|
|
return typeof idx[value] === 'undefined' ? 0 : idx[value];
|
|
- type: DISCARD_UNCHANGED_HEARTBEAT
|
|
parameters:
|
|
- 1h
|
|
master_item:
|
|
key: azure.sql_inst.data.get
|
|
tags:
|
|
- tag: component
|
|
value: health
|
|
triggers:
|
|
- uuid: 08a59eccbb854b6db1711c9141231e94
|
|
expression: 'change(/Azure SQL Managed Instance by HTTP/azure.sql_inst.provision)<>0'
|
|
name: 'Azure SQL instance: Instance provisioning state has changed'
|
|
opdata: '{ITEM.LASTVALUE1}'
|
|
priority: WARNING
|
|
description: 'Azure SQL managed instance provisioning state has changed.'
|
|
tags:
|
|
- tag: scope
|
|
value: notice
|
|
- uuid: d311532917fa409e909c34f3a2d9032b
|
|
name: 'IO request count'
|
|
type: DEPENDENT
|
|
key: azure.sql_inst.requests
|
|
delay: '0'
|
|
description: 'IO request count by the managed instance.'
|
|
preprocessing:
|
|
- type: JSONPATH
|
|
parameters:
|
|
- $.metrics.io_requests.average
|
|
error_handler: DISCARD_VALUE
|
|
master_item:
|
|
key: azure.sql_inst.data.get
|
|
tags:
|
|
- tag: component
|
|
value: performance
|
|
- uuid: e72ef80733cb4dff9722ea1ef73c59d1
|
|
name: 'Instance state'
|
|
type: DEPENDENT
|
|
key: azure.sql_inst.state
|
|
delay: '0'
|
|
value_type: CHAR
|
|
trends: '0'
|
|
description: 'State of the managed instance.'
|
|
preprocessing:
|
|
- type: JSONPATH
|
|
parameters:
|
|
- $.instance.properties.state
|
|
error_handler: DISCARD_VALUE
|
|
- type: DISCARD_UNCHANGED_HEARTBEAT
|
|
parameters:
|
|
- 1h
|
|
master_item:
|
|
key: azure.sql_inst.data.get
|
|
tags:
|
|
- tag: component
|
|
value: health
|
|
triggers:
|
|
- uuid: 9a51e2286f354820b89cd0d35586b99a
|
|
expression: 'change(/Azure SQL Managed Instance by HTTP/azure.sql_inst.state)=1'
|
|
name: 'Azure SQL instance: Instance state has changed'
|
|
opdata: '{ITEM.LASTVALUE1}'
|
|
priority: WARNING
|
|
description: 'Azure SQL managed instance state has changed.'
|
|
tags:
|
|
- tag: scope
|
|
value: availability
|
|
- uuid: 960e4282247f4ea0bc947e2f35182ec2
|
|
name: 'Storage space reserved'
|
|
type: DEPENDENT
|
|
key: azure.sql_inst.storage.reserved
|
|
delay: '0'
|
|
units: B
|
|
description: 'Storage space reserved by the managed instance.'
|
|
preprocessing:
|
|
- type: JSONPATH
|
|
parameters:
|
|
- $.metrics.reserved_storage_mb.average
|
|
error_handler: DISCARD_VALUE
|
|
- type: MULTIPLIER
|
|
parameters:
|
|
- '1048576'
|
|
- type: DISCARD_UNCHANGED_HEARTBEAT
|
|
parameters:
|
|
- 1h
|
|
master_item:
|
|
key: azure.sql_inst.data.get
|
|
tags:
|
|
- tag: component
|
|
value: storage
|
|
- uuid: dd1af2bc16c94b2f8636d24a1aedca0b
|
|
name: 'Storage space used'
|
|
type: DEPENDENT
|
|
key: azure.sql_inst.storage.used
|
|
delay: '0'
|
|
units: B
|
|
description: 'Storage space used by the managed instance.'
|
|
preprocessing:
|
|
- type: JSONPATH
|
|
parameters:
|
|
- $.metrics.storage_space_used_mb.average
|
|
error_handler: DISCARD_VALUE
|
|
- type: MULTIPLIER
|
|
parameters:
|
|
- '1048576'
|
|
master_item:
|
|
key: azure.sql_inst.data.get
|
|
tags:
|
|
- tag: component
|
|
value: storage
|
|
- uuid: b3ea1180eb174fb38656c9696fa9d9a7
|
|
name: 'Storage space utilization'
|
|
type: CALCULATED
|
|
key: azure.sql_inst.storage.utilization
|
|
units: '%'
|
|
params: 'last(//azure.sql_inst.storage.used) * 100 / last(//azure.sql_inst.storage.reserved)'
|
|
description: 'Managed instance storage space utilization, in percent.'
|
|
tags:
|
|
- tag: component
|
|
value: storage
|
|
triggers:
|
|
- uuid: ed8c37e4f62b471385402e0bcf6cc47e
|
|
expression: 'min(/Azure SQL Managed Instance by HTTP/azure.sql_inst.storage.utilization,5m)>{$AZURE.SQL.INST.SPACE.CRIT}'
|
|
name: 'Azure SQL instance: Storage free space is critically low'
|
|
event_name: 'Azure SQL instance: The free storage space is critically low (below {$AZURE.SQL.INST.SPACE.CRIT}% for 5m)'
|
|
opdata: 'Space free: {ITEM.LASTVALUE}'
|
|
priority: AVERAGE
|
|
description: 'The free storage space has been less than `{$AZURE.SQL.INST.SPACE.CRIT}`% for 5m.'
|
|
manual_close: 'YES'
|
|
dependencies:
|
|
- name: 'Azure SQL instance: Storage free space is low'
|
|
expression: 'min(/Azure SQL Managed Instance by HTTP/azure.sql_inst.storage.utilization,5m)>{$AZURE.SQL.INST.SPACE.WARN}'
|
|
tags:
|
|
- tag: scope
|
|
value: capacity
|
|
- uuid: bf8c527a0566490d829ae7654057a1ec
|
|
expression: 'min(/Azure SQL Managed Instance by HTTP/azure.sql_inst.storage.utilization,5m)>{$AZURE.SQL.INST.SPACE.WARN}'
|
|
name: 'Azure SQL instance: Storage free space is low'
|
|
event_name: 'Azure SQL instance: The free storage space is low (below {$AZURE.SQL.INST.SPACE.WARN}% for 5m)'
|
|
opdata: 'Space free: {ITEM.LASTVALUE}'
|
|
priority: WARNING
|
|
description: 'The free storage space has been less than `{$AZURE.SQL.INST.SPACE.WARN}`% for 5m.'
|
|
manual_close: 'YES'
|
|
tags:
|
|
- tag: scope
|
|
value: capacity
|
|
tags:
|
|
- tag: class
|
|
value: software
|
|
- tag: target
|
|
value: azure
|
|
macros:
|
|
- macro: '{$AZURE.APP.ID}'
|
|
description: 'The App ID of Microsoft Azure.'
|
|
- macro: '{$AZURE.DATA.TIMEOUT}'
|
|
value: 15s
|
|
description: 'API response timeout.'
|
|
- macro: '{$AZURE.PASSWORD}'
|
|
type: SECRET_TEXT
|
|
description: 'Microsoft Azure password.'
|
|
- macro: '{$AZURE.PROXY}'
|
|
description: 'Sets the HTTP proxy value. If this macro is empty, then no proxy is used.'
|
|
- macro: '{$AZURE.RESOURCE.ID}'
|
|
description: 'Microsoft Azure SQL managed instance ID.'
|
|
- macro: '{$AZURE.SQL.INST.CPU.CRIT}'
|
|
value: '90'
|
|
description: 'CPU utilization critical threshold, expressed in %.'
|
|
- macro: '{$AZURE.SQL.INST.CPU.WARN}'
|
|
value: '80'
|
|
description: 'CPU utilization warning threshold, expressed in %.'
|
|
- macro: '{$AZURE.SQL.INST.SPACE.CRIT}'
|
|
value: '90'
|
|
description: 'Storage space critical threshold, expressed in %.'
|
|
- macro: '{$AZURE.SQL.INST.SPACE.WARN}'
|
|
value: '80'
|
|
description: 'Storage space warning threshold, expressed in %.'
|
|
- macro: '{$AZURE.SUBSCRIPTION.ID}'
|
|
description: 'Microsoft Azure subscription ID.'
|
|
- macro: '{$AZURE.TENANT.ID}'
|
|
description: 'Microsoft Azure tenant ID.'
|
|
- 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 "Azure SQL Managed Instance", e.g. {$HTTP.TLS.VERIFY:"Azure SQL Managed Instance"}.'
|
|
dashboards:
|
|
- uuid: 28e6b463ca7b429ca356cb61b5394841
|
|
name: 'Azure SQL managed instance'
|
|
pages:
|
|
- name: Overview
|
|
widgets:
|
|
- type: item
|
|
name: 'Availability state'
|
|
width: '18'
|
|
fields:
|
|
- type: INTEGER
|
|
name: decimal_places
|
|
value: '0'
|
|
- type: ITEM
|
|
name: itemid.0
|
|
value:
|
|
host: 'Azure SQL Managed Instance by HTTP'
|
|
key: azure.sql_inst.availability.state
|
|
- type: INTEGER
|
|
name: show.0
|
|
value: '2'
|
|
- type: INTEGER
|
|
name: value_size
|
|
value: '50'
|
|
- type: gauge
|
|
name: 'Average CPU utilization'
|
|
'y': '2'
|
|
width: '18'
|
|
height: '4'
|
|
fields:
|
|
- type: INTEGER
|
|
name: angle
|
|
value: '270'
|
|
- type: INTEGER
|
|
name: decimal_places
|
|
value: '0'
|
|
- type: STRING
|
|
name: empty_color
|
|
value: 0EC9AC
|
|
- type: ITEM
|
|
name: itemid.0
|
|
value:
|
|
host: 'Azure SQL Managed Instance by HTTP'
|
|
key: azure.sql_inst.cpu
|
|
- type: INTEGER
|
|
name: show.0
|
|
value: '3'
|
|
- type: INTEGER
|
|
name: show.1
|
|
value: '2'
|
|
- type: INTEGER
|
|
name: show.2
|
|
value: '5'
|
|
- type: STRING
|
|
name: value_arc_color
|
|
value: ED1248
|
|
- type: gauge
|
|
name: 'Storage space utilization'
|
|
'y': '6'
|
|
width: '18'
|
|
height: '4'
|
|
fields:
|
|
- type: INTEGER
|
|
name: angle
|
|
value: '270'
|
|
- type: INTEGER
|
|
name: decimal_places
|
|
value: '0'
|
|
- type: STRING
|
|
name: empty_color
|
|
value: 0EC9AC
|
|
- type: ITEM
|
|
name: itemid.0
|
|
value:
|
|
host: 'Azure SQL Managed Instance by HTTP'
|
|
key: azure.sql_inst.storage.utilization
|
|
- type: INTEGER
|
|
name: show.0
|
|
value: '3'
|
|
- type: INTEGER
|
|
name: show.1
|
|
value: '2'
|
|
- type: INTEGER
|
|
name: show.2
|
|
value: '5'
|
|
- type: STRING
|
|
name: value_arc_color
|
|
value: ED1248
|
|
- type: svggraph
|
|
name: 'IO bytes read/write'
|
|
'y': '10'
|
|
width: '72'
|
|
height: '4'
|
|
fields:
|
|
- type: STRING
|
|
name: ds.0.color.0
|
|
value: 524BBC
|
|
- type: INTEGER
|
|
name: ds.0.dataset_type
|
|
value: '0'
|
|
- type: INTEGER
|
|
name: ds.0.fill
|
|
value: '0'
|
|
- type: ITEM
|
|
name: ds.0.itemids.0
|
|
value:
|
|
host: 'Azure SQL Managed Instance by HTTP'
|
|
key: azure.sql_inst.bytes.read
|
|
- type: INTEGER
|
|
name: ds.0.missingdatafunc
|
|
value: '3'
|
|
- type: INTEGER
|
|
name: ds.0.width
|
|
value: '2'
|
|
- type: STRING
|
|
name: ds.1.color.0
|
|
value: ED1248
|
|
- type: INTEGER
|
|
name: ds.1.dataset_type
|
|
value: '0'
|
|
- type: INTEGER
|
|
name: ds.1.fill
|
|
value: '0'
|
|
- type: ITEM
|
|
name: ds.1.itemids.0
|
|
value:
|
|
host: 'Azure SQL Managed Instance by HTTP'
|
|
key: azure.sql_inst.bytes.write
|
|
- type: INTEGER
|
|
name: ds.1.missingdatafunc
|
|
value: '3'
|
|
- type: INTEGER
|
|
name: ds.1.width
|
|
value: '2'
|
|
- type: INTEGER
|
|
name: legend_lines
|
|
value: '2'
|
|
- type: INTEGER
|
|
name: legend_statistic
|
|
value: '1'
|
|
- type: STRING
|
|
name: reference
|
|
value: FDADE
|
|
- type: item
|
|
name: 'Instance state'
|
|
x: '18'
|
|
width: '18'
|
|
fields:
|
|
- type: ITEM
|
|
name: itemid.0
|
|
value:
|
|
host: 'Azure SQL Managed Instance by HTTP'
|
|
key: azure.sql_inst.state
|
|
- type: INTEGER
|
|
name: show.0
|
|
value: '2'
|
|
- type: INTEGER
|
|
name: value_size
|
|
value: '50'
|
|
- type: svggraph
|
|
name: 'Average CPU utilization'
|
|
x: '18'
|
|
'y': '2'
|
|
width: '54'
|
|
height: '4'
|
|
fields:
|
|
- type: STRING
|
|
name: ds.0.color.0
|
|
value: 0EC9AC
|
|
- type: INTEGER
|
|
name: ds.0.dataset_type
|
|
value: '0'
|
|
- type: INTEGER
|
|
name: ds.0.fill
|
|
value: '0'
|
|
- type: ITEM
|
|
name: ds.0.itemids.0
|
|
value:
|
|
host: 'Azure SQL Managed Instance by HTTP'
|
|
key: azure.sql_inst.cpu
|
|
- type: INTEGER
|
|
name: ds.0.missingdatafunc
|
|
value: '3'
|
|
- type: INTEGER
|
|
name: ds.0.width
|
|
value: '2'
|
|
- type: STRING
|
|
name: lefty_max
|
|
value: '100'
|
|
- type: STRING
|
|
name: lefty_min
|
|
value: '0'
|
|
- type: INTEGER
|
|
name: legend_statistic
|
|
value: '1'
|
|
- type: STRING
|
|
name: reference
|
|
value: FBADE
|
|
- type: svggraph
|
|
name: 'Storage space utilization'
|
|
x: '18'
|
|
'y': '6'
|
|
width: '54'
|
|
height: '4'
|
|
fields:
|
|
- type: STRING
|
|
name: ds.0.color.0
|
|
value: 0EC9AC
|
|
- type: INTEGER
|
|
name: ds.0.dataset_type
|
|
value: '0'
|
|
- type: INTEGER
|
|
name: ds.0.fill
|
|
value: '0'
|
|
- type: ITEM
|
|
name: ds.0.itemids.0
|
|
value:
|
|
host: 'Azure SQL Managed Instance by HTTP'
|
|
key: azure.sql_inst.storage.utilization
|
|
- type: INTEGER
|
|
name: ds.0.missingdatafunc
|
|
value: '3'
|
|
- type: INTEGER
|
|
name: ds.0.width
|
|
value: '2'
|
|
- type: INTEGER
|
|
name: ds.1.axisy
|
|
value: '1'
|
|
- type: STRING
|
|
name: ds.1.color.0
|
|
value: ED1248
|
|
- type: INTEGER
|
|
name: ds.1.dataset_type
|
|
value: '0'
|
|
- type: INTEGER
|
|
name: ds.1.fill
|
|
value: '0'
|
|
- type: ITEM
|
|
name: ds.1.itemids.0
|
|
value:
|
|
host: 'Azure SQL Managed Instance by HTTP'
|
|
key: azure.sql_inst.storage.used
|
|
- type: INTEGER
|
|
name: ds.1.missingdatafunc
|
|
value: '3'
|
|
- type: INTEGER
|
|
name: ds.1.width
|
|
value: '2'
|
|
- type: STRING
|
|
name: lefty_max
|
|
value: '100'
|
|
- type: STRING
|
|
name: lefty_min
|
|
value: '0'
|
|
- type: INTEGER
|
|
name: legend_lines
|
|
value: '2'
|
|
- type: INTEGER
|
|
name: legend_statistic
|
|
value: '1'
|
|
- type: STRING
|
|
name: reference
|
|
value: FDABE
|
|
- type: item
|
|
name: 'Instance provisioning state'
|
|
x: '36'
|
|
width: '18'
|
|
fields:
|
|
- type: INTEGER
|
|
name: decimal_places
|
|
value: '0'
|
|
- type: ITEM
|
|
name: itemid.0
|
|
value:
|
|
host: 'Azure SQL Managed Instance by HTTP'
|
|
key: azure.sql_inst.provision
|
|
- type: INTEGER
|
|
name: show.0
|
|
value: '2'
|
|
- type: INTEGER
|
|
name: value_size
|
|
value: '50'
|
|
- type: item
|
|
name: 'IO request count'
|
|
x: '54'
|
|
width: '18'
|
|
fields:
|
|
- type: INTEGER
|
|
name: decimal_places
|
|
value: '0'
|
|
- type: ITEM
|
|
name: itemid.0
|
|
value:
|
|
host: 'Azure SQL Managed Instance by HTTP'
|
|
key: azure.sql_inst.requests
|
|
- type: INTEGER
|
|
name: show.0
|
|
value: '2'
|
|
- type: INTEGER
|
|
name: value_size
|
|
value: '50'
|
|
valuemaps:
|
|
- uuid: 9bb00a69069d4c22a0b75b745da0de73
|
|
name: 'Azure resource health state'
|
|
mappings:
|
|
- value: '0'
|
|
newvalue: Available
|
|
- value: '1'
|
|
newvalue: Degraded
|
|
- value: '2'
|
|
newvalue: Unavailable
|
|
- value: '3'
|
|
newvalue: Unknown
|
|
- uuid: aae2eec109b649d38e80684cdeb9458c
|
|
name: 'Azure SQL instance provisioning state'
|
|
mappings:
|
|
- value: '0'
|
|
newvalue: Unknown
|
|
- value: '1'
|
|
newvalue: Accepted
|
|
- value: '2'
|
|
newvalue: Canceled
|
|
- value: '3'
|
|
newvalue: Created
|
|
- value: '4'
|
|
newvalue: Creating
|
|
- value: '5'
|
|
newvalue: Deleted
|
|
- value: '6'
|
|
newvalue: Deleting
|
|
- value: '7'
|
|
newvalue: Failed
|
|
- value: '8'
|
|
newvalue: NotSpecified
|
|
- value: '9'
|
|
newvalue: Registering
|
|
- value: '10'
|
|
newvalue: Running
|
|
- value: '11'
|
|
newvalue: Succeeded
|
|
- value: '12'
|
|
newvalue: TimedOut
|
|
- value: '13'
|
|
newvalue: Unrecognized
|
|
- value: '14'
|
|
newvalue: Updating
|
|
graphs:
|
|
- uuid: 73faeee0b6934fb4983c035b60782ca7
|
|
name: 'Average CPU percentage'
|
|
graph_items:
|
|
- color: 199C0D
|
|
item:
|
|
host: 'Azure SQL Managed Instance by HTTP'
|
|
key: azure.sql_inst.cpu
|
|
- uuid: bcc8df046b3646ed8a14d462b761885e
|
|
name: 'IO bytes read/write'
|
|
graph_items:
|
|
- color: 199C0D
|
|
item:
|
|
host: 'Azure SQL Managed Instance by HTTP'
|
|
key: azure.sql_inst.bytes.read
|
|
- sortorder: '1'
|
|
color: F63100
|
|
item:
|
|
host: 'Azure SQL Managed Instance by HTTP'
|
|
key: azure.sql_inst.bytes.write
|
|
- uuid: ac14ada6a3164e26b81686912e0b10a9
|
|
name: 'IO request count'
|
|
graph_items:
|
|
- color: 199C0D
|
|
item:
|
|
host: 'Azure SQL Managed Instance by HTTP'
|
|
key: azure.sql_inst.requests
|
|
- uuid: 32f7809d7cae4a61a603b6b8d4161570
|
|
name: 'Storage space used'
|
|
ymax_type_1: ITEM
|
|
ymax_item_1:
|
|
host: 'Azure SQL Managed Instance by HTTP'
|
|
key: azure.sql_inst.storage.reserved
|
|
graph_items:
|
|
- color: 199C0D
|
|
item:
|
|
host: 'Azure SQL Managed Instance by HTTP'
|
|
key: azure.sql_inst.storage.used
|
|
- uuid: 2e1c34a01d3a4501be1ed64d45332424
|
|
name: 'Storage space utilization'
|
|
graph_items:
|
|
- color: 199C0D
|
|
item:
|
|
host: 'Azure SQL Managed Instance by HTTP'
|
|
key: azure.sql_inst.storage.utilization
|
|
- uuid: 4f14da1ce6d041ff8bdcc06a172f2734
|
|
name: 'Virtual core count'
|
|
graph_items:
|
|
- color: 199C0D
|
|
item:
|
|
host: 'Azure SQL Managed Instance by HTTP'
|
|
key: azure.sql_inst.core.count
|