zabbix_export:
  version: '8.0'
  template_groups:
    - uuid: c2c162144c2d4c5491c8801193af4945
      name: Templates/Cloud
    - uuid: 36bff6c29af64692839d077febfc7079
      name: 'Templates/Network devices'
    - uuid: 846977d1dfed4968bc5f8bdb363285bc
      name: 'Templates/Operating systems'
    - uuid: e960332b3f6c46a1956486d4f3f99fce
      name: 'Templates/Server hardware'
  host_groups:
    - uuid: a571c0d144b14fd4a87a9d9b2aa9fcd6
      name: Applications
    - uuid: 748ad4d098d447d492bb935c907f652f
      name: Databases
    - uuid: 137f19e6e2dc4219b33553b812627bc2
      name: 'Virtual machines'
  templates:
    - uuid: 3d527f609e344ed8a4ec19762c31c619
      template: 'Azure Backup Jobs by HTTP'
      name: 'Azure Backup Jobs by HTTP'
      description: |
        This template is designed to monitor Azure Backup Jobs via 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"
      wizard_ready: 'YES'
      readme: |
        ## Overview
        
        This template is designed to monitor Microsoft Azure Backup Jobs via 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 [Azure documentation](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 host wizard configuration fields: `Azure App ID`, `Azure password`, `Azure tenant ID`, `Azure subscription ID`, `Azure Vault ID` and `Backup jobs period`.
      vendor:
        name: Zabbix
        version: 8.0-2
      groups:
        - name: Templates/Cloud
      items:
        - uuid: b733302413d54250ba053b017367c6d6
          name: 'Availability status detailed'
          type: DEPENDENT
          key: azure.vault.availability.details
          value_type: CHAR
          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.vault.data.get
          tags:
            - tag: component
              value: health
        - uuid: 1dc10b5b07f648d4a75f614573bb8da5
          name: 'Availability state'
          type: DEPENDENT
          key: azure.vault.availability.state
          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.vault.data.get
          tags:
            - tag: component
              value: health
          triggers:
            - uuid: 68ee9193a98c40778ee57ab2256082ec
              expression: 'last(/Azure Backup Jobs by HTTP/azure.vault.availability.state)=1'
              name: 'Azure backup jobs: Azure vault is degraded'
              opdata: 'Current state: {ITEM.LASTVALUE1}'
              priority: AVERAGE
              description: 'The resource is in a degraded state.'
              tags:
                - tag: scope
                  value: availability
            - uuid: 40b756bf271d46da94d3a9de2b892d88
              expression: 'last(/Azure Backup Jobs by HTTP/azure.vault.availability.state)=3'
              name: 'Azure backup jobs: Azure vault is in unknown state'
              opdata: 'Current state: {ITEM.LASTVALUE1}'
              priority: WARNING
              description: 'The resource state is unknown.'
              tags:
                - tag: scope
                  value: availability
            - uuid: cecb9bb0945f4f21bb2ad3df02307641
              expression: 'last(/Azure Backup Jobs by HTTP/azure.vault.availability.state)=2'
              name: 'Azure backup jobs: Azure vault is unavailable'
              opdata: 'Current state: {ITEM.LASTVALUE1}'
              priority: HIGH
              description: 'The resource state is unavailable.'
              tags:
                - tag: scope
                  value: availability
        - uuid: 00848eb26866420282b2afdfc4334484
          name: 'Get errors'
          type: DEPENDENT
          key: azure.vault.data.errors
          value_type: TEXT
          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.vault.data.get
          tags:
            - tag: component
              value: error
          triggers:
            - uuid: d70f2e4edb38492ea019abbfc1cbb82a
              expression: 'length(last(/Azure Backup Jobs by HTTP/azure.vault.data.errors))>0'
              name: 'Azure backup jobs: There are errors in requests to API'
              opdata: 'Error: {ITEM.LASTVALUE1}'
              priority: AVERAGE
              description: 'Zabbix has received errors in response to API requests.'
              tags:
                - tag: scope
                  value: availability
        - uuid: 57d191150c06423daa1674d09c846dc7
          name: 'Get data'
          type: SCRIPT
          key: azure.vault.data.get
          history: '0'
          value_type: TEXT
          params: |
            var Azure = {
            	params: {},
            	token: null,
            
            	setParams: function (params) {
            		['app_id', 'password', 'tenant_id', 'subscription_id', 'resource_id', 'period'].forEach(function (field) {
            			if (typeof params !== 'object' || typeof params[field] === 'undefined' || params[field] === '') {
            				throw 'Required param is not set: ' + field + '.';
            			}
            		});
            
            		Azure.params = params;
            	},
            
            	login: function () {
            		var response, login = new HttpRequest();
            
            		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();
            
            		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 Vault ] 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 = {},
            			end_date = new Date(),
            			start_date = new Date();
            
            		function formatDate(date) {
            			var year = date.getFullYear(),
            				month = (date.getMonth() + 1),
            				day = date.getDate(),
            				hours = date.getHours(),
            				minutes = date.getMinutes(),
            				seconds = date.getSeconds(),
            				ampm = hours >= 12 ? 'PM' : 'AM';
            
            			hours = hours % 12 || 12;
            			month = month < 10 ? '0' + month : month;
            			day = day < 10 ? '0' + day : day;
            			hours = hours < 10 ? '0' + hours : hours;
            			minutes = minutes < 10 ? '0' + minutes : minutes;
            			seconds = seconds < 10 ? '0' + seconds : seconds;
            
            			formatted_date = year + '-' + month + '-' + day + ' ' + hours + ':' + minutes + ':' + seconds + ' ' + ampm;
            
            			return formatted_date
            		};
            
            		start_date.setDate(start_date.getDate() - Azure.params.period);
            		end_date = encodeURIComponent('\'' + formatDate(end_date) + '\'');
            		start_date = encodeURIComponent('\'' + formatDate(start_date) + '\'');
            		date_filter = '&$filter=' + encodeURIComponent('startTime eq ') + start_date + encodeURIComponent(' and endTime eq ') + end_date;
            
            		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.jobs = Azure.getField(Azure.request('https://management.azure.com' + Azure.params.resource_id + '/backupjobs?api-version=2025-01-01' + date_filter), 'value');
            
            		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 Vault ] ERROR: ' + error);
            	return JSON.stringify({ 'error': error });
            }
          description: 'Gathers data of the Azure vault.'
          timeout: '{$AZURE.DATA.TIMEOUT}'
          parameters:
            - name: app_id
              value: '{$AZURE.APP.ID}'
            - name: password
              value: '{$AZURE.PASSWORD}'
            - name: period
              value: '{$AZURE.VAULT.PERIOD}'
            - 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}'
          tags:
            - tag: component
              value: raw
        - uuid: c5eb6f559a544be89f51ea3f8eee6dab
          name: 'Jobs: Backup'
          type: DEPENDENT
          key: azure.vault.jobs.backup
          description: 'The number of backup jobs over the period of `{$AZURE.VAULT.PERIOD}` day(s).'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$.jobs[?(@.properties.operation == "Backup")].length()'
          master_item:
            key: azure.vault.data.get
          tags:
            - tag: component
              value: backup
        - uuid: 78a30e56155c4a9c8af1fe54999276fd
          name: 'Jobs: Configuring backup'
          type: DEPENDENT
          key: azure.vault.jobs.backup.config
          description: 'The number of backup configuration jobs over the period of `{$AZURE.VAULT.PERIOD}` day(s).'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$.jobs[?(@.properties.operation == "ConfigureBackup")].length()'
          master_item:
            key: azure.vault.data.get
          tags:
            - tag: component
              value: backup
          triggers:
            - uuid: 881f3faf12da40458266c62f047c3c1e
              expression: 'change(/Azure Backup Jobs by HTTP/azure.vault.jobs.backup.config)>0'
              recovery_mode: NONE
              name: 'Azure backup jobs: Backup configuration job has appeared'
              opdata: 'Current amount: {ITEM.LASTVALUE1}'
              priority: INFO
              description: 'New backup configuration job has appeared.'
              manual_close: 'YES'
              tags:
                - tag: scope
                  value: notice
        - uuid: 7b6e5f9eb7e74524bf4fa856225ad107
          name: 'Jobs: Deleting backup data'
          type: DEPENDENT
          key: azure.vault.jobs.backup.delete
          description: 'The number of backup data deletion jobs over the period of `{$AZURE.VAULT.PERIOD}` day(s).'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$.jobs[?(@.properties.operation == "DeleteBackupData")].length()'
          master_item:
            key: azure.vault.data.get
          tags:
            - tag: component
              value: backup
          triggers:
            - uuid: 7d4a36701e3c4384991858c34017b04f
              expression: 'change(/Azure Backup Jobs by HTTP/azure.vault.jobs.backup.delete)>0'
              recovery_mode: NONE
              name: 'Azure backup jobs: Backup data deletion job has appeared'
              opdata: 'Current amount: {ITEM.LASTVALUE1}'
              priority: WARNING
              description: 'New backup data deletion job has appeared.'
              manual_close: 'YES'
              tags:
                - tag: scope
                  value: notice
        - uuid: 7a8af0d3852546e9aa49a3754af4e1f3
          name: 'Jobs: Cancelled'
          type: DEPENDENT
          key: azure.vault.jobs.cancelled
          description: 'The number of cancelled jobs over the period of `{$AZURE.VAULT.PERIOD}` day(s).'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$.jobs[?(@.properties.status == "Cancelled")].length()'
          master_item:
            key: azure.vault.data.get
          tags:
            - tag: component
              value: backup
        - uuid: 1b2f4f764b2c4a65b824e816094117d5
          name: 'Jobs: Completed'
          type: DEPENDENT
          key: azure.vault.jobs.completed
          description: 'The number of completed jobs over the period of `{$AZURE.VAULT.PERIOD}` day(s).'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$.jobs[?(@.properties.status == "Completed")].length()'
          master_item:
            key: azure.vault.data.get
          tags:
            - tag: component
              value: backup
        - uuid: 90a112a3ef2b42d2a372b8b4fb5c95fb
          name: 'Jobs: Failed'
          type: DEPENDENT
          key: azure.vault.jobs.failed
          description: 'The number of failed jobs over the period of `{$AZURE.VAULT.PERIOD}` day(s).'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$.jobs[?(@.properties.status == "Failed")].length()'
          master_item:
            key: azure.vault.data.get
          tags:
            - tag: component
              value: backup
        - uuid: 5b9b00fad0364710b82ed05595848e82
          name: 'Jobs: In progress'
          type: DEPENDENT
          key: azure.vault.jobs.in_progress
          description: 'The number of jobs in progress over the period of `{$AZURE.VAULT.PERIOD}` day(s).'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$.jobs[?(@.properties.status == "InProgress")].length()'
          master_item:
            key: azure.vault.data.get
          tags:
            - tag: component
              value: backup
        - uuid: 482582a2ac6045dc97be5d2fc19bbe8f
          name: 'Jobs: Restore'
          type: DEPENDENT
          key: azure.vault.jobs.restore
          description: 'The number of restore jobs over the period of `{$AZURE.VAULT.PERIOD}` day(s).'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$.jobs[?(@.properties.operation == "Restore")].length()'
          master_item:
            key: azure.vault.data.get
          tags:
            - tag: component
              value: backup
          triggers:
            - uuid: 04f76f2f21a043169ac1fa11d42f72f3
              expression: 'change(/Azure Backup Jobs by HTTP/azure.vault.jobs.restore)>0'
              recovery_mode: NONE
              name: 'Azure backup jobs: Restore job has appeared'
              opdata: 'Current amount: {ITEM.LASTVALUE1}'
              priority: AVERAGE
              description: 'New restore job has appeared.'
              manual_close: 'YES'
              tags:
                - tag: scope
                  value: notice
        - uuid: 3024516bc255403b8aaa765b4d376835
          name: 'Jobs: Total'
          type: DEPENDENT
          key: azure.vault.jobs.total
          description: 'The number of jobs over the period of `{$AZURE.VAULT.PERIOD}` day(s).'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.jobs.length()
          master_item:
            key: azure.vault.data.get
          tags:
            - tag: component
              value: backup
        - uuid: 4ac88439754f426090b0aa454ea4a5ed
          name: 'Jobs: Completed with warnings'
          type: DEPENDENT
          key: azure.vault.jobs.with_warning
          description: 'The number of jobs completed with warnings over the period of `{$AZURE.VAULT.PERIOD}` day(s).'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$.jobs[?(@.properties.status == "CompletedWithWarnings")].length()'
          master_item:
            key: azure.vault.data.get
          tags:
            - tag: component
              value: backup
      discovery_rules:
        - uuid: e37ff9885d014939b9ea182ce2087e05
          name: 'Azure backup job discovery'
          type: DEPENDENT
          key: azure.vault.job.discovery
          filter:
            evaltype: AND
            conditions:
              - macro: '{#JOB.FRIENDLY.NAME}'
                value: '{$AZURE.JOBS.FRIENDLY.NAME.MATCHES}'
              - macro: '{#JOB.FRIENDLY.NAME}'
                value: '{$AZURE.JOBS.FRIENDLY.NAME.NOT.MATCHES}'
                operator: NOT_MATCHES_REGEX
              - macro: '{#JOB.OPERATION}'
                value: '{$AZURE.JOBS.OPERATION.MATCHES}'
              - macro: '{#JOB.OPERATION}'
                value: '{$AZURE.JOBS.OPERATION.NOT.MATCHES}'
                operator: NOT_MATCHES_REGEX
              - macro: '{#JOB.STATUS}'
                value: '{$AZURE.JOBS.STATUS.MATCHES}'
              - macro: '{#JOB.STATUS}'
                value: '{$AZURE.JOBS.STATUS.NOT.MATCHES}'
                operator: NOT_MATCHES_REGEX
          lifetime: '0'
          description: 'List of backup jobs in the vault.'
          item_prototypes:
            - uuid: 9a46651633ad45d69a2a931259d381ac
              name: 'Job status [{#JOB.FRIENDLY.NAME}, {#JOB.NAME}]'
              type: DEPENDENT
              key: 'azure.vault.job.status[{#JOB.NAME}]'
              description: |
                Job status.
                Possible values:
                0 - Unknown
                1 - In progress
                2 - Queued
                3 - Completed
                4 - Completed with warnings
                5 - Failed
                6 - Cancelled
                7 - Expired
              valuemap:
                name: 'Azure backup job status'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.jobs[?(@.name == ''{#JOB.NAME}'')].properties.status.first()'
                - type: JAVASCRIPT
                  parameters:
                    - |
                      const idx = {
                      	'InProgress': 1,
                      	'Queued': 2,
                      	'Completed': 3,
                      	'CompletedWithWarnings': 4,
                      	'Failed': 5,
                      	'Cancelled': 6,
                      	'Expired': 7
                        };
                      
                        return typeof idx[value] === 'undefined' ? 0 : idx[value];
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: azure.vault.data.get
              tags:
                - tag: component
                  value: health
                - tag: resource
                  value: '{#JOB.FRIENDLY.NAME}'
              trigger_prototypes:
                - uuid: a3a8cb87e41546b0a6550375578cc651
                  expression: 'last(/Azure Backup Jobs by HTTP/azure.vault.job.status[{#JOB.NAME}])=6'
                  name: 'Azure backup jobs: Job cancelled [{#JOB.NAME}]'
                  event_name: 'Azure backup jobs: Job type [{#JOB.OPERATION}] for [{#JOB.FRIENDLY.NAME}] with ID [{#JOB.NAME}] has cancelled.'
                  opdata: 'Current status: {ITEM.LASTVALUE1}'
                  priority: AVERAGE
                  description: 'Job has received "Cancelled" status.'
                  manual_close: 'YES'
                  tags:
                    - tag: scope
                      value: notice
                - uuid: 475a62e73f9c4a2abef6320c6909e7fa
                  expression: 'last(/Azure Backup Jobs by HTTP/azure.vault.job.status[{#JOB.NAME}])=4'
                  name: 'Azure backup jobs: Job completed with warnings [{#JOB.NAME}]'
                  event_name: 'Azure backup jobs: Job type [{#JOB.OPERATION}] for [{#JOB.FRIENDLY.NAME}] with ID [{#JOB.NAME}] has completed with warnings.'
                  opdata: 'Current status: {ITEM.LASTVALUE1}'
                  priority: WARNING
                  description: 'Job has received "Completed with warnings" status.'
                  manual_close: 'YES'
                  tags:
                    - tag: scope
                      value: notice
                - uuid: b7e43dbcd4914f228bb0687f585951ea
                  expression: 'last(/Azure Backup Jobs by HTTP/azure.vault.job.status[{#JOB.NAME}])=7'
                  name: 'Azure backup jobs: Job expired [{#JOB.NAME}]'
                  event_name: 'Azure backup jobs: Job type [{#JOB.OPERATION}] for [{#JOB.FRIENDLY.NAME}] with ID [{#JOB.NAME}] has  expired.'
                  opdata: 'Current status: {ITEM.LASTVALUE1}'
                  priority: AVERAGE
                  description: 'Job has received "Expired" status.'
                  manual_close: 'YES'
                  tags:
                    - tag: scope
                      value: notice
                - uuid: f340de23cd004f1b94239dbcf7ec136e
                  expression: 'last(/Azure Backup Jobs by HTTP/azure.vault.job.status[{#JOB.NAME}])=5'
                  name: 'Azure backup jobs: Job failed [{#JOB.NAME}]'
                  event_name: 'Azure backup jobs: Job type [{#JOB.OPERATION}] for [{#JOB.FRIENDLY.NAME}] with ID [{#JOB.NAME}] has failed.'
                  opdata: 'Current status: {ITEM.LASTVALUE1}'
                  priority: HIGH
                  description: 'Job has received "Failed" status.'
                  manual_close: 'YES'
                  tags:
                    - tag: scope
                      value: notice
                - uuid: 860b6d8bbefd4daba537e517dfb94007
                  expression: 'last(/Azure Backup Jobs by HTTP/azure.vault.job.status[{#JOB.NAME}])=0'
                  name: 'Azure backup jobs: Job status unknown [{#JOB.NAME}]'
                  event_name: 'Azure backup jobs: Job type [{#JOB.OPERATION}] for [{#JOB.FRIENDLY.NAME}] with ID [{#JOB.NAME}] is in unknown status.'
                  opdata: 'Current status: {ITEM.LASTVALUE1}'
                  priority: AVERAGE
                  description: 'Job has received "Unknown" status.'
                  manual_close: 'YES'
                  tags:
                    - tag: scope
                      value: notice
          master_item:
            key: azure.vault.data.get
          lld_macro_paths:
            - lld_macro: '{#JOB.FRIENDLY.NAME}'
              path: $.entity_friendly_name
            - lld_macro: '{#JOB.NAME}'
              path: $.name
            - lld_macro: '{#JOB.OPERATION}'
              path: $.operation
            - lld_macro: '{#JOB.STATUS}'
              path: $.status
          preprocessing:
            - type: JAVASCRIPT
              parameters:
                - |
                  const job_list = JSON.parse(value);
                  
                  const result = job_list.jobs.map(function (job) {
                  	return {
                  	  'name': job.name,
                  	  'entity_friendly_name': job.properties.entityFriendlyName,
                  	  'status': job.properties.status,
                  	  'operation': job.properties.operation
                  	};
                  });
                  
                  return JSON.stringify(result);
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
      tags:
        - tag: class
          value: cloud
        - tag: subclass
          value: backup
        - tag: target
          value: azure
      macros:
        - macro: '{$AZURE.APP.ID}'
          description: 'The App ID of Microsoft Azure.'
          config:
            type: TEXT
            priority: '3'
            label: 'Azure App ID'
            description: 'Microsoft Azure App ID.'
            required: 'YES'
        - macro: '{$AZURE.DATA.TIMEOUT}'
          value: 15s
          description: 'API response timeout.'
          config:
            type: TEXT
            priority: '7'
            section_name: Other
            label: 'API timeout'
            description: 'API response timeout, in seconds.'
        - macro: '{$AZURE.JOBS.FRIENDLY.NAME.MATCHES}'
          value: '.*'
          description: 'Set the regex string to include backup jobs based on `entityFriendlyName`.'
          config:
            type: TEXT
            priority: '9'
            section_name: Filters
            label: 'Include backup job filter'
            description: 'Regex string to include discovered Azure backup jobs by `entityFriendlyName`.'
        - macro: '{$AZURE.JOBS.FRIENDLY.NAME.NOT.MATCHES}'
          value: CHANGE_IF_NEEDED
          description: 'Set the regex string to exclude backup jobs based on `entityFriendlyName`.'
          config:
            type: TEXT
            priority: '10'
            section_name: Filters
            label: 'Exclude backup job filter'
            description: 'Regex string to exclude discovered Azure backup jobs by `entityFriendlyName`.'
        - macro: '{$AZURE.JOBS.OPERATION.MATCHES}'
          value: '.*'
          description: 'Set the regex string to include backup jobs based on operation type.'
          config:
            type: TEXT
            priority: '13'
            section_name: Filters
            label: 'Include backup job operation type filter'
            description: 'Regex string to include discovered Azure backup jobs by operation type.'
        - macro: '{$AZURE.JOBS.OPERATION.NOT.MATCHES}'
          value: CHANGE_IF_NEEDED
          description: 'Set the regex string to exclude backup jobs based on operation type.'
          config:
            type: TEXT
            priority: '14'
            section_name: Filters
            label: 'Exclude backup job operation type filter'
            description: 'Regex string to exclude discovered Azure backup jobs by operation type.'
        - macro: '{$AZURE.JOBS.STATUS.MATCHES}'
          value: '.*'
          description: 'Set the regex string to include backup jobs based on status.'
          config:
            type: TEXT
            priority: '11'
            section_name: Filters
            label: 'Include backup job status filter'
            description: 'Regex string to include discovered Azure backup jobs by status.'
        - macro: '{$AZURE.JOBS.STATUS.NOT.MATCHES}'
          value: CHANGE_IF_NEEDED
          description: 'Set the regex string to exclude backup jobs based on status.'
          config:
            type: TEXT
            priority: '12'
            section_name: Filters
            label: 'Exclude backup job status filter'
            description: 'Regex string to exclude discovered Azure backup jobs by status.'
        - macro: '{$AZURE.PASSWORD}'
          type: SECRET_TEXT
          description: 'Microsoft Azure password.'
          config:
            type: TEXT
            priority: '4'
            label: 'Azure password'
            description: 'Microsoft Azure password.'
            required: 'YES'
        - macro: '{$AZURE.PROXY}'
          description: 'Sets the HTTP proxy value. If this macro is empty, then no proxy is used.'
          config:
            type: TEXT
            priority: '8'
            section_name: Other
            label: 'HTTP proxy'
            description: 'HTTP proxy to use for requests.'
        - macro: '{$AZURE.RESOURCE.ID}'
          description: 'Microsoft Azure vault resource ID.'
          config:
            type: TEXT
            priority: '5'
            label: 'Azure Vault ID'
            description: 'Vault resource ID.'
            required: 'YES'
        - macro: '{$AZURE.SUBSCRIPTION.ID}'
          description: 'Microsoft Azure subscription ID.'
          config:
            type: TEXT
            priority: '1'
            label: 'Azure subscription ID'
            description: 'Microsoft Azure subscription ID.'
            required: 'YES'
        - macro: '{$AZURE.TENANT.ID}'
          description: 'Microsoft Azure tenant ID.'
          config:
            type: TEXT
            priority: '2'
            label: 'Azure tenant ID'
            description: 'Microsoft Azure tenant ID.'
            required: 'YES'
        - macro: '{$AZURE.VAULT.PERIOD}'
          value: '7'
          description: 'The number of days over which to retrieve backup jobs.'
          config:
            type: TEXT
            priority: '6'
            label: 'Backup jobs period'
            description: 'Number of days over which to retrieve backup jobs. No less than 0.'
            required: 'YES'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
      dashboards:
        - uuid: dd616732edf646cba117f8de257bafba
          name: 'Azure backup jobs'
          pages:
            - name: 'Backup job overview'
              widgets:
                - type: item
                  name: 'Total jobs'
                  width: '15'
                  fields:
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure Backup Jobs by HTTP'
                        key: azure.vault.jobs.total
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: INTEGER
                      name: value_size
                      value: '60'
                - type: item
                  name: 'Backup jobs'
                  'y': '2'
                  width: '15'
                  fields:
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure Backup Jobs by HTTP'
                        key: azure.vault.jobs.backup
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: INTEGER
                      name: value_size
                      value: '60'
                - type: itemnavigator
                  name: 'Jobs grouped by resource'
                  'y': '4'
                  width: '22'
                  height: '7'
                  fields:
                    - type: INTEGER
                      name: group_by.0.attribute
                      value: '3'
                    - type: STRING
                      name: group_by.0.tag_name
                      value: resource
                    - type: STRING
                      name: items.0
                      value: 'Job status [*]'
                    - type: STRING
                      name: reference
                      value: EBACA
                - type: item
                  name: 'Selected job'
                  'y': '11'
                  width: '22'
                  height: '1'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: description
                      value: 'Selected job status:'
                    - type: INTEGER
                      name: desc_h_pos
                      value: '0'
                    - type: INTEGER
                      name: desc_size
                      value: '60'
                    - type: INTEGER
                      name: desc_v_pos
                      value: '1'
                    - type: STRING
                      name: itemid._reference
                      value: EBACA._itemid
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: INTEGER
                      name: value_h_pos
                      value: '2'
                    - type: INTEGER
                      name: value_size
                      value: '60'
                - type: item
                  name: 'In progress jobs'
                  x: '15'
                  width: '14'
                  fields:
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure Backup Jobs by HTTP'
                        key: azure.vault.jobs.in_progress
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: STRING
                      name: thresholds.0.color
                      value: 00A1FF
                    - type: STRING
                      name: thresholds.0.threshold
                      value: '1'
                    - type: INTEGER
                      name: value_size
                      value: '60'
                - type: item
                  name: 'Restore jobs'
                  x: '15'
                  'y': '2'
                  width: '14'
                  fields:
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure Backup Jobs by HTTP'
                        key: azure.vault.jobs.restore
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: STRING
                      name: thresholds.0.color
                      value: FF465C
                    - type: STRING
                      name: thresholds.0.threshold
                      value: '1'
                    - type: INTEGER
                      name: value_size
                      value: '60'
                - type: honeycomb
                  name: 'Job statuses'
                  x: '22'
                  'y': '4'
                  width: '50'
                  height: '7'
                  fields:
                    - type: STRING
                      name: items.0
                      value: 'Job status [*]'
                    - type: STRING
                      name: reference
                      value: AFAEA
                    - type: STRING
                      name: secondary_label
                      value: '{{ITEM.NAME}.regsub("(Job status \[)(.*)(,.*\])","\2")}'
                    - type: INTEGER
                      name: secondary_label_type
                      value: '0'
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: STRING
                      name: thresholds.0.color
                      value: EC1594
                    - type: STRING
                      name: thresholds.0.threshold
                      value: '0'
                    - type: STRING
                      name: thresholds.1.color
                      value: 00A1FF
                    - type: STRING
                      name: thresholds.1.threshold
                      value: '1'
                    - type: STRING
                      name: thresholds.2.color
                      value: 6AC8FF
                    - type: STRING
                      name: thresholds.2.threshold
                      value: '2'
                    - type: STRING
                      name: thresholds.3.color
                      value: 0EC9AC
                    - type: STRING
                      name: thresholds.3.threshold
                      value: '3'
                    - type: STRING
                      name: thresholds.4.color
                      value: FFD54F
                    - type: STRING
                      name: thresholds.4.threshold
                      value: '4'
                    - type: STRING
                      name: thresholds.5.color
                      value: FF465C
                    - type: STRING
                      name: thresholds.5.threshold
                      value: '5'
                    - type: STRING
                      name: thresholds.6.color
                      value: BF00FF
                    - type: STRING
                      name: thresholds.6.threshold
                      value: '6'
                    - type: STRING
                      name: thresholds.7.color
                      value: BAE37D
                    - type: STRING
                      name: thresholds.7.threshold
                      value: '7'
                - type: item
                  name: 'Selected job'
                  x: '22'
                  'y': '11'
                  width: '50'
                  height: '1'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: description
                      value: '{{ITEM.NAME}.regsub("(Job status \[)(.*)(, )(.*)(\])","Resource: \2, Job ID: \4")}'
                    - type: INTEGER
                      name: desc_h_pos
                      value: '0'
                    - type: INTEGER
                      name: desc_size
                      value: '60'
                    - type: INTEGER
                      name: desc_v_pos
                      value: '1'
                    - type: STRING
                      name: itemid._reference
                      value: AFAEA._itemid
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: INTEGER
                      name: value_h_pos
                      value: '2'
                    - type: INTEGER
                      name: value_size
                      value: '60'
                - type: item
                  name: 'Failed jobs'
                  x: '29'
                  width: '14'
                  fields:
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure Backup Jobs by HTTP'
                        key: azure.vault.jobs.failed
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: STRING
                      name: thresholds.0.color
                      value: FF465C
                    - type: STRING
                      name: thresholds.0.threshold
                      value: '1'
                    - type: INTEGER
                      name: value_size
                      value: '60'
                - type: item
                  name: 'Deleting backup data jobs'
                  x: '29'
                  'y': '2'
                  width: '14'
                  fields:
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure Backup Jobs by HTTP'
                        key: azure.vault.jobs.backup.delete
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: STRING
                      name: thresholds.0.color
                      value: FFD54F
                    - type: STRING
                      name: thresholds.0.threshold
                      value: '1'
                    - type: INTEGER
                      name: value_size
                      value: '60'
                - type: item
                  name: 'Cancelled jobs'
                  x: '43'
                  width: '14'
                  fields:
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure Backup Jobs by HTTP'
                        key: azure.vault.jobs.cancelled
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: STRING
                      name: thresholds.0.color
                      value: BF00FF
                    - type: STRING
                      name: thresholds.0.threshold
                      value: '1'
                    - type: INTEGER
                      name: value_size
                      value: '60'
                - type: item
                  name: 'Configuring backup jobs'
                  x: '43'
                  'y': '2'
                  width: '14'
                  fields:
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure Backup Jobs by HTTP'
                        key: azure.vault.jobs.backup.config
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: STRING
                      name: thresholds.0.color
                      value: 6AC8FF
                    - type: STRING
                      name: thresholds.0.threshold
                      value: '1'
                    - type: INTEGER
                      name: value_size
                      value: '60'
                - type: item
                  name: 'Completed jobs'
                  x: '57'
                  width: '15'
                  fields:
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure Backup Jobs by HTTP'
                        key: azure.vault.jobs.completed
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: STRING
                      name: thresholds.0.color
                      value: 0EC9AC
                    - type: STRING
                      name: thresholds.0.threshold
                      value: '1'
                    - type: INTEGER
                      name: value_size
                      value: '60'
                - type: item
                  name: 'Completed with warning jobs'
                  x: '57'
                  'y': '2'
                  width: '15'
                  fields:
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure Backup Jobs by HTTP'
                        key: azure.vault.jobs.with_warning
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: STRING
                      name: thresholds.0.color
                      value: FFD54F
                    - type: STRING
                      name: thresholds.0.threshold
                      value: '1'
                    - type: INTEGER
                      name: value_size
                      value: '60'
      valuemaps:
        - uuid: f79314c2d4bb458caf510b85f65cae81
          name: 'Azure backup job status'
          mappings:
            - value: '0'
              newvalue: Unknown
            - value: '1'
              newvalue: InProgress
            - value: '2'
              newvalue: Queued
            - value: '3'
              newvalue: Completed
            - value: '4'
              newvalue: CompletedWithWarnings
            - value: '5'
              newvalue: Failed
            - value: '6'
              newvalue: Cancelled
            - value: '7'
              newvalue: Expired
        - uuid: 7bca76cc48c3468ca67b924f59003e4a
          name: 'Azure resource health state'
          mappings:
            - value: '0'
              newvalue: Available
            - value: '1'
              newvalue: Degraded
            - value: '2'
              newvalue: Unavailable
            - value: '3'
              newvalue: Unknown
    - uuid: fa58228fee8a4e34a7c6503950d1c615
      template: 'Azure by HTTP'
      name: 'Azure by HTTP'
      description: |
        This template is designed to monitor Microsoft Azure by HTTP.
        It works without any external scripts and uses the script item.
        Currently the template supports the discovery of virtual machines (VMs), Cosmos DB for MongoDB, storage accounts, Microsoft SQL, MySQL, and PostgreSQL servers.
        
        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}`, and `{$AZURE.SUBSCRIPTION.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"
      wizard_ready: 'YES'
      readme: |
        ## Overview
        
        - This template is designed to monitor Microsoft Azure by HTTP.
        - It works without any external scripts and uses the script item.
        - Currently, the template supports the discovery of virtual machines (VMs), VM scale sets, Cosmos DB for MongoDB, storage accounts, Microsoft SQL, MySQL, and PostgreSQL servers.
        
        ## 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 [Azure documentation](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 host wizard configuration fields: `Azure App ID`, `Azure password`, `Azure tenant ID`, `Azure subscription ID`.
      vendor:
        name: Zabbix
        version: 8.0-3
      groups:
        - name: Templates/Cloud
      items:
        - uuid: 7b2fe9a7ee164718933eb456b0068fea
          name: 'Get errors'
          type: DEPENDENT
          key: azure.get.errors
          value_type: TEXT
          description: 'A list of errors from API requests.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.errors
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.get.resources
          tags:
            - tag: component
              value: raw
          triggers:
            - uuid: 502cb582546046a29267715763c46bff
              expression: 'length(last(/Azure by HTTP/azure.get.errors))>0'
              name: 'Azure: 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: fb6abf3631b240b08357ea9ce9ba89a4
          name: 'Get resources'
          type: SCRIPT
          key: azure.get.resources
          delay: 10m
          history: '0'
          value_type: TEXT
          params: |
            var Azure = {
            	params: {},
            	token: null,
            
            	setParams: function (params) {
            		['app_id', 'password', 'tenant_id', 'subscription_id'].forEach(function (field) {
            			if (typeof params !== 'object' || typeof params[field] === 'undefined' || params[field] === '') {
            				throw 'Required param is not set: ' + field + '.';
            			}
            		});
            
            		Azure.params = params;
            	},
            
            	request: function (url, data) {
            		if (typeof data === 'undefined' || data === null) {
            			data = '';
            		}
            		var response, request = new HttpRequest();
            		if (typeof Azure.params.proxy !== 'undefined' && Azure.params.proxy !== '') {
            			request.setProxy(Azure.params.proxy);
            		}
            		if (Azure.token) {
            			request.addHeader('Accept: application/json');
            			request.addHeader('Authorization: Bearer ' + Azure.token);
            		}
            
            		Zabbix.log(4, '[ Azure ] Sending request: ' + url);
            
            		if (data !== '') {
            			request.addHeader('Content-Type: application/x-www-form-urlencoded');
            			response = request.post(url, data);
            		}
            		else {
            			response = request.get(url);
            		}
            
            		Zabbix.log(4, '[ Azure ] Received response with status code ' + request.getStatus() + ': ' + response);
            
            		if (request.getStatus() !== 200 || response === null) {
            			throw 'Request failed with status code ' + request.getStatus() + ': ' + response;
            		}
            
            		try {
            			return JSON.parse(response);
            		}
            		catch (error) {
            			throw 'Failed to parse response received from API.';
            		}
            	},
            
            	nextlink: function (data) {
            		next_data = data;
            		while ('nextLink' in next_data) {
            			next_data = Azure.request(next_data.nextLink);
            			next_data.value.forEach(function (value) {
            				data.value.push(value);
            			});
            		}
            
            		return data;
            	}
            };
            
            var result,
            	data = {},
            	types = [
            		{"method": "Microsoft.Compute/virtualMachines", "version": "2022-03-01"},
            		{"method": "Microsoft.DBforMySQL/flexibleServers", "version": "2021-05-01"},
            		{"method": "Microsoft.DBforMySQL/servers", "version": "2017-12-01"},
            		{"method": "Microsoft.DBforPostgreSQL/flexibleServers", "version": "2021-06-01"},
            		{"method": "Microsoft.DBforPostgreSQL/servers", "version": "2017-12-01"},
            		{"method": "Microsoft.Sql/servers", "version": "2022-05-01-preview"},
            		{"method": "Microsoft.DocumentDB/databaseAccounts", "version": "2022-11-15-preview"},
            		{"method": "Microsoft.Compute/virtualMachineScaleSets", "version": "2024-03-01"},
            		{"method": "Microsoft.Sql/managedInstances", "version": "2024-05-01-preview"},
            		{"method": "Microsoft.DataProtection/backupVaults", "version": "2025-01-01"},
            		{"method": "Microsoft.RecoveryServices/vaults", "version": "2025-02-28-preview"},
            		{"method": "Microsoft.OperationalInsights/workspaces", "version": "2025-07-01"}
            	];
            	data['errors'] = {},
            	data['resources'] = {};
            	data.resources.value = [];
            
            try {
            	Azure.setParams(JSON.parse(value));
            
            	try {
            		result = Azure.request(
            			'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 ('access_token' in result) {
            			Azure.token = result['access_token'];
            		} else {
            			throw 'Auth response does not contain access token.';
            		}
            	}
            	catch (error) {
            		data.errors.auth = error.toString();
            	}
            
            	if (!('auth' in data.errors)) {
            		try {
            			for (var i in types) {
            				if (types[i].method === "Microsoft.Sql/servers") {
            					mssql_servers = Azure.request('https://management.azure.com/subscriptions/' + encodeURIComponent(Azure.params.subscription_id) + '/providers/' + types[i].method + '?api-version=' + types[i].version);
            
            					if ('nextLink' in mssql_servers) {
            						mssql_servers = Azure.nextlink(mssql_servers);
            					}
            
            					if ('value' in mssql_servers && mssql_servers.value.length > 0) {
            						for (j in mssql_servers.value) {
            							mssql_dbs = Azure.request('https://management.azure.com' + mssql_servers.value[j].id + '/databases?api-version=' + types[i].version);
            
            							if ('nextLink' in mssql_dbs) {
            								mssql_dbs = Azure.nextlink(mssql_dbs);
            							}
            
            							mssql_dbs.value.forEach(function (value) {
            								raw_data.value.push(value);
            							});
            						}
            					}
            				}
            				else if (types[i].method === "Microsoft.OperationalInsights/workspaces") {
            					workspace_list = Azure.request('https://management.azure.com/subscriptions/' + encodeURIComponent(Azure.params.subscription_id) + '/providers/' + types[i].method + '?api-version=' + types[i].version);
            					if ('nextLink' in workspace_list) {
            						workspace_list = Azure.nextlink(workspace_list);
            					}
            
            					if ('value' in workspace_list && workspace_list.value.length > 0) {
            						for (j in workspace_list.value) {
            							try {
            								answer = Azure.request('https://management.azure.com/' + encodeURIComponent(workspace_list.value[j].id) + '/providers/Microsoft.SecurityInsights/onboardingStates?api-version=2025-09-01');
            							}
            							catch (error) {
            								continue;
            							}
            
            							raw_data.value.push(workspace_list.value[j]);
            						}
            					}
            				}
            				else {
            					raw_data = Azure.request('https://management.azure.com/subscriptions/' + encodeURIComponent(Azure.params.subscription_id) + '/providers/' + types[i].method + '?api-version=' + types[i].version);
            
            					if ('nextLink' in raw_data) {
            						raw_data = Azure.nextlink(raw_data);
            					}
            				}
            
            				raw_data.value.forEach(function (value) {
            					value.resourceGroup = value.id.split("/")[4];
            					data.resources.value.push(value);
            				});
            			}
            		}
            		catch (error) {
            			data.errors.resources = error.toString();
            		}
            	}
            }
            catch (error) {
            	data.errors.params = error.toString();
            }
            
            if (Object.keys(data.errors).length !== 0) {
            	errors = 'Failed to receive data:';
            	for (var error in data.errors) {
            		errors += '\n' + error + ' : ' + data.errors[error];
            	}
            	data.errors = errors;
            }
            else {
            	data.errors = '';
            }
            
            return JSON.stringify(data);
          description: 'The result of API requests is expressed in the JSON.'
          timeout: '{$AZURE.DATA.TIMEOUT}'
          parameters:
            - name: app_id
              value: '{$AZURE.APP.ID}'
            - name: password
              value: '{$AZURE.PASSWORD}'
            - name: proxy
              value: '{$AZURE.PROXY}'
            - name: subscription_id
              value: '{$AZURE.SUBSCRIPTION.ID}'
            - name: tenant_id
              value: '{$AZURE.TENANT.ID}'
          tags:
            - tag: component
              value: raw
        - uuid: 91b2290d65b949ad9ea801763c35cf40
          name: 'Get storage accounts'
          type: SCRIPT
          key: azure.get.storage.acc
          delay: 10m
          history: '0'
          value_type: TEXT
          params: |
            var Azure = {
            	params: {},
            	token: '',
            
            	setParams: function (params) {
            		['app_id', 'password', 'tenant_id', 'subscription_id'].forEach(function (field) {
            			if (typeof params !== 'object' || typeof params[field] === 'undefined' || params[field] === '') {
            				throw 'Required param is not set: ' + field + '.';
            			}
            		});
            
            		Azure.params = params;
            	},
            
            	login: function () {
            		var response, login = new HttpRequest();
            		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);
            			if (!response.hasOwnProperty('access_token')) {
            				throw null;
            			}
            		}
            		catch (error) {
            			throw 'Authentication response does not contain access token.';
            		}
            
            		Azure.token = response['access_token'];
            	},
            
            	request: function (url) {
            		var response, request = new HttpRequest();
            		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('Accept: application/json');
            		request.addHeader('Authorization: Bearer ' + Azure.token);
            		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 metric = Azure.request('https://management.azure.com/subscriptions/' + encodeURIComponent(Azure.params.subscription_id) + '/providers/Microsoft.Storage/storageAccounts?api-version=2021-05-01'),
            			data = [];
            
            		if (!metric.hasOwnProperty('value')) {
            			throw 'Failed getting required field. Check debug log for more information.';
            		}
            		for (k in metric.value) {
            			id = Azure.getField(metric.value[k], 'id');
            			json = {};
            			input = id.split('/');
            			for (var i = 1; i < input.length; i += 2) {
            				json[input[i]] = input[i + 1];
            			}
            			data.push({
            				'name': Azure.getField(metric.value[k], 'name'),
            				'id': id,
            				'resourceGroup': Azure.getField(json, 'resourceGroups'),
            				'location': Azure.getField(metric.value[k], 'location'),
            				'token': Azure.token
            			});
            		}
            
            		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 ] ERROR: ' + error);
            	return JSON.stringify({'error': error});
            }
          description: 'The result of API requests is expressed in the JSON.'
          timeout: '{$AZURE.DATA.TIMEOUT}'
          parameters:
            - name: app_id
              value: '{$AZURE.APP.ID}'
            - name: password
              value: '{$AZURE.PASSWORD}'
            - name: proxy
              value: '{$AZURE.PROXY}'
            - name: subscription_id
              value: '{$AZURE.SUBSCRIPTION.ID}'
            - name: tenant_id
              value: '{$AZURE.TENANT.ID}'
          tags:
            - tag: component
              value: raw
        - uuid: 2e425a9ef8d34ea68f7998ceed30ebc4
          name: 'Get storage accounts errors'
          type: DEPENDENT
          key: azure.get.storage.acc.errors
          value_type: TEXT
          description: 'The errors from API requests.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.error
              error_handler: CUSTOM_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.get.storage.acc
          tags:
            - tag: component
              value: status
          triggers:
            - uuid: 253f0835cd134d2591bb2be1b9dc9b29
              expression: 'length(last(/Azure by HTTP/azure.get.storage.acc.errors))>0'
              name: 'Azure: There are errors in storages requests to API'
              opdata: '{ITEM.LASTVALUE1}'
              priority: AVERAGE
              description: 'Zabbix has received errors in response to API requests.'
              dependencies:
                - name: 'Azure: There are errors in requests to API'
                  expression: 'length(last(/Azure by HTTP/azure.get.errors))>0'
              tags:
                - tag: scope
                  value: availability
      discovery_rules:
        - uuid: 3bfbfc8d770a4c77a17d62aaebb55e64
          name: 'Cosmos DB account discovery'
          type: DEPENDENT
          key: azure.cosmos.mongo.db.discovery
          filter:
            evaltype: AND
            conditions:
              - macro: '{#GROUP}'
                value: '{$AZURE.RESOURCE.GROUP.MATCHES}'
              - macro: '{#GROUP}'
                value: '{$AZURE.RESOURCE.GROUP.NOT.MATCHES}'
                operator: NOT_MATCHES_REGEX
              - macro: '{#LOCATION}'
                value: '{$AZURE.COSMOS.MONGO.DB.LOCATION.MATCHES}'
              - macro: '{#LOCATION}'
                value: '{$AZURE.COSMOS.MONGO.DB.LOCATION.NOT.MATCHES}'
                operator: NOT_MATCHES_REGEX
              - macro: '{#NAME}'
                value: '{$AZURE.COSMOS.MONGO.DB.NAME.MATCHES}'
              - macro: '{#NAME}'
                value: '{$AZURE.COSMOS.MONGO.DB.NAME.NOT.MATCHES}'
                operator: NOT_MATCHES_REGEX
              - macro: '{#TYPE}'
                value: ^Microsoft.DocumentDB/databaseAccounts
          description: 'The list of Cosmos databases provided by the subscription.'
          host_prototypes:
            - uuid: 16eec30e921e4627b3599b4d06e48072
              host: 'Azure Cosmos DB {#NAME}'
              name: 'Azure Cosmos DB {#NAME}'
              group_links:
                - group:
                    name: Databases
              macros:
                - macro: '{$AZURE.RESOURCE.ID}'
                  value: '{#ID}'
              tags:
                - tag: location
                  value: '{#LOCATION}'
                - tag: resource-group
                  value: '{#GROUP}'
                - tag: version
                  value: '{#VERSION}'
          master_item:
            key: azure.get.resources
          lld_macro_paths:
            - lld_macro: '{#GROUP}'
              path: $.resourceGroup
            - lld_macro: '{#ID}'
              path: $.id
            - lld_macro: '{#LOCATION}'
              path: $.location
            - lld_macro: '{#NAME}'
              path: $.name
            - lld_macro: '{#TYPE}'
              path: $.type
            - lld_macro: '{#VERSION}'
              path: $.kind
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.resources.value
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 6h
          overrides:
            - name: MongoDB
              step: '1'
              filter:
                conditions:
                  - macro: '{#VERSION}'
                    value: ^MongoDB$
              operations:
                - operationobject: HOST_PROTOTYPE
                  operator: REGEXP
                  templates:
                    - name: 'Azure Cosmos DB for MongoDB by HTTP'
        - uuid: c875a410ddd84ccfbc5b407cd6e34803
          name: 'Microsoft SQL databases discovery'
          type: DEPENDENT
          key: azure.mssql.databases.discovery
          filter:
            evaltype: AND
            conditions:
              - macro: '{#GROUP}'
                value: '{$AZURE.RESOURCE.GROUP.MATCHES}'
              - macro: '{#GROUP}'
                value: '{$AZURE.RESOURCE.GROUP.NOT.MATCHES}'
                operator: NOT_MATCHES_REGEX
              - macro: '{#LOCATION}'
                value: '{$AZURE.MSSQL.DB.LOCATION.MATCHES}'
              - macro: '{#LOCATION}'
                value: '{$AZURE.MSSQL.DB.LOCATION.NOT.MATCHES}'
                operator: NOT_MATCHES_REGEX
              - macro: '{#NAME}'
                value: '{$AZURE.MSSQL.DB.NAME.MATCHES}'
              - macro: '{#NAME}'
                value: '{$AZURE.MSSQL.DB.NAME.NOT.MATCHES}'
                operator: NOT_MATCHES_REGEX
              - macro: '{#SIZE}'
                value: '{$AZURE.MSSQL.DB.SIZE.NOT.MATCHES}'
                operator: NOT_MATCHES_REGEX
              - macro: '{#TYPE}'
                value: ^Microsoft.Sql/servers/databases
          description: 'The list of Microsoft SQL databases provided by the subscription.'
          host_prototypes:
            - uuid: 2aaf7dc7e9f04ccf9dd91fcd803fa076
              host: 'Azure Microsoft SQL database {#NAME}'
              name: 'Azure Microsoft SQL database {#NAME}'
              group_links:
                - group:
                    name: Databases
              macros:
                - macro: '{$AZURE.RESOURCE.ID}'
                  value: '{#ID}'
              tags:
                - tag: location
                  value: '{#LOCATION}'
                - tag: resource-group
                  value: '{#GROUP}'
                - tag: size
                  value: '{#SIZE}'
                - tag: version
                  value: '{#VERSION}'
          master_item:
            key: azure.get.resources
          lld_macro_paths:
            - lld_macro: '{#GROUP}'
              path: $.resourceGroup
            - lld_macro: '{#ID}'
              path: $.id
            - lld_macro: '{#LOCATION}'
              path: $.location
            - lld_macro: '{#NAME}'
              path: $.name
            - lld_macro: '{#SIZE}'
              path: $.sku.name
            - lld_macro: '{#TYPE}'
              path: $.type
            - lld_macro: '{#VERSION}'
              path: $.kind
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.resources.value
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 6h
          overrides:
            - name: Serverless
              step: '1'
              filter:
                conditions:
                  - macro: '{#VERSION}'
                    value: '^(?=.*serverless)(?=.*vcore).*$'
              operations:
                - operationobject: HOST_PROTOTYPE
                  operator: REGEXP
                  templates:
                    - name: 'Azure Microsoft SQL Serverless Database by HTTP'
            - name: Server
              step: '2'
              filter:
                conditions:
                  - macro: '{#VERSION}'
                    value: '^(?!.*serverless)(?=.*vcore).*$'
              operations:
                - operationobject: HOST_PROTOTYPE
                  operator: REGEXP
                  templates:
                    - name: 'Azure Microsoft SQL Database by HTTP'
            - name: DTU-based
              step: '3'
              filter:
                conditions:
                  - macro: '{#VERSION}'
                    value: '^(?!.*serverless)(?!.*vcore).*$'
              operations:
                - operationobject: HOST_PROTOTYPE
                  operator: REGEXP
                  templates:
                    - name: 'Azure Microsoft SQL DTU Database by HTTP'
        - uuid: 7fafbef68f8b46d083eb43da7cd1e2cc
          name: 'MySQL servers discovery'
          type: DEPENDENT
          key: azure.mysql.servers.discovery
          filter:
            evaltype: AND
            conditions:
              - macro: '{#GROUP}'
                value: '{$AZURE.RESOURCE.GROUP.MATCHES}'
              - macro: '{#GROUP}'
                value: '{$AZURE.RESOURCE.GROUP.NOT.MATCHES}'
                operator: NOT_MATCHES_REGEX
              - macro: '{#LOCATION}'
                value: '{$AZURE.MYSQL.DB.LOCATION.MATCHES}'
              - macro: '{#LOCATION}'
                value: '{$AZURE.MYSQL.DB.LOCATION.NOT.MATCHES}'
                operator: NOT_MATCHES_REGEX
              - macro: '{#NAME}'
                value: '{$AZURE.MYSQL.DB.NAME.MATCHES}'
              - macro: '{#NAME}'
                value: '{$AZURE.MYSQL.DB.NAME.NOT.MATCHES}'
                operator: NOT_MATCHES_REGEX
              - macro: '{#TYPE}'
                value: ^Microsoft.DBforMySQL
          description: 'The list of MySQL servers provided by the subscription.'
          host_prototypes:
            - uuid: 55b87078c14c4561b53e64af5ed77d61
              host: 'Azure MySQL server {#NAME}'
              name: 'Azure MySQL server {#NAME}'
              group_links:
                - group:
                    name: Databases
              macros:
                - macro: '{$AZURE.RESOURCE.ID}'
                  value: '{#ID}'
              tags:
                - tag: location
                  value: '{#LOCATION}'
                - tag: resource-group
                  value: '{#GROUP}'
                - tag: size
                  value: '{#SIZE}'
                - tag: version
                  value: '{#VERSION}'
          master_item:
            key: azure.get.resources
          lld_macro_paths:
            - lld_macro: '{#GROUP}'
              path: $.resourceGroup
            - lld_macro: '{#ID}'
              path: $.id
            - lld_macro: '{#LOCATION}'
              path: $.location
            - lld_macro: '{#NAME}'
              path: $.name
            - lld_macro: '{#SIZE}'
              path: $.sku.name
            - lld_macro: '{#TYPE}'
              path: $.type
            - lld_macro: '{#VERSION}'
              path: $.properties.version
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.resources.value
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 6h
          overrides:
            - name: 'Flexible server'
              step: '1'
              filter:
                conditions:
                  - macro: '{#TYPE}'
                    value: Microsoft.DBforMySQL/flexibleServers
              operations:
                - operationobject: HOST_PROTOTYPE
                  operator: REGEXP
                  templates:
                    - name: 'Azure MySQL Flexible Server by HTTP'
            - name: 'Single server'
              step: '2'
              filter:
                conditions:
                  - macro: '{#TYPE}'
                    value: Microsoft.DBforMySQL/servers
              operations:
                - operationobject: HOST_PROTOTYPE
                  operator: REGEXP
                  templates:
                    - name: 'Azure MySQL Single Server by HTTP'
        - uuid: a4b35b5fe8c04b52a9640f2f41013230
          name: 'PostgreSQL servers discovery'
          type: DEPENDENT
          key: azure.pgsql.servers.discovery
          filter:
            evaltype: AND
            conditions:
              - macro: '{#GROUP}'
                value: '{$AZURE.RESOURCE.GROUP.MATCHES}'
              - macro: '{#GROUP}'
                value: '{$AZURE.RESOURCE.GROUP.NOT.MATCHES}'
                operator: NOT_MATCHES_REGEX
              - macro: '{#LOCATION}'
                value: '{$AZURE.PGSQL.DB.LOCATION.MATCHES}'
              - macro: '{#LOCATION}'
                value: '{$AZURE.PGSQL.DB.LOCATION.NOT.MATCHES}'
                operator: NOT_MATCHES_REGEX
              - macro: '{#NAME}'
                value: '{$AZURE.PGSQL.DB.NAME.MATCHES}'
              - macro: '{#NAME}'
                value: '{$AZURE.PGSQL.DB.NAME.NOT.MATCHES}'
                operator: NOT_MATCHES_REGEX
              - macro: '{#TYPE}'
                value: ^Microsoft.DBforPostgreSQL
          description: 'The list of PostgreSQL servers provided by the subscription.'
          host_prototypes:
            - uuid: 54f0e0ec288f4feb9a2dc58a8726bd1d
              host: 'Azure PostgreSQL server {#NAME}'
              name: 'Azure PostgreSQL server {#NAME}'
              group_links:
                - group:
                    name: Databases
              macros:
                - macro: '{$AZURE.RESOURCE.ID}'
                  value: '{#ID}'
              tags:
                - tag: location
                  value: '{#LOCATION}'
                - tag: resource-group
                  value: '{#GROUP}'
                - tag: size
                  value: '{#SIZE}'
                - tag: version
                  value: '{#VERSION}'
          master_item:
            key: azure.get.resources
          lld_macro_paths:
            - lld_macro: '{#GROUP}'
              path: $.resourceGroup
            - lld_macro: '{#ID}'
              path: $.id
            - lld_macro: '{#LOCATION}'
              path: $.location
            - lld_macro: '{#NAME}'
              path: $.name
            - lld_macro: '{#SIZE}'
              path: $.sku.name
            - lld_macro: '{#TYPE}'
              path: $.type
            - lld_macro: '{#VERSION}'
              path: $.properties.version
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.resources.value
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 6h
          overrides:
            - name: 'Flexible server'
              step: '1'
              filter:
                conditions:
                  - macro: '{#TYPE}'
                    value: Microsoft.DBforPostgreSQL/flexibleServers
              operations:
                - operationobject: HOST_PROTOTYPE
                  operator: REGEXP
                  templates:
                    - name: 'Azure PostgreSQL Flexible Server by HTTP'
            - name: 'Single server'
              step: '2'
              filter:
                conditions:
                  - macro: '{#TYPE}'
                    value: Microsoft.DBforPostgreSQL/servers
              operations:
                - operationobject: HOST_PROTOTYPE
                  operator: REGEXP
                  templates:
                    - name: 'Azure PostgreSQL Single Server by HTTP'
        - uuid: 006fc1e9e61d45c5a795a251a3237983
          name: 'Virtual machine scale set discovery'
          type: DEPENDENT
          key: azure.scaleset.discovery
          filter:
            evaltype: AND
            conditions:
              - macro: '{#GROUP}'
                value: '{$AZURE.RESOURCE.GROUP.MATCHES}'
              - macro: '{#GROUP}'
                value: '{$AZURE.RESOURCE.GROUP.NOT.MATCHES}'
                operator: NOT_MATCHES_REGEX
              - macro: '{#LOCATION}'
                value: '{$AZURE.SCALESET.LOCATION.MATCHES}'
              - macro: '{#LOCATION}'
                value: '{$AZURE.SCALESET.LOCATION.NOT.MATCHES}'
                operator: NOT_MATCHES_REGEX
              - macro: '{#NAME}'
                value: '{$AZURE.SCALESET.NAME.MATCHES}'
              - macro: '{#NAME}'
                value: '{$AZURE.SCALESET.NAME.NOT.MATCHES}'
                operator: NOT_MATCHES_REGEX
              - macro: '{#TYPE}'
                value: ^Microsoft.Compute/virtualMachineScaleSets$
          description: 'The list of virtual machine scale sets provided by the subscription.'
          host_prototypes:
            - uuid: 1cbeb513fe3648b6829836800952c9c7
              host: 'Azure VM scale set {#NAME}'
              name: 'Azure VM scale set {#NAME}'
              group_links:
                - group:
                    name: 'Virtual machines'
              templates:
                - name: 'Azure VM Scale Set by HTTP'
              macros:
                - macro: '{$AZURE.RESOURCE.ID}'
                  value: '{#ID}'
              tags:
                - tag: location
                  value: '{#LOCATION}'
                - tag: orchestration
                  value: '{#ORCHESTRATION}'
                - tag: os
                  value: '{#OS}'
                - tag: resource-group
                  value: '{#GROUP}'
          master_item:
            key: azure.get.resources
          lld_macro_paths:
            - lld_macro: '{#GROUP}'
              path: $.resourceGroup
            - lld_macro: '{#ID}'
              path: $.id
            - lld_macro: '{#LOCATION}'
              path: $.location
            - lld_macro: '{#NAME}'
              path: $.name
            - lld_macro: '{#ORCHESTRATION}'
              path: $.properties.orchestrationMode
            - lld_macro: '{#OS}'
              path: $.properties.virtualMachineProfile.storageProfile.osDisk.osType
            - lld_macro: '{#TYPE}'
              path: $.type
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.resources.value
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 6h
        - uuid: 34e88b4d994f436e93381e41f5ba2bde
          name: 'Azure SQL managed instance discovery'
          type: DEPENDENT
          key: azure.sql_inst.discovery
          filter:
            evaltype: AND
            conditions:
              - macro: '{#GROUP}'
                value: '{$AZURE.RESOURCE.GROUP.MATCHES}'
              - macro: '{#GROUP}'
                value: '{$AZURE.RESOURCE.GROUP.NOT.MATCHES}'
                operator: NOT_MATCHES_REGEX
              - macro: '{#LOCATION}'
                value: '{$AZURE.SQL.INST.LOCATION.MATCHES}'
              - macro: '{#LOCATION}'
                value: '{$AZURE.SQL.INST.LOCATION.NOT.MATCHES}'
                operator: NOT_MATCHES_REGEX
              - macro: '{#NAME}'
                value: '{$AZURE.SQL.INST.NAME.MATCHES}'
              - macro: '{#NAME}'
                value: '{$AZURE.SQL.INST.NAME.NOT.MATCHES}'
                operator: NOT_MATCHES_REGEX
              - macro: '{#TYPE}'
                value: ^Microsoft.Sql/managedInstances$
          description: 'The list of Azure SQL managed instances provided by the subscription.'
          host_prototypes:
            - uuid: 5211d232275145598294fc35bac96075
              host: 'Azure SQL managed instance {#NAME}'
              name: 'Azure SQL managed instance {#NAME}'
              group_links:
                - group:
                    name: Databases
              templates:
                - name: 'Azure SQL Managed Instance by HTTP'
              macros:
                - macro: '{$AZURE.RESOURCE.ID}'
                  value: '{#ID}'
              tags:
                - tag: location
                  value: '{#LOCATION}'
                - tag: resource-group
                  value: '{#GROUP}'
          master_item:
            key: azure.get.resources
          lld_macro_paths:
            - lld_macro: '{#GROUP}'
              path: $.resourceGroup
            - lld_macro: '{#ID}'
              path: $.id
            - lld_macro: '{#LOCATION}'
              path: $.location
            - lld_macro: '{#NAME}'
              path: $.name
            - lld_macro: '{#TYPE}'
              path: $.type
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.resources.value
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 6h
        - uuid: 3b9bde32dd6b4e3aa2dd8d7949f655e9
          name: 'Storage accounts discovery'
          type: DEPENDENT
          key: azure.storage.acc.discovery
          filter:
            evaltype: AND
            conditions:
              - macro: '{#GROUP}'
                value: '{$AZURE.RESOURCE.GROUP.MATCHES}'
              - macro: '{#GROUP}'
                value: '{$AZURE.RESOURCE.GROUP.NOT.MATCHES}'
                operator: NOT_MATCHES_REGEX
              - macro: '{#LOCATION}'
                value: '{$AZURE.STORAGE.ACC.LOCATION.MATCHES}'
              - macro: '{#LOCATION}'
                value: '{$AZURE.STORAGE.ACC.LOCATION.NOT.MATCHES}'
                operator: NOT_MATCHES_REGEX
              - macro: '{#NAME}'
                value: '{$AZURE.STORAGE.ACC.NAME.MATCHES}'
              - macro: '{#NAME}'
                value: '{$AZURE.STORAGE.ACC.NAME.NOT.MATCHES}'
                operator: NOT_MATCHES_REGEX
          description: 'The list of all storage accounts available under the subscription.'
          item_prototypes:
            - uuid: 3361508a601748f5aca339f952430889
              name: 'Storage account [{#NAME}]: Get data'
              type: SCRIPT
              key: 'azure.get.storage.acc[{#NAME}]'
              history: '0'
              value_type: TEXT
              params: |
                var AzureStorage = {
                	params: {},
                
                	setParams: function (params) {
                		['token', 'id'].forEach(function (field) {
                			if (typeof params !== 'object' || typeof params[field] === 'undefined' || params[field] === '') {
                				throw 'Required param is not set: ' + field + '.';
                			}
                		});
                
                		AzureStorage.params = params;
                	},
                
                	request: function (url) {
                		var response, request = new HttpRequest();
                		if (typeof AzureStorage.params.proxy !== 'undefined' && AzureStorage.params.proxy !== '') {
                			request.setProxy(AzureStorage.params.proxy);
                		}
                		request.addHeader('Accept: application/json');
                		request.addHeader('Authorization: Bearer ' + AzureStorage.params.token);
                		Zabbix.log(4, '[ Azure ] Sending request: ' + 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 + ' input data: ' + JSON.stringify(data);
                			}
                
                			data = data[step];
                		}
                
                		return data;
                	},
                
                	getMetricsData: function () {
                		var data = {};
                		start_date = new Date((new Date().getTime()) - 4200000).toISOString().replace(/\.\d+/, '');
                		end_date = new Date((new Date().getTime()) - 600000).toISOString().replace(/\.\d+/, '');
                		endpoints = {
                			'tableServices': '/tableServices/default/providers/Microsoft.Insights/metrics?metricnames=TableCapacity,TableCount,TableEntityCount,Transactions,Ingress,Egress,SuccessServerLatency,SuccessE2ELatency,Availability&api-version=2021-05-01&interval=PT1H&timespan=' + encodeURIComponent(start_date) + '/' + encodeURIComponent(end_date),
                			'blobServices': '/blobServices/default/providers/Microsoft.Insights/metrics?metricnames=BlobCapacity,BlobCount,ContainerCount,IndexCapacity,Transactions,Ingress,Egress,SuccessServerLatency,SuccessE2ELatency,Availability&api-version=2021-05-01&interval=PT1H&timespan=' + encodeURIComponent(start_date) + '/' + encodeURIComponent(end_date),
                			'fileServices': '/fileServices/default/providers/Microsoft.Insights/metrics?metricnames=FileCapacity,FileCount,FileShareCount,FileShareSnapshotCount,FileShareSnapshotSize,FileShareCapacityQuota,Transactions,Ingress,Egress,SuccessServerLatency,SuccessE2ELatency,Availability&api-version=2021-05-01&interval=PT1H&timespan=' + encodeURIComponent(start_date) + '/' + encodeURIComponent(end_date),
                			'storageAccount': '/providers/Microsoft.Insights/metrics?metricnames=UsedCapacity,Transactions,Ingress,Egress,SuccessServerLatency,SuccessE2ELatency,Availability&api-version=2021-05-01&interval=PT1H&timespan=' + encodeURIComponent(start_date) + '/' + encodeURIComponent(end_date),
                			'queueServices': '/queueServices/default/providers/Microsoft.Insights/metrics?metricnames=QueueCapacity,QueueCount,QueueMessageCount,Transactions,Ingress,Egress,SuccessServerLatency,SuccessE2ELatency,Availability&api-version=2021-05-01&interval=PT1H&timespan=' + encodeURIComponent(start_date) + '/' + encodeURIComponent(end_date)
                		};
                
                		Object.keys(endpoints).forEach(function (field) {
                			data[field] = {};
                			metrics = AzureStorage.request('https://management.azure.com' + AzureStorage.params.id + endpoints[field]);
                
                			if (!metrics.hasOwnProperty('value')) {
                				throw 'Failed getting required field. Check debug log for more information.';
                			}
                
                			for (k in metrics.value) {
                				key = AzureStorage.getField(metrics.value[k], 'name.value')
                				if (metrics.value[k].timeseries.length === 0) {
                					metrics.value[k].timeseries.push({ 'data': ['nodata'] })
                				}
                				data[field][key] = AzureStorage.getField(metrics.value[k], 'timeseries.0.data.0');
                			}
                		});
                		return data
                	}
                
                };
                
                try {
                	AzureStorage.setParams(JSON.parse(value));
                	return JSON.stringify(AzureStorage.getMetricsData());
                }
                catch (error) {
                	error += (String(error).endsWith('.')) ? '' : '.';
                	Zabbix.log(3, '[ Azure ] ERROR: ' + error);
                	return JSON.stringify({ 'error': error });
                }
              description: 'The HTTP API endpoint that returns storage metrics with the name `[{#NAME}]`.'
              timeout: '{$AZURE.DATA.TIMEOUT}'
              parameters:
                - name: id
                  value: '{#ID}'
                - name: proxy
                  value: '{$AZURE.PROXY}'
                - name: token
                  value: '{#TOKEN}'
              tags:
                - tag: component
                  value: raw
                - tag: component
                  value: storages
                - tag: storage
                  value: '{#NAME}'
            - uuid: 08ce66b39b084182bdb60a5556b88c88
              name: 'Storage account [{#NAME}]: Availability'
              type: DEPENDENT
              key: 'azure.storage.availability[{#NAME}]'
              value_type: FLOAT
              units: '%'
              description: |
                The percentage of availability for the storage service or a specified API operation.
                Availability is calculated by taking the `TotalBillableRequests` value and dividing it by the number of applicable requests, including those that produced unexpected errors.
                All unexpected errors result in reduced availability for the storage service or the specified API operation.
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.storageAccount.Availability.average
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3h
              master_item:
                key: 'azure.get.storage.acc[{#NAME}]'
              tags:
                - tag: component
                  value: storages
                - tag: metrics
                  value: common
                - tag: storage
                  value: '{#NAME}'
              trigger_prototypes:
                - uuid: 6a0b3edebded4d848ad76f86f8152377
                  expression: '(min(/Azure by HTTP/azure.storage.availability[{#NAME}],#3))<{$AZURE.STORAGE.ACC.AVAILABILITY:"{#NAME}"}'
                  name: 'Azure: Storage account [{#NAME}]: Availability is low'
                  event_name: 'Azure: Storage account [{#NAME} availability is too low (less than {$AZURE.STORAGE.ACC.AVAILABILITY:"{#NAME}"}%)'
                  opdata: '{ITEM.LASTVALUE1}'
                  priority: WARNING
                  tags:
                    - tag: scope
                      value: availability
            - uuid: 9ae0af76a37047f5ba84de2f43dfb5c4
              name: 'Storage account [{#NAME}]: Blob Availability'
              type: DEPENDENT
              key: 'azure.storage.blob.availability[{#NAME}]'
              value_type: FLOAT
              units: '%'
              description: |
                The percentage of availability for the storage service or a specified API operation.
                Availability is calculated by taking the `TotalBillableRequests` value and dividing it by the number of applicable requests, including those that produced unexpected errors.
                All unexpected errors result in reduced availability for the storage service or the specified API operation.
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.blobServices.Availability.average
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3h
              master_item:
                key: 'azure.get.storage.acc[{#NAME}]'
              tags:
                - tag: component
                  value: storages
                - tag: metrics
                  value: blob
                - tag: storage
                  value: '{#NAME}'
              trigger_prototypes:
                - uuid: 4cd8ac56b50c4120bf9de56bb1f06245
                  expression: '(min(/Azure by HTTP/azure.storage.blob.availability[{#NAME}],#3))<{$AZURE.STORAGE.ACC.BLOB.AVAILABILITY:"{#NAME}"}'
                  name: 'Azure: Storage account [{#NAME}]: Blob Availability is low'
                  event_name: 'Azure: Storage account [{#NAME} blob availability are too low (less than {$AZURE.STORAGE.ACC.BLOB.AVAILABILITY:"{#NAME}"}%)'
                  opdata: '{ITEM.LASTVALUE1}'
                  priority: WARNING
                  tags:
                    - tag: scope
                      value: availability
            - uuid: c6437ade4fee44f783ab379fb179508d
              name: 'Storage account [{#NAME}]: Blob Capacity'
              type: DEPENDENT
              key: 'azure.storage.blob.capacity[{#NAME}]'
              value_type: FLOAT
              units: B
              description: 'The amount of storage used by the blob service of the storage account with the name `[{#NAME}]`, expressed in bytes.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.blobServices.BlobCapacity.average
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3h
              master_item:
                key: 'azure.get.storage.acc[{#NAME}]'
              tags:
                - tag: component
                  value: storages
                - tag: metrics
                  value: blob
                - tag: storage
                  value: '{#NAME}'
            - uuid: 707be15f02a141548ce5f89097c303a0
              name: 'Storage account [{#NAME}]: Blob Container Count'
              type: DEPENDENT
              key: 'azure.storage.blob.container.count[{#NAME}]'
              description: 'The number of containers in the storage account with the name `[{#NAME}]`.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.blobServices.ContainerCount.average
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3h
              master_item:
                key: 'azure.get.storage.acc[{#NAME}]'
              tags:
                - tag: component
                  value: storages
                - tag: metrics
                  value: blob
                - tag: storage
                  value: '{#NAME}'
            - uuid: 9bd8b8f1b5844298a245d449548de46e
              name: 'Storage account [{#NAME}]: Blob Count'
              type: DEPENDENT
              key: 'azure.storage.blob.count[{#NAME}]'
              description: 'The number of blob objects stored in the storage account with the name `[{#NAME}]`.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.blobServices.BlobCount.average
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3h
              master_item:
                key: 'azure.get.storage.acc[{#NAME}]'
              tags:
                - tag: component
                  value: storages
                - tag: metrics
                  value: blob
                - tag: storage
                  value: '{#NAME}'
            - uuid: ae28bbd289644619b20b1907212d8293
              name: 'Storage account [{#NAME}]: Blob Egress'
              type: DEPENDENT
              key: 'azure.storage.blob.engress[{#NAME}]'
              value_type: FLOAT
              units: B
              description: |
                The amount of egress data. This number includes egress to external client from Azure Storage and also egress within Azure.
                As a result, this number does not reflect billable egress.
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.blobServices.Egress.total
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3h
              master_item:
                key: 'azure.get.storage.acc[{#NAME}]'
              tags:
                - tag: component
                  value: storages
                - tag: metrics
                  value: blob
                - tag: storage
                  value: '{#NAME}'
            - uuid: 8e73a2aba92444dd9c02c6f94227a4e5
              name: 'Storage account [{#NAME}]: Blob Index Capacity'
              type: DEPENDENT
              key: 'azure.storage.blob.index.capacity[{#NAME}]'
              value_type: FLOAT
              units: B
              description: 'The amount of storage with the name `[{#NAME}]` used by the Azure Data Lake Storage Gen2 hierarchical index.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.blobServices.IndexCapacity.average
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3h
              master_item:
                key: 'azure.get.storage.acc[{#NAME}]'
              tags:
                - tag: component
                  value: storages
                - tag: metrics
                  value: blob
                - tag: storage
                  value: '{#NAME}'
            - uuid: ff40325efb174839bef7bc775049837e
              name: 'Storage account [{#NAME}]: Blob Ingress'
              type: DEPENDENT
              key: 'azure.storage.blob.ingress[{#NAME}]'
              value_type: FLOAT
              units: B
              description: 'The amount of ingress data, expressed in bytes. This number includes ingress from an external client into Azure Storage and also ingress within Azure.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.blobServices.Ingress.total
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3h
              master_item:
                key: 'azure.get.storage.acc[{#NAME}]'
              tags:
                - tag: component
                  value: storages
                - tag: metrics
                  value: blob
                - tag: storage
                  value: '{#NAME}'
            - uuid: e17d6f2ed79c4b5eaa54730c82d6840f
              name: 'Storage account [{#NAME}]: Blob Success E2E Latency'
              type: DEPENDENT
              key: 'azure.storage.blob.success.e2e.latency[{#NAME}]'
              value_type: FLOAT
              units: s
              description: |
                The average end-to-end latency of successful requests made to a storage service or the specified API operation, expressed in milliseconds.
                This value includes the required processing time within Azure Storage to read the request, send the response, and receive acknowledgment of the response.
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.blobServices.SuccessE2ELatency.average
                  error_handler: DISCARD_VALUE
                - type: MULTIPLIER
                  parameters:
                    - '0.001'
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3h
              master_item:
                key: 'azure.get.storage.acc[{#NAME}]'
              tags:
                - tag: component
                  value: storages
                - tag: metrics
                  value: blob
                - tag: storage
                  value: '{#NAME}'
            - uuid: 727fb792fe5c4229995f7aa5bbb681ed
              name: 'Storage account [{#NAME}]: Blob Success Server Latency'
              type: DEPENDENT
              key: 'azure.storage.blob.success.server.latency[{#NAME}]'
              value_type: FLOAT
              units: s
              description: |
                The average time used to process a successful request by Azure Storage.
                This value does not include the network latency specified in `SuccessE2ELatency`.
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.blobServices.SuccessServerLatency.average
                  error_handler: DISCARD_VALUE
                - type: MULTIPLIER
                  parameters:
                    - '0.001'
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3h
              master_item:
                key: 'azure.get.storage.acc[{#NAME}]'
              tags:
                - tag: component
                  value: storages
                - tag: metrics
                  value: blob
                - tag: storage
                  value: '{#NAME}'
            - uuid: 48ecb880def34474b73a03eb895db3ea
              name: 'Storage account [{#NAME}]: Blob Transactions'
              type: DEPENDENT
              key: 'azure.storage.blob.transactions[{#NAME}]'
              description: |
                The number of requests made to the storage service or a specified API operation.
                This number includes successful and failed requests and also requests that produced errors.
                Use `ResponseType` dimension for the number of different types of responses.
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.blobServices.Transactions.total
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3h
              master_item:
                key: 'azure.get.storage.acc[{#NAME}]'
              tags:
                - tag: component
                  value: storages
                - tag: metrics
                  value: blob
                - tag: storage
                  value: '{#NAME}'
            - uuid: 4198807e1e08439a9009481ddcfd3bab
              name: 'Storage account [{#NAME}]: Egress'
              type: DEPENDENT
              key: 'azure.storage.engress[{#NAME}]'
              value_type: FLOAT
              units: B
              description: |
                The amount of egress data. This number includes egress to external client from Azure Storage and also egress within Azure.
                As a result, this number does not reflect billable egress.
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.storageAccount.Egress.total
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3h
              master_item:
                key: 'azure.get.storage.acc[{#NAME}]'
              tags:
                - tag: component
                  value: storages
                - tag: metrics
                  value: common
                - tag: storage
                  value: '{#NAME}'
            - uuid: 43069f165849449d8403d1a8c82fe634
              name: 'Storage account [{#NAME}]: File Capacity'
              type: DEPENDENT
              key: 'azure.storage.file.capacity[{#NAME}]'
              value_type: FLOAT
              units: B
              description: 'The amount of file storage used by the storage account with the name `[{#NAME}]`, expressed in bytes.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.fileServices.FileCapacity.average
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3h
              master_item:
                key: 'azure.get.storage.acc[{#NAME}]'
              tags:
                - tag: component
                  value: storages
                - tag: metrics
                  value: file
                - tag: storage
                  value: '{#NAME}'
            - uuid: 3483741c11a141c2866ea58a74a91135
              name: 'Storage account [{#NAME}]: File Count'
              type: DEPENDENT
              key: 'azure.storage.file.count[{#NAME}]'
              description: 'The number of files in the storage account with the name `[{#NAME}]`.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.fileServices.FileCount.average
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3h
              master_item:
                key: 'azure.get.storage.acc[{#NAME}]'
              tags:
                - tag: component
                  value: storages
                - tag: metrics
                  value: file
                - tag: storage
                  value: '{#NAME}'
            - uuid: 7f6d01573bf24d9889f41a14cb581075
              name: 'Storage account [{#NAME}]: File Egress'
              type: DEPENDENT
              key: 'azure.storage.file.engress[{#NAME}]'
              value_type: FLOAT
              units: B
              description: |
                The amount of egress data. This number includes egress to external client from Azure Storage and also egress within Azure.
                As a result, this number does not reflect billable egress.
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.fileServices.Egress.total
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3h
              master_item:
                key: 'azure.get.storage.acc[{#NAME}]'
              tags:
                - tag: component
                  value: storages
                - tag: metrics
                  value: file
                - tag: storage
                  value: '{#NAME}'
            - uuid: 9f9b6772f9d9478ba3be3a93c5408ba2
              name: 'Storage account [{#NAME}]: File Ingress'
              type: DEPENDENT
              key: 'azure.storage.file.ingress[{#NAME}]'
              value_type: FLOAT
              units: B
              description: 'The amount of ingress data, expressed in bytes. This number includes ingress from an external client into Azure Storage and also ingress within Azure.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.fileServices.Ingress.total
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3h
              master_item:
                key: 'azure.get.storage.acc[{#NAME}]'
              tags:
                - tag: component
                  value: storages
                - tag: metrics
                  value: file
                - tag: storage
                  value: '{#NAME}'
            - uuid: 4cb60e5473ce46a08bc962dc97c1f4db
              name: 'Storage account [{#NAME}]: File Share Capacity Quota'
              type: DEPENDENT
              key: 'azure.storage.file.share.capacity.quota[{#NAME}]'
              units: B
              description: 'The upper limit on the amount of storage that can be used by Azure Files Service, in bytes.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.fileServices.FileShareCapacityQuota.average
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3h
              master_item:
                key: 'azure.get.storage.acc[{#NAME}]'
              tags:
                - tag: component
                  value: storages
                - tag: metrics
                  value: file
                - tag: storage
                  value: '{#NAME}'
            - uuid: 220673a2e99a4108b034d04d79108231
              name: 'Storage account [{#NAME}]: File Share Count'
              type: DEPENDENT
              key: 'azure.storage.file.share.count[{#NAME}]'
              description: 'The number of file shares in the storage account.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.fileServices.FileShareCount.average
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3h
              master_item:
                key: 'azure.get.storage.acc[{#NAME}]'
              tags:
                - tag: component
                  value: storages
                - tag: metrics
                  value: file
                - tag: storage
                  value: '{#NAME}'
            - uuid: 47c48f39b9744a92ac13e9db69f6e629
              name: 'Storage account [{#NAME}]: File Share Snapshot Size'
              type: DEPENDENT
              key: 'azure.storage.file.share.snapshot.size[{#NAME}]'
              units: B
              description: 'The amount of storage used by the snapshots in storage account''s File service, in bytes.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.fileServices.FileShareSnapshotSize.average
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3h
              master_item:
                key: 'azure.get.storage.acc[{#NAME}]'
              tags:
                - tag: component
                  value: storages
                - tag: metrics
                  value: file
                - tag: storage
                  value: '{#NAME}'
            - uuid: f0394f8f2d55471c8ab557045349a6ec
              name: 'Storage account [{#NAME}]: File Share Snapshot Count'
              type: DEPENDENT
              key: 'azure.storage.file.shares.snapshot.count[{#NAME}]'
              description: 'The number of snapshots present on the share in storage account''s Files Service.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.fileServices.FileShareSnapshotCount.average
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3h
              master_item:
                key: 'azure.get.storage.acc[{#NAME}]'
              tags:
                - tag: component
                  value: storages
                - tag: metrics
                  value: file
                - tag: storage
                  value: '{#NAME}'
            - uuid: 431a6c51418d401697d105a0d9b62d23
              name: 'Storage account [{#NAME}]: File Success E2E Latency'
              type: DEPENDENT
              key: 'azure.storage.file.success.e2e.latency[{#NAME}]'
              value_type: FLOAT
              units: s
              description: |
                The average end-to-end latency of successful requests made to a storage service or the specified API operation, expressed in milliseconds.
                This value includes the required processing time within Azure Storage to read the request, send the response, and receive acknowledgment of the response.
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.fileServices.file.SuccessE2ELatency.average
                  error_handler: DISCARD_VALUE
                - type: MULTIPLIER
                  parameters:
                    - '0.001'
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3h
              master_item:
                key: 'azure.get.storage.acc[{#NAME}]'
              tags:
                - tag: component
                  value: storages
                - tag: metrics
                  value: file
                - tag: storage
                  value: '{#NAME}'
            - uuid: 43b6c0b948f64d9daada7aaac520c839
              name: 'Storage account [{#NAME}]: File Success Server Latency'
              type: DEPENDENT
              key: 'azure.storage.file.success.server.latency[{#NAME}]'
              value_type: FLOAT
              units: s
              description: |
                The average time used to process a successful request by Azure Storage.
                This value does not include the network latency specified in `SuccessE2ELatency`.
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.fileServices.SuccessServerLatency.average
                  error_handler: DISCARD_VALUE
                - type: MULTIPLIER
                  parameters:
                    - '0.001'
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3h
              master_item:
                key: 'azure.get.storage.acc[{#NAME}]'
              tags:
                - tag: component
                  value: storages
                - tag: metrics
                  value: file
                - tag: storage
                  value: '{#NAME}'
            - uuid: ed4b7ac10368493ba01c7cbeffba3042
              name: 'Storage account [{#NAME}]: File Transactions'
              type: DEPENDENT
              key: 'azure.storage.file.transactions[{#NAME}]'
              description: |
                The number of requests made to the storage service or a specified API operation.
                This number includes successful and failed requests and also requests that produced errors.
                Use `ResponseType` dimension for the number of different types of responses.
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.fileServices.Transactions.total
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3h
              master_item:
                key: 'azure.get.storage.acc[{#NAME}]'
              tags:
                - tag: component
                  value: storages
                - tag: metrics
                  value: file
                - tag: storage
                  value: '{#NAME}'
            - uuid: caeaa6805904471a8b18480f34ef9807
              name: 'Storage account [{#NAME}]: Ingress'
              type: DEPENDENT
              key: 'azure.storage.ingress[{#NAME}]'
              value_type: FLOAT
              units: B
              description: 'The amount of ingress data, expressed in bytes. This number includes ingress from an external client into Azure Storage and also ingress within Azure.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.storageAccount.Ingress.total
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3h
              master_item:
                key: 'azure.get.storage.acc[{#NAME}]'
              tags:
                - tag: component
                  value: storages
                - tag: metrics
                  value: common
                - tag: storage
                  value: '{#NAME}'
            - uuid: be8b82396ff243e8a52864069b192dea
              name: 'Storage account [{#NAME}]: Queue Capacity'
              type: DEPENDENT
              key: 'azure.storage.queue.capacity[{#NAME}]'
              value_type: FLOAT
              units: B
              description: 'The amount of queue storage used by the storage account with the name `[{#NAME}]`, expressed in bytes.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.queueServices.QueueCapacity.average
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3h
              master_item:
                key: 'azure.get.storage.acc[{#NAME}]'
              tags:
                - tag: component
                  value: storages
                - tag: metrics
                  value: queue
                - tag: storage
                  value: '{#NAME}'
            - uuid: 9174d372235e4d14a4896a79ddcbc051
              name: 'Storage account [{#NAME}]: Queue Count'
              type: DEPENDENT
              key: 'azure.storage.queue.count[{#NAME}]'
              description: 'The number of queues in the storage account with the name `[{#NAME}]`.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.queueServices.QueueCount.average
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3h
              master_item:
                key: 'azure.get.storage.acc[{#NAME}]'
              tags:
                - tag: component
                  value: storages
                - tag: metrics
                  value: queue
                - tag: storage
                  value: '{#NAME}'
            - uuid: b8cff599c4194b4abd74f4a27ca93284
              name: 'Storage account [{#NAME}]: Queue Egress'
              type: DEPENDENT
              key: 'azure.storage.queue.engress[{#NAME}]'
              value_type: FLOAT
              units: B
              description: |
                The amount of egress data. This number includes egress to external client from Azure Storage and also egress within Azure.
                As a result, this number does not reflect billable egress.
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.queueServices.Egress.total
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3h
              master_item:
                key: 'azure.get.storage.acc[{#NAME}]'
              tags:
                - tag: component
                  value: storages
                - tag: metrics
                  value: queue
                - tag: storage
                  value: '{#NAME}'
            - uuid: 599f612c3cc64e81a53d507ae0078ab1
              name: 'Storage account [{#NAME}]: Queue Ingress'
              type: DEPENDENT
              key: 'azure.storage.queue.ingress[{#NAME}]'
              value_type: FLOAT
              units: B
              description: 'The amount of ingress data, expressed in bytes. This number includes ingress from an external client into Azure Storage and also ingress within Azure.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.queueServices.Ingress.total
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3h
              master_item:
                key: 'azure.get.storage.acc[{#NAME}]'
              tags:
                - tag: component
                  value: storages
                - tag: metrics
                  value: queue
                - tag: storage
                  value: '{#NAME}'
            - uuid: 70c7b436a03145c5ab694b3a20ac52b1
              name: 'Storage account [{#NAME}]: Queue Message Count'
              type: DEPENDENT
              key: 'azure.storage.queue.message.count[{#NAME}]'
              description: 'The number of unexpired queue messages in the storage account with the name `[{#NAME}]`.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.queueServices.QueueMessageCount.average
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3h
              master_item:
                key: 'azure.get.storage.acc[{#NAME}]'
              tags:
                - tag: component
                  value: storages
                - tag: metrics
                  value: queue
                - tag: storage
                  value: '{#NAME}'
            - uuid: eccdbf48412e4c28afc3bbf87c545cc2
              name: 'Storage account [{#NAME}]: Queue Success E2E Latency'
              type: DEPENDENT
              key: 'azure.storage.queue.success.e2e.latency[{#NAME}]'
              value_type: FLOAT
              units: s
              description: |
                The average end-to-end latency of successful requests made to a storage service or the specified API operation, expressed in milliseconds.
                This value includes the required processing time within Azure Storage to read the request, send the response, and receive acknowledgment of the response.
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.queueServices.queue.SuccessE2ELatency.average
                  error_handler: DISCARD_VALUE
                - type: MULTIPLIER
                  parameters:
                    - '0.001'
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3h
              master_item:
                key: 'azure.get.storage.acc[{#NAME}]'
              tags:
                - tag: component
                  value: storages
                - tag: metrics
                  value: queue
                - tag: storage
                  value: '{#NAME}'
            - uuid: 4d9aa2753d944690b01a23bcd44fd52d
              name: 'Storage account [{#NAME}]: Queue Success Server Latency'
              type: DEPENDENT
              key: 'azure.storage.queue.success.server.latency[{#NAME}]'
              value_type: FLOAT
              units: s
              description: |
                The average time used to process a successful request by Azure Storage.
                This value does not include the network latency specified in `SuccessE2ELatency`.
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.queueServices.SuccessServerLatency.average
                  error_handler: DISCARD_VALUE
                - type: MULTIPLIER
                  parameters:
                    - '0.001'
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3h
              master_item:
                key: 'azure.get.storage.acc[{#NAME}]'
              tags:
                - tag: component
                  value: storages
                - tag: metrics
                  value: queue
                - tag: storage
                  value: '{#NAME}'
            - uuid: e472739df4634b55be2466bd91af9886
              name: 'Storage account [{#NAME}]: Queue Transactions'
              type: DEPENDENT
              key: 'azure.storage.queue.transactions[{#NAME}]'
              description: |
                The number of requests made to the storage service or a specified API operation.
                This number includes successful and failed requests and also requests that produced errors.
                Use `ResponseType` dimension for the number of different types of responses.
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.queueServices.Transactions.total
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3h
              master_item:
                key: 'azure.get.storage.acc[{#NAME}]'
              tags:
                - tag: component
                  value: storages
                - tag: metrics
                  value: queue
                - tag: storage
                  value: '{#NAME}'
            - uuid: 48437de0bdca4f5392c295ca8b82bd0a
              name: 'Storage account [{#NAME}]: Success E2E Latency'
              type: DEPENDENT
              key: 'azure.storage.success.e2e.latency[{#NAME}]'
              value_type: FLOAT
              units: s
              description: |
                The average end-to-end latency of successful requests made to a storage service or the specified API operation, expressed in milliseconds.
                This value includes the required processing time within Azure Storage to read the request, send the response, and receive acknowledgment of the response.
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.storageAccount.SuccessE2ELatency.average
                  error_handler: DISCARD_VALUE
                - type: MULTIPLIER
                  parameters:
                    - '0.001'
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3h
              master_item:
                key: 'azure.get.storage.acc[{#NAME}]'
              tags:
                - tag: component
                  value: storages
                - tag: metrics
                  value: common
                - tag: storage
                  value: '{#NAME}'
            - uuid: 7076dbfb45cd49828b96064aa892e8e4
              name: 'Storage account [{#NAME}]: Success Server Latency'
              type: DEPENDENT
              key: 'azure.storage.success.server.latency[{#NAME}]'
              value_type: FLOAT
              units: s
              description: |
                The average time used to process a successful request by Azure Storage.
                This value does not include the network latency specified in `SuccessE2ELatency`.
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.storageAccount.SuccessServerLatency.average
                  error_handler: DISCARD_VALUE
                - type: MULTIPLIER
                  parameters:
                    - '0.001'
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3h
              master_item:
                key: 'azure.get.storage.acc[{#NAME}]'
              tags:
                - tag: component
                  value: storages
                - tag: metrics
                  value: common
                - tag: storage
                  value: '{#NAME}'
            - uuid: 918f1d1c70964e7c9f5521cf99bbb21d
              name: 'Storage account [{#NAME}]: Table Availability'
              type: DEPENDENT
              key: 'azure.storage.table.availability[{#NAME}]'
              value_type: FLOAT
              units: '%'
              description: |
                The percentage of availability for the storage service or a specified API operation.
                Availability is calculated by taking the `TotalBillableRequests` value and dividing it by the number of applicable requests, including those that produced unexpected errors.
                All unexpected errors result in reduced availability for the storage service or the specified API operation.
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.tableServices.Availability.average
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3h
              master_item:
                key: 'azure.get.storage.acc[{#NAME}]'
              tags:
                - tag: component
                  value: storages
                - tag: metrics
                  value: table
                - tag: storage
                  value: '{#NAME}'
              trigger_prototypes:
                - uuid: bfb1e82685224048ba8082447cad57ca
                  expression: '(min(/Azure by HTTP/azure.storage.table.availability[{#NAME}],#3))<{$AZURE.STORAGE.ACC.TABLE.AVAILABILITY:"{#NAME}"}'
                  name: 'Azure: Storage account [{#NAME}]: Table Availability is low'
                  event_name: 'Azure: Storage account [{#NAME} table availability is too low (less than {$AZURE.STORAGE.ACC.TABLE.AVAILABILITY:"{#NAME}"}%)'
                  opdata: '{ITEM.LASTVALUE1}'
                  priority: WARNING
                  tags:
                    - tag: scope
                      value: availability
            - uuid: ee19a3857a7a4650952eb855193991ee
              name: 'Storage account [{#NAME}]: Table Capacity'
              type: DEPENDENT
              key: 'azure.storage.table.capacity[{#NAME}]'
              value_type: FLOAT
              units: B
              description: 'The amount of storage used by the table service of the storage account with the name `[{#NAME}]`, expressed in bytes.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.tableServices.TableCapacity.average
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3h
              master_item:
                key: 'azure.get.storage.acc[{#NAME}]'
              tags:
                - tag: component
                  value: storages
                - tag: metrics
                  value: table
                - tag: storage
                  value: '{#NAME}'
            - uuid: a3d11321b1cc4c1b9c322c0a7162e76e
              name: 'Storage account [{#NAME}]: Table Count'
              type: DEPENDENT
              key: 'azure.storage.table.count[{#NAME}]'
              description: 'The number of tables in the storage account with the name `[{#NAME}]`.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.tableServices.TableCount.average
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3h
              master_item:
                key: 'azure.get.storage.acc[{#NAME}]'
              tags:
                - tag: component
                  value: storages
                - tag: metrics
                  value: table
                - tag: storage
                  value: '{#NAME}'
            - uuid: d75bd57fdd9f4377aea7c1e52a109c18
              name: 'Storage account [{#NAME}]: Table Egress'
              type: DEPENDENT
              key: 'azure.storage.table.engress[{#NAME}]'
              value_type: FLOAT
              units: B
              description: |
                The amount of egress data. This number includes egress to external client from Azure Storage and also egress within Azure.
                As a result, this number does not reflect billable egress.
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.tableServices.Egress.total
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3h
              master_item:
                key: 'azure.get.storage.acc[{#NAME}]'
              tags:
                - tag: component
                  value: storages
                - tag: metrics
                  value: table
                - tag: storage
                  value: '{#NAME}'
            - uuid: f2911504457b4d329ae7cf7d7a24594a
              name: 'Storage account [{#NAME}]: Table Entity Count'
              type: DEPENDENT
              key: 'azure.storage.table.entity.count[{#NAME}]'
              description: 'The number of table entities in the storage account with the name `[{#NAME}]`.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.tableServices.TableEntityCount.average
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3h
              master_item:
                key: 'azure.get.storage.acc[{#NAME}]'
              tags:
                - tag: component
                  value: storages
                - tag: metrics
                  value: table
                - tag: storage
                  value: '{#NAME}'
            - uuid: 993ca2e5bcd74d27b19998d77f0abec8
              name: 'Storage account [{#NAME}]: Table Ingress'
              type: DEPENDENT
              key: 'azure.storage.table.ingress[{#NAME}]'
              value_type: FLOAT
              units: B
              description: 'The amount of ingress data, expressed in bytes. This number includes ingress from an external client into Azure Storage and also ingress within Azure.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.tableServices.Ingress.total
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3h
              master_item:
                key: 'azure.get.storage.acc[{#NAME}]'
              tags:
                - tag: component
                  value: storages
                - tag: metrics
                  value: table
                - tag: storage
                  value: '{#NAME}'
            - uuid: 00c441cc77f4447584d4bffbefc304e0
              name: 'Storage account [{#NAME}]: Table Success E2E Latency'
              type: DEPENDENT
              key: 'azure.storage.table.success.e2e.latency[{#NAME}]'
              value_type: FLOAT
              units: s
              description: |
                The average end-to-end latency of successful requests made to a storage service or the specified API operation, expressed in milliseconds.
                This value includes the required processing time within Azure Storage to read the request, send the response, and receive acknowledgment of the response.
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.tableServices.SuccessE2ELatency.average
                  error_handler: DISCARD_VALUE
                - type: MULTIPLIER
                  parameters:
                    - '0.001'
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3h
              master_item:
                key: 'azure.get.storage.acc[{#NAME}]'
              tags:
                - tag: component
                  value: storages
                - tag: metrics
                  value: table
                - tag: storage
                  value: '{#NAME}'
            - uuid: f29e3ad4be034f38932cb85654397926
              name: 'Storage account [{#NAME}]: Table Success Server Latency'
              type: DEPENDENT
              key: 'azure.storage.table.success.server.latency[{#NAME}]'
              value_type: FLOAT
              units: s
              description: |
                The average time used to process a successful request by Azure Storage.
                This value does not include the network latency specified in `SuccessE2ELatency`.
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.tableServices.SuccessServerLatency.average
                  error_handler: DISCARD_VALUE
                - type: MULTIPLIER
                  parameters:
                    - '0.001'
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3h
              master_item:
                key: 'azure.get.storage.acc[{#NAME}]'
              tags:
                - tag: component
                  value: storages
                - tag: metrics
                  value: table
                - tag: storage
                  value: '{#NAME}'
            - uuid: 9ba25e87c5bb466a99855a9fb893283d
              name: 'Storage account [{#NAME}]: Table Transactions'
              type: DEPENDENT
              key: 'azure.storage.table.transactions[{#NAME}]'
              description: |
                The number of requests made to the storage service or a specified API operation.
                This number includes successful and failed requests and also requests that produced errors.
                Use `ResponseType` dimension for the number of different types of responses.
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.tableServices.Transactions.total
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3h
              master_item:
                key: 'azure.get.storage.acc[{#NAME}]'
              tags:
                - tag: component
                  value: storages
                - tag: metrics
                  value: table
                - tag: storage
                  value: '{#NAME}'
            - uuid: 6f68f0d8a63640ffa549fde44e8fe56c
              name: 'Storage account [{#NAME}]: Transactions'
              type: DEPENDENT
              key: 'azure.storage.transactions[{#NAME}]'
              description: |
                The number of requests made to the storage service or a specified API operation.
                This number includes successful and failed requests and also requests that produced errors.
                Use `ResponseType` dimension for the number of different types of responses.
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.storageAccount.Transactions.total
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3h
              master_item:
                key: 'azure.get.storage.acc[{#NAME}]'
              tags:
                - tag: component
                  value: storages
                - tag: metrics
                  value: common
                - tag: storage
                  value: '{#NAME}'
            - uuid: 08ef07d874db4823bd167482bf049916
              name: 'Storage account [{#NAME}]: Used Capacity'
              type: DEPENDENT
              key: 'azure.storage.used.capacity[{#NAME}]'
              value_type: FLOAT
              units: B
              description: |
                The amount of storage used by the storage account with the name `[{#NAME}]`, expressed in bytes.
                For standard storage accounts, it's the sum of capacity used by blob, table, file, and queue.
                For premium storage accounts and blob storage accounts, it is the same as BlobCapacity or FileCapacity.
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.storageAccount.UsedCapacity.average
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3h
              master_item:
                key: 'azure.get.storage.acc[{#NAME}]'
              tags:
                - tag: component
                  value: storages
                - tag: metrics
                  value: common
                - tag: storage
                  value: '{#NAME}'
          graph_prototypes:
            - uuid: d569e0daf1974df58584432805f95557
              name: 'Azure: Capacity by storage [{#NAME}]'
              graph_items:
                - color: 199C0D
                  item:
                    host: 'Azure by HTTP'
                    key: 'azure.storage.used.capacity[{#NAME}]'
                - sortorder: '1'
                  color: F63100
                  item:
                    host: 'Azure by HTTP'
                    key: 'azure.storage.blob.capacity[{#NAME}]'
                - sortorder: '2'
                  color: 00611C
                  item:
                    host: 'Azure by HTTP'
                    key: 'azure.storage.table.capacity[{#NAME}]'
                - sortorder: '3'
                  color: F7941D
                  item:
                    host: 'Azure by HTTP'
                    key: 'azure.storage.file.capacity[{#NAME}]'
                - sortorder: '4'
                  color: FC6EA3
                  item:
                    host: 'Azure by HTTP'
                    key: 'azure.storage.queue.capacity[{#NAME}]'
            - uuid: 6bae0cf983104e0fada61468902949e1
              name: 'Azure: Storage account [{#NAME}] egress'
              graph_items:
                - color: 199C0D
                  item:
                    host: 'Azure by HTTP'
                    key: 'azure.storage.engress[{#NAME}]'
                - sortorder: '1'
                  color: F63100
                  item:
                    host: 'Azure by HTTP'
                    key: 'azure.storage.blob.engress[{#NAME}]'
                - sortorder: '2'
                  color: 00611C
                  item:
                    host: 'Azure by HTTP'
                    key: 'azure.storage.table.engress[{#NAME}]'
                - sortorder: '3'
                  color: F7941D
                  item:
                    host: 'Azure by HTTP'
                    key: 'azure.storage.file.engress[{#NAME}]'
                - sortorder: '4'
                  color: FC6EA3
                  item:
                    host: 'Azure by HTTP'
                    key: 'azure.storage.queue.engress[{#NAME}]'
            - uuid: 8860c37426104045a7f9feb6cc370db4
              name: 'Azure: Storage account [{#NAME}] ingress'
              graph_items:
                - color: 199C0D
                  item:
                    host: 'Azure by HTTP'
                    key: 'azure.storage.ingress[{#NAME}]'
                - sortorder: '1'
                  color: F63100
                  item:
                    host: 'Azure by HTTP'
                    key: 'azure.storage.blob.ingress[{#NAME}]'
                - sortorder: '2'
                  color: 00611C
                  item:
                    host: 'Azure by HTTP'
                    key: 'azure.storage.table.ingress[{#NAME}]'
                - sortorder: '3'
                  color: F7941D
                  item:
                    host: 'Azure by HTTP'
                    key: 'azure.storage.file.ingress[{#NAME}]'
                - sortorder: '4'
                  color: FC6EA3
                  item:
                    host: 'Azure by HTTP'
                    key: 'azure.storage.queue.ingress[{#NAME}]'
            - uuid: 9c87dfb9ed7e4c1ea32c8e35c6e23381
              name: 'Azure: Transactions by storage [{#NAME}]'
              graph_items:
                - color: 199C0D
                  item:
                    host: 'Azure by HTTP'
                    key: 'azure.storage.transactions[{#NAME}]'
                - sortorder: '1'
                  color: F63100
                  item:
                    host: 'Azure by HTTP'
                    key: 'azure.storage.blob.transactions[{#NAME}]'
                - sortorder: '2'
                  color: 00611C
                  item:
                    host: 'Azure by HTTP'
                    key: 'azure.storage.table.transactions[{#NAME}]'
                - sortorder: '3'
                  color: F7941D
                  item:
                    host: 'Azure by HTTP'
                    key: 'azure.storage.file.transactions[{#NAME}]'
                - sortorder: '4'
                  color: FC6EA3
                  item:
                    host: 'Azure by HTTP'
                    key: 'azure.storage.queue.transactions[{#NAME}]'
          master_item:
            key: azure.get.storage.acc
          lld_macro_paths:
            - lld_macro: '{#GROUP}'
              path: $.resourceGroup
            - lld_macro: '{#ID}'
              path: $.id
            - lld_macro: '{#LOCATION}'
              path: $.location
            - lld_macro: '{#NAME}'
              path: $.name
            - lld_macro: '{#TOKEN}'
              path: $.token
          preprocessing:
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 6h
        - uuid: b00b92f713724eaa9f028acf244527a6
          name: 'Azure Vault discovery'
          type: DEPENDENT
          key: azure.vault.discovery
          filter:
            evaltype: AND
            conditions:
              - macro: '{#GROUP}'
                value: '{$AZURE.RESOURCE.GROUP.MATCHES}'
              - macro: '{#GROUP}'
                value: '{$AZURE.RESOURCE.GROUP.NOT.MATCHES}'
                operator: NOT_MATCHES_REGEX
              - macro: '{#LOCATION}'
                value: '{$AZURE.VAULT.LOCATION.MATCHES}'
              - macro: '{#LOCATION}'
                value: '{$AZURE.VAULT.LOCATION.NOT.MATCHES}'
                operator: NOT_MATCHES_REGEX
              - macro: '{#NAME}'
                value: '{$AZURE.VAULT.NAME.MATCHES}'
              - macro: '{#NAME}'
                value: '{$AZURE.VAULT.NAME.NOT.MATCHES}'
                operator: NOT_MATCHES_REGEX
              - macro: '{#TYPE}'
                value: '^Microsoft.*(v|V)aults$'
          description: 'The list of Azure Recovery Services and Backup vaults provided by the subscription.'
          host_prototypes:
            - uuid: fb057eebe3fb4d2483c8a3e7fe4c7b07
              host: 'Azure vault {#NAME}'
              name: 'Azure vault {#NAME}'
              group_links:
                - group:
                    name: Applications
              templates:
                - name: 'Azure Backup Jobs by HTTP'
              macros:
                - macro: '{$AZURE.RESOURCE.ID}'
                  value: '{#ID}'
              tags:
                - tag: location
                  value: '{#LOCATION}'
                - tag: resource-group
                  value: '{#GROUP}'
          master_item:
            key: azure.get.resources
          lld_macro_paths:
            - lld_macro: '{#GROUP}'
              path: $.resourceGroup
            - lld_macro: '{#ID}'
              path: $.id
            - lld_macro: '{#LOCATION}'
              path: $.location
            - lld_macro: '{#NAME}'
              path: $.name
            - lld_macro: '{#TYPE}'
              path: $.type
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.resources.value
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 6h
        - uuid: f9386233186648ce828f406c52972ce5
          name: 'Virtual machines discovery'
          type: DEPENDENT
          key: azure.vm.discovery
          filter:
            evaltype: AND
            conditions:
              - macro: '{#GROUP}'
                value: '{$AZURE.RESOURCE.GROUP.MATCHES}'
              - macro: '{#GROUP}'
                value: '{$AZURE.RESOURCE.GROUP.NOT.MATCHES}'
                operator: NOT_MATCHES_REGEX
              - macro: '{#LOCATION}'
                value: '{$AZURE.VM.LOCATION.MATCHES}'
              - macro: '{#LOCATION}'
                value: '{$AZURE.VM.LOCATION.NOT.MATCHES}'
                operator: NOT_MATCHES_REGEX
              - macro: '{#NAME}'
                value: '{$AZURE.VM.NAME.MATCHES}'
              - macro: '{#NAME}'
                value: '{$AZURE.VM.NAME.NOT.MATCHES}'
                operator: NOT_MATCHES_REGEX
              - macro: '{#SCALESET}'
                operator: NOT_EXISTS
              - macro: '{#TYPE}'
                value: ^Microsoft.Compute/virtualMachines$
          description: 'The list of virtual machines provided by the subscription.'
          host_prototypes:
            - uuid: d08c0ee33c924b28bf1fed571da6c7f4
              host: 'Azure virtual machine {#NAME}'
              name: 'Azure virtual machine {#NAME}'
              group_links:
                - group:
                    name: 'Virtual machines'
              templates:
                - name: 'Azure Virtual Machine by HTTP'
              macros:
                - macro: '{$AZURE.RESOURCE.ID}'
                  value: '{#ID}'
              tags:
                - tag: location
                  value: '{#LOCATION}'
                - tag: os
                  value: '{#OS}'
                - tag: resource-group
                  value: '{#GROUP}'
                - tag: size
                  value: '{#SIZE}'
          master_item:
            key: azure.get.resources
          lld_macro_paths:
            - lld_macro: '{#GROUP}'
              path: $.resourceGroup
            - lld_macro: '{#ID}'
              path: $.id
            - lld_macro: '{#LOCATION}'
              path: $.location
            - lld_macro: '{#NAME}'
              path: $.name
            - lld_macro: '{#OS}'
              path: $.properties.storageProfile.osDisk.osType
            - lld_macro: '{#SCALESET}'
              path: $.properties.virtualMachineScaleSet
            - lld_macro: '{#SIZE}'
              path: $.properties.hardwareProfile.vmSize
            - lld_macro: '{#TYPE}'
              path: $.type
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.resources.value
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 6h
        - uuid: a568b6231c2346a0b6376a4e9ac9ad3a
          name: 'Azure Workspace discovery'
          type: DEPENDENT
          key: azure.workspace.discovery
          filter:
            evaltype: AND
            conditions:
              - macro: '{#GROUP}'
                value: '{$AZURE.RESOURCE.GROUP.MATCHES}'
              - macro: '{#GROUP}'
                value: '{$AZURE.RESOURCE.GROUP.NOT.MATCHES}'
                operator: NOT_MATCHES_REGEX
              - macro: '{#LOCATION}'
                value: '{$AZURE.WORKSPACE.LOCATION.MATCHES}'
              - macro: '{#LOCATION}'
                value: '{$AZURE.WORKSPACE.LOCATION.NOT.MATCHES}'
                operator: NOT_MATCHES_REGEX
              - macro: '{#NAME}'
                value: '{$AZURE.WORKSPACE.NAME.MATCHES}'
              - macro: '{#NAME}'
                value: '{$AZURE.WORKSPACE.NAME.NOT.MATCHES}'
                operator: NOT_MATCHES_REGEX
              - macro: '{#TYPE}'
                value: ^Microsoft.OperationalInsights/workspaces$
          description: 'The list of Azure workspaces provided by the subscription.'
          host_prototypes:
            - uuid: adfc06e7becd410c837fbbf8fddfb510
              host: 'Azure workspace {#NAME}'
              name: 'Azure workspace {#NAME}'
              group_links:
                - group:
                    name: Applications
              templates:
                - name: 'Azure Sentinel by HTTP'
              macros:
                - macro: '{$AZURE.RESOURCE.ID}'
                  value: '{#ID}'
              tags:
                - tag: location
                  value: '{#LOCATION}'
                - tag: resource-group
                  value: '{#GROUP}'
          master_item:
            key: azure.get.resources
          lld_macro_paths:
            - lld_macro: '{#GROUP}'
              path: $.resourceGroup
            - lld_macro: '{#ID}'
              path: $.id
            - lld_macro: '{#LOCATION}'
              path: $.location
            - lld_macro: '{#NAME}'
              path: $.name
            - lld_macro: '{#TYPE}'
              path: $.type
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.resources.value
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 6h
      tags:
        - tag: class
          value: cloud
        - tag: subclass
          value: automation
        - tag: subclass
          value: computing
        - tag: subclass
          value: containers
        - tag: subclass
          value: deploy
        - tag: subclass
          value: security
        - tag: subclass
          value: virtualization
        - tag: target
          value: azure
      macros:
        - macro: '{$AZURE.APP.ID}'
          description: 'The App ID of Microsoft Azure.'
          config:
            type: TEXT
            priority: '3'
            label: 'Azure App ID'
            description: 'Microsoft Azure App ID.'
            required: 'YES'
        - macro: '{$AZURE.COSMOS.MONGO.DB.LOCATION.MATCHES}'
          value: '.*'
          description: 'This macro is used in Microsoft Cosmos DB account discovery rule.'
          config:
            type: TEXT
            priority: '47'
            section_name: Filters
            label: 'Include Cosmos DB account location filter'
            description: 'Regex string to include discovered Cosmos DB account locations by name.'
        - macro: '{$AZURE.COSMOS.MONGO.DB.LOCATION.NOT.MATCHES}'
          value: CHANGE_IF_NEEDED
          description: 'This macro is used in Microsoft Cosmos DB account discovery rule.'
          config:
            type: TEXT
            priority: '48'
            section_name: Filters
            label: 'Exclude Cosmos DB account location filter'
            description: 'Regex string to exclude discovered Cosmos DB account locations by name.'
        - macro: '{$AZURE.COSMOS.MONGO.DB.NAME.MATCHES}'
          value: '.*'
          description: 'This macro is used in Microsoft Cosmos DB account discovery rule.'
          config:
            type: TEXT
            priority: '45'
            section_name: Filters
            label: 'Include Cosmos DB account filter'
            description: 'Regex string to include discovered Cosmos DB accounts by name.'
        - macro: '{$AZURE.COSMOS.MONGO.DB.NAME.NOT.MATCHES}'
          value: CHANGE_IF_NEEDED
          description: 'This macro is used in Microsoft Cosmos DB account discovery rule.'
          config:
            type: TEXT
            priority: '46'
            section_name: Filters
            label: 'Exclude Cosmos DB account filter'
            description: 'Regex string to exclude discovered Cosmos DB accounts by name.'
        - macro: '{$AZURE.DATA.TIMEOUT}'
          value: 15s
          description: 'API response timeout.'
          config:
            type: TEXT
            priority: '5'
            section_name: Other
            label: 'API timeout'
            description: 'API response timeout, in seconds.'
        - macro: '{$AZURE.MSSQL.DB.LOCATION.MATCHES}'
          value: '.*'
          description: 'This macro is used in Microsoft SQL databases discovery rule.'
          config:
            type: TEXT
            priority: '42'
            section_name: Filters
            label: 'Include MSSQL database location filter'
            description: 'Regex string to include discovered MSSQL database locations by name.'
        - macro: '{$AZURE.MSSQL.DB.LOCATION.NOT.MATCHES}'
          value: CHANGE_IF_NEEDED
          description: 'This macro is used in Microsoft SQL databases discovery rule.'
          config:
            type: TEXT
            priority: '43'
            section_name: Filters
            label: 'Exclude MSSQL database location filter'
            description: 'Regex string to exclude discovered MSSQL database locations by name.'
        - macro: '{$AZURE.MSSQL.DB.NAME.MATCHES}'
          value: '.*'
          description: 'This macro is used in Microsoft SQL databases discovery rule.'
          config:
            type: TEXT
            priority: '40'
            section_name: Filters
            label: 'Include MSSQL database filter'
            description: 'Regex string to include discovered MSSQL databases by name.'
        - macro: '{$AZURE.MSSQL.DB.NAME.NOT.MATCHES}'
          value: CHANGE_IF_NEEDED
          description: 'This macro is used in Microsoft SQL databases discovery rule.'
          config:
            type: TEXT
            priority: '41'
            section_name: Filters
            label: 'Exclude MSSQL database filter'
            description: 'Regex string to exclude discovered MSSQL databases by name.'
        - macro: '{$AZURE.MSSQL.DB.SIZE.NOT.MATCHES}'
          value: ^System$
          description: 'This macro is used in Microsoft SQL databases discovery rule.'
          config:
            type: TEXT
            priority: '44'
            section_name: Filters
            label: 'Exclude MSSQL database SKU type filter'
            description: 'Regex string to exclude discovered MSSQL database locations by SKU type.'
        - macro: '{$AZURE.MYSQL.DB.LOCATION.MATCHES}'
          value: '.*'
          description: 'This macro is used in MySQL servers discovery rule.'
          config:
            type: TEXT
            priority: '34'
            section_name: Filters
            label: 'Include MySQL server location filter'
            description: 'Regex string to include discovered MySQL server locations by name.'
        - macro: '{$AZURE.MYSQL.DB.LOCATION.NOT.MATCHES}'
          value: CHANGE_IF_NEEDED
          description: 'This macro is used in MySQL servers discovery rule.'
          config:
            type: TEXT
            priority: '35'
            section_name: Filters
            label: 'Exclude MySQL server location filter'
            description: 'Regex string to exclude discovered MySQL server locations by name.'
        - macro: '{$AZURE.MYSQL.DB.NAME.MATCHES}'
          value: '.*'
          description: 'This macro is used in MySQL servers discovery rule.'
          config:
            type: TEXT
            priority: '32'
            section_name: Filters
            label: 'Include MySQL server filter'
            description: 'Regex string to include discovered MySQL servers by name.'
        - macro: '{$AZURE.MYSQL.DB.NAME.NOT.MATCHES}'
          value: CHANGE_IF_NEEDED
          description: 'This macro is used in MySQL servers discovery rule.'
          config:
            type: TEXT
            priority: '33'
            section_name: Filters
            label: 'Exclude MySQL server filter'
            description: 'Regex string to exclude discovered MySQL servers by name.'
        - macro: '{$AZURE.PASSWORD}'
          type: SECRET_TEXT
          description: 'Microsoft Azure password.'
          config:
            type: TEXT
            priority: '4'
            label: 'Azure password'
            description: 'Microsoft Azure password.'
            required: 'YES'
        - macro: '{$AZURE.PGSQL.DB.LOCATION.MATCHES}'
          value: '.*'
          description: 'This macro is used in PostgreSQL servers discovery rule.'
          config:
            type: TEXT
            priority: '38'
            section_name: Filters
            label: 'Include PostgreSQL server location filter'
            description: 'Regex string to include discovered PostgreSQL server locations by name.'
        - macro: '{$AZURE.PGSQL.DB.LOCATION.NOT.MATCHES}'
          value: CHANGE_IF_NEEDED
          description: 'This macro is used in PostgreSQL servers discovery rule.'
          config:
            type: TEXT
            priority: '39'
            section_name: Filters
            label: 'Exclude PostgreSQL server location filter'
            description: 'Regex string to exclude discovered PostgreSQL server locations by name.'
        - macro: '{$AZURE.PGSQL.DB.NAME.MATCHES}'
          value: '.*'
          description: 'This macro is used in PostgreSQL servers discovery rule.'
          config:
            type: TEXT
            priority: '36'
            section_name: Filters
            label: 'Include PostgreSQL server filter'
            description: 'Regex string to include discovered PostgreSQL servers by name.'
        - macro: '{$AZURE.PGSQL.DB.NAME.NOT.MATCHES}'
          value: CHANGE_IF_NEEDED
          description: 'This macro is used in PostgreSQL servers discovery rule.'
          config:
            type: TEXT
            priority: '37'
            section_name: Filters
            label: 'Exclude PostgreSQL server filter'
            description: 'Regex string to exclude discovered PostgreSQL servers by name.'
        - macro: '{$AZURE.PROXY}'
          description: 'Sets the HTTP proxy value. If this macro is empty, then no proxy is used.'
          config:
            type: TEXT
            priority: '6'
            section_name: Other
            label: 'HTTP proxy'
            description: 'HTTP proxy to use for requests.'
        - macro: '{$AZURE.RESOURCE.GROUP.MATCHES}'
          value: '.*'
          description: 'This macro is used in discovery rules.'
          config:
            type: TEXT
            priority: '30'
            section_name: Filters
            label: 'Include resource group filter'
            description: 'Regex string to include discovered resource groups by name.'
        - macro: '{$AZURE.RESOURCE.GROUP.NOT.MATCHES}'
          value: CHANGE_IF_NEEDED
          description: 'This macro is used in discovery rules.'
          config:
            type: TEXT
            priority: '31'
            section_name: Filters
            label: 'Exclude resource group filter'
            description: 'Regex string to exclude discovered resource groups by name.'
        - macro: '{$AZURE.SCALESET.LOCATION.MATCHES}'
          value: '.*'
          description: 'This macro is used in virtual machine scale sets discovery rule.'
          config:
            type: TEXT
            priority: '13'
            section_name: Filters
            label: 'Include VM scale set location filter'
            description: 'Regex string to include discovered VM scale set locations by name.'
        - macro: '{$AZURE.SCALESET.LOCATION.NOT.MATCHES}'
          value: CHANGE_IF_NEEDED
          description: 'This macro is used in virtual machine scale sets discovery rule.'
          config:
            type: TEXT
            priority: '14'
            section_name: Filters
            label: 'Exclude VM scale set location filter'
            description: 'Regex string to exclude discovered VM scale set locations by name.'
        - macro: '{$AZURE.SCALESET.NAME.MATCHES}'
          value: '.*'
          description: 'This macro is used in virtual machine scale sets discovery rule.'
          config:
            type: TEXT
            priority: '11'
            section_name: Filters
            label: 'Include VM scale set filter'
            description: 'Regex string to include discovered VM scale sets by name.'
        - macro: '{$AZURE.SCALESET.NAME.NOT.MATCHES}'
          value: CHANGE_IF_NEEDED
          description: 'This macro is used in virtual machine scale sets discovery rule.'
          config:
            type: TEXT
            priority: '12'
            section_name: Filters
            label: 'Exclude VM scale set filter'
            description: 'Regex string to exclude discovered VM scale sets by name.'
        - macro: '{$AZURE.SQL.INST.LOCATION.MATCHES}'
          value: '.*'
          description: 'This macro is used in Azure SQL Managed Instance discovery rule.'
          config:
            type: TEXT
            priority: '17'
            section_name: Filters
            label: 'Include SQL instance location filter'
            description: 'Regex string to include discovered Azure SQL managed instance locations by name.'
        - macro: '{$AZURE.SQL.INST.LOCATION.NOT.MATCHES}'
          value: CHANGE_IF_NEEDED
          description: 'This macro is used in Azure SQL Managed Instance discovery rule.'
          config:
            type: TEXT
            priority: '18'
            section_name: Filters
            label: 'Exclude SQL instance location filter'
            description: 'Regex string to exclude discovered Azure SQL managed instance locations by name.'
        - macro: '{$AZURE.SQL.INST.NAME.MATCHES}'
          value: '.*'
          description: 'This macro is used in Azure SQL Managed Instance discovery rule.'
          config:
            type: TEXT
            priority: '15'
            section_name: Filters
            label: 'Include SQL instance filter'
            description: 'Regex string to include discovered Azure SQL managed instances by name.'
        - macro: '{$AZURE.SQL.INST.NAME.NOT.MATCHES}'
          value: CHANGE_IF_NEEDED
          description: 'This macro is used in Azure SQL Managed Instance discovery rule.'
          config:
            type: TEXT
            priority: '16'
            section_name: Filters
            label: 'Exclude SQL instance filter'
            description: 'Regex string to exclude discovered Azure SQL managed instances by name.'
        - macro: '{$AZURE.STORAGE.ACC.AVAILABILITY}'
          value: '70'
          description: 'The warning threshold of the storage account availability.'
          config:
            type: TEXT
            priority: '27'
            section_name: Thresholds
            label: 'Storage account availability warning threshold'
            description: 'Warning threshold of the storage account availability, expressed in %. In the range from 0 to 100 inclusive.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$AZURE.STORAGE.ACC.BLOB.AVAILABILITY}'
          value: '70'
          description: 'The warning threshold of the storage account blob services availability.'
          config:
            type: TEXT
            priority: '28'
            section_name: Thresholds
            label: 'Blob services availability warning threshold'
            description: 'Warning threshold of the storage account blob services availability, expressed in %. In the range from 0 to 100 inclusive.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$AZURE.STORAGE.ACC.LOCATION.MATCHES}'
          value: '.*'
          description: 'This macro is used in storage accounts discovery rule.'
          config:
            type: TEXT
            priority: '25'
            section_name: Filters
            label: 'Include storage account location filter'
            description: 'Regex string to include discovered storage account locations by name.'
        - macro: '{$AZURE.STORAGE.ACC.LOCATION.NOT.MATCHES}'
          value: CHANGE_IF_NEEDED
          description: 'This macro is used in storage accounts discovery rule.'
          config:
            type: TEXT
            priority: '26'
            section_name: Filters
            label: 'Exclude storage account location filter'
            description: 'Regex string to exclude discovered storage account locations by name.'
        - macro: '{$AZURE.STORAGE.ACC.NAME.MATCHES}'
          value: '.*'
          description: 'This macro is used in storage accounts discovery rule.'
          config:
            type: TEXT
            priority: '23'
            section_name: Filters
            label: 'Include storage account filter'
            description: 'Regex string to include discovered storage accounts by name.'
        - macro: '{$AZURE.STORAGE.ACC.NAME.NOT.MATCHES}'
          value: CHANGE_IF_NEEDED
          description: 'This macro is used in storage accounts discovery rule.'
          config:
            type: TEXT
            priority: '24'
            section_name: Filters
            label: 'Exclude storage account filter'
            description: 'Regex string to exclude discovered storage accounts by name.'
        - macro: '{$AZURE.STORAGE.ACC.TABLE.AVAILABILITY}'
          value: '70'
          description: 'The warning threshold of the storage account table services availability.'
          config:
            type: TEXT
            priority: '29'
            section_name: Thresholds
            label: 'Table services availability warning threshold'
            description: 'Warning threshold of the storage account table services availability, expressed in %. In the range from 0 to 100 inclusive.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$AZURE.SUBSCRIPTION.ID}'
          description: 'Microsoft Azure subscription ID.'
          config:
            type: TEXT
            priority: '1'
            label: 'Azure subscription ID'
            description: 'Microsoft Azure subscription ID.'
            required: 'YES'
        - macro: '{$AZURE.TENANT.ID}'
          description: 'Microsoft Azure tenant ID.'
          config:
            type: TEXT
            priority: '2'
            label: 'Azure tenant ID'
            description: 'Microsoft Azure tenant ID.'
            required: 'YES'
        - macro: '{$AZURE.VAULT.LOCATION.MATCHES}'
          value: '.*'
          description: 'This macro is used in Azure Vault discovery rule.'
          config:
            type: TEXT
            priority: '21'
            section_name: Filters
            label: 'Include vault location filter'
            description: 'Regex string to include discovered Azure Vault locations by name.'
        - macro: '{$AZURE.VAULT.LOCATION.NOT.MATCHES}'
          value: CHANGE_IF_NEEDED
          description: 'This macro is used in Azure Vault discovery rule.'
          config:
            type: TEXT
            priority: '22'
            section_name: Filters
            label: 'Exclude vault location filter'
            description: 'Regex string to exclude discovered Azure Vault locations by name.'
        - macro: '{$AZURE.VAULT.NAME.MATCHES}'
          value: '.*'
          description: 'This macro is used in Azure Vault discovery rule.'
          config:
            type: TEXT
            priority: '19'
            section_name: Filters
            label: 'Include vaults filter'
            description: 'Regex string to include discovered Azure Vaults by name.'
        - macro: '{$AZURE.VAULT.NAME.NOT.MATCHES}'
          value: CHANGE_IF_NEEDED
          description: 'This macro is used in Azure Vault discovery rule.'
          config:
            type: TEXT
            priority: '20'
            section_name: Filters
            label: 'Exclude vaults filter'
            description: 'Regex string to exclude discovered Azure Vaults by name.'
        - macro: '{$AZURE.VM.LOCATION.MATCHES}'
          value: '.*'
          description: 'This macro is used in virtual machines discovery rule.'
          config:
            type: TEXT
            priority: '9'
            section_name: Filters
            label: 'Include VM location filter'
            description: 'Regex string to include discovered virtual machine locations by name.'
        - macro: '{$AZURE.VM.LOCATION.NOT.MATCHES}'
          value: CHANGE_IF_NEEDED
          description: 'This macro is used in virtual machines discovery rule.'
          config:
            type: TEXT
            priority: '10'
            section_name: Filters
            label: 'Exclude VM location filter'
            description: 'Regex string to exclude discovered virtual machine locations by name.'
        - macro: '{$AZURE.VM.NAME.MATCHES}'
          value: '.*'
          description: 'This macro is used in virtual machines discovery rule.'
          config:
            type: TEXT
            priority: '7'
            section_name: Filters
            label: 'Include virtual machines filter'
            description: 'Regex string to include discovered virtual machines by name.'
        - macro: '{$AZURE.VM.NAME.NOT.MATCHES}'
          value: CHANGE_IF_NEEDED
          description: 'This macro is used in virtual machines discovery rule.'
          config:
            type: TEXT
            priority: '8'
            section_name: Filters
            label: 'Exclude virtual machines filter'
            description: 'Regex string to exclude discovered virtual machines by name.'
        - macro: '{$AZURE.WORKSPACE.LOCATION.MATCHES}'
          value: '.*'
          description: 'This macro is used in workspace discovery rule.'
          config:
            type: TEXT
            priority: '51'
            section_name: Filters
            label: 'Include VM scale set location filter'
            description: 'Regex string to include discovered workspace locations by name.'
        - macro: '{$AZURE.WORKSPACE.LOCATION.NOT.MATCHES}'
          value: CHANGE_IF_NEEDED
          description: 'This macro is used in workspace discovery rule.'
          config:
            type: TEXT
            priority: '52'
            section_name: Filters
            label: 'Exclude VM scale set location filter'
            description: 'Regex string to exclude discovered workspace locations by name.'
        - macro: '{$AZURE.WORKSPACE.NAME.MATCHES}'
          value: '.*'
          description: 'This macro is used in workspace discovery rule.'
          config:
            type: TEXT
            priority: '49'
            section_name: Filters
            label: 'Include VM scale set filter'
            description: 'Regex string to include discovered workspace by name.'
        - macro: '{$AZURE.WORKSPACE.NAME.NOT.MATCHES}'
          value: CHANGE_IF_NEEDED
          description: 'This macro is used in workspace discovery rule.'
          config:
            type: TEXT
            priority: '50'
            section_name: Filters
            label: 'Exclude VM scale set filter'
            description: 'Regex string to exclude discovered workspace by name.'
      dashboards:
        - uuid: d30c78be41fe421cb98cedd7683a11f0
          name: 'Overview Azure Storage accounts'
          pages:
            - name: 'Storage transactions'
              widgets:
                - type: graphprototype
                  width: '72'
                  height: '25'
                  fields:
                    - type: GRAPH_PROTOTYPE
                      name: graphid.0
                      value:
                        host: 'Azure by HTTP'
                        name: 'Azure: Transactions by storage [{#NAME}]'
                    - type: STRING
                      name: reference
                      value: AAAAA
                    - type: INTEGER
                      name: rows
                      value: '6'
            - name: 'Storage engress'
              widgets:
                - type: graphprototype
                  width: '72'
                  height: '25'
                  fields:
                    - type: GRAPH_PROTOTYPE
                      name: graphid.0
                      value:
                        host: 'Azure by HTTP'
                        name: 'Azure: Storage account [{#NAME}] egress'
                    - type: STRING
                      name: reference
                      value: AAAAB
                    - type: INTEGER
                      name: rows
                      value: '6'
            - name: 'Storage ingress'
              widgets:
                - type: graphprototype
                  width: '72'
                  height: '20'
                  fields:
                    - type: GRAPH_PROTOTYPE
                      name: graphid.0
                      value:
                        host: 'Azure by HTTP'
                        name: 'Azure: Storage account [{#NAME}] ingress'
                    - type: STRING
                      name: reference
                      value: AAAAC
                    - type: INTEGER
                      name: rows
                      value: '5'
    - uuid: 29325098807848aa928b4192ad5e020f
      template: 'Azure Cosmos DB for MongoDB by HTTP'
      name: 'Azure Cosmos DB for MongoDB by HTTP'
      description: |
        This template is designed to monitor Microsoft Azure Cosmos DB for MongoDB 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"
      wizard_ready: 'YES'
      readme: |
        ## 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 [Azure documentation](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 host wizard configuration fields: `Azure App ID`, `Azure password`, `Azure tenant ID`, `Azure subscription ID`, and `Azure Cosmos DB ID`.
      vendor:
        name: Zabbix
        version: 8.0-2
      groups:
        - name: Templates/Cloud
      items:
        - uuid: 9e247bdb17f44630b9440b59d5ef251b
          name: 'Autoscale max throughput'
          type: DEPENDENT
          key: azure.cosmosdb.autoscale.max.throughput
          description: 'The autoscale max throughput.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.requests.AutoscaleMaxThroughput.maximum
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.cosmosdb.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 35a7d2c96990407f937e07fd160266a9
          name: 'Get errors'
          type: DEPENDENT
          key: azure.cosmosdb.data.errors
          value_type: TEXT
          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.cosmosdb.data.get
          tags:
            - tag: component
              value: raw
          triggers:
            - uuid: dfd484aa8a4e4b759e4e34c5318c7176
              expression: 'length(last(/Azure Cosmos DB for MongoDB by HTTP/azure.cosmosdb.data.errors))>0'
              name: 'Azure Cosmos DB: 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: 647faea1597c4da6a3cd78694be8e77e
          name: 'Get data'
          type: SCRIPT
          key: azure.cosmosdb.data.get
          history: '0'
          value_type: TEXT
          params: |
            var AzureCosmosDB = {
            	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 + '.';
            			}
            		});
            
            		AzureCosmosDB.params = params;
            	},
            
            	login: function () {
            		var response, login = new HttpRequest();
            		if (typeof AzureCosmosDB.params.proxy !== 'undefined' && AzureCosmosDB.params.proxy !== '') {
            			login.setProxy(AzureCosmosDB.params.proxy);
            		}
            		login.addHeader('Content-Type: application/x-www-form-urlencoded');
            		response = login.post(
            			'https://login.microsoftonline.com/' + encodeURIComponent(AzureCosmosDB.params.tenant_id) + '/oauth2/token',
            			'grant_type=client_credentials&resource=' + encodeURIComponent('https://management.azure.com/') + '&client_id=' + encodeURIComponent(AzureCosmosDB.params.app_id) + '&client_secret=' + encodeURIComponent(AzureCosmosDB.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.';
            		}
            		AzureCosmosDB.token = response['access_token'];
            	},
            
            	request: function (url) {
            		var response, request = new HttpRequest();
            		if (typeof AzureCosmosDB.params.proxy !== 'undefined' && AzureCosmosDB.params.proxy !== '') {
            			request.setProxy(AzureCosmosDB.params.proxy);
            		}
            		if (!AzureCosmosDB.token) {
            			throw 'Request does not contain access token.';
            		}
            		request.addHeader('Accept: application/json');
            		request.addHeader('Authorization: Bearer ' + AzureCosmosDB.token);
            		Zabbix.log(4, '[ AzureCosmosDB ] 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 = {};
            		start_date = new Date((new Date().getTime()) - 600000).toISOString().replace(/\.\d+/, '');
            		end_date = new Date(new Date().getTime()).toISOString().replace(/\.\d+/, '');
            		endpoints = {
            			'availability': '/providers/Microsoft.Insights/metrics?metricnames=ServiceAvailability&api-version=2021-05-01&interval=PT1H&timespan=' + encodeURIComponent(start_date) + '/' + encodeURIComponent(end_date),
            			'requests': '/providers/Microsoft.Insights/metrics?metricnames=DataUsage,IndexUsage,DocumentQuota,AvailableStorage,DocumentCount,NormalizedRUConsumption,PhysicalPartitionThroughputInfo,PhysicalPartitionSizeInfo,AutoscaleMaxThroughput,ProvisionedThroughput,TotalRequests,TotalRequestUnits,MetadataRequests,MongoRequests,MongoRequestCharge,ServerSideLatency,ServerSideLatencyGateway,ServerSideLatencyDirect,ReplicationLatency&api-version=2021-05-01&timespan=' + encodeURIComponent(start_date) + '/' + encodeURIComponent(end_date),
            		};
            
            		Object.keys(endpoints).forEach(function (field) {
            			data[field] = {};
            			try {
            				metrics = AzureCosmosDB.request('https://management.azure.com' + AzureCosmosDB.params.resource_id + endpoints[field]);
            				if (!metrics.hasOwnProperty('value')) {
            					throw 'Failed getting required field. Check debug log for more information.';
            				}
            
            				for (k in metrics.value) {
            					key = AzureCosmosDB.getField(metrics.value[k], 'name.value')
            					if (metrics.value[k].timeseries.length === 0) {
            						metrics.value[k].timeseries.push({ 'data': ['nodata'] })
            					}
            					data[field][key] = AzureCosmosDB.getField(metrics.value[k], 'timeseries.0.data.0');
            				}
            			}
            			catch (error) {
            				data.error = error.toString();
            			}
            		});
            		return data
            	}
            
            };
            
            try {
            	AzureCosmosDB.setParams(JSON.parse(value));
            	AzureCosmosDB.login();
            	return JSON.stringify(AzureCosmosDB.getMetricsData());
            }
            catch (error) {
            	error += (String(error).endsWith('.')) ? '' : '.';
            	Zabbix.log(3, '[ AzureCosmosDB ] ERROR: ' + error);
            	return JSON.stringify({ 'error': error });
            }
          description: 'The result of API requests is expressed in the JSON.'
          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}'
          tags:
            - tag: component
              value: raw
        - uuid: 947a2eb530754a609fa81c59e29fe7b7
          name: 'Data usage'
          type: DEPENDENT
          key: azure.cosmosdb.data.usage
          units: B
          description: 'The total data usage.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.requests.DataUsage.total
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.cosmosdb.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 0bf3da9168144016b663c9b8e76447fa
          name: 'Document count'
          type: DEPENDENT
          key: azure.cosmosdb.document.count
          description: 'The total document count.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.requests.DocumentCount.total
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.cosmosdb.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 7fa0f59f8cfa4d9e83086b203e4f71ea
          name: 'Document quota'
          type: DEPENDENT
          key: azure.cosmosdb.document.quota
          units: B
          description: 'The total storage quota.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.requests.DocumentQuota.total
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.cosmosdb.data.get
          tags:
            - tag: component
              value: storage
        - uuid: b09f9445d960415185457b89b6a73452
          name: 'Index usage'
          type: DEPENDENT
          key: azure.cosmosdb.index.usage
          units: B
          description: 'The total index usage.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.requests.IndexUsage.total
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.cosmosdb.data.get
          tags:
            - tag: component
              value: storage
        - uuid: cd35f04b180542cda50dc5d4e979e54e
          name: 'Metadata requests'
          type: DEPENDENT
          key: azure.cosmosdb.metadata.requests
          description: |
            The count of metadata requests.
            Cosmos DB maintains system metadata collection for each account, which allows you to enumerate collections, databases, etc., and their configurations, free of charge.
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.requests.MetadataRequests.count
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.cosmosdb.data.get
          tags:
            - tag: component
              value: storage
        - uuid: e42cf83e456a490295a84cfe9eb288ef
          name: 'Mongo requests'
          type: DEPENDENT
          key: azure.cosmosdb.mongo.requests
          description: 'The number of Mongo requests made.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.requests.MongoRequests.count
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.cosmosdb.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 8fd4068986af444799ae64c6bc8f16a6
          name: 'Mongo request charge'
          type: DEPENDENT
          key: azure.cosmosdb.mongo.requests.charge
          description: 'The Mongo request units consumed.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.requests.MongoRequestCharge.total
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.cosmosdb.data.get
          tags:
            - tag: component
              value: storage
        - uuid: fda6b39ce6ef4b8c8418b2e123ecdd17
          name: 'Normalized RU consumption'
          type: DEPENDENT
          key: azure.cosmosdb.normalized.ru.consumption
          units: '%'
          description: 'The max RU consumption percentage per minute.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.requests.NormalizedRUConsumption.maximum
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.cosmosdb.data.get
          tags:
            - tag: component
              value: storage
        - uuid: be6800214a0443e899c40f8a4b6c3f21
          name: 'Physical partition size'
          type: DEPENDENT
          key: azure.cosmosdb.physical.partition.size
          units: B
          description: 'The physical partition size in bytes.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.requests.PhysicalPartitionSizeInfo.maximum
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.cosmosdb.data.get
          tags:
            - tag: component
              value: storage
        - uuid: e30d5eadde15427484e7a0d1cb38e9e3
          name: 'Physical partition throughput'
          type: DEPENDENT
          key: azure.cosmosdb.physical.partition.throughput
          description: 'The physical partition throughput.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.requests.PhysicalPartitionThroughputInfo.maximum
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.cosmosdb.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 49311bbfb2584a46b42ed1a7d8fcfd94
          name: 'Provisioned throughput'
          type: DEPENDENT
          key: azure.cosmosdb.provisioned.throughput
          description: 'The provisioned throughput.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.requests.ProvisionedThroughput.maximum
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.cosmosdb.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 6d7175e27d10406191c883dc2e5949e4
          name: 'Replication latency, P99'
          type: DEPENDENT
          key: azure.cosmosdb.replication.latency
          value_type: FLOAT
          units: s
          description: 'The P99 replication latency across source and target regions for geo-enabled account.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.requests.ReplicationLatency.average
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '0.001'
          master_item:
            key: azure.cosmosdb.data.get
          tags:
            - tag: component
              value: network
        - uuid: d9b5af0c71874114b48464ce20f8cf3d
          name: 'Server side latency'
          type: DEPENDENT
          key: azure.cosmosdb.server.side.latency
          value_type: FLOAT
          units: s
          description: 'The server side latency.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.requests.ServerSideLatency.average
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '0.001'
          master_item:
            key: azure.cosmosdb.data.get
          tags:
            - tag: component
              value: network
        - uuid: 7587d3750d1643f085db5931670dc2f3
          name: 'Server side latency, direct'
          type: DEPENDENT
          key: azure.cosmosdb.server.side.latency.direct
          value_type: FLOAT
          units: s
          description: 'The server side latency in direct connection mode.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.requests.ServerSideLatencyDirect.average
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '0.001'
          master_item:
            key: azure.cosmosdb.data.get
          tags:
            - tag: component
              value: network
        - uuid: 0aefdc3101fe4bcba4743d6e32671554
          name: 'Server side latency, gateway'
          type: DEPENDENT
          key: azure.cosmosdb.server.side.latency.gateway
          value_type: FLOAT
          units: s
          description: 'The server side latency in gateway connection mode.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.requests.ServerSideLatencyGateway.average
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '0.001'
          master_item:
            key: azure.cosmosdb.data.get
          tags:
            - tag: component
              value: network
        - uuid: 42bd03c1753b4f19bc9793b03834cd3d
          name: 'Service availability'
          type: DEPENDENT
          key: azure.cosmosdb.service.availability
          value_type: FLOAT
          units: '%'
          description: 'The account requests availability at one hour granularity.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.availability.ServiceAvailability.average
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.cosmosdb.data.get
          tags:
            - tag: component
              value: health
          triggers:
            - uuid: c7649cd317f04a3d8fec0eebe3df6766
              expression: '(min(/Azure Cosmos DB for MongoDB by HTTP/azure.cosmosdb.service.availability,#3))<{$AZURE.DB.COSMOS.MONGO.AVAILABILITY}'
              name: 'Azure Cosmos DB: Cosmos DB for MongoDB account: Availability is low'
              opdata: '{ITEM.LASTVALUE1}'
              priority: WARNING
              tags:
                - tag: scope
                  value: availability
        - uuid: f4d4d2def5e945ab9048ada4813b7f04
          name: 'Total request units'
          type: DEPENDENT
          key: azure.cosmosdb.total.request.units
          value_type: FLOAT
          description: 'The request units consumed per minute.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.requests.TotalRequestUnits.total
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.cosmosdb.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 3dd2cd4edb7746edb9d917c83b280ca3
          name: 'Total requests'
          type: DEPENDENT
          key: azure.cosmosdb.total.requests
          description: 'Number of requests per minute.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.requests.TotalRequests.count
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.cosmosdb.data.get
          tags:
            - tag: component
              value: storage
      tags:
        - tag: class
          value: cloud
        - tag: subclass
          value: management
        - tag: subclass
          value: nosql
        - tag: target
          value: azure
        - tag: target
          value: cosmosdb
        - tag: target
          value: mongodb
      macros:
        - macro: '{$AZURE.APP.ID}'
          description: 'The App ID of Microsoft Azure.'
          config:
            type: TEXT
            priority: '3'
            label: 'Azure App ID'
            description: 'Microsoft Azure App ID.'
            required: 'YES'
        - macro: '{$AZURE.DATA.TIMEOUT}'
          value: 15s
          description: 'API response timeout.'
          config:
            type: TEXT
            priority: '7'
            section_name: Other
            label: 'API timeout'
            description: 'API response timeout, in seconds.'
        - macro: '{$AZURE.DB.COSMOS.MONGO.AVAILABILITY}'
          value: '70'
          description: 'The warning threshold of the Cosmos DB for MongoDB service availability.'
          config:
            type: TEXT
            priority: '6'
            section_name: Other
            label: 'Cosmos DB warning threshold'
            description: 'Warning threshold of the Cosmos DB for MongoDB service availability. In the range from 0 to 100 inclusive.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$AZURE.PASSWORD}'
          type: SECRET_TEXT
          description: 'Microsoft Azure password.'
          config:
            type: TEXT
            priority: '4'
            label: 'Azure password'
            description: 'Microsoft Azure password.'
            required: 'YES'
        - macro: '{$AZURE.PROXY}'
          description: 'Sets the HTTP proxy value. If this macro is empty, then no proxy is used.'
          config:
            type: TEXT
            priority: '8'
            section_name: Other
            label: 'HTTP proxy'
            description: 'HTTP proxy to use for requests.'
        - macro: '{$AZURE.RESOURCE.ID}'
          description: 'Microsoft Azure Cosmos DB ID.'
          config:
            type: TEXT
            priority: '5'
            label: 'Azure Cosmos DB ID'
            description: 'Microsoft Azure Cosmos DB ID.'
            required: 'YES'
        - macro: '{$AZURE.SUBSCRIPTION.ID}'
          description: 'Microsoft Azure subscription ID.'
          config:
            type: TEXT
            priority: '1'
            label: 'Azure subscription ID'
            description: 'Microsoft Azure subscription ID.'
            required: 'YES'
        - macro: '{$AZURE.TENANT.ID}'
          description: 'Microsoft Azure tenant ID.'
          config:
            type: TEXT
            priority: '2'
            label: 'Azure tenant ID'
            description: 'Microsoft Azure tenant ID.'
            required: 'YES'
      dashboards:
        - uuid: 323fb91b388a44bfbd4b7d634f6e6b6c
          name: 'Overview Azure Cosmos DB for MongoDB'
          pages:
            - widgets:
                - type: item
                  name: 'Service Availability'
                  width: '18'
                  height: '4'
                  fields:
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: STRING
                      name: down_color
                      value: FF0000
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure Cosmos DB for MongoDB by HTTP'
                        key: azure.cosmosdb.service.availability
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '4'
                    - type: STRING
                      name: units
                      value: '%'
                    - type: STRING
                      name: units_color
                      value: 66BB6A
                    - type: STRING
                      name: up_color
                      value: 4CAF50
                    - type: STRING
                      name: value_color
                      value: 66BB6A
                - type: graph
                  'y': '4'
                  width: '72'
                  height: '5'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Azure Cosmos DB for MongoDB by HTTP'
                        name: 'Azure MongoDB: Usage'
                    - type: STRING
                      name: reference
                      value: AAAAC
                - type: graph
                  'y': '9'
                  width: '72'
                  height: '5'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Azure Cosmos DB for MongoDB by HTTP'
                        name: 'Azure MongoDB: Requests'
                    - type: STRING
                      name: reference
                      value: AAAAB
                - type: graph
                  'y': '14'
                  width: '72'
                  height: '5'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Azure Cosmos DB for MongoDB by HTTP'
                        name: 'Azure MongoDB: Latency'
                    - type: STRING
                      name: reference
                      value: AAAAA
                - type: item
                  name: 'Provisioned Throughput'
                  x: '18'
                  width: '18'
                  height: '4'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure Cosmos DB for MongoDB by HTTP'
                        key: azure.cosmosdb.provisioned.throughput
                    - type: INTEGER
                      name: show.0
                      value: '2'
                - type: item
                  name: 'Normalized RU Consumption'
                  x: '36'
                  width: '18'
                  height: '4'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure Cosmos DB for MongoDB by HTTP'
                        key: azure.cosmosdb.normalized.ru.consumption
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'Document Count'
                  x: '54'
                  width: '18'
                  height: '4'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure Cosmos DB for MongoDB by HTTP'
                        key: azure.cosmosdb.document.count
                    - type: INTEGER
                      name: show.0
                      value: '2'
    - uuid: 2d8b9329b5d04cdf85bf17d2d0db2b29
      template: 'Azure Microsoft SQL Database by HTTP'
      name: 'Azure Microsoft SQL Database by HTTP'
      description: |
        This template is designed to monitor Microsoft SQL databases 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"
      wizard_ready: 'YES'
      readme: |
        ## Overview
        
        This template is designed to monitor Microsoft SQL databases 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 [Azure documentation](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 host wizard configuration fields: `Azure App ID`, `Azure password`, `Azure tenant ID`, `Azure subscription ID`, and `Azure MSSQL database ID`.
      vendor:
        name: Zabbix
        version: 8.0-2
      groups:
        - name: Templates/Cloud
      items:
        - uuid: 2ff1f479e0b447f2b85e75e99bc011fe
          name: 'Availability status detailed'
          type: DEPENDENT
          key: azure.db.mssql.availability.details
          value_type: CHAR
          description: 'The summary description of the availability status.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.health.summary
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: health
        - uuid: f15e8075ac9a4f1ca6e95106940b246e
          name: 'Availability state'
          type: DEPENDENT
          key: azure.db.mssql.availability.state
          description: 'The availability status of the resource.'
          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.db.mssql.data.get
          tags:
            - tag: component
              value: health
          triggers:
            - uuid: 5156f35b82084fd3b1d1a11c35757993
              expression: 'last(/Azure Microsoft SQL Database by HTTP/azure.db.mssql.availability.state)=1'
              name: 'Azure MSSQL: Microsoft SQL database is degraded'
              opdata: '{ITEM.LASTVALUE1}'
              priority: AVERAGE
              description: 'The resource is in a degraded state.'
              tags:
                - tag: scope
                  value: availability
            - uuid: 0cf3cce995c241838e13df12d5908b61
              expression: 'last(/Azure Microsoft SQL Database by HTTP/azure.db.mssql.availability.state)=3'
              name: 'Azure MSSQL: Microsoft SQL database is in unknown state'
              opdata: '{ITEM.LASTVALUE1}'
              priority: WARNING
              description: 'The resource state is unknown.'
              tags:
                - tag: scope
                  value: availability
            - uuid: 2130dc83dee94fdfad87894127c6a578
              expression: 'last(/Azure Microsoft SQL Database by HTTP/azure.db.mssql.availability.state)=2'
              name: 'Azure MSSQL: Microsoft SQL database is unavailable'
              opdata: '{ITEM.LASTVALUE1}'
              priority: HIGH
              description: 'The resource state is unavailable.'
              tags:
                - tag: scope
                  value: availability
        - uuid: ce744d69ed12435db781fbc6100d97ab
          name: 'Connections failed: System errors'
          type: DEPENDENT
          key: azure.db.mssql.connections.failed.system
          value_type: FLOAT
          description: 'The count of failed connections with system errors.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.connection_failed.total
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: network
        - uuid: 8ec27240f59947858c41762a266cab25
          name: 'Connections successful'
          type: DEPENDENT
          key: azure.db.mssql.connections.successful
          value_type: FLOAT
          description: 'The count of successful connections.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.connection_successful.total
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: network
        - uuid: 04737f2746444d2fb348a9444964dc7a
          name: 'CPU limit'
          type: DEPENDENT
          key: azure.db.mssql.cpu.limit
          value_type: FLOAT
          description: 'The CPU limit. Applies to the vCore-based databases.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.cpu_limit.average
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: cpu
        - uuid: e55a199cc0bd4749a69478da8268785d
          name: 'Percentage CPU'
          type: DEPENDENT
          key: azure.db.mssql.cpu.percentage
          value_type: FLOAT
          units: '%'
          description: 'The CPU percent of a host.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.cpu_percent.average
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: cpu
          triggers:
            - uuid: 506c034e707442519792a4366bc0879d
              expression: 'min(/Azure Microsoft SQL Database by HTTP/azure.db.mssql.cpu.percentage,5m)>{$AZURE.DB.CPU.UTIL.CRIT}'
              name: 'Azure MSSQL: High CPU utilization'
              opdata: 'Current utilization: {ITEM.LASTVALUE1}'
              priority: HIGH
              description: 'The CPU utilization is too high. The system might be slow to respond.'
              tags:
                - tag: scope
                  value: performance
        - uuid: 9a4a948f41e4434e9a94b3d9546df896
          name: 'CPU used'
          type: DEPENDENT
          key: azure.db.mssql.cpu.used
          value_type: FLOAT
          description: 'The CPU used. Applies to the vCore-based databases.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.cpu_used.average
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: cpu
        - uuid: e8aa1b70a7384ffead05cd2e95a6f10a
          name: 'Get errors'
          type: DEPENDENT
          key: azure.db.mssql.data.errors
          value_type: TEXT
          description: 'A list of errors from API requests.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.errors
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: raw
          triggers:
            - uuid: 62d08fe430bd45e890c81547860d5c3d
              expression: 'length(last(/Azure Microsoft SQL Database by HTTP/azure.db.mssql.data.errors))>0'
              name: 'Azure MSSQL: 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: 741cc1ec6a824e429f06b3d12a8a7082
          name: 'Get data'
          type: SCRIPT
          key: azure.db.mssql.data.get
          history: '0'
          value_type: TEXT
          params: |
            var AzureDB = {
            	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 + '.';
            			}
            		});
            
            		AzureDB.params = params;
            	},
            
            
            	request: function (url, data) {
            		if (typeof data === 'undefined' || data === null) {
            			data = '';
            		}
            
            		var response, request = new HttpRequest();
            		if (typeof AzureDB.params.proxy !== 'undefined' && AzureDB.params.proxy !== '') {
            			request.setProxy(AzureDB.params.proxy);
            		}
            		if (AzureDB.token) {
            			request.addHeader('Accept: application/json');
            			request.addHeader('Authorization: Bearer ' + AzureDB.token);
            		}
            
            		Zabbix.log(4, '[ Azure ] Sending request: ' + url);
            
            		if (data !== '') {
            			request.addHeader('Content-Type: application/x-www-form-urlencoded');
            			response = request.post(url, data);
            		}
            		else {
            			response = request.get(url);
            		}
            
            		Zabbix.log(4, '[ Azure ] Received response with status code ' + request.getStatus() + ': ' + response);
            
            		if (request.getStatus() !== 200 || response === null) {
            			throw 'Request failed with status code ' + request.getStatus() + ': ' + response;
            		}
            
            		try {
            			return JSON.parse(response);
            		}
            		catch (error) {
            			throw 'Failed to parse response received from API.';
            		}
            	}
            
            };
            
            var metrics = [
            	'cpu_percent',
            	'physical_data_read_percent',
            	'log_write_percent',
            	'storage',
            	'connection_successful',
            	'connection_failed',
            	'blocked_by_firewall',
            	'deadlock',
            	'storage_percent',
            	'xtp_storage_percent',
            	'workers_percent',
            	'sessions_percent',
            	'sessions_count',
            	'cpu_limit',
            	'cpu_used',
            	'sqlserver_process_core_percent',
            	'sqlserver_process_memory_percent',
            	'tempdb_data_size',
            	'tempdb_log_size',
            	'tempdb_log_used_percent',
            	'allocated_data_storage'
            ],
            	day_metrics = 'full_backup_size_bytes,diff_backup_size_bytes,log_backup_size_bytes',
            	prepared_metrics = [],
            	data = {};
            	data['errors'] = {};
            	data['metrics'] = {};
            
            try {
            	AzureDB.setParams(JSON.parse(value));
            
            	try {
            		result = AzureDB.request(
            			'https://login.microsoftonline.com/' + encodeURIComponent(AzureDB.params.tenant_id) + '/oauth2/token',
            			'grant_type=client_credentials&resource=' + encodeURIComponent('https://management.azure.com/') + '&client_id=' + encodeURIComponent(AzureDB.params.app_id) + '&client_secret=' + encodeURIComponent(AzureDB.params.password)
            		);
            
            		if ('access_token' in result) {
            			AzureDB.token = result['access_token'];
            		} else {
            			throw 'Auth response does not contain access token.';
            		}
            	}
            	catch (error) {
            		data.errors.auth = error.toString();
            	}
            
            	if (!('auth' in data.errors)) {
            		try {
            			health = AzureDB.request('https://management.azure.com' + AzureDB.params.resource_id + '/providers/Microsoft.ResourceHealth/availabilityStatuses?api-version=2020-05-01');
            			if ('value' in health && Array.isArray(health.value) && health.value.length > 0 && 'properties' in health.value[0] && typeof health.value[0].properties === 'object') {
            				data.health = health.value[0].properties;
            			}
            		}
            		catch (error) {
            			data.errors.health = error.toString();
            		}
            
            		for (var i = 0; i < metrics.length; i += 20) {
            			var chunk = metrics.slice(i, i + 20);
            
            			prepared_metrics.push(
            				chunk.map(function (element) {
            					return encodeURIComponent(element);
            				}).join(',')
            			);
            		}
            
            		start_date = new Date((new Date().getTime()) - 300000).toISOString().replace(/\.\d+/, '');
            		end_date = new Date().toISOString().replace(/\.\d+/, '');
            
            		for (var j in prepared_metrics) {
            			try {
            				metrics_data = AzureDB.request('https://management.azure.com' + AzureDB.params.resource_id + '/providers/Microsoft.Insights/metrics?metricnames=' + prepared_metrics[j] + '&timespan=' + encodeURIComponent(start_date) + '/' + encodeURIComponent(end_date) + '&api-version=2021-05-01');
            				if ('value' in metrics_data && Array.isArray(metrics_data.value) && metrics_data.value.length > 0) {
            					for (k in metrics_data.value) {
            						if ('name' in metrics_data.value[k] && typeof metrics_data.value[k].name === 'object' && 'value' in metrics_data.value[k].name && typeof metrics_data.value[k].name.value === 'string' && 'timeseries' in metrics_data.value[k] && Array.isArray(metrics_data.value[k].timeseries) && metrics_data.value[k].timeseries.length > 0 && 'data' in metrics_data.value[k].timeseries[0] && Array.isArray(metrics_data.value[k].timeseries[0].data) && metrics_data.value[k].timeseries[0].data.length > 0) {
            							data.metrics[metrics_data.value[k].name.value.replace(/(\s|\/)+/g, '')] = metrics_data.value[k].timeseries[0].data[metrics_data.value[k].timeseries[0].data.length - 1];
            						}
            					}
            				}
            			}
            			catch (error) {
            				data.errors[prepared_metrics[j]] = error.toString();
            			}
            		}
            		start_date = new Date((new Date().getTime()) - 86400000).toISOString().replace(/\.\d+/, '');
            		end_date = new Date().toISOString().replace(/\.\d+/, '');
            		try {
            			metrics_data = AzureDB.request('https://management.azure.com' + AzureDB.params.resource_id + '/providers/Microsoft.Insights/metrics?metricnames=' + day_metrics + '&timespan=' + encodeURIComponent(start_date) + '/' + encodeURIComponent(end_date) + '&api-version=2021-05-01');
            			if ('value' in metrics_data && Array.isArray(metrics_data.value) && metrics_data.value.length > 0) {
            				for (l in metrics_data.value) {
            					if ('name' in metrics_data.value[l] && typeof metrics_data.value[l].name === 'object' && 'value' in metrics_data.value[l].name && typeof metrics_data.value[l].name.value === 'string' && 'timeseries' in metrics_data.value[l] && Array.isArray(metrics_data.value[l].timeseries) && metrics_data.value[l].timeseries.length > 0 && 'data' in metrics_data.value[l].timeseries[0] && Array.isArray(metrics_data.value[l].timeseries[0].data) && metrics_data.value[l].timeseries[0].data.length > 0) {
            						data.metrics[metrics_data.value[l].name.value.replace(/(\s|\/)+/g, '')] = metrics_data.value[l].timeseries[0].data[metrics_data.value[l].timeseries[0].data.length - 1];
            					}
            				}
            			}
            		}
            		catch (error) {
            			data.errors[day_metrics] = error.toString();
            		}
            	}
            }
            catch (error) {
            	data.errors.params = error.toString();
            }
            
            if (Object.keys(data.errors).length !== 0) {
            	errors = 'Failed to receive data:';
            	for (var error in data.errors) {
            		errors += '\n' + error + ' : ' + data.errors[error];
            	}
            	data.errors = errors;
            }
            else {
            	data.errors = '';
            }
            
            return JSON.stringify(data);
          description: 'The result of API requests is expressed in the JSON.'
          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}'
          tags:
            - tag: component
              value: raw
        - uuid: 75d9288a8240425782cce8701c1bdfa8
          name: 'Data IO percentage'
          type: DEPENDENT
          key: azure.db.mssql.data.read.percentage
          value_type: FLOAT
          units: '%'
          description: 'The percentage of physical data read.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.physical_data_read_percent.average
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: operations
        - uuid: 81f87d35131c426299b233279f8f6c4b
          name: Deadlocks
          type: DEPENDENT
          key: azure.db.mssql.deadlocks
          value_type: FLOAT
          description: 'The count of deadlocks. Not applicable to the data warehouses.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.deadlock.total
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: network
        - uuid: 4d78e4691b6f4ab095849e6af2713638
          name: 'Connections blocked by firewall'
          type: DEPENDENT
          key: azure.db.mssql.firewall.blocked
          value_type: FLOAT
          description: 'The count of connections blocked by firewall.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.blocked_by_firewall.total
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: network
        - uuid: 324c16e5da5b40c78d687f1f41a9d180
          name: 'Log IO percentage'
          type: DEPENDENT
          key: azure.db.mssql.log.write.percentage
          value_type: FLOAT
          units: '%'
          description: 'The percentage of I/O log. Not applicable to the data warehouses.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.log_write_percent.average
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: operations
        - uuid: f417464b2de14e3292d68442570b931d
          name: 'SQL Server process core percent'
          type: DEPENDENT
          key: azure.db.mssql.server.cpu.percent
          value_type: FLOAT
          units: '%'
          description: 'The CPU usage as a percentage of the SQL DB process. Not applicable to the data warehouses.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.sqlserver_process_core_percent.maximum
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: cpu
            - tag: component
              value: server
        - uuid: b39aa0798a824dafb3f3871b6406106a
          name: 'SQL Server process memory percent'
          type: DEPENDENT
          key: azure.db.mssql.server.memory.percent
          value_type: FLOAT
          units: '%'
          description: 'Memory usage as a percentage of the SQL DB process. Not applicable to data warehouses.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.sqlserver_process_memory_percent.maximum
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: memory
            - tag: component
              value: server
        - uuid: 754b453cdf464f73b09eced3dd3e5859
          name: 'Sessions count'
          type: DEPENDENT
          key: azure.db.mssql.sessions.count
          value_type: FLOAT
          description: 'The number of active sessions. Not applicable to Synapse DW Analytics.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.sessions_count.average
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: sessions
        - uuid: b6696ac3d83841e2a001cdad1aeaea89
          name: 'Sessions percentage'
          type: DEPENDENT
          key: azure.db.mssql.sessions.percent
          value_type: FLOAT
          units: '%'
          description: 'The percentage of sessions. Not applicable to the data warehouses.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.sessions_percent.average
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: sessions
        - uuid: fddff3dcbcf44c408314946f01f26a79
          name: 'Data space allocated'
          type: DEPENDENT
          key: azure.db.mssql.storage.allocated
          value_type: FLOAT
          units: B
          description: 'The allocated data storage. Not applicable to the data warehouses.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.allocated_data_storage.average
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 3d492b552468462ba17524a9c6951dd7
          name: 'Differential backup storage size'
          type: DEPENDENT
          key: azure.db.mssql.storage.backup.diff.size
          value_type: FLOAT
          units: B
          description: 'Cumulative differential backup storage size. Applies to the vCore-based databases. Not applicable to the Hyperscale databases.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.diff_backup_size_bytes.maximum
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1d
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: storage
        - uuid: e8cd0339a82248e3ad777374f219552e
          name: 'Log backup storage size'
          type: DEPENDENT
          key: azure.db.mssql.storage.backup.log.size
          value_type: FLOAT
          units: B
          description: 'Cumulative log backup storage size. Applies to the vCore-based and Hyperscale databases.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.log_backup_size_bytes.maximum
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1d
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: storage
        - uuid: c92867a096ad4d89b31a2dba7e560df1
          name: 'Full backup storage size'
          type: DEPENDENT
          key: azure.db.mssql.storage.backup.size
          value_type: FLOAT
          units: B
          description: 'Cumulative full backup storage size. Applies to the vCore-based databases. Not applicable to the Hyperscale databases.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.full_backup_size_bytes.maximum
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1d
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 6eb5dc0a0b864c0bb35634612472ed38
          name: 'Data space used percent'
          type: DEPENDENT
          key: azure.db.mssql.storage.percent
          value_type: FLOAT
          units: '%'
          description: 'Data space used percent. Not applicable to the data warehouses or Hyperscale databases.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.storage_percent.maximum
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: storage
          triggers:
            - uuid: a2d6cf9ac67d4d0eb312e9536299b345
              expression: 'last(/Azure Microsoft SQL Database by HTTP/azure.db.mssql.storage.percent)>{$AZURE.DB.STORAGE.PUSED.CRIT}'
              name: 'Azure MSSQL: Storage space is critically low'
              opdata: 'Current utilization: {ITEM.LASTVALUE1}'
              priority: AVERAGE
              description: 'Critical utilization of the storage space.'
              tags:
                - tag: scope
                  value: capacity
            - uuid: 6dbf1d3aeb8b44b8bd96a9ca75f5249e
              expression: 'last(/Azure Microsoft SQL Database by HTTP/azure.db.mssql.storage.percent)>{$AZURE.DB.STORAGE.PUSED.WARN}'
              name: 'Azure MSSQL: Storage space is low'
              opdata: 'Current utilization: {ITEM.LASTVALUE1}'
              priority: WARNING
              description: 'High utilization of the storage space.'
              tags:
                - tag: scope
                  value: capacity
        - uuid: a0335bde6f3546cdad5bbd2db8fa50b1
          name: 'Data space used'
          type: DEPENDENT
          key: azure.db.mssql.storage.used
          value_type: FLOAT
          units: B
          description: 'Data space used. Not applicable to the data warehouses.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.storage.maximum
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 6ff07a9a680749bfa3deabbec508b7c3
          name: 'In-Memory OLTP storage percent'
          type: DEPENDENT
          key: azure.db.mssql.storage.xtp.percent
          value_type: FLOAT
          units: '%'
          description: 'In-Memory OLTP storage percent. Not applicable to the data warehouses.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.xtp_storage_percent.average
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 76da2f210c084546a19ce156e0aee1d6
          name: 'Tempdb data file size'
          type: DEPENDENT
          key: azure.db.mssql.tempdb.data.size
          value_type: FLOAT
          units: B
          description: 'The space used in `tempdb` data files, expressed in bytes. Not applicable to the data warehouses.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.tempdb_data_size.maximum
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1024'
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: storage
        - uuid: dd2986cc6ce441fe9b3ab9b44b5fc103
          name: 'Tempdb log used percent'
          type: DEPENDENT
          key: azure.db.mssql.tempdb.log.percent
          value_type: FLOAT
          units: '%'
          description: 'The percentage of space used in `tempdb` transaction log file. Not applicable to the data warehouses.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.tempdb_log_used_percent.maximum
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 51212e2af3854079950064bd9d16da83
          name: 'Tempdb log file size'
          type: DEPENDENT
          key: azure.db.mssql.tempdb.log.size
          value_type: FLOAT
          units: B
          description: 'The space used in `tempdb` transaction log file, expressed in bytes. Not applicable to the data warehouses.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.tempdb_log_size.maximum
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1024'
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: storage
        - uuid: b5d63b2cbcb1470d8559a90cb3df0002
          name: 'Workers percentage'
          type: DEPENDENT
          key: azure.db.mssql.workers.percent
          value_type: FLOAT
          units: '%'
          description: 'The percentage of workers. Not applicable to the data warehouses.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.workers_percent.average
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: workers
      tags:
        - tag: class
          value: cloud
        - tag: subclass
          value: sql
        - tag: target
          value: azure
        - tag: target
          value: mssql
      macros:
        - macro: '{$AZURE.APP.ID}'
          description: 'The App ID of Microsoft Azure.'
          config:
            type: TEXT
            priority: '3'
            label: 'Azure App ID'
            description: 'Microsoft Azure App ID.'
            required: 'YES'
        - macro: '{$AZURE.DATA.TIMEOUT}'
          value: 15s
          description: 'API response timeout.'
          config:
            type: TEXT
            priority: '10'
            section_name: Other
            label: 'API timeout'
            description: 'API response timeout, in seconds.'
        - macro: '{$AZURE.DB.CPU.UTIL.CRIT}'
          value: '90'
          description: 'The critical threshold of CPU utilization, expressed in %.'
          config:
            type: TEXT
            priority: '6'
            section_name: Thresholds
            label: 'CPU utilization critical threshold'
            description: 'Critical threshold of CPU utilization, expressed in %. In the range from 0 to 100 inclusive.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$AZURE.DB.MEMORY.UTIL.CRIT}'
          value: '90'
          description: 'The critical threshold of memory utilization, expressed in %.'
          config:
            type: TEXT
            priority: '7'
            section_name: Thresholds
            label: 'Memory utilization critical threshold'
            description: 'Critical threshold of memory utilization, expressed in %. In the range from 0 to 100 inclusive.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$AZURE.DB.STORAGE.PUSED.CRIT}'
          value: '90'
          description: 'The critical threshold of storage utilization, expressed in %.'
          config:
            type: TEXT
            priority: '9'
            section_name: Thresholds
            label: 'Storage utilization critical threshold'
            description: 'Critical threshold of storage utilization, expressed in %. In the range from 0 to 100 inclusive.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$AZURE.DB.STORAGE.PUSED.WARN}'
          value: '80'
          description: 'The warning threshold of storage utilization, expressed in %.'
          config:
            type: TEXT
            priority: '8'
            section_name: Thresholds
            label: 'Storage utilization warning threshold'
            description: 'Warning threshold of storage utilization, expressed in %. In the range from 0 to 100 inclusive.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$AZURE.PASSWORD}'
          type: SECRET_TEXT
          description: 'Microsoft Azure password.'
          config:
            type: TEXT
            priority: '4'
            label: 'Azure password'
            description: 'Microsoft Azure password.'
            required: 'YES'
        - macro: '{$AZURE.PROXY}'
          description: 'Sets the HTTP proxy value. If this macro is empty, then no proxy is used.'
          config:
            type: TEXT
            priority: '11'
            section_name: Other
            label: 'HTTP proxy'
            description: 'HTTP proxy to use for requests.'
        - macro: '{$AZURE.RESOURCE.ID}'
          description: 'Microsoft Azure Microsoft SQL database ID.'
          config:
            type: TEXT
            priority: '5'
            label: 'Azure MSSQL database ID'
            description: 'Microsoft Azure MSSQL database ID.'
            required: 'YES'
        - macro: '{$AZURE.SUBSCRIPTION.ID}'
          description: 'Microsoft Azure subscription ID.'
          config:
            type: TEXT
            priority: '1'
            label: 'Azure subscription ID'
            description: 'Microsoft Azure subscription ID.'
            required: 'YES'
        - macro: '{$AZURE.TENANT.ID}'
          description: 'Microsoft Azure tenant ID.'
          config:
            type: TEXT
            priority: '2'
            label: 'Azure tenant ID'
            description: 'Microsoft Azure tenant ID.'
            required: 'YES'
      dashboards:
        - uuid: 72b6f0916b9245adadb3445327aed633
          name: 'Overview Azure Microsoft SQL Database'
          pages:
            - widgets:
                - type: item
                  name: Deadlocks
                  width: '12'
                  height: '3'
                  fields:
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure Microsoft SQL Database by HTTP'
                        key: azure.db.mssql.deadlocks
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'SQL Server process memory percent'
                  'y': '3'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure Microsoft SQL Database by HTTP'
                        key: azure.db.mssql.server.memory.percent
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: STRING
                      name: units
                      value: '%'
                - type: item
                  name: 'CPU limit'
                  'y': '6'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure Microsoft SQL Database by HTTP'
                        key: azure.db.mssql.cpu.limit
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'Data space allocated'
                  'y': '9'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure Microsoft SQL Database by HTTP'
                        key: azure.db.mssql.storage.allocated
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'Connections successful'
                  'y': '12'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure Microsoft SQL Database by HTTP'
                        key: azure.db.mssql.connections.successful
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'Availability state'
                  x: '12'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure Microsoft SQL Database by HTTP'
                        key: azure.db.mssql.availability.state
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: STRING
                      name: up_color
                      value: FF0000
                - type: item
                  name: 'SQL Server process core percent'
                  x: '12'
                  'y': '3'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure Microsoft SQL Database by HTTP'
                        key: azure.db.mssql.server.cpu.percent
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: STRING
                      name: units
                      value: '%'
                - type: item
                  name: 'CPU used'
                  x: '12'
                  'y': '6'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure Microsoft SQL Database by HTTP'
                        key: azure.db.mssql.cpu.used
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'Data space used'
                  x: '12'
                  'y': '9'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure Microsoft SQL Database by HTTP'
                        key: azure.db.mssql.storage.used
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'Connections failed: System errors'
                  x: '12'
                  'y': '12'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure Microsoft SQL Database by HTTP'
                        key: azure.db.mssql.connections.failed.system
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: itemhistory
                  name: 'Availability status detailed'
                  x: '24'
                  width: '48'
                  height: '3'
                  fields:
                    - type: INTEGER
                      name: columns.0.display
                      value: '4'
                    - type: ITEM
                      name: columns.0.itemid
                      value:
                        host: 'Azure Microsoft SQL Database by HTTP'
                        key: azure.db.mssql.availability.details
                    - type: INTEGER
                      name: columns.0.monospace_font
                      value: '1'
                    - type: STRING
                      name: columns.0.name
                      value: 'Azure Microsoft SQL: Availability status detailed'
                    - type: STRING
                      name: reference
                      value: BAAAG
                    - type: INTEGER
                      name: show_timestamp
                      value: '1'
                - type: item
                  name: 'Sessions count'
                  x: '24'
                  'y': '3'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure Microsoft SQL Database by HTTP'
                        key: azure.db.mssql.sessions.count
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: graph
                  name: 'Percentage CPU'
                  x: '24'
                  'y': '6'
                  width: '48'
                  height: '3'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Azure Microsoft SQL Database by HTTP'
                        name: 'Azure Microsoft SQL: CPU usage'
                    - type: STRING
                      name: reference
                      value: AAAAA
                - type: graph
                  name: 'Storage utilization'
                  x: '24'
                  'y': '9'
                  width: '48'
                  height: '3'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Azure Microsoft SQL Database by HTTP'
                        name: 'Azure Microsoft SQL: Storage utilization'
                    - type: STRING
                      name: reference
                      value: AAAAB
                - type: graph
                  name: Connections
                  x: '24'
                  'y': '12'
                  width: '48'
                  height: '3'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Azure Microsoft SQL Database by HTTP'
                        name: 'Azure Microsoft SQL: Connections'
                    - type: STRING
                      name: reference
                      value: AAAAC
                - type: item
                  name: 'Workers percentage'
                  x: '36'
                  'y': '3'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure Microsoft SQL Database by HTTP'
                        key: azure.db.mssql.workers.percent
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: STRING
                      name: units
                      value: '%'
                - type: item
                  name: 'Full backup storage size'
                  x: '48'
                  'y': '3'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure Microsoft SQL Database by HTTP'
                        key: azure.db.mssql.storage.backup.size
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'Data IO percentage'
                  x: '60'
                  'y': '3'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure Microsoft SQL Database by HTTP'
                        key: azure.db.mssql.data.read.percentage
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: STRING
                      name: units
                      value: '%'
      valuemaps:
        - uuid: 6f9c01899d9e45c9a1316ee081718e9e
          name: 'Azure resource health state'
          mappings:
            - value: '0'
              newvalue: Available
            - value: '1'
              newvalue: Degraded
            - value: '2'
              newvalue: Unavailable
            - value: '3'
              newvalue: Unknown
    - uuid: c3a9fa0e07be4c1bbe19ae65c3375d17
      template: 'Azure Microsoft SQL DTU Database by HTTP'
      name: 'Azure Microsoft SQL DTU Database by HTTP'
      description: |
        This template is designed to monitor Microsoft SQL DTU-based databases via 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"
      wizard_ready: 'YES'
      readme: |
        ## Overview
        
        This template is designed to monitor Microsoft SQL DTU-based databases via 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 [Azure documentation](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 host wizard configuration fields: `Azure App ID`, `Azure password`, `Azure tenant ID`, `Azure subscription ID` and `Azure SQL DTU-based database ID`.
      vendor:
        name: Zabbix
        version: 8.0-2
      groups:
        - name: Templates/Cloud
      items:
        - uuid: d13b970f51c64553942d04043dd3f8b5
          name: 'Availability status detailed'
          type: DEPENDENT
          key: azure.db.mssql.availability.details
          value_type: CHAR
          description: 'A detailed summary of the availability status.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.health.summary
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: health
        - uuid: 96a795438e244fefa2218fcd73542201
          name: 'Availability state'
          type: DEPENDENT
          key: azure.db.mssql.availability.state
          description: 'The availability status of the resource.'
          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.db.mssql.data.get
          tags:
            - tag: component
              value: health
          triggers:
            - uuid: 6bf8f84c7b494c4da90ef5e47fa75627
              expression: 'last(/Azure Microsoft SQL DTU Database by HTTP/azure.db.mssql.availability.state)=1'
              name: 'Azure MSSQL DTU: Microsoft SQL database is degraded'
              opdata: 'Current state: {ITEM.LASTVALUE1}'
              priority: AVERAGE
              description: 'The resource is in a degraded state.'
              tags:
                - tag: scope
                  value: availability
            - uuid: 4196d310e6e84c61a0a7115116f10854
              expression: 'last(/Azure Microsoft SQL DTU Database by HTTP/azure.db.mssql.availability.state)=3'
              name: 'Azure MSSQL DTU: Microsoft SQL database is in unknown state'
              opdata: 'Current state: {ITEM.LASTVALUE1}'
              priority: WARNING
              description: 'The resource state is unknown.'
              tags:
                - tag: scope
                  value: availability
            - uuid: b6f356182f3d4b0c88f52d88fce580b9
              expression: 'last(/Azure Microsoft SQL DTU Database by HTTP/azure.db.mssql.availability.state)=2'
              name: 'Azure MSSQL DTU: Microsoft SQL database is unavailable'
              opdata: 'Current state: {ITEM.LASTVALUE1}'
              priority: HIGH
              description: 'The resource state is unavailable.'
              tags:
                - tag: scope
                  value: availability
        - uuid: adc84144c91c4e4091e10e2f07d3e026
          name: 'Connections failed: System errors'
          type: DEPENDENT
          key: azure.db.mssql.connections.failed.system
          value_type: FLOAT
          description: 'The number of failed connections with system errors.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.connection_failed.total
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: network
        - uuid: f55c3fcf1a4b4539a6770496453e3ee8
          name: 'Connections successful'
          type: DEPENDENT
          key: azure.db.mssql.connections.successful
          value_type: FLOAT
          description: 'The number of successful connections.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.connection_successful.total
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: network
        - uuid: fb2f97642cb647afaf5f52bb14b6a91c
          name: 'CPU percentage'
          type: DEPENDENT
          key: azure.db.mssql.cpu.percentage
          value_type: FLOAT
          units: '%'
          description: 'The average percentage of CPU usage on a host.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.cpu_percent.average
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: cpu
          triggers:
            - uuid: 97caae1175be4c21b2fd5a53d5be25d2
              expression: 'min(/Azure Microsoft SQL DTU Database by HTTP/azure.db.mssql.cpu.percentage,5m)>{$AZURE.DB.CPU.UTIL.CRIT}'
              name: 'Azure MSSQL DTU: High CPU utilization'
              opdata: 'Current utilization: {ITEM.LASTVALUE1}'
              priority: HIGH
              description: 'The CPU utilization is too high. The system might be slow to respond.'
              tags:
                - tag: scope
                  value: performance
        - uuid: 86c709baa2e54477b483eb9289b7ae78
          name: 'Get errors'
          type: DEPENDENT
          key: azure.db.mssql.data.errors
          value_type: TEXT
          description: 'A list of errors from API requests.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.errors
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: raw
          triggers:
            - uuid: a21b8c56bd914548949c277c77efbd4b
              expression: 'length(last(/Azure Microsoft SQL DTU Database by HTTP/azure.db.mssql.data.errors))>0'
              name: 'Azure MSSQL DTU: There are errors in requests to API'
              opdata: 'Current error: {ITEM.LASTVALUE1}'
              priority: AVERAGE
              description: 'Zabbix has received errors in response to API requests.'
              tags:
                - tag: scope
                  value: availability
        - uuid: 4349f68c08a548d19d9ce58e66557ce5
          name: 'Get data'
          type: SCRIPT
          key: azure.db.mssql.data.get
          history: '0'
          value_type: TEXT
          params: |
            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;
            	},
            
            	login: function () {
            		var response, login = new HttpRequest();
            
            		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();
            
            		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 DTU DB ] 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 = {
            				'metrics_main': '/providers/Microsoft.Insights/metrics?metricnames=' + encodeURIComponent('allocated_data_storage,availability,blocked_by_firewall,connection_failed,connection_successful,cpu_percent,deadlock,dtu_consumption_percent,dtu_limit,dtu_used,log_write_percent,physical_data_read_percent,sessions_count,sessions_percent,sql_instance_cpu_percent,sql_instance_memory_percent,storage,storage_percent') + '&api-version=2021-05-01&timespan=PT5M',
            				'metrics_secondary': '/providers/Microsoft.Insights/metrics?metricnames=' + encodeURIComponent('tempdb_data_size,tempdb_log_size,tempdb_log_used_percent,workers_percent,xtp_storage_percent') + '&api-version=2021-05-01&timespan=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--) {
            
            					dataseriesKeys = Object.keys(values[i]);
            					aggregation = dataseriesKeys[1];
            
            					if (typeof (values[i][aggregation]) !== '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');
            
            		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 DTU DB ] ERROR: ' + error);
            	return JSON.stringify({ 'error': error });
            }
          description: 'The result of API requests is expressed in JSON format.'
          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}'
          tags:
            - tag: component
              value: raw
        - uuid: 447d6c462a384e87860eeba0b1e17787
          name: 'Data IO percentage'
          type: DEPENDENT
          key: azure.db.mssql.data.read.percentage
          value_type: FLOAT
          units: '%'
          description: 'The average percentage of physical data read.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.physical_data_read_percent.average
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: operations
        - uuid: 192a5d5a4c6541b1a2e6394dc4e6961d
          name: Deadlocks
          type: DEPENDENT
          key: azure.db.mssql.deadlocks
          value_type: FLOAT
          description: 'The number of deadlocks. Not applicable to data warehouses.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.deadlock.total
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: network
        - uuid: 1b9a19283e9f4f5c9ec386edbfd99d86
          name: 'DTU limit'
          type: DEPENDENT
          key: azure.db.mssql.dtu.limit
          value_type: FLOAT
          description: 'The DTU limit. Applicable to DTU-based databases.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.dtu_limit.average
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: dtu
        - uuid: 35daacf9b481454bbf017841c3b4acf6
          name: 'DTU percentage'
          type: DEPENDENT
          key: azure.db.mssql.dtu.percentage
          value_type: FLOAT
          units: '%'
          description: 'The average percentage of DTU consumption for a DTU-based database.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.dtu_consumption_percent.average
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: dtu
          triggers:
            - uuid: eceb245b910841ceb8078ea8b3dbad1b
              expression: 'min(/Azure Microsoft SQL DTU Database by HTTP/azure.db.mssql.dtu.percentage,5m)>{$AZURE.DB.DTU.UTIL.CRIT}'
              name: 'Azure MSSQL DTU: High DTU utilization'
              opdata: 'Current utilization: {ITEM.LASTVALUE1}'
              priority: HIGH
              description: 'The DTU utilization is too high. The system might be slow to respond.'
              tags:
                - tag: scope
                  value: performance
        - uuid: 9bd9b5d0fc1d439ebfdfac51f6eb3487
          name: 'DTU used'
          type: DEPENDENT
          key: azure.db.mssql.dtu.used
          value_type: FLOAT
          description: 'The DTU used. Applicable to DTU-based databases.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.dtu_used.average
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: dtu
        - uuid: 4a0b3146d95742b1a30950da3fb6dcc5
          name: 'Connections blocked by firewall'
          type: DEPENDENT
          key: azure.db.mssql.firewall.blocked
          value_type: FLOAT
          description: 'The number of connections blocked by the firewall.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.blocked_by_firewall.total
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: network
        - uuid: 0f71327c99054e5d8ebf432eccc0a536
          name: 'Log IO percentage'
          type: DEPENDENT
          key: azure.db.mssql.log.write.percentage
          value_type: FLOAT
          units: '%'
          description: 'The percentage of I/O used for log writes. Not applicable to data warehouses.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.log_write_percent.average
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: operations
        - uuid: 218525cc5d474d249d62db21ca08d7c6
          name: 'SQL instance CPU percent'
          type: DEPENDENT
          key: azure.db.mssql.server.cpu.percent
          value_type: FLOAT
          units: '%'
          description: 'CPU usage from all user and system workloads. Not applicable to data warehouses.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.sql_instance_cpu_percent.maximum
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: cpu
            - tag: component
              value: server
        - uuid: d6d0d99c736f4ecea48c3cb5d920ee72
          name: 'SQL instance memory percent'
          type: DEPENDENT
          key: azure.db.mssql.server.memory.percent
          value_type: FLOAT
          units: '%'
          description: 'The percentage of memory used by the database engine instance. Not applicable to data warehouses.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.sql_instance_cpu_percent.maximum
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: memory
            - tag: component
              value: server
        - uuid: b9d6045642de46e08c45cca9b619bf75
          name: 'Sessions count'
          type: DEPENDENT
          key: azure.db.mssql.sessions.count
          value_type: FLOAT
          description: 'The number of active sessions. Not applicable to Synapse DW Analytics.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.sessions_count.average
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: sessions
        - uuid: 62298388449448e18fb0efb5b139b79c
          name: 'Sessions percentage'
          type: DEPENDENT
          key: azure.db.mssql.sessions.percent
          value_type: FLOAT
          units: '%'
          description: 'The percentage of sessions. Not applicable to data warehouses.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.sessions_percent.average
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: sessions
        - uuid: e5cec53daadf40f79f580af1df77c35c
          name: 'Data space allocated'
          type: DEPENDENT
          key: azure.db.mssql.storage.allocated
          value_type: FLOAT
          units: B
          description: 'The allocated data storage. Not applicable to data warehouses.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.allocated_data_storage.average
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 7c66b3e9b28043098a1d942c48fc0369
          name: 'Log backup storage size'
          type: DEPENDENT
          key: azure.db.mssql.storage.backup.log.size
          value_type: FLOAT
          units: B
          description: 'The cumulative log backup storage size. Applies to vCore-based and Hyperscale databases.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.log_backup_size_bytes.maximum
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1d
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 6a09939f232f4a078aa088f0dbcf370c
          name: 'Data space used percent'
          type: DEPENDENT
          key: azure.db.mssql.storage.percent
          value_type: FLOAT
          units: '%'
          description: 'Data space used in percent. Not applicable to data warehouses or Hyperscale databases.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.storage_percent.maximum
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: storage
          triggers:
            - uuid: b13d1ed5b1144e0095dca50bcbba37ae
              expression: 'last(/Azure Microsoft SQL DTU Database by HTTP/azure.db.mssql.storage.percent)>{$AZURE.DB.STORAGE.PUSED.CRIT}'
              name: 'Azure MSSQL DTU: Storage space is critically low'
              opdata: 'Current space used: {ITEM.LASTVALUE1}%'
              priority: AVERAGE
              description: 'Critical utilization of the storage space.'
              tags:
                - tag: scope
                  value: capacity
            - uuid: 74c7b9f109924177a37bc7717c6f39e0
              expression: 'last(/Azure Microsoft SQL DTU Database by HTTP/azure.db.mssql.storage.percent)>{$AZURE.DB.STORAGE.PUSED.WARN}'
              name: 'Azure MSSQL DTU: Storage space is low'
              opdata: 'Current space used: {ITEM.LASTVALUE1}%'
              priority: WARNING
              description: 'High utilization of the storage space.'
              dependencies:
                - name: 'Azure MSSQL DTU: Storage space is critically low'
                  expression: 'last(/Azure Microsoft SQL DTU Database by HTTP/azure.db.mssql.storage.percent)>{$AZURE.DB.STORAGE.PUSED.CRIT}'
              tags:
                - tag: scope
                  value: capacity
        - uuid: 829a31cfbd58473fb6aca227623dd374
          name: 'Data space used'
          type: DEPENDENT
          key: azure.db.mssql.storage.used
          value_type: FLOAT
          units: B
          description: 'Data space used. Not applicable to data warehouses.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.storage.maximum
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 154d7dd42d2849be9d3cf92e11a6f923
          name: 'In-Memory OLTP storage percent'
          type: DEPENDENT
          key: azure.db.mssql.storage.xtp.percent
          value_type: FLOAT
          units: '%'
          description: 'In-Memory OLTP storage percent. Not applicable to data warehouses.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.xtp_storage_percent.average
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: storage
        - uuid: d9a7c8558eb7418eb1113342d0c6225a
          name: 'Tempdb data file size'
          type: DEPENDENT
          key: azure.db.mssql.tempdb.data.size
          value_type: FLOAT
          units: B
          description: 'The space used in `tempdb` data files, expressed in bytes. Not applicable to data warehouses.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.tempdb_data_size.maximum
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1024'
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: storage
        - uuid: a3d555807a4247e9ba3c388ae75bb5ce
          name: 'Tempdb log used percent'
          type: DEPENDENT
          key: azure.db.mssql.tempdb.log.percent
          value_type: FLOAT
          units: '%'
          description: 'The percentage of space used in the `tempdb` transaction log file. Not applicable to data warehouses.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.tempdb_log_used_percent.maximum
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 3e64483271b347ceb300288079451f3e
          name: 'Tempdb log file size'
          type: DEPENDENT
          key: azure.db.mssql.tempdb.log.size
          value_type: FLOAT
          units: B
          description: 'The space used in the `tempdb` transaction log file, expressed in bytes. Not applicable to data warehouses.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.tempdb_log_size.maximum
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1024'
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 75ad7da5a2c74022ace6f28fed2c8ef2
          name: 'Workers percentage'
          type: DEPENDENT
          key: azure.db.mssql.workers.percent
          value_type: FLOAT
          units: '%'
          description: 'The percentage of workers. Not applicable to data warehouses.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.workers_percent.average
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: workers
      tags:
        - tag: class
          value: cloud
        - tag: subclass
          value: sql
        - tag: target
          value: azure
        - tag: target
          value: mssql
      macros:
        - macro: '{$AZURE.APP.ID}'
          description: 'The App ID of Microsoft Azure.'
          config:
            type: TEXT
            priority: '3'
            label: 'Azure App ID'
            description: 'Microsoft Azure App ID.'
            required: 'YES'
        - macro: '{$AZURE.DATA.TIMEOUT}'
          value: 15s
          description: 'API response timeout.'
          config:
            type: TEXT
            priority: '10'
            section_name: Other
            label: 'API timeout'
            description: 'API response timeout, in seconds.'
        - macro: '{$AZURE.DB.CPU.UTIL.CRIT}'
          value: '90'
          description: 'The critical threshold of CPU utilization, expressed in %.'
          config:
            type: TEXT
            priority: '6'
            section_name: Thresholds
            label: 'CPU utilization critical threshold'
            description: 'Critical threshold of CPU utilization, expressed in %. In the range from 0 to 100 inclusive.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$AZURE.DB.MEMORY.UTIL.CRIT}'
          value: '90'
          description: 'The critical threshold of memory utilization, expressed in %.'
          config:
            type: TEXT
            priority: '7'
            section_name: Thresholds
            label: 'Memory utilization critical threshold'
            description: 'Critical threshold of memory utilization, expressed in %. In the range from 0 to 100 inclusive.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$AZURE.DB.STORAGE.PUSED.CRIT}'
          value: '90'
          description: 'The critical threshold of storage utilization, expressed in %.'
          config:
            type: TEXT
            priority: '9'
            section_name: Thresholds
            label: 'Storage utilization critical threshold'
            description: 'Critical threshold of storage utilization, expressed in %. In the range from 0 to 100 inclusive.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$AZURE.DB.STORAGE.PUSED.WARN}'
          value: '80'
          description: 'The warning threshold of storage utilization, expressed in %.'
          config:
            type: TEXT
            priority: '8'
            section_name: Thresholds
            label: 'Storage utilization warning threshold'
            description: 'Warning threshold of storage utilization, expressed in %. In the range from 0 to 100 inclusive.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$AZURE.PASSWORD}'
          type: SECRET_TEXT
          description: 'Microsoft Azure password.'
          config:
            type: TEXT
            priority: '4'
            label: 'Azure password'
            description: 'Microsoft Azure password.'
            required: 'YES'
        - macro: '{$AZURE.PROXY}'
          description: 'Sets the HTTP proxy value. If this macro is empty, then no proxy is used.'
          config:
            type: TEXT
            priority: '11'
            section_name: Other
            label: 'HTTP proxy'
            description: 'HTTP proxy to use for requests.'
        - macro: '{$AZURE.RESOURCE.ID}'
          description: 'Microsoft Azure SQL DTU-based database ID.'
          config:
            type: TEXT
            priority: '5'
            label: 'Azure SQL DTU-based database ID'
            description: 'Microsoft Azure SQL DTU-based database ID.'
            required: 'YES'
        - macro: '{$AZURE.SUBSCRIPTION.ID}'
          description: 'Microsoft Azure subscription ID.'
          config:
            type: TEXT
            priority: '1'
            label: 'Azure subscription ID'
            description: 'Microsoft Azure subscription ID.'
            required: 'YES'
        - macro: '{$AZURE.TENANT.ID}'
          description: 'Microsoft Azure tenant ID.'
          config:
            type: TEXT
            priority: '2'
            label: 'Azure tenant ID'
            description: 'Microsoft Azure tenant ID.'
            required: 'YES'
      dashboards:
        - uuid: 0e19ba53f50c48c3bce738d5420096cb
          name: 'Overview Azure Microsoft SQL Database'
          pages:
            - widgets:
                - type: item
                  name: Deadlocks
                  width: '12'
                  height: '3'
                  fields:
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure Microsoft SQL DTU Database by HTTP'
                        key: azure.db.mssql.deadlocks
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'SQL Server process memory percent'
                  'y': '3'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure Microsoft SQL DTU Database by HTTP'
                        key: azure.db.mssql.server.memory.percent
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: STRING
                      name: units
                      value: '%'
                - type: item
                  name: 'DTU limit'
                  'y': '6'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure Microsoft SQL DTU Database by HTTP'
                        key: azure.db.mssql.dtu.limit
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'Data space allocated'
                  'y': '9'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure Microsoft SQL DTU Database by HTTP'
                        key: azure.db.mssql.storage.allocated
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'Connections successful'
                  'y': '12'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure Microsoft SQL DTU Database by HTTP'
                        key: azure.db.mssql.connections.successful
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'Availability state'
                  x: '12'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure Microsoft SQL DTU Database by HTTP'
                        key: azure.db.mssql.availability.state
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: STRING
                      name: up_color
                      value: FF0000
                - type: item
                  name: 'SQL Server process core percent'
                  x: '12'
                  'y': '3'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure Microsoft SQL DTU Database by HTTP'
                        key: azure.db.mssql.server.cpu.percent
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: STRING
                      name: units
                      value: '%'
                - type: item
                  name: 'DTU used'
                  x: '12'
                  'y': '6'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure Microsoft SQL DTU Database by HTTP'
                        key: azure.db.mssql.dtu.used
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'Data space used'
                  x: '12'
                  'y': '9'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure Microsoft SQL DTU Database by HTTP'
                        key: azure.db.mssql.storage.used
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'Connections failed: System errors'
                  x: '12'
                  'y': '12'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure Microsoft SQL DTU Database by HTTP'
                        key: azure.db.mssql.connections.failed.system
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: itemhistory
                  name: 'Availability status detailed'
                  x: '24'
                  width: '48'
                  height: '3'
                  fields:
                    - type: INTEGER
                      name: columns.0.display
                      value: '4'
                    - type: ITEM
                      name: columns.0.itemid
                      value:
                        host: 'Azure Microsoft SQL DTU Database by HTTP'
                        key: azure.db.mssql.availability.details
                    - type: INTEGER
                      name: columns.0.monospace_font
                      value: '1'
                    - type: STRING
                      name: columns.0.name
                      value: 'Azure Microsoft SQL: Availability status detailed'
                    - type: STRING
                      name: reference
                      value: BAAAG
                    - type: INTEGER
                      name: show_timestamp
                      value: '1'
                - type: item
                  name: 'Sessions count'
                  x: '24'
                  'y': '3'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure Microsoft SQL DTU Database by HTTP'
                        key: azure.db.mssql.sessions.count
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: graph
                  name: 'DTU percentage'
                  x: '24'
                  'y': '6'
                  width: '48'
                  height: '3'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Azure Microsoft SQL DTU Database by HTTP'
                        name: 'Azure Microsoft SQL: DTU usage'
                    - type: STRING
                      name: reference
                      value: AAAAA
                - type: graph
                  name: 'Storage utilization'
                  x: '24'
                  'y': '9'
                  width: '48'
                  height: '3'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Azure Microsoft SQL DTU Database by HTTP'
                        name: 'Azure Microsoft SQL: Storage utilization'
                    - type: STRING
                      name: reference
                      value: AAAAB
                - type: graph
                  name: Connections
                  x: '24'
                  'y': '12'
                  width: '48'
                  height: '3'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Azure Microsoft SQL DTU Database by HTTP'
                        name: 'Azure Microsoft SQL: Connections'
                    - type: STRING
                      name: reference
                      value: AAAAC
                - type: item
                  name: 'Workers percentage'
                  x: '36'
                  'y': '3'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure Microsoft SQL DTU Database by HTTP'
                        key: azure.db.mssql.workers.percent
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: STRING
                      name: units
                      value: '%'
                - type: item
                  name: 'CPU percentage'
                  x: '48'
                  'y': '3'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure Microsoft SQL DTU Database by HTTP'
                        key: azure.db.mssql.cpu.percentage
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: STRING
                      name: units
                      value: '%'
                - type: item
                  name: 'Data IO percentage'
                  x: '60'
                  'y': '3'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure Microsoft SQL DTU Database by HTTP'
                        key: azure.db.mssql.data.read.percentage
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: STRING
                      name: units
                      value: '%'
      valuemaps:
        - uuid: 34874b4cf9cb4ce2863a5698ff308126
          name: 'Azure resource health state'
          mappings:
            - value: '0'
              newvalue: Available
            - value: '1'
              newvalue: Degraded
            - value: '2'
              newvalue: Unavailable
            - value: '3'
              newvalue: Unknown
    - uuid: 5175afdf713744d9a81ce53864ccfc1d
      template: 'Azure Microsoft SQL Serverless Database by HTTP'
      name: 'Azure Microsoft SQL Serverless Database by HTTP'
      description: |
        This template is designed to monitor Microsoft SQL serverless databases 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"
      wizard_ready: 'YES'
      readme: |
        ## Overview
        
        This template is designed to monitor Microsoft SQL serverless databases 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 [Azure documentation](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 host wizard configuration fields: `Azure App ID`, `Azure password`, `Azure tenant ID`, `Azure subscription ID`, and `Azure MSSQL database ID`.
      vendor:
        name: Zabbix
        version: 8.0-2
      groups:
        - name: Templates/Cloud
      items:
        - uuid: 7c11fcc4f4b349f8b98fac93ae5e32be
          name: 'App CPU billed'
          type: DEPENDENT
          key: azure.db.mssql.app.cpu.billed
          value_type: FLOAT
          description: 'App CPU billed. Applies to serverless databases.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.app_cpu_billed.total
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: cpu
        - uuid: 6e67a868b2d84838803d3cb464ae9648
          name: 'App CPU percentage'
          type: DEPENDENT
          key: azure.db.mssql.app.cpu.percent
          value_type: FLOAT
          units: '%'
          description: 'App CPU percentage. Applies to serverless databases.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.app_cpu_percent.average
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: cpu
        - uuid: a38a887341914e75a01c7527c40b678f
          name: 'App memory percentage'
          type: DEPENDENT
          key: azure.db.mssql.app.memory.percent
          value_type: FLOAT
          units: '%'
          description: 'App memory percentage. Applies to serverless databases.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.app_memory_percent.average
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: memory
        - uuid: c2d3bc4ff95b4e05898dccee3d73a349
          name: 'Availability status detailed'
          type: DEPENDENT
          key: azure.db.mssql.availability.details
          value_type: CHAR
          description: 'The summary description of the availability status.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.health.summary
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: health
        - uuid: 9a3f2e99a768492c859c8f368c6a5cd3
          name: 'Availability state'
          type: DEPENDENT
          key: azure.db.mssql.availability.state
          description: 'The availability status of the resource.'
          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.db.mssql.data.get
          tags:
            - tag: component
              value: health
          triggers:
            - uuid: 37c52a28908a45378266f68acdf5c308
              expression: 'last(/Azure Microsoft SQL Serverless Database by HTTP/azure.db.mssql.availability.state)=1'
              name: 'Azure MSSQL Serverless: Microsoft SQL database is degraded'
              opdata: '{ITEM.LASTVALUE1}'
              priority: AVERAGE
              description: 'The resource is in a degraded state.'
              tags:
                - tag: scope
                  value: availability
            - uuid: 20bd79f05f3241a9950a83dcd9e325ba
              expression: 'last(/Azure Microsoft SQL Serverless Database by HTTP/azure.db.mssql.availability.state)=3'
              name: 'Azure MSSQL Serverless: Microsoft SQL database is in unknown state'
              opdata: '{ITEM.LASTVALUE1}'
              priority: WARNING
              description: 'The resource state is unknown.'
              tags:
                - tag: scope
                  value: availability
            - uuid: 124813388e9844e8aae5ce474a66a774
              expression: 'last(/Azure Microsoft SQL Serverless Database by HTTP/azure.db.mssql.availability.state)=2'
              name: 'Azure MSSQL Serverless: Microsoft SQL database is unavailable'
              opdata: '{ITEM.LASTVALUE1}'
              priority: HIGH
              description: 'The resource state is unavailable.'
              tags:
                - tag: scope
                  value: availability
        - uuid: 2457708a49d141faa16bd7b4ceb2c0a4
          name: 'Connections failed: System errors'
          type: DEPENDENT
          key: azure.db.mssql.connections.failed.system
          value_type: FLOAT
          description: 'The count of failed connections with system errors.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.connection_failed.total
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: network
        - uuid: 59e028a7323d4222a4efd727314327c1
          name: 'Connections successful'
          type: DEPENDENT
          key: azure.db.mssql.connections.successful
          value_type: FLOAT
          description: 'The count of successful connections.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.connection_successful.total
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: network
        - uuid: 0dc1cf6302574c1fbb51583e03409713
          name: 'CPU limit'
          type: DEPENDENT
          key: azure.db.mssql.cpu.limit
          value_type: FLOAT
          description: 'The CPU limit. Applies to the vCore-based databases.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.cpu_limit.average
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: cpu
        - uuid: 53be31ecfd48472c8edfe223107c0b07
          name: 'Percentage CPU'
          type: DEPENDENT
          key: azure.db.mssql.cpu.percentage
          value_type: FLOAT
          units: '%'
          description: 'The CPU percent of a host.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.cpu_percent.average
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: cpu
          triggers:
            - uuid: 933a04a1455b4a89b1527f9ce7848259
              expression: 'min(/Azure Microsoft SQL Serverless Database by HTTP/azure.db.mssql.cpu.percentage,5m)>{$AZURE.DB.CPU.UTIL.CRIT}'
              name: 'Azure MSSQL Serverless: High CPU utilization'
              opdata: 'Current utilization: {ITEM.LASTVALUE1}'
              priority: HIGH
              description: 'The CPU utilization is too high. The system might be slow to respond.'
              tags:
                - tag: scope
                  value: performance
        - uuid: ec0fc85904e149939836c2818a6ca66a
          name: 'CPU used'
          type: DEPENDENT
          key: azure.db.mssql.cpu.used
          value_type: FLOAT
          description: 'The CPU used. Applies to the vCore-based databases.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.cpu_used.average
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: cpu
        - uuid: d933dbacb2b94e40a757e15f13d51d2d
          name: 'Get errors'
          type: DEPENDENT
          key: azure.db.mssql.data.errors
          value_type: TEXT
          description: 'A list of errors from API requests.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.errors
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: raw
          triggers:
            - uuid: f56b125a8eff49d2aa002609c7df8b34
              expression: 'length(last(/Azure Microsoft SQL Serverless Database by HTTP/azure.db.mssql.data.errors))>0'
              name: 'Azure MSSQL Serverless: 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: e1c668773b974deeaf64c0d51d1cb02d
          name: 'Get data'
          type: SCRIPT
          key: azure.db.mssql.data.get
          history: '0'
          value_type: TEXT
          params: |
            var AzureDB = {
            	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 + '.';
            			}
            		});
            
            		AzureDB.params = params;
            	},
            
            
            	request: function (url, data) {
            		if (typeof data === 'undefined' || data === null) {
            			data = '';
            		}
            		var response, request = new HttpRequest();
            		if (typeof AzureDB.params.proxy !== 'undefined' && AzureDB.params.proxy !== '') {
            			request.setProxy(AzureDB.params.proxy);
            		}
            		if (AzureDB.token) {
            			request.addHeader('Accept: application/json');
            			request.addHeader('Authorization: Bearer ' + AzureDB.token);
            		}
            
            		Zabbix.log(4, '[ Azure ] Sending request: ' + url);
            
            		if (data !== '') {
            			request.addHeader('Content-Type: application/x-www-form-urlencoded');
            			response = request.post(url, data);
            		}
            		else {
            			response = request.get(url);
            		}
            
            		Zabbix.log(4, '[ Azure ] Received response with status code ' + request.getStatus() + ': ' + response);
            
            		if (request.getStatus() !== 200 || response === null) {
            			throw 'Request failed with status code ' + request.getStatus() + ': ' + response;
            		}
            
            		try {
            			return JSON.parse(response);
            		}
            		catch (error) {
            			throw 'Failed to parse response received from API.';
            		}
            	}
            
            };
            
            var metrics = [
            	'cpu_percent',
            	'physical_data_read_percent',
            	'log_write_percent',
            	'storage',
            	'connection_successful',
            	'connection_failed',
            	'blocked_by_firewall',
            	'deadlock',
            	'storage_percent',
            	'xtp_storage_percent',
            	'workers_percent',
            	'sessions_percent',
            	'cpu_limit',
            	'cpu_used',
            	'sqlserver_process_core_percent',
            	'sqlserver_process_memory_percent',
            	'tempdb_data_size',
            	'tempdb_log_size',
            	'tempdb_log_used_percent',
            	'app_cpu_billed',
            	'app_cpu_percent',
            	'app_memory_percent',
            	'allocated_data_storage'
            ],
            	prepared_metrics = [],
            	data = {};
            	data['errors'] = {};
            	data['metrics'] = {};
            
            try {
            	AzureDB.setParams(JSON.parse(value));
            
            	try {
            		result = AzureDB.request(
            			'https://login.microsoftonline.com/' + encodeURIComponent(AzureDB.params.tenant_id) + '/oauth2/token',
            			'grant_type=client_credentials&resource=' + encodeURIComponent('https://management.azure.com/') + '&client_id=' + encodeURIComponent(AzureDB.params.app_id) + '&client_secret=' + encodeURIComponent(AzureDB.params.password)
            		);
            
            		if ('access_token' in result) {
            			AzureDB.token = result['access_token'];
            		} else {
            			throw 'Auth response does not contain access token.';
            		}
            	}
            	catch (error) {
            		data.errors.auth = error.toString();
            	}
            
            	if (!('auth' in data.errors)) {
            		try {
            			health = AzureDB.request('https://management.azure.com' + AzureDB.params.resource_id + '/providers/Microsoft.ResourceHealth/availabilityStatuses?api-version=2020-05-01');
            			if ('value' in health && Array.isArray(health.value) && health.value.length > 0 && 'properties' in health.value[0] && typeof health.value[0].properties === 'object') {
            				data.health = health.value[0].properties;
            			}
            		}
            		catch (error) {
            			data.errors.health = error.toString();
            		}
            
            		for (var i = 0; i < metrics.length; i += 20) {
            			var chunk = metrics.slice(i, i + 20);
            
            			prepared_metrics.push(
            				chunk.map(function (element) {
            					return encodeURIComponent(element);
            				}).join(',')
            			);
            		}
            
            		start_date = new Date((new Date().getTime()) - 300000).toISOString().replace(/\.\d+/, '');
            		end_date = new Date().toISOString().replace(/\.\d+/, '');
            
            		for (var j in prepared_metrics) {
            			try {
            				metrics_data = AzureDB.request('https://management.azure.com' + AzureDB.params.resource_id + '/providers/Microsoft.Insights/metrics?metricnames=' + prepared_metrics[j] + '&timespan=' + encodeURIComponent(start_date) + '/' + encodeURIComponent(end_date) + '&api-version=2021-05-01');
            				if ('value' in metrics_data && Array.isArray(metrics_data.value) && metrics_data.value.length > 0) {
            					for (k in metrics_data.value) {
            						if ('name' in metrics_data.value[k] && typeof metrics_data.value[k].name === 'object' && 'value' in metrics_data.value[k].name && typeof metrics_data.value[k].name.value === 'string' && 'timeseries' in metrics_data.value[k] && Array.isArray(metrics_data.value[k].timeseries) && metrics_data.value[k].timeseries.length > 0 && 'data' in metrics_data.value[k].timeseries[0] && Array.isArray(metrics_data.value[k].timeseries[0].data) && metrics_data.value[k].timeseries[0].data.length > 0) {
            							data.metrics[metrics_data.value[k].name.value.replace(/(\s|\/)+/g, '')] = metrics_data.value[k].timeseries[0].data[metrics_data.value[k].timeseries[0].data.length - 1];
            						}
            					}
            				}
            			}
            			catch (error) {
            				data.errors[prepared_metrics[j]] = error.toString();
            			}
            		}
            	}
            }
            catch (error) {
            	data.errors.params = error.toString();
            }
            
            if (Object.keys(data.errors).length !== 0) {
            	errors = 'Failed to receive data:';
            	for (var error in data.errors) {
            		errors += '\n' + error + ' : ' + data.errors[error];
            	}
            	data.errors = errors;
            }
            else {
            	data.errors = '';
            }
            
            return JSON.stringify(data);
          description: 'The result of API requests is expressed in the JSON.'
          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}'
          tags:
            - tag: component
              value: raw
        - uuid: 40b15dd3d7a943d99f1bbe7fb34a9f48
          name: 'Data IO percentage'
          type: DEPENDENT
          key: azure.db.mssql.data.read.percentage
          value_type: FLOAT
          units: '%'
          description: 'The physical data read percentage.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.physical_data_read_percent.average
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: operations
        - uuid: 25b97b67d87945b48ae5c44b1db20187
          name: Deadlocks
          type: DEPENDENT
          key: azure.db.mssql.deadlocks
          value_type: FLOAT
          description: 'The count of deadlocks. Not applicable to the data warehouses.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.deadlock.total
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: network
        - uuid: de91693b0a3345b4ad2c9aafd2af5325
          name: 'Connections blocked by firewall'
          type: DEPENDENT
          key: azure.db.mssql.firewall.blocked
          value_type: FLOAT
          description: 'The count of connections blocked by firewall.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.blocked_by_firewall.total
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: network
        - uuid: b41292705c284a77847856c2818d7145
          name: 'Log IO percentage'
          type: DEPENDENT
          key: azure.db.mssql.log.write.percentage
          value_type: FLOAT
          units: '%'
          description: 'The percentage of I/O log. Not applicable to the data warehouses.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.log_write_percent.average
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: operations
        - uuid: 7b772170199f41d4ab614dee66176630
          name: 'SQL Server process core percent'
          type: DEPENDENT
          key: azure.db.mssql.server.cpu.percent
          value_type: FLOAT
          units: '%'
          description: 'The CPU usage as a percentage of the SQL DB process. Not applicable to the data warehouses.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.sqlserver_process_core_percent.maximum
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: cpu
            - tag: component
              value: server
        - uuid: 5c0a5b745c094475b1e7a0d4f17a5627
          name: 'SQL Server process memory percent'
          type: DEPENDENT
          key: azure.db.mssql.server.memory.percent
          value_type: FLOAT
          units: '%'
          description: 'Memory usage as a percentage of the SQL DB process. Not applicable to the data warehouses.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.sqlserver_process_memory_percent.maximum
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: memory
            - tag: component
              value: server
        - uuid: 924d96d212764c3ab18e5c14daa58840
          name: 'Sessions percentage'
          type: DEPENDENT
          key: azure.db.mssql.sessions.percent
          value_type: FLOAT
          units: '%'
          description: 'The percentage of sessions. Not applicable to the data warehouses.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.sessions_percent.average
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: sessions
        - uuid: a87fd8ac96944e57ac58b39a18f6ad41
          name: 'Data space allocated'
          type: DEPENDENT
          key: azure.db.mssql.storage.allocated
          value_type: FLOAT
          units: B
          description: 'The allocated data storage. Not applicable to the data warehouses.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.allocated_data_storage.average
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 2f95fd2dd48c4664afc5cd62d02b0b0a
          name: 'Data space used percent'
          type: DEPENDENT
          key: azure.db.mssql.storage.percent
          value_type: FLOAT
          units: '%'
          description: 'The percentage of used data space. Not applicable to the data warehouses or Hyperscale databases.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.storage_percent.maximum
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: storage
          triggers:
            - uuid: 4638130e599243fba3206abc85a7447f
              expression: 'last(/Azure Microsoft SQL Serverless Database by HTTP/azure.db.mssql.storage.percent)>{$AZURE.DB.STORAGE.PUSED.CRIT}'
              name: 'Azure MSSQL Serverless: Storage space is critically low'
              opdata: 'Current utilization: {ITEM.LASTVALUE1}'
              priority: AVERAGE
              description: 'Critical utilization of the storage space.'
              tags:
                - tag: scope
                  value: capacity
            - uuid: 4732eab4aabf439fa0b2d80b63e821e5
              expression: 'last(/Azure Microsoft SQL Serverless Database by HTTP/azure.db.mssql.storage.percent)>{$AZURE.DB.STORAGE.PUSED.WARN}'
              name: 'Azure MSSQL Serverless: Storage space is low'
              opdata: 'Current utilization: {ITEM.LASTVALUE1}'
              priority: WARNING
              description: 'High utilization of the storage space.'
              tags:
                - tag: scope
                  value: capacity
        - uuid: 3b1fb8f993e74795b38abd56eceace0a
          name: 'Data space used'
          type: DEPENDENT
          key: azure.db.mssql.storage.used
          value_type: FLOAT
          units: B
          description: 'Data space used. Not applicable to the data warehouses.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.storage.maximum
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: storage
        - uuid: fbd572ca3d3f42eea794ce78a5a27ec1
          name: 'In-Memory OLTP storage percent'
          type: DEPENDENT
          key: azure.db.mssql.storage.xtp.percent
          value_type: FLOAT
          units: '%'
          description: 'In-Memory OLTP storage percent. Not applicable to the data warehouses.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.xtp_storage_percent.average
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: storage
        - uuid: cea8a8ea0eaa4d26a28721882c19d9cd
          name: 'Tempdb data file size'
          type: DEPENDENT
          key: azure.db.mssql.tempdb.data.size
          value_type: FLOAT
          units: B
          description: 'Space used in `tempdb` data files, expressed in bytes. Not applicable to the data warehouses.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.tempdb_data_size.maximum
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1024'
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 6c8196751a504b82920b7ffa5314a2fc
          name: 'Tempdb log used percent'
          type: DEPENDENT
          key: azure.db.mssql.tempdb.log.percent
          value_type: FLOAT
          units: '%'
          description: 'The percentage of space used in `tempdb` transaction log files. Not applicable to the data warehouses.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.tempdb_log_used_percent.maximum
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: storage
        - uuid: b83992d1001c41b6ad3d13dbb227a733
          name: 'Tempdb log file size'
          type: DEPENDENT
          key: azure.db.mssql.tempdb.log.size
          value_type: FLOAT
          units: B
          description: 'Space used in `tempdb` transaction log files, expressed in bytes. Not applicable to the data warehouses.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.tempdb_log_size.maximum
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1024'
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: storage
        - uuid: a4f597ab784a4e31aedc82bfb34feeb7
          name: 'Workers percentage'
          type: DEPENDENT
          key: azure.db.mssql.workers.percent
          value_type: FLOAT
          units: '%'
          description: 'The percentage of workers. Not applicable to the data warehouses.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.workers_percent.average
          master_item:
            key: azure.db.mssql.data.get
          tags:
            - tag: component
              value: workers
      tags:
        - tag: class
          value: cloud
        - tag: subclass
          value: sql
        - tag: target
          value: azure
        - tag: target
          value: mssql
      macros:
        - macro: '{$AZURE.APP.ID}'
          description: 'The App ID of Microsoft Azure.'
          config:
            type: TEXT
            priority: '3'
            label: 'Azure App ID'
            description: 'Microsoft Azure App ID.'
            required: 'YES'
        - macro: '{$AZURE.DATA.TIMEOUT}'
          value: 15s
          description: 'API response timeout.'
          config:
            type: TEXT
            priority: '10'
            section_name: Other
            label: 'API timeout'
            description: 'API response timeout, in seconds.'
        - macro: '{$AZURE.DB.CPU.UTIL.CRIT}'
          value: '90'
          description: 'The critical threshold of CPU utilization, expressed in %.'
          config:
            type: TEXT
            priority: '6'
            section_name: Thresholds
            label: 'CPU utilization critical threshold'
            description: 'Critical threshold of CPU utilization, expressed in %. In the range from 0 to 100 inclusive.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$AZURE.DB.MEMORY.UTIL.CRIT}'
          value: '90'
          description: 'The critical threshold of memory utilization, expressed in %.'
          config:
            type: TEXT
            priority: '7'
            section_name: Thresholds
            label: 'Memory utilization critical threshold'
            description: 'Critical threshold of memory utilization, expressed in %. In the range from 0 to 100 inclusive.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$AZURE.DB.STORAGE.PUSED.CRIT}'
          value: '90'
          description: 'The critical threshold of storage utilization, expressed in %.'
          config:
            type: TEXT
            priority: '9'
            section_name: Thresholds
            label: 'Storage utilization critical threshold'
            description: 'Critical threshold of storage utilization, expressed in %. In the range from 0 to 100 inclusive.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$AZURE.DB.STORAGE.PUSED.WARN}'
          value: '80'
          description: 'The warning threshold of storage utilization, expressed in %.'
          config:
            type: TEXT
            priority: '8'
            section_name: Thresholds
            label: 'Storage utilization warning threshold'
            description: 'Warning threshold of storage utilization, expressed in %. In the range from 0 to 100 inclusive.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$AZURE.PASSWORD}'
          type: SECRET_TEXT
          description: 'Microsoft Azure password.'
          config:
            type: TEXT
            priority: '4'
            label: 'Azure password'
            description: 'Microsoft Azure password.'
            required: 'YES'
        - macro: '{$AZURE.PROXY}'
          description: 'Sets the HTTP proxy value. If this macro is empty, then no proxy is used.'
          config:
            type: TEXT
            priority: '11'
            section_name: Other
            label: 'HTTP proxy'
            description: 'HTTP proxy to use for requests.'
        - macro: '{$AZURE.RESOURCE.ID}'
          description: 'Microsoft Azure Microsoft SQL database ID.'
          config:
            type: TEXT
            priority: '5'
            label: 'Azure MSSQL database ID'
            description: 'Microsoft Azure MSSQL database ID.'
            required: 'YES'
        - macro: '{$AZURE.SUBSCRIPTION.ID}'
          description: 'Microsoft Azure subscription ID.'
          config:
            type: TEXT
            priority: '1'
            label: 'Azure subscription ID'
            description: 'Microsoft Azure subscription ID.'
            required: 'YES'
        - macro: '{$AZURE.TENANT.ID}'
          description: 'Microsoft Azure tenant ID.'
          config:
            type: TEXT
            priority: '2'
            label: 'Azure tenant ID'
            description: 'Microsoft Azure tenant ID.'
            required: 'YES'
      dashboards:
        - uuid: 7a1b55d933ba4a529f2fccef44e5cff7
          name: 'Overview Azure Microsoft SQL Serverless Database'
          pages:
            - widgets:
                - type: item
                  name: Deadlocks
                  width: '12'
                  height: '3'
                  fields:
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure Microsoft SQL Serverless Database by HTTP'
                        key: azure.db.mssql.deadlocks
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'SQL Server process memory percent'
                  'y': '3'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure Microsoft SQL Serverless Database by HTTP'
                        key: azure.db.mssql.server.memory.percent
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: STRING
                      name: units
                      value: '%'
                - type: item
                  name: 'CPU limit'
                  'y': '6'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure Microsoft SQL Serverless Database by HTTP'
                        key: azure.db.mssql.cpu.limit
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'Data space allocated'
                  'y': '9'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure Microsoft SQL Serverless Database by HTTP'
                        key: azure.db.mssql.storage.allocated
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'Connections successful'
                  'y': '12'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure Microsoft SQL Serverless Database by HTTP'
                        key: azure.db.mssql.connections.successful
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'Availability state'
                  x: '12'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure Microsoft SQL Serverless Database by HTTP'
                        key: azure.db.mssql.availability.state
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: STRING
                      name: up_color
                      value: FF0000
                - type: item
                  name: 'SQL Server process core percent'
                  x: '12'
                  'y': '3'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure Microsoft SQL Serverless Database by HTTP'
                        key: azure.db.mssql.server.cpu.percent
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: STRING
                      name: units
                      value: '%'
                - type: item
                  name: 'CPU used'
                  x: '12'
                  'y': '6'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure Microsoft SQL Serverless Database by HTTP'
                        key: azure.db.mssql.cpu.used
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'Data space used'
                  x: '12'
                  'y': '9'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure Microsoft SQL Serverless Database by HTTP'
                        key: azure.db.mssql.storage.used
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'Connections failed: System errors'
                  x: '12'
                  'y': '12'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure Microsoft SQL Serverless Database by HTTP'
                        key: azure.db.mssql.connections.failed.system
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: itemhistory
                  name: 'Availability status detailed'
                  x: '24'
                  width: '48'
                  height: '3'
                  fields:
                    - type: INTEGER
                      name: columns.0.display
                      value: '4'
                    - type: ITEM
                      name: columns.0.itemid
                      value:
                        host: 'Azure Microsoft SQL Serverless Database by HTTP'
                        key: azure.db.mssql.availability.details
                    - type: INTEGER
                      name: columns.0.monospace_font
                      value: '1'
                    - type: STRING
                      name: columns.0.name
                      value: 'Azure Microsoft SQL: Availability status detailed'
                    - type: STRING
                      name: reference
                      value: BAAAF
                    - type: INTEGER
                      name: show_timestamp
                      value: '1'
                - type: item
                  name: 'Sessions percentage'
                  x: '24'
                  'y': '3'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure Microsoft SQL Serverless Database by HTTP'
                        key: azure.db.mssql.sessions.percent
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: graph
                  name: 'Percentage CPU'
                  x: '24'
                  'y': '6'
                  width: '48'
                  height: '3'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Azure Microsoft SQL Serverless Database by HTTP'
                        name: 'Azure Microsoft SQL: CPU usage'
                    - type: STRING
                      name: reference
                      value: AAAAA
                - type: graph
                  name: 'Storage utilization'
                  x: '24'
                  'y': '9'
                  width: '48'
                  height: '3'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Azure Microsoft SQL Serverless Database by HTTP'
                        name: 'Azure Microsoft SQL: Storage utilization'
                    - type: STRING
                      name: reference
                      value: AAAAB
                - type: graph
                  name: Connections
                  x: '24'
                  'y': '12'
                  width: '48'
                  height: '3'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Azure Microsoft SQL Serverless Database by HTTP'
                        name: 'Azure Microsoft SQL: Connections'
                    - type: STRING
                      name: reference
                      value: AAAAC
                - type: item
                  name: 'Workers percentage'
                  x: '36'
                  'y': '3'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure Microsoft SQL Serverless Database by HTTP'
                        key: azure.db.mssql.workers.percent
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: STRING
                      name: units
                      value: '%'
                - type: item
                  name: 'App memory percentage'
                  x: '48'
                  'y': '3'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure Microsoft SQL Serverless Database by HTTP'
                        key: azure.db.mssql.app.memory.percent
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: STRING
                      name: units
                      value: '%'
                - type: item
                  name: 'Data IO percentage'
                  x: '60'
                  'y': '3'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure Microsoft SQL Serverless Database by HTTP'
                        key: azure.db.mssql.data.read.percentage
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: STRING
                      name: units
                      value: '%'
      valuemaps:
        - uuid: c87b2eaeb88c4932ad63c73fcafa5331
          name: 'Azure resource health state'
          mappings:
            - value: '0'
              newvalue: Available
            - value: '1'
              newvalue: Degraded
            - value: '2'
              newvalue: Unavailable
            - value: '3'
              newvalue: Unknown
    - uuid: ec92c7b0b1d14946b6ac61de89357199
      template: 'Azure MySQL Flexible Server by HTTP'
      name: 'Azure MySQL Flexible Server by HTTP'
      description: |
        This template is designed to monitor Microsoft Azure MySQL flexible servers 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"
      wizard_ready: 'YES'
      readme: |
        ## Overview
        
        This template is designed to monitor Microsoft Azure MySQL flexible servers 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 [Azure documentation](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 host wizard configuration fields: `Azure App ID`, `Azure password`, `Azure tenant ID`, `Azure subscription ID`, and `Azure MySQL server ID`.
      vendor:
        name: Zabbix
        version: 8.0-2
      groups:
        - name: Templates/Cloud
      items:
        - uuid: 9c87cde45e984ce282d8ba9fbe184f9b
          name: 'Availability status detailed'
          type: DEPENDENT
          key: azure.db.mysql.availability.details
          value_type: CHAR
          description: 'The summary description of the availability status.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.health.summary
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.db.mysql.data.get
          tags:
            - tag: component
              value: health
        - uuid: 7f2d8e8d94ae4c87ba0480a2d9518f65
          name: 'Availability state'
          type: DEPENDENT
          key: azure.db.mysql.availability.state
          description: 'The availability status of the resource.'
          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.db.mysql.data.get
          tags:
            - tag: component
              value: health
          triggers:
            - uuid: e822fd2214fb41db9b57cdb8eec0444a
              expression: 'last(/Azure MySQL Flexible Server by HTTP/azure.db.mysql.availability.state)=1'
              name: 'Azure MySQL Flexible: MySQL server is degraded'
              opdata: '{ITEM.LASTVALUE1}'
              priority: AVERAGE
              description: 'The resource is in a degraded state.'
              tags:
                - tag: scope
                  value: availability
            - uuid: ebb35037a5b646a0bd2c6be44bb1f3c6
              expression: 'last(/Azure MySQL Flexible Server by HTTP/azure.db.mysql.availability.state)=3'
              name: 'Azure MySQL Flexible: MySQL server is in unknown state'
              opdata: '{ITEM.LASTVALUE1}'
              priority: WARNING
              description: 'The resource state is unknown.'
              tags:
                - tag: scope
                  value: availability
            - uuid: 240b861c09a94e209036782b6c7496fa
              expression: 'last(/Azure MySQL Flexible Server by HTTP/azure.db.mysql.availability.state)=2'
              name: 'Azure MySQL Flexible: MySQL server is unavailable'
              opdata: '{ITEM.LASTVALUE1}'
              priority: HIGH
              description: 'The resource state is unavailable.'
              tags:
                - tag: scope
                  value: availability
        - uuid: cab6ac822f2c4e118b030e49cc15eaa2
          name: 'Connections aborted'
          type: DEPENDENT
          key: azure.db.mysql.connections.aborted
          value_type: FLOAT
          description: 'The count of aborted connections.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.aborted_connections.total
          master_item:
            key: azure.db.mysql.data.get
          tags:
            - tag: component
              value: network
          triggers:
            - uuid: 3346ea2331c14fa18658eb33e461ec7c
              expression: 'min(/Azure MySQL Flexible Server by HTTP/azure.db.mysql.connections.aborted,5m)>{$AZURE.DB.ABORTED.CONN.MAX.WARN}'
              name: 'Azure MySQL Flexible: Server has aborted connections'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: AVERAGE
              description: 'The number of failed attempts to connect to the MySQL server is more than `{$AZURE.DB.ABORTED.CONN.MAX.WARN}`.'
              tags:
                - tag: scope
                  value: availability
        - uuid: 71b33f0a5d37498dbb57d185ac0f2741
          name: 'Connections active'
          type: DEPENDENT
          key: azure.db.mysql.connections.active
          value_type: FLOAT
          description: 'The count of active connections.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.active_connections.maximum
          master_item:
            key: azure.db.mysql.data.get
          tags:
            - tag: component
              value: network
        - uuid: 1993ae276fe44db6a89451291749f703
          name: 'Connections total'
          type: DEPENDENT
          key: azure.db.mysql.connections.total
          value_type: FLOAT
          description: 'The count of total connections.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.total_connections.total
          master_item:
            key: azure.db.mysql.data.get
          tags:
            - tag: component
              value: network
        - uuid: b235666b98954555ae5e75e757bba707
          name: 'CPU credits consumed'
          type: DEPENDENT
          key: azure.db.mysql.cpu.credits.consumed
          value_type: FLOAT
          description: 'The consumed CPU credits.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.cpu_credits_consumed.maximum
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.db.mysql.data.get
          tags:
            - tag: component
              value: cpu
        - uuid: 4f591346d3d34d49b37cfff2a169f57e
          name: 'CPU credits remaining'
          type: DEPENDENT
          key: azure.db.mysql.cpu.credits.remaining
          value_type: FLOAT
          description: 'The remaining CPU credits.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.cpu_credits_remaining.maximum
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.db.mysql.data.get
          tags:
            - tag: component
              value: cpu
        - uuid: afe4d11c2f474428acc00d153ad2a6e5
          name: 'Percentage CPU'
          type: DEPENDENT
          key: azure.db.mysql.cpu.percentage
          value_type: FLOAT
          units: '%'
          description: 'The CPU percent of a host.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.cpu_percent.maximum
          master_item:
            key: azure.db.mysql.data.get
          tags:
            - tag: component
              value: cpu
          triggers:
            - uuid: 5af82cc95239479c86c7ab3dabcfb592
              expression: 'min(/Azure MySQL Flexible Server by HTTP/azure.db.mysql.cpu.percentage,5m)>{$AZURE.DB.CPU.UTIL.CRIT}'
              name: 'Azure MySQL Flexible: High CPU utilization'
              opdata: 'Current utilization: {ITEM.LASTVALUE1}'
              priority: HIGH
              description: 'The CPU utilization is too high. The system might be slow to respond.'
              tags:
                - tag: scope
                  value: performance
        - uuid: f960e7667571497c96454b5c4b7b69ff
          name: 'Get errors'
          type: DEPENDENT
          key: azure.db.mysql.data.errors
          value_type: TEXT
          description: 'A list of errors from API requests.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.errors
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.db.mysql.data.get
          tags:
            - tag: component
              value: raw
          triggers:
            - uuid: 98c1b86b79e9469cac2870fb2ba42949
              expression: 'length(last(/Azure MySQL Flexible Server by HTTP/azure.db.mysql.data.errors))>0'
              name: 'Azure MySQL Flexible: 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: de712334db1440309fa68f9252d4f9bc
          name: 'Get data'
          type: SCRIPT
          key: azure.db.mysql.data.get
          history: '0'
          value_type: TEXT
          params: |
            var AzureDB = {
            	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 + '.';
            			}
            		});
            
            		AzureDB.params = params;
            	},
            
            
            	request: function (url, data) {
            		if (typeof data === 'undefined' || data === null) {
            			data = '';
            		}
            
            		var response, request = new HttpRequest();
            		if (typeof AzureDB.params.proxy !== 'undefined' && AzureDB.params.proxy !== '') {
            			request.setProxy(AzureDB.params.proxy);
            		}
            		if (AzureDB.token) {
            			request.addHeader('Accept: application/json');
            			request.addHeader('Authorization: Bearer ' + AzureDB.token);
            		}
            
            		Zabbix.log(4, '[ Azure ] Sending request: ' + url);
            
            		if (data !== '') {
            			request.addHeader('Content-Type: application/x-www-form-urlencoded');
            			response = request.post(url, data);
            		}
            		else {
            			response = request.get(url);
            		}
            
            		Zabbix.log(4, '[ Azure ] Received response with status code ' + request.getStatus() + ': ' + response);
            
            		if (request.getStatus() !== 200 || response === null) {
            			throw 'Request failed with status code ' + request.getStatus() + ': ' + response;
            		}
            
            		try {
            			return JSON.parse(response);
            		}
            		catch (error) {
            			throw 'Failed to parse response received from API.';
            		}
            	}
            
            };
            
            var metrics = [
            	'cpu_percent',
            	'memory_percent',
            	'network_bytes_egress',
            	'network_bytes_ingress',
            	'active_connections',
            	'total_connections',
            	'aborted_connections',
            	'Queries',
            	'io_consumption_percent',
            	'storage_percent',
            	'storage_used',
            	'storage_limit',
            	'backup_storage_used',
            	'replication_lag',
            	'cpu_credits_remaining',
            	'cpu_credits_consumed'
            ],
            	prepared_metrics = [],
            	data = {};
            	data['errors'] = {};
            	data['metrics'] = {};
            
            try {
            	AzureDB.setParams(JSON.parse(value));
            
            	try {
            		result = AzureDB.request(
            			'https://login.microsoftonline.com/' + encodeURIComponent(AzureDB.params.tenant_id) + '/oauth2/token',
            			'grant_type=client_credentials&resource=' + encodeURIComponent('https://management.azure.com/') + '&client_id=' + encodeURIComponent(AzureDB.params.app_id) + '&client_secret=' + encodeURIComponent(AzureDB.params.password)
            		);
            
            		if ('access_token' in result) {
            			AzureDB.token = result['access_token'];
            		} else {
            			throw 'Auth response does not contain access token.';
            		}
            	}
            	catch (error) {
            		data.errors.auth = error.toString();
            	}
            
            	if (!('auth' in data.errors)) {
            		try {
            			health = AzureDB.request('https://management.azure.com' + AzureDB.params.resource_id + '/providers/Microsoft.ResourceHealth/availabilityStatuses?api-version=2020-05-01');
            			if ('value' in health && Array.isArray(health.value) && health.value.length > 0 && 'properties' in health.value[0] && typeof health.value[0].properties === 'object') {
            				data.health = health.value[0].properties;
            			}
            		}
            		catch (error) {
            			data.errors.health = error.toString();
            		}
            
            		for (var i = 0; i < metrics.length; i += 20) {
            			var chunk = metrics.slice(i, i + 20);
            
            			prepared_metrics.push(
            				chunk.map(function (element) {
            					return encodeURIComponent(element);
            				}).join(',')
            			);
            		}
            
            		start_date = new Date((new Date().getTime()) - 300000).toISOString().replace(/\.\d+/, '');
            		end_date = new Date().toISOString().replace(/\.\d+/, '');
            
            		for (var j in prepared_metrics) {
            			try {
            				metrics_data = AzureDB.request('https://management.azure.com' + AzureDB.params.resource_id + '/providers/Microsoft.Insights/metrics?metricnames=' + prepared_metrics[j] + '&timespan=' + encodeURIComponent(start_date) + '/' + encodeURIComponent(end_date) + '&api-version=2021-05-01');
            				if ('value' in metrics_data && Array.isArray(metrics_data.value) && metrics_data.value.length > 0) {
            					for (k in metrics_data.value) {
            						if ('name' in metrics_data.value[k] && typeof metrics_data.value[k].name === 'object' && 'value' in metrics_data.value[k].name && typeof metrics_data.value[k].name.value === 'string' && 'timeseries' in metrics_data.value[k] && Array.isArray(metrics_data.value[k].timeseries) && metrics_data.value[k].timeseries.length > 0 && 'data' in metrics_data.value[k].timeseries[0] && Array.isArray(metrics_data.value[k].timeseries[0].data) && metrics_data.value[k].timeseries[0].data.length > 0) {
            							data.metrics[metrics_data.value[k].name.value.replace(/(\s|\/)+/g, '')] = metrics_data.value[k].timeseries[0].data[metrics_data.value[k].timeseries[0].data.length - 1];
            						}
            					}
            				}
            			}
            			catch (error) {
            				data.errors[prepared_metrics[j]] = error.toString();
            			}
            		}
            	}
            }
            catch (error) {
            	data.errors.params = error.toString();
            }
            
            if (Object.keys(data.errors).length !== 0) {
            	errors = 'Failed to receive data:';
            	for (var error in data.errors) {
            		errors += '\n' + error + ' : ' + data.errors[error];
            	}
            	data.errors = errors;
            }
            else {
            	data.errors = '';
            }
            
            return JSON.stringify(data);
          description: 'The result of API requests is expressed in the JSON.'
          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}'
          tags:
            - tag: component
              value: raw
        - uuid: b4a6363aac734b6c8d043718ca667c09
          name: 'IO consumption percent'
          type: DEPENDENT
          key: azure.db.mysql.io.consumption.percent
          value_type: FLOAT
          units: '%'
          description: 'The consumption percent of I/O.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.io_consumption_percent.maximum
          master_item:
            key: azure.db.mysql.data.get
          tags:
            - tag: component
              value: operations
        - uuid: f0f56a67942a40509d6835f3da9eb7e2
          name: 'Memory utilization'
          type: DEPENDENT
          key: azure.db.mysql.memory.percentage
          value_type: FLOAT
          units: '%'
          description: 'The memory percent of a host.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.memory_percent.maximum
          master_item:
            key: azure.db.mysql.data.get
          tags:
            - tag: component
              value: memory
        - uuid: 84f3d2b152784993944a2d4c3fad1a59
          name: 'Network out'
          type: DEPENDENT
          key: azure.db.mysql.network.egress
          value_type: FLOAT
          units: bps
          description: 'Network egress of a host, expressed in bytes.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.network_bytes_egress.total
            - type: MULTIPLIER
              parameters:
                - '0.0088'
          master_item:
            key: azure.db.mysql.data.get
          tags:
            - tag: component
              value: network
        - uuid: 5f38b6b4e3a849d09022bd34c4347088
          name: 'Network in'
          type: DEPENDENT
          key: azure.db.mysql.network.ingress
          value_type: FLOAT
          units: bps
          description: 'Network ingress of a host, expressed in bytes.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.network_bytes_ingress.total
            - type: MULTIPLIER
              parameters:
                - '0.0088'
          master_item:
            key: azure.db.mysql.data.get
          tags:
            - tag: component
              value: network
        - uuid: 05329dcdb2e14080a43d1bf7553037f6
          name: Queries
          type: DEPENDENT
          key: azure.db.mysql.queries
          value_type: FLOAT
          description: 'The count of queries.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.Queries.total
          master_item:
            key: azure.db.mysql.data.get
          tags:
            - tag: component
              value: queries
        - uuid: 80a05247fec04e39a99ccafaefbd0441
          name: 'Replication lag'
          type: DEPENDENT
          key: azure.db.mysql.replication.lag
          value_type: FLOAT
          units: s
          description: 'The replication lag, expressed in seconds.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.replication_lag.maximum
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.db.mysql.data.get
          tags:
            - tag: component
              value: replication
        - uuid: 8d5cd0d3cd0744a5a260a8a0485f6735
          name: 'Backup storage used'
          type: DEPENDENT
          key: azure.db.mysql.storage.backup.used
          value_type: FLOAT
          units: B
          description: 'Used backup storage, expressed in bytes.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.backup_storage_used.maximum
          master_item:
            key: azure.db.mysql.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 78f3e03b5caf4f85a3c61513cf242f76
          name: 'Storage limit'
          type: DEPENDENT
          key: azure.db.mysql.storage.limit
          value_type: FLOAT
          units: B
          description: 'The storage limit, expressed in bytes.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.storage_limit.maximum
          master_item:
            key: azure.db.mysql.data.get
          tags:
            - tag: component
              value: storage
        - uuid: ced51184b59643adaa51bef90710166b
          name: 'Storage percent'
          type: DEPENDENT
          key: azure.db.mysql.storage.percent
          value_type: FLOAT
          units: '%'
          description: 'The storage utilization, expressed in %.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.storage_percent.maximum
          master_item:
            key: azure.db.mysql.data.get
          tags:
            - tag: component
              value: storage
          triggers:
            - uuid: 1703edc1553644e5aa25d35928c5eafd
              expression: 'last(/Azure MySQL Flexible Server by HTTP/azure.db.mysql.storage.percent)>{$AZURE.DB.STORAGE.PUSED.CRIT}'
              name: 'Azure MySQL Flexible: Storage space is critically low'
              opdata: 'Current utilization: {ITEM.LASTVALUE1}'
              priority: AVERAGE
              description: 'Critical utilization of the storage space.'
              tags:
                - tag: scope
                  value: capacity
            - uuid: a2ec23a5e77c40aa9e45d214f4e06ca1
              expression: 'last(/Azure MySQL Flexible Server by HTTP/azure.db.mysql.storage.percent)>{$AZURE.DB.STORAGE.PUSED.WARN}'
              name: 'Azure MySQL Flexible: Storage space is low'
              opdata: 'Current utilization: {ITEM.LASTVALUE1}'
              priority: WARNING
              description: 'High utilization of the storage space.'
              tags:
                - tag: scope
                  value: capacity
        - uuid: 9f96e947eee646f890742676e9f9a22a
          name: 'Storage used'
          type: DEPENDENT
          key: azure.db.mysql.storage.used
          value_type: FLOAT
          units: B
          description: 'Used storage space, expressed in bytes.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.storage_used.maximum
          master_item:
            key: azure.db.mysql.data.get
          tags:
            - tag: component
              value: storage
      tags:
        - tag: class
          value: cloud
        - tag: subclass
          value: sql
        - tag: target
          value: azure
        - tag: target
          value: mysql
      macros:
        - macro: '{$AZURE.APP.ID}'
          description: 'The App ID of Microsoft Azure.'
          config:
            type: TEXT
            priority: '3'
            label: 'Azure App ID'
            description: 'Microsoft Azure App ID.'
            required: 'YES'
        - macro: '{$AZURE.DATA.TIMEOUT}'
          value: 15s
          description: 'API response timeout.'
          config:
            type: TEXT
            priority: '10'
            section_name: Other
            label: 'API timeout'
            description: 'API response timeout, in seconds.'
        - macro: '{$AZURE.DB.ABORTED.CONN.MAX.WARN}'
          value: '25'
          description: 'The number of failed attempts to connect to the MySQL server for a trigger expression.'
          config:
            type: TEXT
            priority: '9'
            section_name: Thresholds
            label: 'Failed connection attempts threshold'
            description: 'Number of failed attempts to connect to the MySQL server for a trigger expression. No less than 0.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$AZURE.DB.CPU.UTIL.CRIT}'
          value: '90'
          description: 'The critical threshold of CPU utilization, expressed in %.'
          config:
            type: TEXT
            priority: '6'
            section_name: Thresholds
            label: 'CPU utilization critical threshold'
            description: 'Critical threshold of CPU utilization, expressed in %. In the range from 0 to 100 inclusive.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$AZURE.DB.STORAGE.PUSED.CRIT}'
          value: '90'
          description: 'The critical threshold of the storage utilization, expressed in %.'
          config:
            type: TEXT
            priority: '8'
            section_name: Thresholds
            label: 'Storage utilization critical threshold'
            description: 'Critical threshold of the storage utilization, expressed in %. In the range from 0 to 100 inclusive.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$AZURE.DB.STORAGE.PUSED.WARN}'
          value: '80'
          description: 'The warning threshold of the storage utilization, expressed in %.'
          config:
            type: TEXT
            priority: '7'
            section_name: Thresholds
            label: 'Storage utilization warning threshold'
            description: 'Warning threshold of the storage utilization, expressed in %. In the range from 0 to 100 inclusive.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$AZURE.PASSWORD}'
          type: SECRET_TEXT
          description: 'Microsoft Azure password.'
          config:
            type: TEXT
            priority: '4'
            label: 'Azure password'
            description: 'Microsoft Azure password.'
            required: 'YES'
        - macro: '{$AZURE.PROXY}'
          description: 'Sets the HTTP proxy value. If this macro is empty, then no proxy is used.'
          config:
            type: TEXT
            priority: '11'
            section_name: Other
            label: 'HTTP proxy'
            description: 'HTTP proxy to use for requests.'
        - macro: '{$AZURE.RESOURCE.ID}'
          description: 'Microsoft Azure MySQL server ID.'
          config:
            type: TEXT
            priority: '5'
            label: 'Azure MySQL server ID'
            description: 'Microsoft Azure MySQL server ID.'
            required: 'YES'
        - macro: '{$AZURE.SUBSCRIPTION.ID}'
          description: 'Microsoft Azure subscription ID.'
          config:
            type: TEXT
            priority: '1'
            label: 'Azure subscription ID'
            description: 'Microsoft Azure subscription ID.'
            required: 'YES'
        - macro: '{$AZURE.TENANT.ID}'
          description: 'Microsoft Azure tenant ID.'
          config:
            type: TEXT
            priority: '2'
            label: 'Azure tenant ID'
            description: 'Microsoft Azure tenant ID.'
            required: 'YES'
      dashboards:
        - uuid: 12974ad6fc5a42ba9683af06f9166cef
          name: 'Overview Azure MySQL Flexible Server'
          pages:
            - widgets:
                - type: item
                  name: 'Memory utilization'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure MySQL Flexible Server by HTTP'
                        key: azure.db.mysql.memory.percentage
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: STRING
                      name: units
                      value: '%'
                - type: item
                  name: 'CPU credits consumed'
                  'y': '3'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure MySQL Flexible Server by HTTP'
                        key: azure.db.mysql.cpu.credits.consumed
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'Storage used'
                  'y': '6'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure MySQL Flexible Server by HTTP'
                        key: azure.db.mysql.storage.used
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'Network in'
                  'y': '9'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure MySQL Flexible Server by HTTP'
                        key: azure.db.mysql.network.ingress
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'Connections active'
                  'y': '12'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure MySQL Flexible Server by HTTP'
                        key: azure.db.mysql.connections.active
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'Percentage CPU'
                  x: '12'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure MySQL Flexible Server by HTTP'
                        key: azure.db.mysql.cpu.percentage
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: STRING
                      name: units
                      value: '%'
                - type: item
                  name: 'CPU credits remaining'
                  x: '12'
                  'y': '3'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure MySQL Flexible Server by HTTP'
                        key: azure.db.mysql.cpu.credits.remaining
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'Storage limit'
                  x: '12'
                  'y': '6'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure MySQL Flexible Server by HTTP'
                        key: azure.db.mysql.storage.limit
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'Network out'
                  x: '12'
                  'y': '9'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure MySQL Flexible Server by HTTP'
                        key: azure.db.mysql.network.egress
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'Connections total'
                  x: '12'
                  'y': '12'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure MySQL Flexible Server by HTTP'
                        key: azure.db.mysql.connections.total
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'Availability state'
                  x: '24'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure MySQL Flexible Server by HTTP'
                        key: azure.db.mysql.availability.state
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: STRING
                      name: up_color
                      value: FF0000
                - type: item
                  name: 'Backup storage used'
                  x: '24'
                  'y': '3'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure MySQL Flexible Server by HTTP'
                        key: azure.db.mysql.storage.backup.used
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: graph
                  name: 'Storage utilization'
                  x: '24'
                  'y': '6'
                  width: '48'
                  height: '3'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Azure MySQL Flexible Server by HTTP'
                        name: 'Azure MySQL: Storage utilization'
                    - type: STRING
                      name: reference
                      value: AAAAA
                - type: graph
                  name: 'Network traffic'
                  x: '24'
                  'y': '9'
                  width: '48'
                  height: '3'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Azure MySQL Flexible Server by HTTP'
                        name: 'Azure MySQL: Network traffic'
                    - type: STRING
                      name: reference
                      value: AAAAB
                - type: graph
                  name: Connections
                  x: '24'
                  'y': '12'
                  width: '48'
                  height: '3'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Azure MySQL Flexible Server by HTTP'
                        name: 'Azure MySQL: Connections'
                    - type: STRING
                      name: reference
                      value: AAAAC
                - type: itemhistory
                  name: 'Availability status detailed'
                  x: '36'
                  width: '36'
                  height: '3'
                  fields:
                    - type: INTEGER
                      name: columns.0.display
                      value: '4'
                    - type: ITEM
                      name: columns.0.itemid
                      value:
                        host: 'Azure MySQL Flexible Server by HTTP'
                        key: azure.db.mysql.availability.details
                    - type: INTEGER
                      name: columns.0.monospace_font
                      value: '1'
                    - type: STRING
                      name: columns.0.name
                      value: 'Azure MySQL: Availability status detailed'
                    - type: STRING
                      name: reference
                      value: BAAAB
                    - type: INTEGER
                      name: show_timestamp
                      value: '1'
                - type: item
                  name: Queries
                  x: '36'
                  'y': '3'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure MySQL Flexible Server by HTTP'
                        key: azure.db.mysql.queries
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'IO consumption percent'
                  x: '48'
                  'y': '3'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure MySQL Flexible Server by HTTP'
                        key: azure.db.mysql.io.consumption.percent
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: STRING
                      name: units
                      value: '%'
                - type: item
                  name: 'Replication lag'
                  x: '60'
                  'y': '3'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure MySQL Flexible Server by HTTP'
                        key: azure.db.mysql.replication.lag
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
      valuemaps:
        - uuid: 4eec167b4d69441398b96b8e375d6825
          name: 'Azure resource health state'
          mappings:
            - value: '0'
              newvalue: Available
            - value: '1'
              newvalue: Degraded
            - value: '2'
              newvalue: Unavailable
            - value: '3'
              newvalue: Unknown
    - uuid: c1396bf1e8cf46f6a407e88ddceef0b8
      template: 'Azure MySQL Single Server by HTTP'
      name: 'Azure MySQL Single Server by HTTP'
      description: |
        This template is designed to monitor Microsoft Azure MySQL single servers 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"
      wizard_ready: 'YES'
      readme: |
        ## Overview
        
        This template is designed to monitor Microsoft Azure MySQL single servers 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 [Azure documentation](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 host wizard configuration fields: `Azure App ID`, `Azure password`, `Azure tenant ID`, `Azure subscription ID`, and `Azure MySQL server ID`.
      vendor:
        name: Zabbix
        version: 8.0-2
      groups:
        - name: Templates/Cloud
      items:
        - uuid: c7771aa67d3c424490d8de2d6c2d609a
          name: 'Availability status detailed'
          type: DEPENDENT
          key: azure.db.mysql.availability.details
          value_type: CHAR
          description: 'The summary description of the availability status.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.health.summary
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.db.mysql.data.get
          tags:
            - tag: component
              value: health
        - uuid: c325b977b26e4e00acc3ea8703895f05
          name: 'Availability state'
          type: DEPENDENT
          key: azure.db.mysql.availability.state
          description: 'The availability status of the resource.'
          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.db.mysql.data.get
          tags:
            - tag: component
              value: health
          triggers:
            - uuid: 91a32645266547d78df3a70b44c7782b
              expression: 'last(/Azure MySQL Single Server by HTTP/azure.db.mysql.availability.state)=1'
              name: 'Azure MySQL Single: MySQL server is degraded'
              opdata: '{ITEM.LASTVALUE1}'
              priority: AVERAGE
              description: 'The resource is in a degraded state.'
              tags:
                - tag: scope
                  value: availability
            - uuid: 852aba88476a40aeb2170b933726b7d8
              expression: 'last(/Azure MySQL Single Server by HTTP/azure.db.mysql.availability.state)=3'
              name: 'Azure MySQL Single: MySQL server is in unknown state'
              opdata: '{ITEM.LASTVALUE1}'
              priority: WARNING
              description: 'The resource state is unknown.'
              tags:
                - tag: scope
                  value: availability
            - uuid: 5f2d2254dfc24f5481207585bed0d933
              expression: 'last(/Azure MySQL Single Server by HTTP/azure.db.mysql.availability.state)=2'
              name: 'Azure MySQL Single: MySQL server is unavailable'
              opdata: '{ITEM.LASTVALUE1}'
              priority: HIGH
              description: 'The resource state is unavailable.'
              tags:
                - tag: scope
                  value: availability
        - uuid: 69aba8caa6874c9d9423926a2ee78e99
          name: 'Connections active'
          type: DEPENDENT
          key: azure.db.mysql.connections.active
          value_type: FLOAT
          description: 'The count of active connections.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.active_connections.average
          master_item:
            key: azure.db.mysql.data.get
          tags:
            - tag: component
              value: network
        - uuid: e185b56984914507bc40c07c55153967
          name: 'Connections failed'
          type: DEPENDENT
          key: azure.db.mysql.connections.failed
          value_type: FLOAT
          description: 'The count of failed connections.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.connections_failed.total
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.db.mysql.data.get
          tags:
            - tag: component
              value: network
          triggers:
            - uuid: 5b3a09ca04704e6a9972ee4865d358cd
              expression: 'min(/Azure MySQL Single Server by HTTP/azure.db.mysql.connections.failed,5m)>{$AZURE.DB.FAILED.CONN.MAX.WARN}'
              name: 'Azure MySQL Single: Server has failed connections'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: AVERAGE
              description: 'The number of failed attempts to connect to the MySQL server is more than `{$AZURE.DB.FAILED.CONN.MAX.WARN}`.'
              tags:
                - tag: scope
                  value: availability
        - uuid: d0b5864a56094166b76fbc58a5e05c7c
          name: 'Percentage CPU'
          type: DEPENDENT
          key: azure.db.mysql.cpu.percentage
          value_type: FLOAT
          units: '%'
          description: 'The CPU percent of a host.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.cpu_percent.average
          master_item:
            key: azure.db.mysql.data.get
          tags:
            - tag: component
              value: cpu
          triggers:
            - uuid: 7115fb320e2b4cc1ad1739c8a6cee155
              expression: 'min(/Azure MySQL Single Server by HTTP/azure.db.mysql.cpu.percentage,5m)>{$AZURE.DB.CPU.UTIL.CRIT}'
              name: 'Azure MySQL Single: High CPU utilization'
              opdata: 'Current utilization: {ITEM.LASTVALUE1}'
              priority: HIGH
              description: 'The CPU utilization is too high. The system might be slow to respond.'
              tags:
                - tag: scope
                  value: performance
        - uuid: 2fc253a20100478d91cac13590a64bfc
          name: 'Get errors'
          type: DEPENDENT
          key: azure.db.mysql.data.errors
          value_type: TEXT
          description: 'A list of errors from API requests.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.errors
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.db.mysql.data.get
          tags:
            - tag: component
              value: raw
          triggers:
            - uuid: df5fa33f8c13413bb9d61ea4470b9b2d
              expression: 'length(last(/Azure MySQL Single Server by HTTP/azure.db.mysql.data.errors))>0'
              name: 'Azure MySQL Single: 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: cd62d92ef0384ea9acf0cae71c88ebc6
          name: 'Get data'
          type: SCRIPT
          key: azure.db.mysql.data.get
          history: '0'
          value_type: TEXT
          params: |
            var AzureDB = {
            	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 + '.';
            			}
            		});
            
            		AzureDB.params = params;
            	},
            
            
            	request: function (url, data) {
            		if (typeof data === 'undefined' || data === null) {
            			data = '';
            		}
            
            		var response, request = new HttpRequest();
            		if (typeof AzureDB.params.proxy !== 'undefined' && AzureDB.params.proxy !== '') {
            			request.setProxy(AzureDB.params.proxy);
            		}
            		if (AzureDB.token) {
            			request.addHeader('Accept: application/json');
            			request.addHeader('Authorization: Bearer ' + AzureDB.token);
            		}
            
            		Zabbix.log(4, '[ Azure ] Sending request: ' + url);
            
            		if (data !== '') {
            			request.addHeader('Content-Type: application/x-www-form-urlencoded');
            			response = request.post(url, data);
            		}
            		else {
            			response = request.get(url);
            		}
            
            		Zabbix.log(4, '[ Azure ] Received response with status code ' + request.getStatus() + ': ' + response);
            
            		if (request.getStatus() !== 200 || response === null) {
            			throw 'Request failed with status code ' + request.getStatus() + ': ' + response;
            		}
            
            		try {
            			return JSON.parse(response);
            		}
            		catch (error) {
            			throw 'Failed to parse response received from API.';
            		}
            	}
            
            };
            
            var metrics = [
            	'cpu_percent',
            	'memory_percent',
            	'io_consumption_percent',
            	'storage_percent',
            	'storage_used',
            	'storage_limit',
            	'serverlog_storage_percent',
            	'serverlog_storage_usage',
            	'serverlog_storage_limit',
            	'active_connections',
            	'connections_failed',
            	'seconds_behind_master',
            	'backup_storage_used',
            	'network_bytes_egress',
            	'network_bytes_ingress'
            ],
            	prepared_metrics = [],
            	data = {};
            data['errors'] = {};
            data['metrics'] = {};
            
            try {
            	AzureDB.setParams(JSON.parse(value));
            
            	try {
            		result = AzureDB.request(
            			'https://login.microsoftonline.com/' + encodeURIComponent(AzureDB.params.tenant_id) + '/oauth2/token',
            			'grant_type=client_credentials&resource=' + encodeURIComponent('https://management.azure.com/') + '&client_id=' + encodeURIComponent(AzureDB.params.app_id) + '&client_secret=' + encodeURIComponent(AzureDB.params.password)
            		);
            
            		if ('access_token' in result) {
            			AzureDB.token = result['access_token'];
            		} else {
            			throw 'Auth response does not contain access token.';
            		}
            	}
            	catch (error) {
            		data.errors.auth = error.toString();
            	}
            
            	if (!('auth' in data.errors)) {
            		try {
            			health = AzureDB.request('https://management.azure.com' + AzureDB.params.resource_id + '/providers/Microsoft.ResourceHealth/availabilityStatuses?api-version=2020-05-01');
            			if ('value' in health && Array.isArray(health.value) && health.value.length > 0 && 'properties' in health.value[0] && typeof health.value[0].properties === 'object') {
            				data.health = health.value[0].properties;
            			}
            		}
            		catch (error) {
            			data.errors.health = error.toString();
            		}
            
            		for (var i = 0; i < metrics.length; i += 20) {
            			var chunk = metrics.slice(i, i + 20);
            
            			prepared_metrics.push(
            				chunk.map(function (element) {
            					return encodeURIComponent(element);
            				}).join(',')
            			);
            		}
            
            		start_date = new Date((new Date().getTime()) - 300000).toISOString().replace(/\.\d+/, '');
            		end_date = new Date().toISOString().replace(/\.\d+/, '');
            
            		for (var j in prepared_metrics) {
            			try {
            				metrics_data = AzureDB.request('https://management.azure.com' + AzureDB.params.resource_id + '/providers/Microsoft.Insights/metrics?metricnames=' + prepared_metrics[j] + '&timespan=' + encodeURIComponent(start_date) + '/' + encodeURIComponent(end_date) + '&api-version=2021-05-01');
            				if ('value' in metrics_data && Array.isArray(metrics_data.value) && metrics_data.value.length > 0) {
            					for (k in metrics_data.value) {
            						if ('name' in metrics_data.value[k] && typeof metrics_data.value[k].name === 'object' && 'value' in metrics_data.value[k].name && typeof metrics_data.value[k].name.value === 'string' && 'timeseries' in metrics_data.value[k] && Array.isArray(metrics_data.value[k].timeseries) && metrics_data.value[k].timeseries.length > 0 && 'data' in metrics_data.value[k].timeseries[0] && Array.isArray(metrics_data.value[k].timeseries[0].data) && metrics_data.value[k].timeseries[0].data.length > 0) {
            							data.metrics[metrics_data.value[k].name.value.replace(/(\s|\/)+/g, '')] = metrics_data.value[k].timeseries[0].data[metrics_data.value[k].timeseries[0].data.length - 1];
            						}
            					}
            				}
            			}
            			catch (error) {
            				data.errors[prepared_metrics[j]] = error.toString();
            			}
            		}
            	}
            }
            catch (error) {
            	data.errors.params = error.toString();
            }
            
            if (Object.keys(data.errors).length !== 0) {
            	errors = 'Failed to receive data:';
            	for (var error in data.errors) {
            		errors += '\n' + error + ' : ' + data.errors[error];
            	}
            	data.errors = errors;
            }
            else {
            	data.errors = '';
            }
            
            return JSON.stringify(data);
          description: 'The result of API requests is expressed in the JSON.'
          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}'
          tags:
            - tag: component
              value: raw
        - uuid: a17c365253eb4821841ec82ac8f61106
          name: 'IO consumption percent'
          type: DEPENDENT
          key: azure.db.mysql.io.consumption.percent
          value_type: FLOAT
          units: '%'
          description: 'The consumption percent of I/O.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.io_consumption_percent.average
          master_item:
            key: azure.db.mysql.data.get
          tags:
            - tag: component
              value: operations
        - uuid: 5c19c08912634993b1f96fb11e5d1ae2
          name: 'Memory utilization'
          type: DEPENDENT
          key: azure.db.mysql.memory.percentage
          value_type: FLOAT
          units: '%'
          description: 'The memory percent of a host.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.memory_percent.average
          master_item:
            key: azure.db.mysql.data.get
          tags:
            - tag: component
              value: memory
          triggers:
            - uuid: a67b35f1ac674d6692b0b2bcd6f89bd8
              expression: 'min(/Azure MySQL Single Server by HTTP/azure.db.mysql.memory.percentage,5m)>{$AZURE.DB.MEMORY.UTIL.CRIT}'
              name: 'Azure MySQL Single: High memory utilization'
              opdata: 'Current utilization: {ITEM.LASTVALUE1}'
              priority: AVERAGE
              description: 'The system is running out of free memory.'
              tags:
                - tag: scope
                  value: performance
        - uuid: fe1b9846a634412aaa6a76fc05dbe46a
          name: 'Network out'
          type: DEPENDENT
          key: azure.db.mysql.network.egress
          value_type: FLOAT
          units: bps
          description: 'The network outbound traffic across the active connections.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.network_bytes_egress.total
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '0.0088'
          master_item:
            key: azure.db.mysql.data.get
          tags:
            - tag: component
              value: network
        - uuid: 1cc97817bda5470887e3d5d9f2d78650
          name: 'Network in'
          type: DEPENDENT
          key: azure.db.mysql.network.ingress
          value_type: FLOAT
          units: bps
          description: 'The network inbound traffic across the active connections.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.network_bytes_ingress.total
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '0.0088'
          master_item:
            key: azure.db.mysql.data.get
          tags:
            - tag: component
              value: network
        - uuid: 8e60794282ea42c7bad1573811b2e498
          name: 'Replication lag'
          type: DEPENDENT
          key: azure.db.mysql.replication.lag
          value_type: FLOAT
          units: s
          description: 'The replication lag, expressed in seconds.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.seconds_behind_master.maximum
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.db.mysql.data.get
          tags:
            - tag: component
              value: replication
        - uuid: 1303a659d17a4e4fa9fa03cef35fef5a
          name: 'Backup storage used'
          type: DEPENDENT
          key: azure.db.mysql.storage.backup.used
          value_type: FLOAT
          units: B
          description: 'Used backup storage, expressed in bytes.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.backup_storage_used.average
          master_item:
            key: azure.db.mysql.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 4aed6d0c01d1458fbd1f7c7ea5386303
          name: 'Storage limit'
          type: DEPENDENT
          key: azure.db.mysql.storage.limit
          value_type: FLOAT
          units: B
          description: 'The storage limit, expressed in bytes.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.storage_limit.maximum
          master_item:
            key: azure.db.mysql.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 5b1b350be6f0409fb7ab842571c3f086
          name: 'Storage percent'
          type: DEPENDENT
          key: azure.db.mysql.storage.percent
          value_type: FLOAT
          units: '%'
          description: 'The storage utilization, expressed in %.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.storage_percent.average
          master_item:
            key: azure.db.mysql.data.get
          tags:
            - tag: component
              value: storage
          triggers:
            - uuid: 3afcb840e8004822a2dada2a89971f69
              expression: 'last(/Azure MySQL Single Server by HTTP/azure.db.mysql.storage.percent)>{$AZURE.DB.STORAGE.PUSED.CRIT}'
              name: 'Azure MySQL Single: Storage space is critically low'
              opdata: 'Current utilization: {ITEM.LASTVALUE1}'
              priority: AVERAGE
              description: 'Critical utilization of the storage space.'
              tags:
                - tag: scope
                  value: capacity
            - uuid: 2e605f906b284f769e7c880d4e642b43
              expression: 'last(/Azure MySQL Single Server by HTTP/azure.db.mysql.storage.percent)>{$AZURE.DB.STORAGE.PUSED.WARN}'
              name: 'Azure MySQL Single: Storage space is low'
              opdata: 'Current utilization: {ITEM.LASTVALUE1}'
              priority: WARNING
              description: 'High utilization of the storage space.'
              tags:
                - tag: scope
                  value: capacity
        - uuid: 7f553d8a0898477b87a2828e51efcfcc
          name: 'Server log storage limit'
          type: DEPENDENT
          key: azure.db.mysql.storage.server.log.limit
          value_type: FLOAT
          units: B
          description: 'The storage limit of server log, expressed in bytes.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.serverlog_storage_limit.maximum
          master_item:
            key: azure.db.mysql.data.get
          tags:
            - tag: component
              value: storage
        - uuid: cf5a77306c554a24b3741ef065b6d27a
          name: 'Server log storage percent'
          type: DEPENDENT
          key: azure.db.mysql.storage.server.log.percent
          value_type: FLOAT
          units: '%'
          description: 'The storage utilization by server log, expressed in %.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.serverlog_storage_percent.average
          master_item:
            key: azure.db.mysql.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 8ed99a951e264185b1e0f343d7ea0aec
          name: 'Server log storage used'
          type: DEPENDENT
          key: azure.db.mysql.storage.server.log.used
          value_type: FLOAT
          units: B
          description: 'The storage space used by server log, expressed in bytes.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.serverlog_storage_usage.average
          master_item:
            key: azure.db.mysql.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 0c9a5496d9884c8e9a434fb232b3208f
          name: 'Storage used'
          type: DEPENDENT
          key: azure.db.mysql.storage.used
          value_type: FLOAT
          units: B
          description: 'Used storage space, expressed in bytes.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.storage_used.average
          master_item:
            key: azure.db.mysql.data.get
          tags:
            - tag: component
              value: storage
      tags:
        - tag: class
          value: cloud
        - tag: subclass
          value: sql
        - tag: target
          value: azure
        - tag: target
          value: mysql
      macros:
        - macro: '{$AZURE.APP.ID}'
          description: 'The App ID of Microsoft Azure.'
          config:
            type: TEXT
            priority: '3'
            label: 'Azure App ID'
            description: 'Microsoft Azure App ID.'
            required: 'YES'
        - macro: '{$AZURE.DATA.TIMEOUT}'
          value: 15s
          description: 'API response timeout.'
          config:
            type: TEXT
            priority: '11'
            section_name: Other
            label: 'API timeout'
            description: 'API response timeout, in seconds.'
        - macro: '{$AZURE.DB.CPU.UTIL.CRIT}'
          value: '90'
          description: 'The critical threshold of CPU utilization, expressed in %.'
          config:
            type: TEXT
            priority: '6'
            section_name: Thresholds
            label: 'CPU utilization critical threshold'
            description: 'Critical threshold of CPU utilization, expressed in %. In the range from 0 to 100 inclusive.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$AZURE.DB.FAILED.CONN.MAX.WARN}'
          value: '25'
          description: 'The number of failed attempts to connect to the MySQL server for trigger expression.'
          config:
            type: TEXT
            priority: '10'
            section_name: Thresholds
            label: 'Failed connection attempts threshold'
            description: 'Number of failed attempts to connect to the MySQL server for a trigger expression. No less than 0.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$AZURE.DB.MEMORY.UTIL.CRIT}'
          value: '90'
          description: 'The critical threshold of memory utilization, expressed in %.'
          config:
            type: TEXT
            priority: '7'
            section_name: Thresholds
            label: 'Memory utilization critical threshold'
            description: 'Critical threshold of memory utilization, expressed in %. In the range from 0 to 100 inclusive.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$AZURE.DB.STORAGE.PUSED.CRIT}'
          value: '90'
          description: 'The critical threshold of storage utilization, expressed in %.'
          config:
            type: TEXT
            priority: '9'
            section_name: Thresholds
            label: 'Storage utilization critical threshold'
            description: 'Critical threshold of the storage utilization, expressed in %. In the range from 0 to 100 inclusive.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$AZURE.DB.STORAGE.PUSED.WARN}'
          value: '80'
          description: 'The warning threshold of storage utilization, expressed in %.'
          config:
            type: TEXT
            priority: '8'
            section_name: Thresholds
            label: 'Storage utilization warning threshold'
            description: 'Warning threshold of the storage utilization, expressed in %. In the range from 0 to 100 inclusive.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$AZURE.PASSWORD}'
          type: SECRET_TEXT
          description: 'Microsoft Azure password.'
          config:
            type: TEXT
            priority: '4'
            label: 'Azure password'
            description: 'Microsoft Azure password.'
            required: 'YES'
        - macro: '{$AZURE.PROXY}'
          description: 'Sets the HTTP proxy value. If this macro is empty, then no proxy is used.'
          config:
            type: TEXT
            priority: '12'
            section_name: Other
            label: 'HTTP proxy'
            description: 'HTTP proxy to use for requests.'
        - macro: '{$AZURE.RESOURCE.ID}'
          description: 'Microsoft Azure MySQL server ID.'
          config:
            type: TEXT
            priority: '5'
            label: 'Azure MySQL server ID'
            description: 'Microsoft Azure MySQL server ID.'
            required: 'YES'
        - macro: '{$AZURE.SUBSCRIPTION.ID}'
          description: 'Microsoft Azure subscription ID.'
          config:
            type: TEXT
            priority: '1'
            label: 'Azure subscription ID'
            description: 'Microsoft Azure subscription ID.'
            required: 'YES'
        - macro: '{$AZURE.TENANT.ID}'
          description: 'Microsoft Azure tenant ID.'
          config:
            type: TEXT
            priority: '2'
            label: 'Azure tenant ID'
            description: 'Microsoft Azure tenant ID.'
            required: 'YES'
      dashboards:
        - uuid: 8760f5409fbd488d8b8e8ba24d9077ae
          name: 'Overview Azure MySQL Single Server'
          pages:
            - widgets:
                - type: item
                  name: 'Memory utilization'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure MySQL Single Server by HTTP'
                        key: azure.db.mysql.memory.percentage
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: STRING
                      name: units
                      value: '%'
                - type: item
                  name: 'Network in'
                  'y': '3'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure MySQL Single Server by HTTP'
                        key: azure.db.mysql.network.ingress
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'Server log storage limit'
                  'y': '6'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure MySQL Single Server by HTTP'
                        key: azure.db.mysql.storage.server.log.limit
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'Storage limit'
                  'y': '9'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure MySQL Single Server by HTTP'
                        key: azure.db.mysql.storage.limit
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'Connections active'
                  'y': '12'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure MySQL Single Server by HTTP'
                        key: azure.db.mysql.connections.active
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'Percentage CPU'
                  x: '12'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure MySQL Single Server by HTTP'
                        key: azure.db.mysql.cpu.percentage
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: STRING
                      name: units
                      value: '%'
                - type: item
                  name: 'Network out'
                  x: '12'
                  'y': '3'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure MySQL Single Server by HTTP'
                        key: azure.db.mysql.network.egress
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'Server log storage used'
                  x: '12'
                  'y': '6'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure MySQL Single Server by HTTP'
                        key: azure.db.mysql.storage.server.log.used
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'Storage used'
                  x: '12'
                  'y': '9'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure MySQL Single Server by HTTP'
                        key: azure.db.mysql.storage.used
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'Connections failed'
                  x: '12'
                  'y': '12'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure MySQL Single Server by HTTP'
                        key: azure.db.mysql.connections.failed
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'Availability state'
                  x: '24'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure MySQL Single Server by HTTP'
                        key: azure.db.mysql.availability.state
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: STRING
                      name: up_color
                      value: FF0000
                - type: graph
                  name: 'Network traffic'
                  x: '24'
                  'y': '3'
                  width: '48'
                  height: '3'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Azure MySQL Single Server by HTTP'
                        name: 'Azure MySQL: Network traffic'
                    - type: STRING
                      name: reference
                      value: AAAAA
                - type: graph
                  name: 'Server log storage utilization'
                  x: '24'
                  'y': '6'
                  width: '48'
                  height: '3'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Azure MySQL Single Server by HTTP'
                        name: 'Azure MySQL: Server log storage utilization'
                    - type: STRING
                      name: reference
                      value: AAAAB
                - type: graph
                  name: 'Storage utilization'
                  x: '24'
                  'y': '9'
                  width: '48'
                  height: '3'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Azure MySQL Single Server by HTTP'
                        name: 'Azure MySQL: Storage utilization'
                    - type: STRING
                      name: reference
                      value: AAAAC
                - type: graph
                  name: Connections
                  x: '24'
                  'y': '12'
                  width: '48'
                  height: '3'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Azure MySQL Single Server by HTTP'
                        name: 'Azure MySQL: Connections'
                    - type: STRING
                      name: reference
                      value: AAAAD
                - type: itemhistory
                  name: 'Availability status detailed'
                  x: '36'
                  width: '36'
                  height: '3'
                  fields:
                    - type: INTEGER
                      name: columns.0.display
                      value: '4'
                    - type: ITEM
                      name: columns.0.itemid
                      value:
                        host: 'Azure MySQL Single Server by HTTP'
                        key: azure.db.mysql.availability.details
                    - type: INTEGER
                      name: columns.0.monospace_font
                      value: '1'
                    - type: STRING
                      name: columns.0.name
                      value: 'Azure MySQL: Availability status detailed'
                    - type: STRING
                      name: reference
                      value: BAAAC
                    - type: INTEGER
                      name: show_timestamp
                      value: '1'
      valuemaps:
        - uuid: 323a5259fb854724891515767f341540
          name: 'Azure resource health state'
          mappings:
            - value: '0'
              newvalue: Available
            - value: '1'
              newvalue: Degraded
            - value: '2'
              newvalue: Unavailable
            - value: '3'
              newvalue: Unknown
    - uuid: 35ef29f24158444097272d2ea7fa6044
      template: 'Azure PostgreSQL Flexible Server by HTTP'
      name: 'Azure PostgreSQL Flexible Server by HTTP'
      description: |
        This template is designed to monitor Microsoft Azure PostgreSQL flexible servers 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"
      wizard_ready: 'YES'
      readme: |
        ## Overview
        
        This template is designed to monitor Microsoft Azure PostgreSQL flexible servers 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 [Azure documentation](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 host wizard configuration fields: `Azure App ID`, `Azure password`, `Azure tenant ID`, `Azure subscription ID`, and `Azure PostgreSQL server ID`.
      vendor:
        name: Zabbix
        version: 8.0-2
      groups:
        - name: Templates/Cloud
      items:
        - uuid: 7f7deae517e54cf582ae758a6988037b
          name: 'Availability status detailed'
          type: DEPENDENT
          key: azure.db.pgsql.availability.details
          value_type: CHAR
          description: 'The summary description of the availability status.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.health.summary
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.db.pgsql.data.get
          tags:
            - tag: component
              value: health
        - uuid: cd9072a3895c42dab794707f3bcaf743
          name: 'Availability state'
          type: DEPENDENT
          key: azure.db.pgsql.availability.state
          description: 'The availability status of the resource.'
          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.db.pgsql.data.get
          tags:
            - tag: component
              value: health
          triggers:
            - uuid: 65b5c39b48e248c4866c511bbba91e1b
              expression: 'last(/Azure PostgreSQL Flexible Server by HTTP/azure.db.pgsql.availability.state)=1'
              name: 'Azure PostgreSQL Flexible: PostgreSQL server is degraded'
              opdata: '{ITEM.LASTVALUE1}'
              priority: AVERAGE
              description: 'The resource is in a degraded state.'
              tags:
                - tag: scope
                  value: availability
            - uuid: d8ce86c853064cba80c9883052ed1403
              expression: 'last(/Azure PostgreSQL Flexible Server by HTTP/azure.db.pgsql.availability.state)=3'
              name: 'Azure PostgreSQL Flexible: PostgreSQL server is in unknown state'
              opdata: '{ITEM.LASTVALUE1}'
              priority: WARNING
              description: 'The resource state is unknown.'
              tags:
                - tag: scope
                  value: availability
            - uuid: 9572c9e56a6b44368bcf2d8a17a220d8
              expression: 'last(/Azure PostgreSQL Flexible Server by HTTP/azure.db.pgsql.availability.state)=2'
              name: 'Azure PostgreSQL Flexible: PostgreSQL server is unavailable'
              opdata: '{ITEM.LASTVALUE1}'
              priority: HIGH
              description: 'The resource state is unavailable.'
              tags:
                - tag: scope
                  value: availability
        - uuid: 05ada75c666e45269c3c36159f9902cc
          name: 'Connections active'
          type: DEPENDENT
          key: azure.db.pgsql.connections.active
          value_type: FLOAT
          description: 'The count of active connections.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.active_connections.average
          master_item:
            key: azure.db.pgsql.data.get
          tags:
            - tag: component
              value: network
        - uuid: 00d1116141874dbfb204ebfe96c203f1
          name: 'Connections failed'
          type: DEPENDENT
          key: azure.db.pgsql.connections.failed
          value_type: FLOAT
          description: 'The count of failed connections.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.connections_failed.total
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.db.pgsql.data.get
          tags:
            - tag: component
              value: network
        - uuid: f422f01bf1c9484e880581f31f70e120
          name: 'Connections succeeded'
          type: DEPENDENT
          key: azure.db.pgsql.connections.succeeded
          value_type: FLOAT
          description: 'The count of succeeded connections.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.connections_succeeded.total
          master_item:
            key: azure.db.pgsql.data.get
          tags:
            - tag: component
              value: network
        - uuid: 1f1270c6981b4d08864572410fdeccde
          name: 'CPU credits consumed'
          type: DEPENDENT
          key: azure.db.pgsql.cpu.credits.consumed
          value_type: FLOAT
          description: 'The total number of credits consumed by the database server.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.cpu_credits_consumed.average
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.db.pgsql.data.get
          tags:
            - tag: component
              value: cpu
        - uuid: e55082c4a278435286335cebd2ae1cac
          name: 'CPU credits remaining'
          type: DEPENDENT
          key: azure.db.pgsql.cpu.credits.remaining
          value_type: FLOAT
          description: 'The total number of credits available to burst.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.cpu_credits_remaining.average
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.db.pgsql.data.get
          tags:
            - tag: component
              value: cpu
        - uuid: 8d85c5c73c894cdda6324832a703fea2
          name: 'Percentage CPU'
          type: DEPENDENT
          key: azure.db.pgsql.cpu.percentage
          value_type: FLOAT
          units: '%'
          description: 'The CPU percent of a host.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.cpu_percent.average
          master_item:
            key: azure.db.pgsql.data.get
          tags:
            - tag: component
              value: cpu
          triggers:
            - uuid: f8672e4488b740a9a17395689c3d853c
              expression: 'min(/Azure PostgreSQL Flexible Server by HTTP/azure.db.pgsql.cpu.percentage,5m)>{$AZURE.DB.CPU.UTIL.CRIT}'
              name: 'Azure PostgreSQL Flexible: High CPU utilization'
              opdata: 'Current utilization: {ITEM.LASTVALUE1}'
              priority: HIGH
              description: 'The CPU utilization is too high. The system might be slow to respond.'
              tags:
                - tag: scope
                  value: performance
        - uuid: 06c4226667ec4c4489e6d3ad31c3135f
          name: 'Get errors'
          type: DEPENDENT
          key: azure.db.pgsql.data.errors
          value_type: TEXT
          description: 'A list of errors from API requests.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.errors
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.db.pgsql.data.get
          tags:
            - tag: component
              value: raw
          triggers:
            - uuid: 55962f0d8a4c44c9a6b09da705e94c59
              expression: 'length(last(/Azure PostgreSQL Flexible Server by HTTP/azure.db.pgsql.data.errors))>0'
              name: 'Azure PostgreSQL Flexible: 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: 1792c0566e8a438dad5e299d8f5b9094
          name: 'Get data'
          type: SCRIPT
          key: azure.db.pgsql.data.get
          history: '0'
          value_type: TEXT
          params: |
            var AzureDB = {
            	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 + '.';
            			}
            		});
            
            		AzureDB.params = params;
            	},
            
            
            	request: function (url, data) {
            		if (typeof data === 'undefined' || data === null) {
            			data = '';
            		}
            
            		var response, request = new HttpRequest();
            		if (typeof AzureDB.params.proxy !== 'undefined' && AzureDB.params.proxy !== '') {
            			request.setProxy(AzureDB.params.proxy);
            		}
            		if (AzureDB.token) {
            			request.addHeader('Accept: application/json');
            			request.addHeader('Authorization: Bearer ' + AzureDB.token);
            		}
            
            		Zabbix.log(4, '[ Azure ] Sending request: ' + url);
            
            		if (data !== '') {
            			request.addHeader('Content-Type: application/x-www-form-urlencoded');
            			response = request.post(url, data);
            		}
            		else {
            			response = request.get(url);
            		}
            
            		Zabbix.log(4, '[ Azure ] Received response with status code ' + request.getStatus() + ': ' + response);
            
            		if (request.getStatus() !== 200 || response === null) {
            			throw 'Request failed with status code ' + request.getStatus() + ': ' + response;
            		}
            
            		try {
            			return JSON.parse(response);
            		}
            		catch (error) {
            			throw 'Failed to parse response received from API.';
            		}
            	}
            
            };
            
            var metrics = [
            	'cpu_percent',
            	'memory_percent',
            	'iops',
            	'disk_queue_depth',
            	'read_throughput',
            	'write_throughput',
            	'read_iops',
            	'write_iops',
            	'network_bytes_egress',
            	'network_bytes_ingress',
            	'active_connections',
            	'connections_failed',
            	'connections_succeeded',
            	'storage_percent',
            	'storage_used',
            	'storage_free',
            	'txlogs_storage_used',
            	'backup_storage_used',
            	'maximum_used_transactionIDs',
            	'cpu_credits_remaining',
            	'cpu_credits_consumed'
            ],
            	prepared_metrics = [],
            	data = {};
            	data['errors'] = {};
            	data['metrics'] = {};
            
            try {
            	AzureDB.setParams(JSON.parse(value));
            
            	try {
            		result = AzureDB.request(
            			'https://login.microsoftonline.com/' + encodeURIComponent(AzureDB.params.tenant_id) + '/oauth2/token',
            			'grant_type=client_credentials&resource=' + encodeURIComponent('https://management.azure.com/') + '&client_id=' + encodeURIComponent(AzureDB.params.app_id) + '&client_secret=' + encodeURIComponent(AzureDB.params.password)
            		);
            
            		if ('access_token' in result) {
            			AzureDB.token = result['access_token'];
            		} else {
            			throw 'Auth response does not contain access token.';
            		}
            	}
            	catch (error) {
            		data.errors.auth = error.toString();
            	}
            
            	if (!('auth' in data.errors)) {
            		try {
            			health = AzureDB.request('https://management.azure.com' + AzureDB.params.resource_id + '/providers/Microsoft.ResourceHealth/availabilityStatuses?api-version=2020-05-01');
            			if ('value' in health && Array.isArray(health.value) && health.value.length > 0 && 'properties' in health.value[0] && typeof health.value[0].properties === 'object') {
            				data.health = health.value[0].properties;
            			}
            		}
            		catch (error) {
            			data.errors.health = error.toString();
            		}
            
            		for (var i = 0; i < metrics.length; i += 20) {
            			var chunk = metrics.slice(i, i + 20);
            
            			prepared_metrics.push(
            				chunk.map(function (element) {
            					return encodeURIComponent(element);
            				}).join(',')
            			);
            		}
            
            		start_date = new Date((new Date().getTime()) - 600000).toISOString().replace(/\.\d+/, '');
            		end_date = new Date().toISOString().replace(/\.\d+/, '');
            
            		for (var j in prepared_metrics) {
            			try {
            				metrics_data = AzureDB.request('https://management.azure.com' + AzureDB.params.resource_id + '/providers/Microsoft.Insights/metrics?metricnames=' + prepared_metrics[j] + '&timespan=' + encodeURIComponent(start_date) + '/' + encodeURIComponent(end_date) + '&api-version=2021-05-01');
            				if ('value' in metrics_data && Array.isArray(metrics_data.value) && metrics_data.value.length > 0) {
            					for (k in metrics_data.value) {
            						if ('name' in metrics_data.value[k] && typeof metrics_data.value[k].name === 'object' && 'value' in metrics_data.value[k].name && typeof metrics_data.value[k].name.value === 'string' && 'timeseries' in metrics_data.value[k] && Array.isArray(metrics_data.value[k].timeseries) && metrics_data.value[k].timeseries.length > 0 && 'data' in metrics_data.value[k].timeseries[0] && Array.isArray(metrics_data.value[k].timeseries[0].data) && metrics_data.value[k].timeseries[0].data.length > 0) {
            							if (metrics_data.value[k].name.value === 'disk_queue_depth' ||
            								metrics_data.value[k].name.value === 'read_throughput' ||
            								metrics_data.value[k].name.value === 'write_throughput' ||
            								metrics_data.value[k].name.value === 'read_iops' ||
            								metrics_data.value[k].name.value === 'write_iops') {
            									data.metrics[metrics_data.value[k].name.value.replace(/(\s|\/)+/g, '')] = metrics_data.value[k].timeseries[0].data[metrics_data.value[k].timeseries[0].data.length - 6];
            							} else {
            								data.metrics[metrics_data.value[k].name.value.replace(/(\s|\/)+/g, '')] = metrics_data.value[k].timeseries[0].data[metrics_data.value[k].timeseries[0].data.length - 1];
            							}
            						}
            					}
            				}
            			}
            			catch (error) {
            				data.errors[prepared_metrics[j]] = error.toString();
            			}
            		}
            	}
            }
            catch (error) {
            	data.errors.params = error.toString();
            }
            
            if (Object.keys(data.errors).length !== 0) {
            	errors = 'Failed to receive data:';
            	for (var error in data.errors) {
            		errors += '\n' + error + ' : ' + data.errors[error];
            	}
            	data.errors = errors;
            }
            else {
            	data.errors = '';
            }
            
            return JSON.stringify(data);
          description: 'The result of API requests is expressed in the JSON.'
          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}'
          tags:
            - tag: component
              value: raw
        - uuid: 9fc7a458995d4ac8a4c1d8550177471d
          name: 'Data disk read Bps'
          type: DEPENDENT
          key: azure.db.pgsql.disk.bps.read
          value_type: FLOAT
          units: Bps
          description: 'Bytes read per second from the data disk during the monitoring period.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.read_throughput.average
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.db.pgsql.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 46c500b44164430c952be3a1b2008fb8
          name: 'Data disk write Bps'
          type: DEPENDENT
          key: azure.db.pgsql.disk.bps.write
          value_type: FLOAT
          units: Bps
          description: 'Bytes written per second to the data disk during the monitoring period.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.write_throughput.average
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.db.pgsql.data.get
          tags:
            - tag: component
              value: storage
        - uuid: b8812461d49a4ff5a2177c2990969c38
          name: 'Data disk queue depth'
          type: DEPENDENT
          key: azure.db.pgsql.disk.queue.depth
          value_type: FLOAT
          description: 'The number of outstanding I/O operations to the data disk.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.disk_queue_depth.average
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.db.pgsql.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 10dd8ed658d8442ca39ac1decf9bc2f8
          name: 'Data disk IOPS'
          type: DEPENDENT
          key: azure.db.pgsql.iops
          value_type: FLOAT
          units: '!ops'
          description: 'I/O operations per second.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.iops.average
          master_item:
            key: azure.db.pgsql.data.get
          tags:
            - tag: component
              value: storage
        - uuid: dee65b110a4842ccba8e74eefc097304
          name: 'Data disk read IOPS'
          type: DEPENDENT
          key: azure.db.pgsql.iops.read
          value_type: FLOAT
          units: '!ops'
          description: 'The number of the data disk I/O read operations per second.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.read_iops.average
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.db.pgsql.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 805dfa040c0a4700acac4b5b1f8a4d11
          name: 'Data disk write IOPS'
          type: DEPENDENT
          key: azure.db.pgsql.iops.write
          value_type: FLOAT
          units: '!ops'
          description: 'The number of the data disk I/O write operations per second.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.write_iops.average
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.db.pgsql.data.get
          tags:
            - tag: component
              value: storage
        - uuid: d1d909c2dd0d42649094ec8339e08881
          name: 'Memory utilization'
          type: DEPENDENT
          key: azure.db.pgsql.memory.percentage
          value_type: FLOAT
          units: '%'
          description: 'The memory percent of a host.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.memory_percent.average
          master_item:
            key: azure.db.pgsql.data.get
          tags:
            - tag: component
              value: memory
          triggers:
            - uuid: aac52a89709044ed987a365a1d5af17b
              expression: 'min(/Azure PostgreSQL Flexible Server by HTTP/azure.db.pgsql.memory.percentage,5m)>{$AZURE.DB.MEMORY.UTIL.CRIT}'
              name: 'Azure PostgreSQL Flexible: High memory utilization'
              opdata: 'Current utilization: {ITEM.LASTVALUE1}'
              priority: AVERAGE
              description: 'The system is running out of free memory.'
              tags:
                - tag: scope
                  value: performance
        - uuid: 040898e15a26455a9992c603ca2d45df
          name: 'Network out'
          type: DEPENDENT
          key: azure.db.pgsql.network.egress
          value_type: FLOAT
          units: bps
          description: 'The network outbound traffic across the active connections.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.network_bytes_egress.total
            - type: MULTIPLIER
              parameters:
                - '0.1333'
          master_item:
            key: azure.db.pgsql.data.get
          tags:
            - tag: component
              value: network
        - uuid: 8e398d8b33444a148760ec33622755a6
          name: 'Network in'
          type: DEPENDENT
          key: azure.db.pgsql.network.ingress
          value_type: FLOAT
          units: bps
          description: 'The network inbound traffic across the active connections.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.network_bytes_ingress.total
            - type: MULTIPLIER
              parameters:
                - '0.1333'
          master_item:
            key: azure.db.pgsql.data.get
          tags:
            - tag: component
              value: network
        - uuid: ebebf8b3a2884576abb250fdc2385c6f
          name: 'Backup storage used'
          type: DEPENDENT
          key: azure.db.pgsql.storage.backup.used
          value_type: FLOAT
          units: B
          description: 'Used backup storage, expressed in bytes.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.backup_storage_used.average
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.db.pgsql.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 9bbfba89a1834798b71260536fedab55
          name: 'Storage free'
          type: DEPENDENT
          key: azure.db.pgsql.storage.free
          value_type: FLOAT
          units: B
          description: 'Free storage space, expressed in bytes.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.storage_free.average
          master_item:
            key: azure.db.pgsql.data.get
          tags:
            - tag: component
              value: storage
        - uuid: d9d97e728d1741568fce925c0fca33a8
          name: 'Storage percent'
          type: DEPENDENT
          key: azure.db.pgsql.storage.percent
          value_type: FLOAT
          units: '%'
          description: 'The storage utilization, expressed in %.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.storage_percent.average
          master_item:
            key: azure.db.pgsql.data.get
          tags:
            - tag: component
              value: storage
          triggers:
            - uuid: de3142bed28340d9abe518cd3967b024
              expression: 'last(/Azure PostgreSQL Flexible Server by HTTP/azure.db.pgsql.storage.percent)>{$AZURE.DB.STORAGE.PUSED.CRIT}'
              name: 'Azure PostgreSQL Flexible: Storage space is critically low'
              opdata: 'Current utilization: {ITEM.LASTVALUE1}'
              priority: AVERAGE
              description: 'Critical utilization of the storage space.'
              tags:
                - tag: scope
                  value: capacity
            - uuid: e948600affaa4ff4a0ab4e50f4858c0a
              expression: 'last(/Azure PostgreSQL Flexible Server by HTTP/azure.db.pgsql.storage.percent)>{$AZURE.DB.STORAGE.PUSED.WARN}'
              name: 'Azure PostgreSQL Flexible: Storage space is low'
              opdata: 'Current utilization: {ITEM.LASTVALUE1}'
              priority: WARNING
              description: 'High utilization of the storage space.'
              tags:
                - tag: scope
                  value: capacity
        - uuid: 4dae6c2c1dbf4492a73fd1834cae6aad
          name: 'Transaction log storage used'
          type: DEPENDENT
          key: azure.db.pgsql.storage.txlogs.used
          value_type: FLOAT
          units: B
          description: 'The storage space used by transaction log, expressed in bytes.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.txlogs_storage_used.average
          master_item:
            key: azure.db.pgsql.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 7a85b5223ec44ff8bc996c9df1673611
          name: 'Storage used'
          type: DEPENDENT
          key: azure.db.pgsql.storage.used
          value_type: FLOAT
          units: B
          description: 'Used storage space, expressed in bytes.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.storage_used.average
          master_item:
            key: azure.db.pgsql.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 6df77ed1d4614ca793df56dbc70d821c
          name: 'Maximum used transaction IDs'
          type: DEPENDENT
          key: azure.db.pgsql.txid.used.max
          value_type: FLOAT
          description: 'The maximum number of used transaction IDs.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.maximum_used_transactionIDs.average
          master_item:
            key: azure.db.pgsql.data.get
          tags:
            - tag: component
              value: storage
      tags:
        - tag: class
          value: cloud
        - tag: subclass
          value: sql
        - tag: target
          value: azure
        - tag: target
          value: postgresql
      macros:
        - macro: '{$AZURE.APP.ID}'
          description: 'The App ID of Microsoft Azure.'
          config:
            type: TEXT
            priority: '3'
            label: 'Azure App ID'
            description: 'Microsoft Azure App ID.'
            required: 'YES'
        - macro: '{$AZURE.DATA.TIMEOUT}'
          value: 15s
          description: 'API response timeout.'
          config:
            type: TEXT
            priority: '10'
            section_name: Other
            label: 'API timeout'
            description: 'API response timeout, in seconds.'
        - macro: '{$AZURE.DB.CPU.UTIL.CRIT}'
          value: '90'
          description: 'The critical threshold of CPU utilization, expressed in %.'
          config:
            type: TEXT
            priority: '6'
            section_name: Thresholds
            label: 'CPU utilization critical threshold'
            description: 'Critical threshold of CPU utilization, expressed in %. In the range from 0 to 100 inclusive.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$AZURE.DB.MEMORY.UTIL.CRIT}'
          value: '90'
          description: 'The critical threshold of memory utilization, expressed in %.'
          config:
            type: TEXT
            priority: '7'
            section_name: Thresholds
            label: 'Memory utilization critical threshold'
            description: 'Critical threshold of memory utilization, expressed in %. In the range from 0 to 100 inclusive.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$AZURE.DB.STORAGE.PUSED.CRIT}'
          value: '90'
          description: 'The critical threshold of storage utilization, expressed in %.'
          config:
            type: TEXT
            priority: '9'
            section_name: Thresholds
            label: 'Storage utilization critical threshold'
            description: 'Critical threshold of storage utilization, expressed in %. In the range from 0 to 100 inclusive.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$AZURE.DB.STORAGE.PUSED.WARN}'
          value: '80'
          description: 'The warning threshold of storage utilization, expressed in %.'
          config:
            type: TEXT
            priority: '8'
            section_name: Thresholds
            label: 'Storage utilization warning threshold'
            description: 'Warning threshold of storage utilization, expressed in %. In the range from 0 to 100 inclusive.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$AZURE.PASSWORD}'
          type: SECRET_TEXT
          description: 'Microsoft Azure password.'
          config:
            type: TEXT
            priority: '4'
            label: 'Azure password'
            description: 'Microsoft Azure password.'
            required: 'YES'
        - macro: '{$AZURE.PROXY}'
          description: 'Sets the HTTP proxy value. If this macro is empty, then no proxy is used.'
          config:
            type: TEXT
            priority: '11'
            section_name: Other
            label: 'HTTP proxy'
            description: 'HTTP proxy to use for requests.'
        - macro: '{$AZURE.RESOURCE.ID}'
          description: 'Microsoft Azure PostgreSQL server ID.'
          config:
            type: TEXT
            priority: '5'
            label: 'Azure PostgreSQL server ID'
            description: 'Microsoft Azure PostgreSQL server ID.'
            required: 'YES'
        - macro: '{$AZURE.SUBSCRIPTION.ID}'
          description: 'Microsoft Azure subscription ID.'
          config:
            type: TEXT
            priority: '1'
            label: 'Azure subscription ID'
            description: 'Microsoft Azure subscription ID.'
            required: 'YES'
        - macro: '{$AZURE.TENANT.ID}'
          description: 'Microsoft Azure tenant ID.'
          config:
            type: TEXT
            priority: '2'
            label: 'Azure tenant ID'
            description: 'Microsoft Azure tenant ID.'
            required: 'YES'
      dashboards:
        - uuid: 89588d831e7348b6b41b47a2cca79190
          name: 'Overview Azure PostgreSQL Flexible Server'
          pages:
            - widgets:
                - type: item
                  name: 'Memory utilization'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure PostgreSQL Flexible Server by HTTP'
                        key: azure.db.pgsql.memory.percentage
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: STRING
                      name: units
                      value: '%'
                - type: item
                  name: 'Data disk queue depth'
                  'y': '3'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure PostgreSQL Flexible Server by HTTP'
                        key: azure.db.pgsql.disk.queue.depth
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'Storage free'
                  'y': '6'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure PostgreSQL Flexible Server by HTTP'
                        key: azure.db.pgsql.storage.free
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'Network in'
                  'y': '9'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure PostgreSQL Flexible Server by HTTP'
                        key: azure.db.pgsql.network.ingress
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'Connections active'
                  'y': '12'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure PostgreSQL Flexible Server by HTTP'
                        key: azure.db.pgsql.connections.active
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'Percentage CPU'
                  x: '12'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure PostgreSQL Flexible Server by HTTP'
                        key: azure.db.pgsql.cpu.percentage
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: STRING
                      name: units
                      value: '%'
                - type: item
                  name: 'Data disk IOPS'
                  x: '12'
                  'y': '3'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure PostgreSQL Flexible Server by HTTP'
                        key: azure.db.pgsql.iops
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'Storage used'
                  x: '12'
                  'y': '6'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure PostgreSQL Flexible Server by HTTP'
                        key: azure.db.pgsql.storage.used
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'Network out'
                  x: '12'
                  'y': '9'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure PostgreSQL Flexible Server by HTTP'
                        key: azure.db.pgsql.network.egress
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'Connections failed'
                  x: '12'
                  'y': '12'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure PostgreSQL Flexible Server by HTTP'
                        key: azure.db.pgsql.connections.failed
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'Availability state'
                  x: '24'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure PostgreSQL Flexible Server by HTTP'
                        key: azure.db.pgsql.availability.state
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: STRING
                      name: up_color
                      value: FF0000
                - type: item
                  name: 'Data disk read IOPS'
                  x: '24'
                  'y': '3'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure PostgreSQL Flexible Server by HTTP'
                        key: azure.db.pgsql.iops.read
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: graph
                  name: 'Storage utilization'
                  x: '24'
                  'y': '6'
                  width: '48'
                  height: '3'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Azure PostgreSQL Flexible Server by HTTP'
                        name: 'Azure PostgreSQL: Storage utilization'
                    - type: STRING
                      name: reference
                      value: AAAAA
                - type: graph
                  name: 'Network traffic'
                  x: '24'
                  'y': '9'
                  width: '48'
                  height: '3'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Azure PostgreSQL Flexible Server by HTTP'
                        name: 'Azure PostgreSQL: Network traffic'
                    - type: STRING
                      name: reference
                      value: AAAAB
                - type: graph
                  name: Connections
                  x: '24'
                  'y': '12'
                  width: '48'
                  height: '3'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Azure PostgreSQL Flexible Server by HTTP'
                        name: 'Azure PostgreSQL: Connections'
                    - type: STRING
                      name: reference
                      value: AAAAC
                - type: itemhistory
                  name: 'Availability status detailed'
                  x: '36'
                  width: '36'
                  height: '3'
                  fields:
                    - type: INTEGER
                      name: columns.0.display
                      value: '4'
                    - type: ITEM
                      name: columns.0.itemid
                      value:
                        host: 'Azure PostgreSQL Flexible Server by HTTP'
                        key: azure.db.pgsql.availability.details
                    - type: INTEGER
                      name: columns.0.monospace_font
                      value: '1'
                    - type: STRING
                      name: columns.0.name
                      value: 'Azure PostgreSQL: Availability status detailed'
                    - type: STRING
                      name: reference
                      value: BAAAD
                    - type: INTEGER
                      name: show_timestamp
                      value: '1'
                - type: item
                  name: 'Data disk write IOPS'
                  x: '36'
                  'y': '3'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure PostgreSQL Flexible Server by HTTP'
                        key: azure.db.pgsql.iops.write
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'Data disk read Bps'
                  x: '48'
                  'y': '3'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure PostgreSQL Flexible Server by HTTP'
                        key: azure.db.pgsql.disk.bps.read
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'Data disk write Bps'
                  x: '60'
                  'y': '3'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure PostgreSQL Flexible Server by HTTP'
                        key: azure.db.pgsql.disk.bps.write
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
      valuemaps:
        - uuid: f208cf6141c44659a2c6904ec4cd7ac3
          name: 'Azure resource health state'
          mappings:
            - value: '0'
              newvalue: Available
            - value: '1'
              newvalue: Degraded
            - value: '2'
              newvalue: Unavailable
            - value: '3'
              newvalue: Unknown
    - uuid: d023e2cd326c486f908e3e361d1fe157
      template: 'Azure PostgreSQL Single Server by HTTP'
      name: 'Azure PostgreSQL Single Server by HTTP'
      description: |
        This template is designed to monitor Microsoft Azure PostgreSQL servers 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"
      wizard_ready: 'YES'
      readme: |
        ## Overview
        
        This template is designed to monitor Microsoft Azure PostgreSQL servers 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 [Azure documentation](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 host wizard configuration fields: `Azure App ID`, `Azure password`, `Azure tenant ID`, `Azure subscription ID`, and `Azure PostgreSQL server ID`.
      vendor:
        name: Zabbix
        version: 8.0-2
      groups:
        - name: Templates/Cloud
      items:
        - uuid: 9eb43a5ffb0d4e07be8d1fccfdecd2aa
          name: 'Availability status detailed'
          type: DEPENDENT
          key: azure.db.pgsql.availability.details
          value_type: CHAR
          description: 'The summary description of the availability status.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.health.summary
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.db.pgsql.data.get
          tags:
            - tag: component
              value: health
        - uuid: df4c66646f864f79b5f5e9f71dbefe82
          name: 'Availability state'
          type: DEPENDENT
          key: azure.db.pgsql.availability.state
          description: 'The availability status of the resource.'
          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.db.pgsql.data.get
          tags:
            - tag: component
              value: health
          triggers:
            - uuid: 699ca12c916746b1bf1e121261771cc3
              expression: 'last(/Azure PostgreSQL Single Server by HTTP/azure.db.pgsql.availability.state)=1'
              name: 'Azure PostgreSQL Single: PostgreSQL server is degraded'
              opdata: '{ITEM.LASTVALUE1}'
              priority: AVERAGE
              description: 'The resource is in a degraded state.'
              tags:
                - tag: scope
                  value: availability
            - uuid: 14e45ba0bc26409a89d92edfda152947
              expression: 'last(/Azure PostgreSQL Single Server by HTTP/azure.db.pgsql.availability.state)=3'
              name: 'Azure PostgreSQL Single: PostgreSQL server is in unknown state'
              opdata: '{ITEM.LASTVALUE1}'
              priority: WARNING
              description: 'The resource state is unknown.'
              tags:
                - tag: scope
                  value: availability
            - uuid: 4dc9113f8a914ac098d8736dba5aed4a
              expression: 'last(/Azure PostgreSQL Single Server by HTTP/azure.db.pgsql.availability.state)=2'
              name: 'Azure PostgreSQL Single: PostgreSQL server is unavailable'
              opdata: '{ITEM.LASTVALUE1}'
              priority: HIGH
              description: 'The resource state is unavailable.'
              tags:
                - tag: scope
                  value: availability
        - uuid: 3d0d3e1fe77740e4bd7b720368707214
          name: 'Connections active'
          type: DEPENDENT
          key: azure.db.pgsql.connections.active
          value_type: FLOAT
          description: 'The count of active connections.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.active_connections.average
          master_item:
            key: azure.db.pgsql.data.get
          tags:
            - tag: component
              value: network
        - uuid: 353a6ba543a84b32b16a5809ae63b4e1
          name: 'Connections failed'
          type: DEPENDENT
          key: azure.db.pgsql.connections.failed
          value_type: FLOAT
          description: 'The count of failed connections.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.connections_failed.total
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.db.pgsql.data.get
          tags:
            - tag: component
              value: network
        - uuid: 537330b2372b434ebcea8a77a809c2f3
          name: 'Percentage CPU'
          type: DEPENDENT
          key: azure.db.pgsql.cpu.percentage
          value_type: FLOAT
          units: '%'
          description: 'The CPU percent of a host.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.cpu_percent.average
          master_item:
            key: azure.db.pgsql.data.get
          tags:
            - tag: component
              value: cpu
          triggers:
            - uuid: 33bd2ef88ad3468b9f0b2b1358cc7448
              expression: 'min(/Azure PostgreSQL Single Server by HTTP/azure.db.pgsql.cpu.percentage,5m)>{$AZURE.DB.CPU.UTIL.CRIT}'
              name: 'Azure PostgreSQL Single: High CPU utilization'
              opdata: 'Current utilization: {ITEM.LASTVALUE1}'
              priority: HIGH
              description: 'The CPU utilization is too high. The system might be slow to respond.'
              tags:
                - tag: scope
                  value: performance
        - uuid: 5b132ff050c94daa92b252529a52c535
          name: 'Get errors'
          type: DEPENDENT
          key: azure.db.pgsql.data.errors
          value_type: TEXT
          description: 'A list of errors from API requests.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.errors
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.db.pgsql.data.get
          tags:
            - tag: component
              value: raw
          triggers:
            - uuid: dd3d0be997204f8b9968ef5839fb7a9b
              expression: 'length(last(/Azure PostgreSQL Single Server by HTTP/azure.db.pgsql.data.errors))>0'
              name: 'Azure PostgreSQL Single: 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: e47d863822e64e6292bfa3e684bc2839
          name: 'Get data'
          type: SCRIPT
          key: azure.db.pgsql.data.get
          history: '0'
          value_type: TEXT
          params: |
            var AzureDB = {
            	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 + '.';
            			}
            		});
            
            		AzureDB.params = params;
            	},
            
            
            	request: function (url, data) {
            		if (typeof data === 'undefined' || data === null) {
            			data = '';
            		}
            
            		var response, request = new HttpRequest();
            		if (typeof AzureDB.params.proxy !== 'undefined' && AzureDB.params.proxy !== '') {
            			request.setProxy(AzureDB.params.proxy);
            		}
            		if (AzureDB.token) {
            			request.addHeader('Accept: application/json');
            			request.addHeader('Authorization: Bearer ' + AzureDB.token);
            		}
            
            		Zabbix.log(4, '[ Azure ] Sending request: ' + url);
            
            		if (data !== '') {
            			request.addHeader('Content-Type: application/x-www-form-urlencoded');
            			response = request.post(url, data);
            		}
            		else {
            			response = request.get(url);
            		}
            
            		Zabbix.log(4, '[ Azure ] Received response with status code ' + request.getStatus() + ': ' + response);
            
            		if (request.getStatus() !== 200 || response === null) {
            			throw 'Request failed with status code ' + request.getStatus() + ': ' + response;
            		}
            
            		try {
            			return JSON.parse(response);
            		}
            		catch (error) {
            			throw 'Failed to parse response received from API.';
            		}
            	}
            
            };
            
            var metrics = [
            	'cpu_percent',
            	'memory_percent',
            	'io_consumption_percent',
            	'storage_percent',
            	'storage_used',
            	'storage_limit',
            	'serverlog_storage_percent',
            	'serverlog_storage_usage',
            	'serverlog_storage_limit',
            	'active_connections',
            	'connections_failed',
            	'backup_storage_used',
            	'network_bytes_egress',
            	'network_bytes_ingress',
            	'pg_replica_log_delay_in_seconds',
            	'pg_replica_log_delay_in_bytes'
            ],
            	prepared_metrics = [],
            	data = {};
            	data['errors'] = {};
            	data['metrics'] = {};
            
            try {
            	AzureDB.setParams(JSON.parse(value));
            
            	try {
            		result = AzureDB.request(
            			'https://login.microsoftonline.com/' + encodeURIComponent(AzureDB.params.tenant_id) + '/oauth2/token',
            			'grant_type=client_credentials&resource=' + encodeURIComponent('https://management.azure.com/') + '&client_id=' + encodeURIComponent(AzureDB.params.app_id) + '&client_secret=' + encodeURIComponent(AzureDB.params.password)
            		);
            
            		if ('access_token' in result) {
            			AzureDB.token = result['access_token'];
            		} else {
            			throw 'Auth response does not contain access token.';
            		}
            	}
            	catch (error) {
            		data.errors.auth = error.toString();
            	}
            
            	if (!('auth' in data.errors)) {
            		try {
            			health = AzureDB.request('https://management.azure.com' + AzureDB.params.resource_id + '/providers/Microsoft.ResourceHealth/availabilityStatuses?api-version=2020-05-01');
            			if ('value' in health && Array.isArray(health.value) && health.value.length > 0 && 'properties' in health.value[0] && typeof health.value[0].properties === 'object') {
            				data.health = health.value[0].properties;
            			}
            		}
            		catch (error) {
            			data.errors.health = error.toString();
            		}
            
            		for (var i = 0; i < metrics.length; i += 20) {
            			var chunk = metrics.slice(i, i + 20);
            
            			prepared_metrics.push(
            				chunk.map(function (element) {
            					return encodeURIComponent(element);
            				}).join(',')
            			);
            		}
            
            		start_date = new Date((new Date().getTime()) - 300000).toISOString().replace(/\.\d+/, '');
            		end_date = new Date().toISOString().replace(/\.\d+/, '');
            
            		for (var j in prepared_metrics) {
            			try {
            				metrics_data = AzureDB.request('https://management.azure.com' + AzureDB.params.resource_id + '/providers/Microsoft.Insights/metrics?metricnames=' + prepared_metrics[j] + '&timespan=' + encodeURIComponent(start_date) + '/' + encodeURIComponent(end_date) + '&api-version=2021-05-01');
            				if ('value' in metrics_data && Array.isArray(metrics_data.value) && metrics_data.value.length > 0) {
            					for (k in metrics_data.value) {
            						if ('name' in metrics_data.value[k] && typeof metrics_data.value[k].name === 'object' && 'value' in metrics_data.value[k].name && typeof metrics_data.value[k].name.value === 'string' && 'timeseries' in metrics_data.value[k] && Array.isArray(metrics_data.value[k].timeseries) && metrics_data.value[k].timeseries.length > 0 && 'data' in metrics_data.value[k].timeseries[0] && Array.isArray(metrics_data.value[k].timeseries[0].data) && metrics_data.value[k].timeseries[0].data.length > 0) {
            							data.metrics[metrics_data.value[k].name.value.replace(/(\s|\/)+/g, '')] = metrics_data.value[k].timeseries[0].data[metrics_data.value[k].timeseries[0].data.length - 1];
            						}
            					}
            				}
            			}
            			catch (error) {
            				data.errors[prepared_metrics[j]] = error.toString();
            			}
            		}
            	}
            }
            catch (error) {
            	data.errors.params = error.toString();
            }
            
            if (Object.keys(data.errors).length !== 0) {
            	errors = 'Failed to receive data:';
            	for (var error in data.errors) {
            		errors += '\n' + error + ' : ' + data.errors[error];
            	}
            	data.errors = errors;
            }
            else {
            	data.errors = '';
            }
            
            return JSON.stringify(data);
          description: 'The result of API requests is expressed in the JSON.'
          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}'
          tags:
            - tag: component
              value: raw
        - uuid: 9eade85c49bc462aab33b03e37581d87
          name: 'IO consumption percent'
          type: DEPENDENT
          key: azure.db.pgsql.io.consumption.percent
          value_type: FLOAT
          units: '%'
          description: 'The consumption percent of I/O.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.io_consumption_percent.average
          master_item:
            key: azure.db.pgsql.data.get
          tags:
            - tag: component
              value: operations
        - uuid: e2ee4882b08f45788e6abb698265810e
          name: 'Memory utilization'
          type: DEPENDENT
          key: azure.db.pgsql.memory.percentage
          value_type: FLOAT
          units: '%'
          description: 'The memory percent of a host.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.memory_percent.average
          master_item:
            key: azure.db.pgsql.data.get
          tags:
            - tag: component
              value: memory
          triggers:
            - uuid: 3119f21167a546369c05d31cda2e0147
              expression: 'min(/Azure PostgreSQL Single Server by HTTP/azure.db.pgsql.memory.percentage,5m)>{$AZURE.DB.MEMORY.UTIL.CRIT}'
              name: 'Azure PostgreSQL Single: High memory utilization'
              opdata: 'Current utilization: {ITEM.LASTVALUE1}'
              priority: AVERAGE
              description: 'The system is running out of free memory.'
              tags:
                - tag: scope
                  value: performance
        - uuid: f81eeb98d5e942f296c360ff71e8bf8d
          name: 'Network out'
          type: DEPENDENT
          key: azure.db.pgsql.network.egress
          value_type: FLOAT
          units: bps
          description: 'The network outbound traffic across the active connections.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.network_bytes_egress.total
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '0.1333'
          master_item:
            key: azure.db.pgsql.data.get
          tags:
            - tag: component
              value: network
        - uuid: 51f7e35042d04ddb88c7703d1b015d3b
          name: 'Network in'
          type: DEPENDENT
          key: azure.db.pgsql.network.ingress
          value_type: FLOAT
          units: bps
          description: 'The network inbound traffic across the active connections.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.network_bytes_ingress.total
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '0.1333'
          master_item:
            key: azure.db.pgsql.data.get
          tags:
            - tag: component
              value: network
        - uuid: 1db9e470b527476fae1d26d4b67f855b
          name: 'Replication lag'
          type: DEPENDENT
          key: azure.db.pgsql.replica.log.delay
          value_type: FLOAT
          units: s
          description: 'The replication lag, expressed in seconds.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.pg_replica_log_delay_in_seconds.maximum
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.db.pgsql.data.get
          tags:
            - tag: component
              value: replication
        - uuid: 6cdfda8f9e6640f8a8536f88729d75d6
          name: 'Max lag across replicas in bytes'
          type: DEPENDENT
          key: azure.db.pgsql.replica.log.delay.bytes
          value_type: FLOAT
          units: B
          description: 'Lag for the most lagging replica, expressed in bytes.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.pg_replica_log_delay_in_bytes.maximum
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.db.pgsql.data.get
          tags:
            - tag: component
              value: replication
        - uuid: 6b06fb0e008640839dc3cda5bcc3f91a
          name: 'Backup storage used'
          type: DEPENDENT
          key: azure.db.pgsql.storage.backup.used
          value_type: FLOAT
          units: B
          description: 'Used backup storage, expressed in bytes.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.backup_storage_used.average
          master_item:
            key: azure.db.pgsql.data.get
          tags:
            - tag: component
              value: storage
        - uuid: b8d5ac0b049a4d73b2f35f59c7e7609c
          name: 'Storage limit'
          type: DEPENDENT
          key: azure.db.pgsql.storage.limit
          value_type: FLOAT
          units: B
          description: 'The storage limit, expressed in bytes.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.storage_limit.maximum
          master_item:
            key: azure.db.pgsql.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 750b4d3438614cc992694136d309c3cb
          name: 'Storage percent'
          type: DEPENDENT
          key: azure.db.pgsql.storage.percent
          value_type: FLOAT
          units: '%'
          description: 'The storage utilization, expressed in %.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.storage_percent.average
          master_item:
            key: azure.db.pgsql.data.get
          tags:
            - tag: component
              value: storage
          triggers:
            - uuid: 6538d2c8ed774feb951204308f1458ce
              expression: 'last(/Azure PostgreSQL Single Server by HTTP/azure.db.pgsql.storage.percent)>{$AZURE.DB.STORAGE.PUSED.CRIT}'
              name: 'Azure PostgreSQL Single: Storage space is critically low'
              opdata: 'Current utilization: {ITEM.LASTVALUE1}'
              priority: AVERAGE
              description: 'Critical utilization of the storage space.'
              tags:
                - tag: scope
                  value: capacity
            - uuid: 7f7a004cfc2a492092dd74c475888e8b
              expression: 'last(/Azure PostgreSQL Single Server by HTTP/azure.db.pgsql.storage.percent)>{$AZURE.DB.STORAGE.PUSED.WARN}'
              name: 'Azure PostgreSQL Single: Storage space is low'
              opdata: 'Current utilization: {ITEM.LASTVALUE1}'
              priority: WARNING
              description: 'High utilization of the storage space.'
              tags:
                - tag: scope
                  value: capacity
        - uuid: 399ef67426494a5cb7a820d056dfd4d5
          name: 'Server log storage limit'
          type: DEPENDENT
          key: azure.db.pgsql.storage.server.log.limit
          value_type: FLOAT
          units: B
          description: 'The storage limit of server log, expressed in bytes.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.serverlog_storage_limit.maximum
          master_item:
            key: azure.db.pgsql.data.get
          tags:
            - tag: component
              value: storage
        - uuid: ef6890330ebe4fe09f46b0d2f6d3f827
          name: 'Server log storage percent'
          type: DEPENDENT
          key: azure.db.pgsql.storage.server.log.percent
          value_type: FLOAT
          units: '%'
          description: 'The storage utilization by server log, expressed in %.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.serverlog_storage_percent.average
          master_item:
            key: azure.db.pgsql.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 36bd10a959964083ae47349dd83ec695
          name: 'Server log storage used'
          type: DEPENDENT
          key: azure.db.pgsql.storage.server.log.used
          value_type: FLOAT
          units: B
          description: 'The storage space used by server log, expressed in bytes.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.serverlog_storage_usage.average
          master_item:
            key: azure.db.pgsql.data.get
          tags:
            - tag: component
              value: storage
        - uuid: dcbb87d442a04938b23e68f739f1e36f
          name: 'Storage used'
          type: DEPENDENT
          key: azure.db.pgsql.storage.used
          value_type: FLOAT
          units: B
          description: 'Used storage space, expressed in bytes.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.storage_used.average
          master_item:
            key: azure.db.pgsql.data.get
          tags:
            - tag: component
              value: storage
      tags:
        - tag: class
          value: cloud
        - tag: subclass
          value: sql
        - tag: target
          value: azure
        - tag: target
          value: postgresql
      macros:
        - macro: '{$AZURE.APP.ID}'
          description: 'The App ID of Microsoft Azure.'
          config:
            type: TEXT
            priority: '3'
            label: 'Azure App ID'
            description: 'Microsoft Azure App ID.'
            required: 'YES'
        - macro: '{$AZURE.DATA.TIMEOUT}'
          value: 15s
          description: 'API response timeout.'
          config:
            type: TEXT
            priority: '10'
            section_name: Other
            label: 'API timeout'
            description: 'API response timeout, in seconds.'
        - macro: '{$AZURE.DB.CPU.UTIL.CRIT}'
          value: '90'
          description: 'The critical threshold of CPU utilization, expressed in %.'
          config:
            type: TEXT
            priority: '6'
            section_name: Thresholds
            label: 'CPU utilization critical threshold'
            description: 'Critical threshold of CPU utilization, expressed in %. In the range from 0 to 100 inclusive.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$AZURE.DB.MEMORY.UTIL.CRIT}'
          value: '90'
          description: 'The critical threshold of memory utilization, expressed in %.'
          config:
            type: TEXT
            priority: '7'
            section_name: Thresholds
            label: 'Memory utilization critical threshold'
            description: 'Critical threshold of memory utilization, expressed in %. In the range from 0 to 100 inclusive.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$AZURE.DB.STORAGE.PUSED.CRIT}'
          value: '90'
          description: 'The critical threshold of storage utilization, expressed in %.'
          config:
            type: TEXT
            priority: '9'
            section_name: Thresholds
            label: 'Storage utilization critical threshold'
            description: 'Critical threshold of storage utilization, expressed in %. In the range from 0 to 100 inclusive.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$AZURE.DB.STORAGE.PUSED.WARN}'
          value: '80'
          description: 'The warning threshold of storage utilization, expressed in %.'
          config:
            type: TEXT
            priority: '8'
            section_name: Thresholds
            label: 'Storage utilization warning threshold'
            description: 'Warning threshold of storage utilization, expressed in %. In the range from 0 to 100 inclusive.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$AZURE.PASSWORD}'
          type: SECRET_TEXT
          description: 'Microsoft Azure password.'
          config:
            type: TEXT
            priority: '4'
            label: 'Azure password'
            description: 'Microsoft Azure password.'
            required: 'YES'
        - macro: '{$AZURE.PROXY}'
          description: 'Sets the HTTP proxy value. If this macro is empty, then no proxy is used.'
          config:
            type: TEXT
            priority: '11'
            section_name: Other
            label: 'HTTP proxy'
            description: 'HTTP proxy to use for requests.'
        - macro: '{$AZURE.RESOURCE.ID}'
          description: 'Microsoft Azure PostgreSQL server ID.'
          config:
            type: TEXT
            priority: '5'
            label: 'Azure PostgreSQL server ID'
            description: 'Microsoft Azure PostgreSQL server ID.'
            required: 'YES'
        - macro: '{$AZURE.SUBSCRIPTION.ID}'
          description: 'Microsoft Azure subscription ID.'
          config:
            type: TEXT
            priority: '1'
            label: 'Azure subscription ID'
            description: 'Microsoft Azure subscription ID.'
            required: 'YES'
        - macro: '{$AZURE.TENANT.ID}'
          description: 'Microsoft Azure tenant ID.'
          config:
            type: TEXT
            priority: '2'
            label: 'Azure tenant ID'
            description: 'Microsoft Azure tenant ID.'
            required: 'YES'
      dashboards:
        - uuid: 9ef73571560743379fa0b4929370e1b4
          name: 'Overview Azure PostgreSQL Single Server'
          pages:
            - widgets:
                - type: item
                  name: 'Memory utilization'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure PostgreSQL Single Server by HTTP'
                        key: azure.db.pgsql.memory.percentage
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: STRING
                      name: units
                      value: '%'
                - type: item
                  name: 'Network in'
                  'y': '3'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure PostgreSQL Single Server by HTTP'
                        key: azure.db.pgsql.network.ingress
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'Server log storage limit'
                  'y': '6'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure PostgreSQL Single Server by HTTP'
                        key: azure.db.pgsql.storage.server.log.limit
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'Storage limit'
                  'y': '9'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure PostgreSQL Single Server by HTTP'
                        key: azure.db.pgsql.storage.limit
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'Connections active'
                  'y': '12'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure PostgreSQL Single Server by HTTP'
                        key: azure.db.pgsql.connections.active
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'Percentage CPU'
                  x: '12'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure PostgreSQL Single Server by HTTP'
                        key: azure.db.pgsql.cpu.percentage
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: STRING
                      name: units
                      value: '%'
                - type: item
                  name: 'Network out'
                  x: '12'
                  'y': '3'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure PostgreSQL Single Server by HTTP'
                        key: azure.db.pgsql.network.egress
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'Server log storage used'
                  x: '12'
                  'y': '6'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure PostgreSQL Single Server by HTTP'
                        key: azure.db.pgsql.storage.server.log.used
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'Storage used'
                  x: '12'
                  'y': '9'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure PostgreSQL Single Server by HTTP'
                        key: azure.db.pgsql.storage.used
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'Connections failed'
                  x: '12'
                  'y': '12'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure PostgreSQL Single Server by HTTP'
                        key: azure.db.pgsql.connections.failed
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'Availability state'
                  x: '24'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure PostgreSQL Single Server by HTTP'
                        key: azure.db.pgsql.availability.state
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: STRING
                      name: up_color
                      value: FF0000
                - type: graph
                  name: 'Network traffic'
                  x: '24'
                  'y': '3'
                  width: '48'
                  height: '3'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Azure PostgreSQL Single Server by HTTP'
                        name: 'Azure PostgreSQL: Network traffic'
                    - type: STRING
                      name: reference
                      value: AAAAA
                - type: graph
                  name: 'Server log storage utilization'
                  x: '24'
                  'y': '6'
                  width: '48'
                  height: '3'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Azure PostgreSQL Single Server by HTTP'
                        name: 'Azure PostgreSQL: Server log storage utilization'
                    - type: STRING
                      name: reference
                      value: AAAAB
                - type: graph
                  name: 'Storage utilization'
                  x: '24'
                  'y': '9'
                  width: '48'
                  height: '3'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Azure PostgreSQL Single Server by HTTP'
                        name: 'Azure PostgreSQL: Storage utilization'
                    - type: STRING
                      name: reference
                      value: AAAAC
                - type: graph
                  name: Connections
                  x: '24'
                  'y': '12'
                  width: '48'
                  height: '3'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Azure PostgreSQL Single Server by HTTP'
                        name: 'Azure PostgreSQL: Connections'
                    - type: STRING
                      name: reference
                      value: AAAAD
                - type: itemhistory
                  name: 'Availability status detailed'
                  x: '36'
                  width: '36'
                  height: '3'
                  fields:
                    - type: INTEGER
                      name: columns.0.display
                      value: '4'
                    - type: ITEM
                      name: columns.0.itemid
                      value:
                        host: 'Azure PostgreSQL Single Server by HTTP'
                        key: azure.db.pgsql.availability.details
                    - type: INTEGER
                      name: columns.0.monospace_font
                      value: '1'
                    - type: STRING
                      name: columns.0.name
                      value: 'Azure PostgreSQL: Availability status detailed'
                    - type: STRING
                      name: reference
                      value: BAAAE
                    - type: INTEGER
                      name: show_timestamp
                      value: '1'
      valuemaps:
        - uuid: 61fc206aaae04abda4012e031f0e27ac
          name: 'Azure resource health state'
          mappings:
            - value: '0'
              newvalue: Available
            - value: '1'
              newvalue: Degraded
            - value: '2'
              newvalue: Unavailable
            - value: '3'
              newvalue: Unknown
    - uuid: fbc8443b2bd846faaf946f336b92e842
      template: 'Azure Sentinel by HTTP'
      name: 'Azure Sentinel by HTTP'
      description: |
        This template is designed to monitor Microsoft Azure Sentinel 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. Give the created principal the "Microsoft Sentinel Reader" role via the Azure command-line interface (Azure CLI).
            `az role assignment create --assignee "zabbix" --role "Microsoft Sentinel Reader" --scope /subscriptions/<subscription_id>`
          3. Link the template to a host.
          4. 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"
      wizard_ready: 'YES'
      readme: |
        ## Overview
        
        This template is designed to monitor Microsoft Azure Sentinel 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 [Azure documentation](https://docs.microsoft.com/en-us/cli/azure/create-an-azure-service-principal-azure-cli) for more details.
        
        2. Give created principal "Microsoft Sentinel Reader" role via the Azure command-line interface (Azure CLI).
        
              `az role assignment create --assignee "zabbix" --role "Microsoft Sentinel Reader" --scope /subscriptions/<subscription_id>`
        
        
        3. Link the template to a host.
        4. Configure the host wizard configuration fields: `Azure App ID`, `Azure password`, `Azure tenant ID`, `Azure subscription ID`, `Azure workspace`, and `Period`.
      vendor:
        name: Zabbix
        version: 8.0-0
      groups:
        - name: Templates/Cloud
      items:
        - uuid: b7c8d616e02f410f9a92d897d56b64a7
          name: 'Alert rules: Microsoft security incident creation'
          type: DEPENDENT
          key: azure.sentinel.alert_rules.creation
          description: 'The number of Microsoft security incident creation alert rules.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$.metrics.alertRules[?(@.kind == "MicrosoftSecurityIncidentCreation")].length()'
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.sentinel.data.get
          tags:
            - tag: component
              value: alert-rules
            - tag: component
              value: security
        - uuid: bdbb44285ac74cad87f95a5b0f4bc07d
          name: 'Alert rules: Disabled'
          type: DEPENDENT
          key: azure.sentinel.alert_rules.disabled
          description: 'The number of disabled alert rules.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$.metrics.alertRules[?(@.properties.enabled == "false")].length()'
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.sentinel.data.get
          tags:
            - tag: component
              value: alert-rules
            - tag: component
              value: security
        - uuid: 0ae4bd3c2e2e48589b1e5f58e173a890
          name: 'Alert rules: Enabled'
          type: DEPENDENT
          key: azure.sentinel.alert_rules.enabled
          description: 'The number of enabled alert rules.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$.metrics.alertRules[?(@.properties.enabled == "true")].length()'
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.sentinel.data.get
          tags:
            - tag: component
              value: alert-rules
            - tag: component
              value: security
        - uuid: 2eaf3c28e2d94b488ee0b8a2256077e0
          name: 'Alert rules: Fusion'
          type: DEPENDENT
          key: azure.sentinel.alert_rules.fusion
          description: 'The number of fusion alert rules.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$.metrics.alertRules[?(@.kind == "Fusion")].length()'
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.sentinel.data.get
          tags:
            - tag: component
              value: alert-rules
            - tag: component
              value: security
        - uuid: 497b0f7993a44e2b9ee56a6e16993561
          name: 'Alert rules: High severity'
          type: DEPENDENT
          key: azure.sentinel.alert_rules.high
          description: 'The number of high-severity alert rules.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$.metrics.alertRules[?(@.properties.severity == "High")].length()'
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.sentinel.data.get
          tags:
            - tag: component
              value: alert-rules
            - tag: component
              value: security
        - uuid: 52f4ac19b8f345e5911092911a052596
          name: 'Alert rules: Informational severity'
          type: DEPENDENT
          key: azure.sentinel.alert_rules.info
          description: 'The number of informational severity alert rules.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$.metrics.alertRules[?(@.properties.severity == "Informational")].length()'
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.sentinel.data.get
          tags:
            - tag: component
              value: alert-rules
            - tag: component
              value: security
        - uuid: d30b8f4e517e4d03a3ad4b2593337859
          name: 'Alert rules: Low severity'
          type: DEPENDENT
          key: azure.sentinel.alert_rules.low
          description: 'The number of low-severity alert rules.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$.metrics.alertRules[?(@.properties.severity == "Low")].length()'
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.sentinel.data.get
          tags:
            - tag: component
              value: alert-rules
            - tag: component
              value: security
        - uuid: ccfccfab068a49b48d1f9d562d30f123
          name: 'Alert rules: Medium severity'
          type: DEPENDENT
          key: azure.sentinel.alert_rules.medium
          description: 'The number of medium-severity alert rules.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$.metrics.alertRules[?(@.properties.severity == "Medium")].length()'
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.sentinel.data.get
          tags:
            - tag: component
              value: alert-rules
            - tag: component
              value: security
        - uuid: fa8fc8d34eeb4b2b984db1813f2eee9d
          name: 'Alert rules: Scheduled'
          type: DEPENDENT
          key: azure.sentinel.alert_rules.scheduled
          description: 'The number of scheduled alert rules.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$.metrics.alertRules[?(@.kind == "Scheduled")].length()'
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.sentinel.data.get
          tags:
            - tag: component
              value: alert-rules
            - tag: component
              value: security
        - uuid: 7db797b87f674de0ab05b0b78d0985e5
          name: 'Alert rules: Total number'
          type: DEPENDENT
          key: azure.sentinel.alert_rules.total
          description: 'The number of alert rules.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.alertRules.length()
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.sentinel.data.get
          tags:
            - tag: component
              value: alert-rules
            - tag: component
              value: security
          triggers:
            - uuid: d4465fc2a6e845cf86883321411f49b9
              expression: 'change(/Azure Sentinel by HTTP/azure.sentinel.alert_rules.total)<>0'
              name: 'Azure Sentinel: Alert rule total has changed.'
              event_name: 'Azure Sentinel: The number of alert rules has changed from {ITEM.LASTVALUE2} to {ITEM.LASTVALUE1}.'
              opdata: 'Current number: {ITEM.LASTVALUE1}'
              priority: WARNING
              description: 'The number of alert rules has changed.'
              manual_close: 'YES'
              tags:
                - tag: scope
                  value: notice
        - uuid: ab38afaeab6a4831969a4654f6654deb
          name: 'Automation rules: Add incident task'
          type: DEPENDENT
          key: azure.sentinel.automation_rules.add_incident
          description: 'The number of automation rules that add a task to an incident object.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$.metrics.automationRules.[?(@.properties.actions.actionType == "AddIncidentTask")].length()'
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.sentinel.data.get
          tags:
            - tag: component
              value: automation-rules
            - tag: component
              value: security
        - uuid: 317df9556f62404bb852f7de224de8ed
          name: 'Automation rules: On alerts'
          type: DEPENDENT
          key: azure.sentinel.automation_rules.alerts
          description: 'The number of automation rules that are triggered on alerts.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$.metrics.automationRules.[?(@.properties.triggeringLogic.triggersOn == "Alerts")].length()'
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.sentinel.data.get
          tags:
            - tag: component
              value: automation-rules
            - tag: component
              value: security
        - uuid: 6b30213cac2e4d39917042ae2a17d27f
          name: 'Automation rules: On incidents'
          type: DEPENDENT
          key: azure.sentinel.automation_rules.incidents
          description: 'The number of automation rules that are triggered on incidents.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$.metrics.automationRules.[?(@.properties.triggeringLogic.triggersOn == "Incidents")].length()'
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.sentinel.data.get
          tags:
            - tag: component
              value: automation-rules
            - tag: component
              value: security
        - uuid: 106d3241aea54ed2a4a2894a46c449e3
          name: 'Automation rules: Modify properties'
          type: DEPENDENT
          key: azure.sentinel.automation_rules.modify
          description: 'The number of automation rules that modify an object''s properties.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$.metrics.automationRules.[?(@.properties.actions.actionType == "ModifyProperties")].length()'
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.sentinel.data.get
          tags:
            - tag: component
              value: automation-rules
            - tag: component
              value: security
        - uuid: 4e00c3064a4f4517b2e8c0908abac69b
          name: 'Automation rules: Run playbook'
          type: DEPENDENT
          key: azure.sentinel.automation_rules.playbook
          description: 'The number of automation rules that run a playbook on an object.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$.metrics.automationRules.[?(@.properties.actions.actionType == "RunPlaybook")].length()'
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.sentinel.data.get
          tags:
            - tag: component
              value: automation-rules
            - tag: component
              value: security
        - uuid: 8a51949a86974699bad84a865e1fe982
          name: 'Automation rules: Total'
          type: DEPENDENT
          key: azure.sentinel.automation_rules.total
          description: 'The total number of automation rules.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.automationRules.length()
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.sentinel.data.get
          tags:
            - tag: component
              value: automation-rules
            - tag: component
              value: security
          triggers:
            - uuid: 09b5d6f0daff4b93bf3b025feac01cad
              expression: 'change(/Azure Sentinel by HTTP/azure.sentinel.automation_rules.total)<>0'
              name: 'Azure Sentinel: Automation rule total has changed.'
              event_name: 'Azure Sentinel: The number of automation rules has changed from {ITEM.LASTVALUE2} to {ITEM.LASTVALUE1}.'
              opdata: 'Current number: {ITEM.LASTVALUE1}'
              priority: WARNING
              description: 'The number of automation rules has changed.'
              manual_close: 'YES'
              tags:
                - tag: scope
                  value: notice
        - uuid: 3830108041be45f689b74140105d64fb
          name: 'Get data'
          type: SCRIPT
          key: azure.sentinel.data.get
          delay: '{$AZURE.SENTINEL.INTERVAL}'
          history: '0'
          value_type: TEXT
          params: |
            var Azure = {
            	params: {},
            	token: null,
            
            	setParams: function (params) {
            		['app_id', 'password', 'tenant_id', 'subscription_id', 'resource_id', 'period'].forEach(function (field) {
            			if (typeof params !== 'object' || typeof params[field] === 'undefined' || params[field] === '') {
            				throw 'Required param is not set: ' + field + '.';
            			}
            		});
            
            		Azure.params = params;
            	},
            
            	login: function () {
            		var response, login = new HttpRequest();
            
            		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();
            
            		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 Sentinel ] 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;
            	},
            
            	toUtcIso: function (date) {
            		var year = date.getFullYear(),
            			month = (date.getMonth() + 1),
            			day = date.getDate(),
            			hours = date.getHours(),
            			minutes = date.getMinutes(),
            			seconds = date.getSeconds(),
            
            		month = month < 10 ? '0' + month : month;
            		day = day < 10 ? '0' + day : day;
            		hours = hours < 10 ? '0' + hours : hours;
            		minutes = minutes < 10 ? '0' + minutes : minutes;
            		seconds = seconds < 10 ? '0' + seconds : seconds;
            
            		formatted_date = year + '-' + month + '-' + day + 'T' + hours + ':' + minutes + ':' + seconds + 'Z';
            
            		return formatted_date
            	},
            
            	getMetricsData: function () {
            		var startDate = new Date();
            
            		startDate.setDate(startDate.getDate() - Azure.params.period);
            		startDate = new Date(startDate.getTime() + startDate.getTimezoneOffset() * 60000);
            		startDate = Azure.toUtcIso(startDate);
            
            		var data = {},
            			endpoints = [
            				{"entity": "incidents", "filter": "properties/lastModifiedTimeUtc ge " + startDate},
            				{"entity": "dataConnectors", "filter": ""},
            				{"entity": "alertRules", "filter": "properties/lastModifiedTimeUtc ge " + startDate},
            				{"entity": "automationRules", "filter": "properties/lastModifiedTimeUtc ge " + startDate},
            				{"entity": "watchlists", "filter": ""}
            			];
            
            		data.metrics = {};
            
            		endpoints.forEach(function (endpoint) {
            			var filter = (endpoint.filter === "") ? "" : '&$filter=',
            				url = 'https://management.azure.com' +
            				Azure.params.resource_id +
            				'/providers/Microsoft.SecurityInsights/' +
            				endpoint.entity +
            				'?api-version=2025-09-01' +
            				filter +
            				encodeURIComponent(endpoint.filter);
            
            			data.metrics[endpoint.entity] = Azure.getField(Azure.request(url), 'value');
            		});
            
            		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 Sentinel ] ERROR: ' + error);
            	return JSON.stringify({ 'error': error });
            }
          description: 'Gathers data from Azure Sentinel.'
          timeout: '{$AZURE.DATA.TIMEOUT}'
          parameters:
            - name: app_id
              value: '{$AZURE.APP.ID}'
            - name: password
              value: '{$AZURE.PASSWORD}'
            - name: period
              value: '{$AZURE.SENTINEL.PERIOD}'
            - 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}'
          tags:
            - tag: component
              value: raw
        - uuid: 50c6c14b401f44bd8f5da39fda1ed75e
          name: 'Data connectors: Disabled'
          type: DEPENDENT
          key: azure.sentinel.data_connectors.disabled
          description: 'The number of disabled data connectors.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$.metrics.dataConnectors.[?(@.properties.dataTypes..state == "Disabled")].length()'
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.sentinel.data.get
          tags:
            - tag: component
              value: data-connectors
            - tag: component
              value: security
        - uuid: 647d9cb27c524613829e231192fd210b
          name: 'Data connectors: Enabled'
          type: DEPENDENT
          key: azure.sentinel.data_connectors.enabled
          description: 'The number of enabled data connectors.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$.metrics.dataConnectors.[?(@.properties.dataTypes..state == "Enabled")].length()'
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.sentinel.data.get
          tags:
            - tag: component
              value: data-connectors
            - tag: component
              value: security
        - uuid: f70712d9fce04a5083e8455b8f1d0c9e
          name: 'Data connectors: Total'
          type: DEPENDENT
          key: azure.sentinel.data_connectors.total
          description: 'The total number of data connectors.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.dataConnectors.length()
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.sentinel.data.get
          tags:
            - tag: component
              value: data-connectors
            - tag: component
              value: security
          triggers:
            - uuid: 85201a2e3b4a48a980c02be2939d0e3e
              expression: 'change(/Azure Sentinel by HTTP/azure.sentinel.data_connectors.total)<>0'
              name: 'Azure Sentinel: Data connector total has changed.'
              event_name: 'Azure Sentinel: The number of data connectors has changed from {ITEM.LASTVALUE2} to {ITEM.LASTVALUE1}.'
              opdata: 'Current number: {ITEM.LASTVALUE1}'
              priority: WARNING
              description: 'The number of data connectors has changed.'
              manual_close: 'YES'
              tags:
                - tag: scope
                  value: notice
        - uuid: 15ddd25ac72d42209579a0292e61e972
          name: 'Incidents: Active'
          type: DEPENDENT
          key: azure.sentinel.incidents.active
          description: 'The number of active incidents.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$.metrics.incidents[?(@.properties.status == "Active")].length()'
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.sentinel.data.get
          tags:
            - tag: component
              value: incidents
            - tag: component
              value: security
        - uuid: 19bae8a23edd46deb06be5f9441f06b9
          name: 'Incidents: Closed'
          type: DEPENDENT
          key: azure.sentinel.incidents.closed
          description: 'The number of closed incidents.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$.metrics.incidents[?(@.properties.status == "Closed")].length()'
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.sentinel.data.get
          tags:
            - tag: component
              value: incidents
            - tag: component
              value: security
        - uuid: 634db4c5d7ae4557a0080d87c0f4e51f
          name: 'Incidents: High severity'
          type: DEPENDENT
          key: azure.sentinel.incidents.high
          description: 'The number of high-severity incidents.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$.metrics.incidents[?(@.properties.severity == "High")].length()'
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.sentinel.data.get
          tags:
            - tag: component
              value: incidents
            - tag: component
              value: security
        - uuid: d1e20c4e18c64949bbcd251f6ed571d3
          name: 'Incidents: Informational severity'
          type: DEPENDENT
          key: azure.sentinel.incidents.info
          description: 'The number of informational severity incidents.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$.metrics.incidents[?(@.properties.severity == "Informational")].length()'
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.sentinel.data.get
          tags:
            - tag: component
              value: incidents
            - tag: component
              value: security
        - uuid: 81d9c958794a4431997cccf31dd8ba24
          name: 'Incidents: Low severity'
          type: DEPENDENT
          key: azure.sentinel.incidents.low
          description: 'The number of low-severity incidents.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$.metrics.incidents[?(@.properties.severity == "Low")].length()'
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.sentinel.data.get
          tags:
            - tag: component
              value: incidents
            - tag: component
              value: security
        - uuid: f5672de7b77843149ab8bc1405476512
          name: 'Incidents: Medium severity'
          type: DEPENDENT
          key: azure.sentinel.incidents.medium
          description: 'The number of medium-severity incidents.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$.metrics.incidents[?(@.properties.severity == "Medium")].length()'
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.sentinel.data.get
          tags:
            - tag: component
              value: incidents
            - tag: component
              value: security
        - uuid: 52433db78cf240b79e1bc33662340166
          name: 'Incidents: New'
          type: DEPENDENT
          key: azure.sentinel.incidents.new
          description: 'The number of new incidents.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$.metrics.incidents[?(@.properties.status == "New")].length()'
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.sentinel.data.get
          tags:
            - tag: component
              value: incidents
            - tag: component
              value: security
        - uuid: 6b8f2e4895b6449aa3ab009503820645
          name: 'Incidents: Total number'
          type: DEPENDENT
          key: azure.sentinel.incidents.total
          description: 'The total number of incidents.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.incidents.length()
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.sentinel.data.get
          tags:
            - tag: component
              value: incidents
            - tag: component
              value: security
        - uuid: 5d292c4cbeb84ae0ad6a90b79874f464
          name: 'Watchlists: Canceled'
          type: DEPENDENT
          key: azure.sentinel.watchlist.canceled
          description: 'The number of canceled watchlists.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$.metrics.watchlists.[?(@.properties.provisioningState == "Canceled")].length()'
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.sentinel.data.get
          tags:
            - tag: component
              value: security
            - tag: component
              value: watchlists
        - uuid: 802f3bb70c4a4faea036f8a1aa31dbe6
          name: 'Watchlists: Deleting'
          type: DEPENDENT
          key: azure.sentinel.watchlist.deleting
          description: 'The number of watchlists being deleted.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$.metrics.watchlists.[?(@.properties.provisioningState == "Deleting")].length()'
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.sentinel.data.get
          tags:
            - tag: component
              value: security
            - tag: component
              value: watchlists
        - uuid: 34e3927f7b2549b6bd7cf606d47fc8f0
          name: 'Watchlists: Failed'
          type: DEPENDENT
          key: azure.sentinel.watchlist.failed
          description: 'The number of failed watchlists.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$.metrics.watchlists.[?(@.properties.provisioningState == "Failed")].length()'
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.sentinel.data.get
          tags:
            - tag: component
              value: security
            - tag: component
              value: watchlists
        - uuid: 52fe31df3d8245e780a612ea1f5cdd30
          name: 'Watchlists: New'
          type: DEPENDENT
          key: azure.sentinel.watchlist.new
          description: 'The number of new watchlists.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$.metrics.watchlists.[?(@.properties.provisioningState == "New")].length()'
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.sentinel.data.get
          tags:
            - tag: component
              value: security
            - tag: component
              value: watchlists
        - uuid: d228fcaa4e9f42bfa55586ae96a59874
          name: 'Watchlists: In progress'
          type: DEPENDENT
          key: azure.sentinel.watchlist.progress
          description: 'The number of watchlists in progress.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$.metrics.watchlists.[?(@.properties.provisioningState == "InProgress")].length()'
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.sentinel.data.get
          tags:
            - tag: component
              value: security
            - tag: component
              value: watchlists
        - uuid: 6d16ab796bab488897aca9b30c687e65
          name: 'Watchlists: Succeeded'
          type: DEPENDENT
          key: azure.sentinel.watchlist.succeeded
          description: 'The number of succeeded watchlists.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$.metrics.watchlists.[?(@.properties.provisioningState == "Succeeded")].length()'
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.sentinel.data.get
          tags:
            - tag: component
              value: security
            - tag: component
              value: watchlists
        - uuid: 504de002251e4acf9559c2323165d329
          name: 'Watchlists: Total'
          type: DEPENDENT
          key: azure.sentinel.watchlist.total
          description: 'The total number of watchlists.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.watchlists.length()
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.sentinel.data.get
          tags:
            - tag: component
              value: security
            - tag: component
              value: watchlists
          triggers:
            - uuid: 103a16f32d514d85ba9f847931bf694a
              expression: 'change(/Azure Sentinel by HTTP/azure.sentinel.watchlist.total)<>0'
              name: 'Azure Sentinel: Watchlist total has changed.'
              event_name: 'Azure Sentinel: The number of watchlists has changed from {ITEM.LASTVALUE2} to {ITEM.LASTVALUE1}.'
              opdata: 'Current number: {ITEM.LASTVALUE1}'
              priority: WARNING
              description: 'The number of watchlists has changed.'
              manual_close: 'YES'
              tags:
                - tag: scope
                  value: notice
        - uuid: 2850a1b56d5545f6a7c173a94b80b6d8
          name: 'Watchlists: Uploading'
          type: DEPENDENT
          key: azure.sentinel.watchlist.uploading
          description: 'The number of watchlists being uploaded.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$.metrics.watchlists.[?(@.properties.provisioningState == "Uploading")].length()'
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.sentinel.data.get
          tags:
            - tag: component
              value: security
            - tag: component
              value: watchlists
      tags:
        - tag: class
          value: cloud
        - tag: subclass
          value: security
        - tag: target
          value: azure
        - tag: target
          value: sentinel
      macros:
        - macro: '{$AZURE.APP.ID}'
          description: 'The App ID of Microsoft Azure.'
          config:
            type: TEXT
            priority: '3'
            label: 'Azure App ID'
            description: 'Microsoft Azure App ID.'
            required: 'YES'
        - macro: '{$AZURE.DATA.TIMEOUT}'
          value: 15s
          description: 'API response timeout.'
          config:
            type: TEXT
            priority: '6'
            section_name: Other
            label: 'API timeout'
            description: 'API response timeout, in seconds.'
        - macro: '{$AZURE.PASSWORD}'
          type: SECRET_TEXT
          description: 'Microsoft Azure password.'
          config:
            type: TEXT
            priority: '4'
            label: 'Azure password'
            description: 'Microsoft Azure password.'
            required: 'YES'
        - macro: '{$AZURE.PROXY}'
          description: 'Sets the HTTP proxy value. If this macro is empty, then no proxy is used.'
          config:
            type: TEXT
            priority: '7'
            section_name: Other
            label: 'HTTP proxy'
            description: 'HTTP proxy to use for requests.'
        - macro: '{$AZURE.RESOURCE.ID}'
          description: 'Microsoft Azure scale set ID.'
          config:
            type: TEXT
            priority: '5'
            label: 'Azure scale set ID'
            description: 'Microsoft Azure scale set ID.'
            required: 'YES'
        - macro: '{$AZURE.SENTINEL.INCIDENTS.NEW}'
          value: '1'
          description: 'The threshold for new incidents during the interval defined in the `{$AZURE.SENTINEL.INTERVAL}` macro. Can be used with context if needed (check the context values in relevant items).'
          config:
            type: TEXT
            priority: '10'
            section_name: Thresholds
            label: 'Incidents threshold'
            description: 'The threshold for new incidents during the interval defined in the `{$AZURE.SENTINEL.INTERVAL}` macro. No less than 1.'
            required: 'YES'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$AZURE.SENTINEL.INCIDENTS.NEW:high}'
          value: '1'
          description: 'The threshold for new high-severity incidents during the interval defined in the `{$AZURE.SENTINEL.INTERVAL}` macro.'
          config:
            type: TEXT
            priority: '14'
            section_name: Thresholds
            label: 'Incidents threshold'
            description: 'The threshold for new high-severity incidents during the interval defined in the `{$AZURE.SENTINEL.INTERVAL}` macro. No less than 1.'
            required: 'YES'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$AZURE.SENTINEL.INCIDENTS.NEW:info}'
          value: '10'
          description: 'The threshold for new informational severity incidents during the interval defined in the `{$AZURE.SENTINEL.INTERVAL}` macro.'
          config:
            type: TEXT
            priority: '11'
            section_name: Thresholds
            label: 'Incidents threshold'
            description: 'The threshold for new informational severity incidents during the interval defined in the `{$AZURE.SENTINEL.INTERVAL}` macro. No less than 1.'
            required: 'YES'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$AZURE.SENTINEL.INCIDENTS.NEW:low}'
          value: '5'
          description: 'The threshold for new low-severity incidents during the interval defined in the `{$AZURE.SENTINEL.INTERVAL}` macro.'
          config:
            type: TEXT
            priority: '12'
            section_name: Thresholds
            label: 'Incidents threshold'
            description: 'The threshold for new low-severity incidents during the interval defined in the `{$AZURE.SENTINEL.INTERVAL}` macro. No less than 1.'
            required: 'YES'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$AZURE.SENTINEL.INCIDENTS.NEW:medium}'
          value: '1'
          description: 'The threshold for new medium-severity incidents during the interval defined in the `{$AZURE.SENTINEL.INTERVAL}` macro.'
          config:
            type: TEXT
            priority: '13'
            section_name: Thresholds
            label: 'Incidents threshold'
            description: 'The threshold for new medium-severity incidents during the interval defined in the `{$AZURE.SENTINEL.INTERVAL}` macro. No less than 1.'
            required: 'YES'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$AZURE.SENTINEL.INTERVAL}'
          value: 10m
          description: 'The update interval for the script items that retrieve data from the API.'
          config:
            type: TEXT
            priority: '9'
            section_name: Other
            label: 'Data update interval'
            description: 'The update interval for the script items that retrieve data from the API.'
            required: 'YES'
        - macro: '{$AZURE.SENTINEL.PERIOD}'
          value: '30'
          description: 'The number of days during which to retrieve modified entities (incidents, alert rules, automation rules).'
          config:
            type: TEXT
            priority: '8'
            label: Period
            description: 'Number of days over which to retrieve modified entities. No less than 0.'
            required: 'YES'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$AZURE.SUBSCRIPTION.ID}'
          description: 'Microsoft Azure subscription ID.'
          config:
            type: TEXT
            priority: '1'
            label: 'Azure subscription ID'
            description: 'Microsoft Azure subscription ID.'
            required: 'YES'
        - macro: '{$AZURE.TENANT.ID}'
          description: 'Microsoft Azure tenant ID.'
          config:
            type: TEXT
            priority: '2'
            label: 'Azure tenant ID'
            description: 'Microsoft Azure tenant ID.'
            required: 'YES'
      dashboards:
        - uuid: 4ef5f12b11514942a2f5f1e8a4fe0512
          name: Overview
          pages:
            - widgets:
                - type: piechart
                  name: 'Incidents by severity'
                  width: '18'
                  height: '4'
                  fields:
                    - type: STRING
                      name: ds.0.color.0
                      value: 7499FF
                    - type: INTEGER
                      name: ds.0.dataset_type
                      value: '0'
                    - type: ITEM
                      name: ds.0.itemids.0
                      value:
                        host: 'Azure Sentinel by HTTP'
                        key: azure.sentinel.incidents.info
                    - type: INTEGER
                      name: ds.0.type.0
                      value: '0'
                    - type: STRING
                      name: ds.1.color.0
                      value: FFBF59
                    - type: INTEGER
                      name: ds.1.dataset_type
                      value: '0'
                    - type: ITEM
                      name: ds.1.itemids.0
                      value:
                        host: 'Azure Sentinel by HTTP'
                        key: azure.sentinel.incidents.low
                    - type: INTEGER
                      name: ds.1.type.0
                      value: '0'
                    - type: STRING
                      name: ds.2.color.0
                      value: FFA059
                    - type: INTEGER
                      name: ds.2.dataset_type
                      value: '0'
                    - type: ITEM
                      name: ds.2.itemids.0
                      value:
                        host: 'Azure Sentinel by HTTP'
                        key: azure.sentinel.incidents.medium
                    - type: INTEGER
                      name: ds.2.type.0
                      value: '0'
                    - type: STRING
                      name: ds.3.color.0
                      value: E97659
                    - type: INTEGER
                      name: ds.3.dataset_type
                      value: '0'
                    - type: ITEM
                      name: ds.3.itemids.0
                      value:
                        host: 'Azure Sentinel by HTTP'
                        key: azure.sentinel.incidents.high
                    - type: INTEGER
                      name: ds.3.type.0
                      value: '0'
                    - type: INTEGER
                      name: legend_lines
                      value: '4'
                    - type: INTEGER
                      name: legend_value
                      value: '1'
                - type: piechart
                  name: 'Alert rules by status'
                  'y': '4'
                  width: '12'
                  height: '4'
                  fields:
                    - type: STRING
                      name: ds.0.color.0
                      value: E45959
                    - type: INTEGER
                      name: ds.0.dataset_type
                      value: '0'
                    - type: ITEM
                      name: ds.0.itemids.0
                      value:
                        host: 'Azure Sentinel by HTTP'
                        key: azure.sentinel.alert_rules.disabled
                    - type: INTEGER
                      name: ds.0.type.0
                      value: '0'
                    - type: STRING
                      name: ds.1.color.0
                      value: 00C48C
                    - type: INTEGER
                      name: ds.1.dataset_type
                      value: '0'
                    - type: ITEM
                      name: ds.1.itemids.0
                      value:
                        host: 'Azure Sentinel by HTTP'
                        key: azure.sentinel.alert_rules.enabled
                    - type: INTEGER
                      name: ds.1.type.0
                      value: '0'
                    - type: INTEGER
                      name: legend_lines
                      value: '2'
                    - type: INTEGER
                      name: legend_value
                      value: '1'
                - type: piechart
                  name: 'Automation rules by solution'
                  'y': '8'
                  width: '18'
                  height: '4'
                  fields:
                    - type: STRING
                      name: ds.0.color.0
                      value: 7499FF
                    - type: INTEGER
                      name: ds.0.dataset_type
                      value: '0'
                    - type: ITEM
                      name: ds.0.itemids.0
                      value:
                        host: 'Azure Sentinel by HTTP'
                        key: azure.sentinel.automation_rules.add_incident
                    - type: INTEGER
                      name: ds.0.type.0
                      value: '0'
                    - type: STRING
                      name: ds.1.color.0
                      value: 00C48C
                    - type: INTEGER
                      name: ds.1.dataset_type
                      value: '0'
                    - type: ITEM
                      name: ds.1.itemids.0
                      value:
                        host: 'Azure Sentinel by HTTP'
                        key: azure.sentinel.automation_rules.playbook
                    - type: INTEGER
                      name: ds.1.type.0
                      value: '0'
                    - type: STRING
                      name: ds.2.color.0
                      value: FFBF59
                    - type: INTEGER
                      name: ds.2.dataset_type
                      value: '0'
                    - type: ITEM
                      name: ds.2.itemids.0
                      value:
                        host: 'Azure Sentinel by HTTP'
                        key: azure.sentinel.automation_rules.modify
                    - type: INTEGER
                      name: ds.2.type.0
                      value: '0'
                    - type: INTEGER
                      name: legend_lines
                      value: '3'
                    - type: INTEGER
                      name: legend_value
                      value: '1'
                - type: piechart
                  name: 'Alert rules by severity'
                  x: '12'
                  'y': '4'
                  width: '12'
                  height: '4'
                  fields:
                    - type: STRING
                      name: ds.0.color.0
                      value: 7499FF
                    - type: INTEGER
                      name: ds.0.dataset_type
                      value: '0'
                    - type: STRING
                      name: ds.0.data_set_label
                      value: INFO
                    - type: ITEM
                      name: ds.0.itemids.0
                      value:
                        host: 'Azure Sentinel by HTTP'
                        key: azure.sentinel.alert_rules.info
                    - type: INTEGER
                      name: ds.0.type.0
                      value: '0'
                    - type: STRING
                      name: ds.1.color.0
                      value: FFBF59
                    - type: INTEGER
                      name: ds.1.dataset_type
                      value: '0'
                    - type: STRING
                      name: ds.1.data_set_label
                      value: LOW
                    - type: ITEM
                      name: ds.1.itemids.0
                      value:
                        host: 'Azure Sentinel by HTTP'
                        key: azure.sentinel.alert_rules.low
                    - type: INTEGER
                      name: ds.1.type.0
                      value: '0'
                    - type: STRING
                      name: ds.2.color.0
                      value: FFA059
                    - type: INTEGER
                      name: ds.2.dataset_type
                      value: '0'
                    - type: ITEM
                      name: ds.2.itemids.0
                      value:
                        host: 'Azure Sentinel by HTTP'
                        key: azure.sentinel.alert_rules.medium
                    - type: INTEGER
                      name: ds.2.type.0
                      value: '0'
                    - type: STRING
                      name: ds.3.color.0
                      value: E97659
                    - type: INTEGER
                      name: ds.3.dataset_type
                      value: '0'
                    - type: ITEM
                      name: ds.3.itemids.0
                      value:
                        host: 'Azure Sentinel by HTTP'
                        key: azure.sentinel.alert_rules.high
                    - type: INTEGER
                      name: ds.3.type.0
                      value: '0'
                    - type: INTEGER
                      name: legend_lines
                      value: '4'
                    - type: INTEGER
                      name: legend_value
                      value: '1'
                - type: piechart
                  name: 'Incidents by status'
                  x: '18'
                  width: '18'
                  height: '4'
                  fields:
                    - type: STRING
                      name: ds.0.color.0
                      value: E45959
                    - type: INTEGER
                      name: ds.0.dataset_type
                      value: '0'
                    - type: ITEM
                      name: ds.0.itemids.0
                      value:
                        host: 'Azure Sentinel by HTTP'
                        key: azure.sentinel.incidents.new
                    - type: INTEGER
                      name: ds.0.type.0
                      value: '0'
                    - type: STRING
                      name: ds.1.color.0
                      value: 00C48C
                    - type: INTEGER
                      name: ds.1.dataset_type
                      value: '0'
                    - type: ITEM
                      name: ds.1.itemids.0
                      value:
                        host: 'Azure Sentinel by HTTP'
                        key: azure.sentinel.incidents.closed
                    - type: INTEGER
                      name: ds.1.type.0
                      value: '0'
                    - type: STRING
                      name: ds.2.color.0
                      value: FFBF59
                    - type: INTEGER
                      name: ds.2.dataset_type
                      value: '0'
                    - type: ITEM
                      name: ds.2.itemids.0
                      value:
                        host: 'Azure Sentinel by HTTP'
                        key: azure.sentinel.incidents.active
                    - type: INTEGER
                      name: ds.2.type.0
                      value: '0'
                    - type: INTEGER
                      name: legend_lines
                      value: '3'
                    - type: INTEGER
                      name: legend_value
                      value: '1'
                - type: piechart
                  name: 'Automation rules by type'
                  x: '18'
                  'y': '8'
                  width: '18'
                  height: '4'
                  fields:
                    - type: STRING
                      name: ds.0.color.0
                      value: 7499FF
                    - type: INTEGER
                      name: ds.0.dataset_type
                      value: '0'
                    - type: ITEM
                      name: ds.0.itemids.0
                      value:
                        host: 'Azure Sentinel by HTTP'
                        key: azure.sentinel.automation_rules.incidents
                    - type: INTEGER
                      name: ds.0.type.0
                      value: '0'
                    - type: STRING
                      name: ds.1.color.0
                      value: FFBF59
                    - type: INTEGER
                      name: ds.1.dataset_type
                      value: '0'
                    - type: ITEM
                      name: ds.1.itemids.0
                      value:
                        host: 'Azure Sentinel by HTTP'
                        key: azure.sentinel.automation_rules.alerts
                    - type: INTEGER
                      name: ds.1.type.0
                      value: '0'
                    - type: INTEGER
                      name: legend_lines
                      value: '2'
                    - type: INTEGER
                      name: legend_value
                      value: '1'
                - type: piechart
                  name: 'Alert rules by type'
                  x: '24'
                  'y': '4'
                  width: '12'
                  height: '4'
                  fields:
                    - type: STRING
                      name: ds.0.color.0
                      value: BF00FF
                    - type: INTEGER
                      name: ds.0.dataset_type
                      value: '0'
                    - type: ITEM
                      name: ds.0.itemids.0
                      value:
                        host: 'Azure Sentinel by HTTP'
                        key: azure.sentinel.alert_rules.fusion
                    - type: INTEGER
                      name: ds.0.type.0
                      value: '0'
                    - type: STRING
                      name: ds.1.color.0
                      value: 7499FF
                    - type: INTEGER
                      name: ds.1.dataset_type
                      value: '0'
                    - type: ITEM
                      name: ds.1.itemids.0
                      value:
                        host: 'Azure Sentinel by HTTP'
                        key: azure.sentinel.alert_rules.creation
                    - type: INTEGER
                      name: ds.1.type.0
                      value: '0'
                    - type: STRING
                      name: ds.2.color.0
                      value: 00C48C
                    - type: INTEGER
                      name: ds.2.dataset_type
                      value: '0'
                    - type: ITEM
                      name: ds.2.itemids.0
                      value:
                        host: 'Azure Sentinel by HTTP'
                        key: azure.sentinel.alert_rules.scheduled
                    - type: INTEGER
                      name: ds.2.type.0
                      value: '0'
                    - type: INTEGER
                      name: legend_lines
                      value: '3'
                    - type: INTEGER
                      name: legend_value
                      value: '1'
                - type: problemsbysv
                  x: '36'
                  width: '36'
                  fields:
                    - type: STRING
                      name: reference
                      value: INIKB
                - type: toptriggers
                  x: '36'
                  'y': '2'
                  width: '36'
                  height: '6'
                - type: piechart
                  name: 'Watchlists by state'
                  x: '36'
                  'y': '8'
                  width: '18'
                  height: '4'
                  fields:
                    - type: STRING
                      name: ds.0.color.0
                      value: 7499FF
                    - type: STRING
                      name: ds.0.color.1
                      value: 7499FF
                    - type: STRING
                      name: ds.0.color.2
                      value: 7499FF
                    - type: INTEGER
                      name: ds.0.dataset_aggregation
                      value: '5'
                    - type: INTEGER
                      name: ds.0.dataset_type
                      value: '0'
                    - type: STRING
                      name: ds.0.data_set_label
                      value: Incoming
                    - type: ITEM
                      name: ds.0.itemids.0
                      value:
                        host: 'Azure Sentinel by HTTP'
                        key: azure.sentinel.watchlist.new
                    - type: ITEM
                      name: ds.0.itemids.1
                      value:
                        host: 'Azure Sentinel by HTTP'
                        key: azure.sentinel.watchlist.uploading
                    - type: ITEM
                      name: ds.0.itemids.2
                      value:
                        host: 'Azure Sentinel by HTTP'
                        key: azure.sentinel.watchlist.progress
                    - type: INTEGER
                      name: ds.0.type.0
                      value: '0'
                    - type: INTEGER
                      name: ds.0.type.1
                      value: '0'
                    - type: INTEGER
                      name: ds.0.type.2
                      value: '0'
                    - type: STRING
                      name: ds.1.color.0
                      value: E97659
                    - type: STRING
                      name: ds.1.color.1
                      value: E97659
                    - type: STRING
                      name: ds.1.color.2
                      value: E97659
                    - type: INTEGER
                      name: ds.1.dataset_aggregation
                      value: '5'
                    - type: INTEGER
                      name: ds.1.dataset_type
                      value: '0'
                    - type: STRING
                      name: ds.1.data_set_label
                      value: Outgoing
                    - type: ITEM
                      name: ds.1.itemids.0
                      value:
                        host: 'Azure Sentinel by HTTP'
                        key: azure.sentinel.watchlist.canceled
                    - type: ITEM
                      name: ds.1.itemids.1
                      value:
                        host: 'Azure Sentinel by HTTP'
                        key: azure.sentinel.watchlist.failed
                    - type: ITEM
                      name: ds.1.itemids.2
                      value:
                        host: 'Azure Sentinel by HTTP'
                        key: azure.sentinel.watchlist.deleting
                    - type: INTEGER
                      name: ds.1.type.0
                      value: '0'
                    - type: INTEGER
                      name: ds.1.type.1
                      value: '0'
                    - type: INTEGER
                      name: ds.1.type.2
                      value: '0'
                    - type: STRING
                      name: ds.2.color.0
                      value: 00C48C
                    - type: INTEGER
                      name: ds.2.dataset_aggregation
                      value: '5'
                    - type: INTEGER
                      name: ds.2.dataset_type
                      value: '0'
                    - type: STRING
                      name: ds.2.data_set_label
                      value: Succeeded
                    - type: ITEM
                      name: ds.2.itemids.0
                      value:
                        host: 'Azure Sentinel by HTTP'
                        key: azure.sentinel.watchlist.succeeded
                    - type: INTEGER
                      name: ds.2.type.0
                      value: '0'
                    - type: INTEGER
                      name: legend_aggregation
                      value: '1'
                    - type: INTEGER
                      name: legend_lines
                      value: '3'
                    - type: INTEGER
                      name: legend_value
                      value: '1'
                - type: piechart
                  name: 'Data connectors by status'
                  x: '54'
                  'y': '8'
                  width: '18'
                  height: '4'
                  fields:
                    - type: STRING
                      name: ds.0.color.0
                      value: E45959
                    - type: INTEGER
                      name: ds.0.dataset_type
                      value: '0'
                    - type: ITEM
                      name: ds.0.itemids.0
                      value:
                        host: 'Azure Sentinel by HTTP'
                        key: azure.sentinel.data_connectors.disabled
                    - type: INTEGER
                      name: ds.0.type.0
                      value: '0'
                    - type: STRING
                      name: ds.1.color.0
                      value: 00C48C
                    - type: INTEGER
                      name: ds.1.dataset_type
                      value: '0'
                    - type: ITEM
                      name: ds.1.itemids.0
                      value:
                        host: 'Azure Sentinel by HTTP'
                        key: azure.sentinel.data_connectors.enabled
                    - type: INTEGER
                      name: ds.1.type.0
                      value: '0'
                    - type: INTEGER
                      name: legend_lines
                      value: '2'
                    - type: INTEGER
                      name: legend_value
                      value: '1'
    - 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"
      wizard_ready: 'YES'
      readme: |
        ## Overview
        
        This template is designed to monitor Microsoft 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 [Azure documentation](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 host wizard configuration fields: `Azure App ID`, `Azure password`, `Azure tenant ID`, `Azure subscription ID`, and `Azure SQL managed instance ID`.
      vendor:
        name: Zabbix
        version: 8.0-2
      groups:
        - name: Templates/Cloud
      items:
        - uuid: dd047204951f449496ab9b4938dd0a3a
          name: 'Availability status detailed'
          type: DEPENDENT
          key: azure.sql_inst.availability.details
          value_type: CHAR
          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
          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
          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
          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
          value_type: CHAR
          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
          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
          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
          value_type: TEXT
          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
          params: |
            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;
            	},
            
            	login: function () {
            		var response, login = new HttpRequest();
            
            		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();
            
            		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&timespan=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}'
          tags:
            - tag: component
              value: raw
        - uuid: 953ba49d81a048dcbed882b955606c96
          name: 'Instance provisioning state'
          type: DEPENDENT
          key: azure.sql_inst.provision
          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
          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
          value_type: CHAR
          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
          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
          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: cloud
        - tag: subclass
          value: sql
        - tag: target
          value: azure
      macros:
        - macro: '{$AZURE.APP.ID}'
          description: 'The App ID of Microsoft Azure.'
          config:
            type: TEXT
            priority: '3'
            label: 'Azure App ID'
            description: 'Microsoft Azure App ID.'
            required: 'YES'
        - macro: '{$AZURE.DATA.TIMEOUT}'
          value: 15s
          description: 'API response timeout.'
          config:
            type: TEXT
            priority: '10'
            section_name: Other
            label: 'API timeout'
            description: 'API response timeout, in seconds.'
        - macro: '{$AZURE.PASSWORD}'
          type: SECRET_TEXT
          description: 'Microsoft Azure password.'
          config:
            type: TEXT
            priority: '4'
            label: 'Azure password'
            description: 'Microsoft Azure password.'
            required: 'YES'
        - macro: '{$AZURE.PROXY}'
          description: 'Sets the HTTP proxy value. If this macro is empty, then no proxy is used.'
          config:
            type: TEXT
            priority: '11'
            section_name: Other
            label: 'HTTP proxy'
            description: 'HTTP proxy to use for requests.'
        - macro: '{$AZURE.RESOURCE.ID}'
          description: 'Microsoft Azure SQL managed instance ID.'
          config:
            type: TEXT
            priority: '5'
            label: 'Azure SQL managed instance ID'
            description: 'Microsoft Azure SQL managed instance ID.'
            required: 'YES'
        - macro: '{$AZURE.SQL.INST.CPU.CRIT}'
          value: '90'
          description: 'CPU utilization critical threshold, expressed in %.'
          config:
            type: TEXT
            priority: '7'
            section_name: Thresholds
            label: 'CPU utilization critical threshold'
            description: 'CPU utilization critical threshold, expressed in %. In the range from 0 to 100 inclusive.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$AZURE.SQL.INST.CPU.WARN}'
          value: '80'
          description: 'CPU utilization warning threshold, expressed in %.'
          config:
            type: TEXT
            priority: '6'
            section_name: Thresholds
            label: 'CPU utilization warning threshold'
            description: 'CPU utilization warning threshold, expressed in %. In the range from 0 to 100 inclusive.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$AZURE.SQL.INST.SPACE.CRIT}'
          value: '90'
          description: 'Storage space critical threshold, expressed in %.'
          config:
            type: TEXT
            priority: '9'
            section_name: Thresholds
            label: 'Storage space critical threshold'
            description: 'Storage space critical threshold, expressed in %. In the range from 0 to 100 inclusive.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$AZURE.SQL.INST.SPACE.WARN}'
          value: '80'
          description: 'Storage space warning threshold, expressed in %.'
          config:
            type: TEXT
            priority: '8'
            section_name: Thresholds
            label: 'Storage space warning threshold'
            description: 'Storage space warning threshold, expressed in %. In the range from 0 to 100 inclusive.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$AZURE.SUBSCRIPTION.ID}'
          description: 'Microsoft Azure subscription ID.'
          config:
            type: TEXT
            priority: '1'
            label: 'Azure subscription ID'
            description: 'Microsoft Azure subscription ID.'
            required: 'YES'
        - macro: '{$AZURE.TENANT.ID}'
          description: 'Microsoft Azure tenant ID.'
          config:
            type: TEXT
            priority: '2'
            label: 'Azure tenant ID'
            description: 'Microsoft Azure tenant ID.'
            required: 'YES'
      dashboards:
        - uuid: 28e6b463ca7b429ca356cb61b5394841
          name: 'Azure SQL managed instance'
          pages:
            - name: Overview
              widgets:
                - type: item
                  name: 'Availability state'
                  width: '18'
                  fields:
                    - 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: 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
    - uuid: 820fa4a1565c43e4aac07a691a5bface
      template: 'Azure Virtual Machine by HTTP'
      name: 'Azure Virtual Machine by HTTP'
      description: |
        This template is designed to monitor Microsoft Azure virtual machines (VMs) 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"
      wizard_ready: 'YES'
      readme: |
        ## Overview
        
        This template is designed to monitor Microsoft Azure virtual machines (VMs) 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 [Azure documentation](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 host wizard configuration fields: `Azure App ID`, `Azure password`, `Azure tenant ID`, `Azure subscription ID`, and `Azure virtual machine ID`.
      vendor:
        name: Zabbix
        version: 8.0-2
      groups:
        - name: Templates/Cloud
      items:
        - uuid: 86f996df859a445994ed671feab6012f
          name: 'VM availability metric'
          type: DEPENDENT
          key: azure.vm.availability
          value_type: FLOAT
          description: 'Measure of availability of virtual machine over time.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.VmAvailabilityMetric.average
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.vm.data.get
          tags:
            - tag: component
              value: health
        - uuid: c299999d69904340acd44fead6c7672c
          name: 'Availability status detailed'
          type: DEPENDENT
          key: azure.vm.availability.details
          value_type: CHAR
          description: 'The summary description of availability status.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.health.summary
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.vm.data.get
          tags:
            - tag: component
              value: health
        - uuid: 25e2af44bfbf4e9083ce493d85232088
          name: 'Availability state'
          type: DEPENDENT
          key: azure.vm.availability.state
          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.vm.data.get
          tags:
            - tag: component
              value: health
          triggers:
            - uuid: c0170d8a09ae460da923fe773b2b0bd0
              expression: 'last(/Azure Virtual Machine by HTTP/azure.vm.availability.state)=1'
              name: 'Azure VM: Virtual machine is degraded'
              opdata: '{ITEM.LASTVALUE1}'
              priority: AVERAGE
              description: 'The resource is in a degraded state.'
              tags:
                - tag: scope
                  value: availability
            - uuid: e1b85765b83445ebbf15f02d782b9858
              expression: 'last(/Azure Virtual Machine by HTTP/azure.vm.availability.state)=3'
              name: 'Azure VM: Virtual machine is in unknown state'
              opdata: '{ITEM.LASTVALUE1}'
              priority: WARNING
              description: 'The resource state is unknown.'
              tags:
                - tag: scope
                  value: availability
            - uuid: b3d764ff735e44f8806cc4d29090719e
              expression: 'last(/Azure Virtual Machine by HTTP/azure.vm.availability.state)=2'
              name: 'Azure VM: Virtual machine is unavailable'
              opdata: '{ITEM.LASTVALUE1}'
              priority: HIGH
              description: 'The resource state is unavailable.'
              tags:
                - tag: scope
                  value: availability
        - uuid: a93308573303437487d151de340fcaed
          name: 'VM cached bandwidth consumed'
          type: DEPENDENT
          key: azure.vm.cached.bandwidth.consumed
          value_type: FLOAT
          units: '%'
          description: 'Percentage of the cached disk bandwidth consumed by the VM.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.VMCachedBandwidthConsumedPercentage.average
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.vm.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 989dec26d97d44b6bd4a84fdbd37dec5
          name: 'VM cached IOPS consumed'
          type: DEPENDENT
          key: azure.vm.cached.iops.consumed
          value_type: FLOAT
          units: '%'
          description: 'Percentage of the cached disk IOPS consumed by the VM.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.VMCachedIOPSConsumedPercentage.average
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.vm.data.get
          tags:
            - tag: component
              value: storage
        - uuid: fb0641ca8f104cf1bebdced63cd6af16
          name: 'CPU credits consumed'
          type: DEPENDENT
          key: azure.vm.cpu.credits.consumed
          value_type: FLOAT
          description: 'Total number of credits consumed by the virtual machine. Only available on B-series burstable VMs.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.CPUCreditsConsumed.average
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.vm.data.get
          tags:
            - tag: component
              value: cpu
        - uuid: 963752cbaba046cab1f05b0cbcff3137
          name: 'CPU credits remaining'
          type: DEPENDENT
          key: azure.vm.cpu.credits.remaining
          value_type: FLOAT
          description: 'Total number of credits available to burst. Available only on B-series burstable VMs.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.CPUCreditsRemaining.average
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.vm.data.get
          tags:
            - tag: component
              value: cpu
        - uuid: 492edacf92544a95a5aa7b034efa7931
          name: 'CPU utilization'
          type: DEPENDENT
          key: azure.vm.cpu.utilization
          value_type: FLOAT
          units: '%'
          description: 'Percentage of allocated compute units that are currently in use by virtual machine.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.PercentageCPU.average
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.vm.data.get
          tags:
            - tag: component
              value: cpu
          triggers:
            - uuid: 9e6d9394570641418b4291befb1e38e5
              expression: 'min(/Azure Virtual Machine by HTTP/azure.vm.cpu.utilization,5m)>{$AZURE.VM.CPU.UTIL.CRIT}'
              name: 'Azure VM: High CPU utilization'
              event_name: 'Azure VM: CPU utilization is high (over {$AZURE.VM.CPU.UTIL.CRIT}% for last 5m)'
              opdata: '{ITEM.LASTVALUE1}'
              priority: HIGH
              description: 'The CPU utilization is too high. The system might be slow to respond.'
              tags:
                - tag: scope
                  value: performance
        - uuid: 68c730e4904f402cb12fb71b45fede02
          name: 'Data disk used burst BPS credits'
          type: DEPENDENT
          key: azure.vm.data.disk.bandwidth.burst.used
          value_type: FLOAT
          units: '%'
          description: 'Percentage of the data disk burst bandwidth credits used so far.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.DataDiskUsedBurstBPSCreditsPercentage.average
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.vm.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 47cda13c203e4f1e9918eb73fd8afa20
          name: 'Data disk bandwidth consumed'
          type: DEPENDENT
          key: azure.vm.data.disk.bandwidth.consumed
          value_type: FLOAT
          units: '%'
          description: 'Percentage of the data disk bandwidth consumed per minute.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.DataDiskBandwidthConsumedPercentage.average
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.vm.data.get
          tags:
            - tag: component
              value: storage
        - uuid: d0fb23206d564e1da746bff3369056c1
          name: 'Data disk max burst bandwidth'
          type: DEPENDENT
          key: azure.vm.data.disk.bandwidth.max
          value_type: FLOAT
          units: Bps
          description: 'Maximum byte-per-second throughput that the data disk can achieve with bursting.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.DataDiskMaxBurstBandwidth.average
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.vm.data.get
          tags:
            - tag: component
              value: storage
        - uuid: c61ad4af97c243cca75bbece40eea795
          name: 'Data disk target bandwidth'
          type: DEPENDENT
          key: azure.vm.data.disk.bandwidth.target
          value_type: FLOAT
          units: Bps
          description: 'Baseline byte-per-second throughput that the data disk can achieve without bursting.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.DataDiskTargetBandwidth.average
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.vm.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 731a82833bdd42c59c453adf8625e3b4
          name: 'Data disk used burst IO credits'
          type: DEPENDENT
          key: azure.vm.data.disk.iops.burst.used
          value_type: FLOAT
          units: '%'
          description: 'Percentage of the data disk burst I/O credits used so far.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.DataDiskUsedBurstIOCreditsPercentage.average
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.vm.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 3121980d3319431691ed9e98d176430b
          name: 'Data disk IOPS consumed'
          type: DEPENDENT
          key: azure.vm.data.disk.iops.consumed
          value_type: FLOAT
          units: '%'
          description: 'Percentage of the data disk input/output (I/O) consumed per minute.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.DataDiskIOPSConsumedPercentage.average
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.vm.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 6afcbb02c53243faa341670f155678e4
          name: 'Data disk max burst IOPS'
          type: DEPENDENT
          key: azure.vm.data.disk.iops.max
          value_type: FLOAT
          units: '!iops'
          description: 'Maximum IOPS that the data disk can achieve with bursting.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.DataDiskMaxBurstIOPS.average
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.vm.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 9370988456e74b889700ea5798d17092
          name: 'Data disk target IOPS'
          type: DEPENDENT
          key: azure.vm.data.disk.iops.target
          value_type: FLOAT
          units: '!iops'
          description: 'Baseline IOPS that the data disk can achieve without bursting.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.DataDiskTargetIOPS.average
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.vm.data.get
          tags:
            - tag: component
              value: storage
        - uuid: b81f304bbc2a42df9b0550ecdc1ec6b7
          name: 'Data disk queue depth'
          type: DEPENDENT
          key: azure.vm.data.disk.queue.depth
          value_type: FLOAT
          description: 'The number of outstanding IO requests that are waiting to be performed on a disk.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.DataDiskQueueDepth.average
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.vm.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 021d92f3075544319191d6f85a701222
          name: 'Data disk read rate'
          type: DEPENDENT
          key: azure.vm.data.disk.read.bps
          value_type: FLOAT
          units: Bps
          description: 'Bytes per second read from a single disk during the monitoring period.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.DataDiskReadBytessec.average
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.vm.data.get
          tags:
            - tag: component
              value: storage
        - uuid: cc31283ab96548b7bdcc88e89dfae53c
          name: 'Data disk IOPS read'
          type: DEPENDENT
          key: azure.vm.data.disk.read.ops
          value_type: FLOAT
          units: '!iops'
          description: 'Read IOPS from a single disk during the monitoring period.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.DataDiskReadOperationsSec.average
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.vm.data.get
          tags:
            - tag: component
              value: storage
        - uuid: b8712f8fd60a43f6b099d9eafed19945
          name: 'Data disk write rate'
          type: DEPENDENT
          key: azure.vm.data.disk.write.bps
          value_type: FLOAT
          units: Bps
          description: 'Bytes per second written to a single disk during the monitoring period.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.DataDiskWriteBytessec.average
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.vm.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 87794f5a502b4e2db91f820483e38fb3
          name: 'Data disk IOPS write'
          type: DEPENDENT
          key: azure.vm.data.disk.write.ops
          value_type: FLOAT
          units: '!iops'
          description: 'Write IOPS from a single disk during the monitoring period.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.DataDiskWriteOperationsSec.average
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.vm.data.get
          tags:
            - tag: component
              value: storage
        - uuid: e253c2a908944be1a033fc3df550d979
          name: 'Get errors'
          type: DEPENDENT
          key: azure.vm.data.errors
          value_type: TEXT
          description: 'A list of errors from API requests.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.errors
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.vm.data.get
          tags:
            - tag: component
              value: error
          triggers:
            - uuid: 87236c99652643ba800601a461d66d94
              expression: 'length(last(/Azure Virtual Machine by HTTP/azure.vm.data.errors))>0'
              name: 'Azure VM: 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: cff54514d795495da8bc1152e02631aa
          name: 'Get data'
          type: SCRIPT
          key: azure.vm.data.get
          history: '0'
          value_type: TEXT
          params: |
            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;
            	},
            
            	login: function () {
            		var response, login = new HttpRequest();
            
            		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();
            
            		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, '[ AzureVM ] 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_and_premium_metrics': '/providers/Microsoft.Insights/metrics?metricnames=' + encodeURIComponent('Percentage CPU,CPU Credits Remaining,CPU Credits Consumed,VmAvailabilityMetric,Available Memory Bytes,Network In Total,Network Out Total,Inbound Flows,Outbound Flows,Inbound Flows Maximum Creation Rate,Outbound Flows Maximum Creation Rate,Premium Data Disk Cache Read Hit,Premium Data Disk Cache Read Miss,Premium OS Disk Cache Read Hit,Premium OS Disk Cache Read Miss,VM Cached Bandwidth Consumed Percentage,VM Cached IOPS Consumed Percentage,VM Uncached Bandwidth Consumed Percentage,VM Uncached IOPS Consumed Percentage') + '&api-version=2024-02-01&timespan=PT1M',
            				'disks_metrics': '/providers/Microsoft.Insights/metrics?metricnames=' + encodeURIComponent('Disk Read Bytes,Disk Write Bytes,Disk Read Operations/Sec,Disk Write Operations/Sec,Data Disk Latency,Data Disk Read Bytes/sec,Data Disk Write Bytes/sec,Data Disk Read Operations/Sec,Data Disk Write Operations/Sec,Data Disk Queue Depth,Data Disk Bandwidth Consumed Percentage,Data Disk IOPS Consumed Percentage,Data Disk Target Bandwidth,Data Disk Target IOPS,Data Disk Max Burst Bandwidth,Data Disk Max Burst IOPS,Data Disk Used Burst BPS Credits Percentage,Data Disk Used Burst IO Credits Percentage') + '&api-version=2024-02-01&timespan=PT1M',
            				'os_disk_metrics': '/providers/Microsoft.Insights/metrics?metricnames=' + encodeURIComponent('OS Disk Latency,OS Disk Read Bytes/sec,OS Disk Write Bytes/sec,OS Disk Read Operations/Sec,OS Disk Write Operations/Sec,OS Disk Queue Depth,OS Disk Bandwidth Consumed Percentage,OS Disk IOPS Consumed Percentage,OS Disk Target Bandwidth,OS Disk Target IOPS,OS Disk Max Burst Bandwidth,OS Disk Max Burst IOPS,OS Disk Used Burst BPS Credits Percentage,OS Disk Used Burst IO Credits Percentage,Temp Disk Latency,Temp Disk Read Bytes/sec,Temp Disk Write Bytes/sec,Temp Disk Read Operations/Sec,Temp Disk Write Operations/Sec,Temp Disk Queue Depth') + '&api-version=2024-02-01&timespan=PT1M'
            			};
            		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'] })
            				}
            				data.metrics[key] = Azure.getField(metrics[k], 'timeseries.0.data.0');
            			}
            		});
            
            		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');
            
            		return data
            	}
            };
            
            try {
            	Azure.setParams(JSON.parse(value));
            	Azure.login();
            	return JSON.stringify(Azure.getMetricsData());
            }
            catch (error) {
            	error += (String(error).endsWith('.')) ? '' : '.';
            	Zabbix.log(3, '[ AzureVM ] ERROR: ' + error);
            	return JSON.stringify({ 'error': error });
            }
          description: 'The result of API requests is expressed in the JSON.'
          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}'
          tags:
            - tag: component
              value: raw
        - uuid: 903b8b2724924d5e8627253d851f09e5
          name: 'Data disk latency'
          type: DEPENDENT
          key: azure.vm.disk.latency
          value_type: FLOAT
          units: s
          description: 'Average time to complete each IO during the monitoring period for Data Disk.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.DataDiskLatency.average
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '0.001'
          master_item:
            key: azure.vm.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 1dc9f8d45b6f48a38f701f089cbcb279
          name: 'Disk read'
          type: DEPENDENT
          key: azure.vm.disk.read.bytes
          value_type: FLOAT
          units: B
          description: 'Bytes read from the disk during the monitoring period.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.DiskReadBytes.total
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.vm.data.get
          tags:
            - tag: component
              value: storage
        - uuid: cd3240d31a4f42a89b5c9817ea288b5a
          name: 'Disk IOPS read'
          type: DEPENDENT
          key: azure.vm.disk.read.ops
          value_type: FLOAT
          units: '!iops'
          description: 'The count of read operations from the disk per second.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.DiskReadOperationsSec.average
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.vm.data.get
          tags:
            - tag: component
              value: storage
        - uuid: b5e2070bde1444ea809ba4e0a29b05d9
          name: 'Disk write'
          type: DEPENDENT
          key: azure.vm.disk.write.bytes
          value_type: FLOAT
          units: B
          description: 'Bytes written to the disk during the monitoring period.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.DiskWriteBytes.total
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.vm.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 0d93d1b510614c1f83418bd481f1e7cb
          name: 'Disk IOPS write'
          type: DEPENDENT
          key: azure.vm.disk.write.ops
          value_type: FLOAT
          units: '!iops'
          description: 'The count of write operations to the disk per second.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.DiskWriteOperationsSec.average
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.vm.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 3a30a59aabd54c8b8feb1f4a8ba06db5
          name: 'Inbound flows'
          type: DEPENDENT
          key: azure.vm.flows.inbound
          value_type: FLOAT
          description: 'The number of current flows in the inbound direction (the traffic going into the VM).'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.InboundFlows.average
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.vm.data.get
          tags:
            - tag: component
              value: network
        - uuid: 3964ffbb7ea949f69863edcf91f5c555
          name: 'Inbound flows max creation rate'
          type: DEPENDENT
          key: azure.vm.flows.inbound.max
          value_type: FLOAT
          description: 'Maximum creation rate of the inbound flows (the traffic going into the VM).'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.InboundFlowsMaximumCreationRate.average
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.vm.data.get
          tags:
            - tag: component
              value: network
        - uuid: 2084cb1d010a4ab494c0826c458d922a
          name: 'Outbound flows'
          type: DEPENDENT
          key: azure.vm.flows.outbound
          value_type: FLOAT
          description: 'The number of current flows in the outbound direction (the traffic going out of the VM).'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.OutboundFlows.average
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.vm.data.get
          tags:
            - tag: component
              value: network
        - uuid: eac3e6b53d394e3289fc03bf5772799c
          name: 'Outbound flows max creation rate'
          type: DEPENDENT
          key: azure.vm.flows.outbound.max
          value_type: FLOAT
          description: 'Maximum creation rate of the outbound flows (the traffic going out of the VM).'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.OutboundFlowsMaximumCreationRate.average
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.vm.data.get
          tags:
            - tag: component
              value: network
        - uuid: 0a354c9b104b468d9749adfd28d1373e
          name: 'Available memory'
          type: DEPENDENT
          key: azure.vm.memory.available
          value_type: FLOAT
          units: B
          description: 'Amount of physical memory, in bytes, immediately available for the allocation to a process or for a system use in the virtual machine.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.AvailableMemoryBytes.average
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.vm.data.get
          tags:
            - tag: component
              value: memory
        - uuid: 411c5f6fcb374c4c90e2951a546c0c08
          name: 'Network in total'
          type: DEPENDENT
          key: azure.vm.network.in.total
          value_type: FLOAT
          units: B
          description: 'The number of bytes received by the VM via all network interfaces (incoming traffic).'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.NetworkInTotal.total
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.vm.data.get
          tags:
            - tag: component
              value: network
        - uuid: ee2ef1d1e2844ae8be2a5f04c86631ba
          name: 'Network out total'
          type: DEPENDENT
          key: azure.vm.network.out.total
          value_type: FLOAT
          units: B
          description: 'The number of bytes sent by the VM via all network interfaces (outgoing traffic).'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.NetworkOutTotal.total
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.vm.data.get
          tags:
            - tag: component
              value: network
        - uuid: 9d42609950864c899a0d63b94f1d2235
          name: 'OS disk used burst BPS credits'
          type: DEPENDENT
          key: azure.vm.os.disk.bandwidth.burst.used
          value_type: FLOAT
          units: '%'
          description: 'Percentage of the OS disk burst bandwidth credits used so far.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.OSDiskUsedBurstBPSCreditsPercentage.average
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.vm.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 24c58e473c5c4b8388a0e78ae38378fc
          name: 'OS disk bandwidth consumed'
          type: DEPENDENT
          key: azure.vm.os.disk.bandwidth.consumed
          value_type: FLOAT
          units: '%'
          description: 'Percentage of the operating system disk bandwidth consumed per minute.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.OSDiskBandwidthConsumedPercentage.average
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.vm.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 7d0ca132bc264ac08e3c55809bdc40d1
          name: 'OS disk max burst bandwidth'
          type: DEPENDENT
          key: azure.vm.os.disk.bandwidth.max
          value_type: FLOAT
          units: Bps
          description: 'Maximum byte-per-second throughput that the OS disk can achieve with bursting.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.OSDiskMaxBurstBandwidth.average
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.vm.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 5cc422b7da3145fa885a88bb6165e3b9
          name: 'OS disk target bandwidth'
          type: DEPENDENT
          key: azure.vm.os.disk.bandwidth.target
          value_type: FLOAT
          units: Bps
          description: 'Baseline byte-per-second throughput that the OS disk can achieve without bursting.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.OSDiskTargetBandwidth.average
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.vm.data.get
          tags:
            - tag: component
              value: storage
        - uuid: c08f45df2e594e1fab01ba63df7da05b
          name: 'OS disk used burst IO credits'
          type: DEPENDENT
          key: azure.vm.os.disk.iops.burst.used
          value_type: FLOAT
          units: '%'
          description: 'Percentage of the OS disk burst I/O credits used so far.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.OSDiskUsedBurstIOCreditsPercentage.average
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.vm.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 33a7fff9758046e3be07dad6c0a710ca
          name: 'OS disk IOPS consumed'
          type: DEPENDENT
          key: azure.vm.os.disk.iops.consumed
          value_type: FLOAT
          units: '%'
          description: 'Percentage of the operating system disk I/Os consumed per minute.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.OSDiskIOPSConsumedPercentage.average
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.vm.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 8374282688dc4fabb770c07eb335c666
          name: 'OS disk max burst IOPS'
          type: DEPENDENT
          key: azure.vm.os.disk.iops.max
          value_type: FLOAT
          units: '!iops'
          description: 'Maximum IOPS that the OS disk can achieve with bursting.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.OSDiskMaxBurstIOPS.average
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.vm.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 556941b1df5d470f8de628230b085623
          name: 'OS disk target IOPS'
          type: DEPENDENT
          key: azure.vm.os.disk.iops.target
          value_type: FLOAT
          units: '!iops'
          description: 'Baseline IOPS that the OS disk can achieve without bursting.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.OSDiskTargetIOPS.average
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.vm.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 3932b607cff14ee0a891c96587438807
          name: 'OS disk latency'
          type: DEPENDENT
          key: azure.vm.os.disk.latency
          value_type: FLOAT
          units: s
          description: 'Average time to complete each IO during the monitoring period for OS Disk.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.OSDiskLatency.average
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '0.001'
          master_item:
            key: azure.vm.data.get
          tags:
            - tag: component
              value: storage
        - uuid: ca8fe9d0ea58482c9bb8b83a716362a2
          name: 'OS disk queue depth'
          type: DEPENDENT
          key: azure.vm.os.disk.queue.depth
          value_type: FLOAT
          description: 'The OS disk queue depth (or queue length).'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.OSDiskQueueDepth.average
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.vm.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 30265aac759d45769769eae081f570ac
          name: 'OS disk read rate'
          type: DEPENDENT
          key: azure.vm.os.disk.read.bps
          value_type: FLOAT
          units: Bps
          description: 'Bytes/sec read from a single disk during the monitoring period - for an OS disk.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.OSDiskReadBytessec.average
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.vm.data.get
          tags:
            - tag: component
              value: storage
        - uuid: f11fcbbd63234993a9c301dc8bac3e80
          name: 'OS disk IOPS read'
          type: DEPENDENT
          key: azure.vm.os.disk.read.ops
          value_type: FLOAT
          units: '!iops'
          description: 'Read IOPS from a single disk during the monitoring period - for an OS disk.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.OSDiskReadOperationsSec.average
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.vm.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 7645519a786b42908f1ec693128899c2
          name: 'OS disk write rate'
          type: DEPENDENT
          key: azure.vm.os.disk.write.bps
          value_type: FLOAT
          units: Bps
          description: 'Bytes/sec written to a single disk during the monitoring period - for an OS disk.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.OSDiskWriteBytessec.average
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.vm.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 1e9392bc0c934e7d93f743c86e36e23e
          name: 'OS disk IOPS write'
          type: DEPENDENT
          key: azure.vm.os.disk.write.ops
          value_type: FLOAT
          units: '!iops'
          description: 'Write IOPS from a single disk during the monitoring period - for an OS disk.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.OSDiskWriteOperationsSec.average
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.vm.data.get
          tags:
            - tag: component
              value: storage
        - uuid: d6fcff826cfa486d945f33708be2f630
          name: 'Premium data disk cache read hit in %'
          type: DEPENDENT
          key: azure.vm.premium.data.disk.cache.read.hit
          value_type: FLOAT
          units: '%'
          description: 'Percentage of premium data disk cache read hit.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.PremiumDataDiskCacheReadHit.average
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.vm.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 288853ee5d08442fa43f8df1dfcc7823
          name: 'Premium data disk cache read miss in %'
          type: DEPENDENT
          key: azure.vm.premium.data.disk.cache.read.miss
          value_type: FLOAT
          units: '%'
          description: 'Percentage of premium data disk cache read miss.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.PremiumDataDiskCacheReadMiss.average
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.vm.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 66b629ae3d7e4abeaf0282414c91876f
          name: 'Premium OS disk cache read hit in %'
          type: DEPENDENT
          key: azure.vm.premium.os.disk.cache.read.hit
          value_type: FLOAT
          units: '%'
          description: 'Percentage of premium OS disk cache read hit.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.PremiumOSDiskCacheReadHit.average
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.vm.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 3927f34d5d0649d7ac29703f64054dbf
          name: 'Premium OS disk cache read miss in %'
          type: DEPENDENT
          key: azure.vm.premium.os.disk.cache.read.miss
          value_type: FLOAT
          units: '%'
          description: 'Percentage of premium OS disk cache read miss.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.PremiumOSDiskCacheReadMiss.average
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.vm.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 7d2ca29fce9a4c9ba60279f07de73089
          name: 'Temp disk latency'
          type: DEPENDENT
          key: azure.vm.temp.disk.latency
          value_type: FLOAT
          units: s
          description: 'Average time to complete each IO during the monitoring period for temp disk.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.TempDiskLatency.average
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '0.001'
          master_item:
            key: azure.vm.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 67638ce2228e4f5d9f4aae44d9c4a47f
          name: 'Temp disk queue depth'
          type: DEPENDENT
          key: azure.vm.temp.disk.queue.depth
          value_type: FLOAT
          description: 'Temp Disk queue depth (or queue length).'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.TempDiskQueueDepth.average
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.vm.data.get
          tags:
            - tag: component
              value: storage
        - uuid: f07200debf2d49dba3c0a63102258c6c
          name: 'Temp disk read rate'
          type: DEPENDENT
          key: azure.vm.temp.disk.read.bps
          value_type: FLOAT
          units: Bps
          description: 'Bytes/Sec read from a single disk during the monitoring period for temp disk.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.TempDiskReadBytessec.average
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.vm.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 4b7b661391ac46179913a0e1bf012e76
          name: 'Temp disk IOPS read'
          type: DEPENDENT
          key: azure.vm.temp.disk.read.ops
          value_type: FLOAT
          units: '!iops'
          description: 'Read IOPS from a single disk during the monitoring period for temp disk.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.TempDiskReadOperationsSec.average
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.vm.data.get
          tags:
            - tag: component
              value: storage
        - uuid: dc3601128000423b8b46ef1046562105
          name: 'Temp disk write rate'
          type: DEPENDENT
          key: azure.vm.temp.disk.write.bps
          value_type: FLOAT
          units: Bps
          description: 'Bytes/Sec written to a single disk during the monitoring period for temp disk.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.TempDiskWriteBytessec.average
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.vm.data.get
          tags:
            - tag: component
              value: storage
        - uuid: d03cdea05ae549ffb63c6db4a7e40c13
          name: 'Temp disk IOPS write'
          type: DEPENDENT
          key: azure.vm.temp.disk.write.ops
          value_type: FLOAT
          units: '!iops'
          description: 'Bytes/Sec written to a single disk during the monitoring period for temp disk.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.TempDiskWriteOperationsSec.average
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.vm.data.get
          tags:
            - tag: component
              value: storage
        - uuid: d6e85395e34b4288988a5287d287f182
          name: 'VM uncached bandwidth consumed'
          type: DEPENDENT
          key: azure.vm.uncached.bandwidth.consumed
          value_type: FLOAT
          units: '%'
          description: 'Percentage of the uncached disk bandwidth consumed by the VM.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.VMUncachedBandwidthConsumedPercentage.average
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.vm.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 124203560922429bb32b76c45f24b2b9
          name: 'VM uncached IOPS consumed'
          type: DEPENDENT
          key: azure.vm.uncached.iops.consumed
          value_type: FLOAT
          units: '%'
          description: 'Percentage of the uncached disk IOPS consumed by the VM.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.VMUncachedIOPSConsumedPercentage.average
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.vm.data.get
          tags:
            - tag: component
              value: storage
      tags:
        - tag: class
          value: cloud
        - tag: subclass
          value: virtualization
        - tag: target
          value: azure
      macros:
        - macro: '{$AZURE.APP.ID}'
          description: 'The App ID of Microsoft Azure.'
          config:
            type: TEXT
            priority: '3'
            label: 'Azure App ID'
            description: 'Microsoft Azure App ID.'
            required: 'YES'
        - macro: '{$AZURE.DATA.TIMEOUT}'
          value: 15s
          description: 'API response timeout.'
          config:
            type: TEXT
            priority: '7'
            section_name: Other
            label: 'API timeout'
            description: 'API response timeout, in seconds.'
        - macro: '{$AZURE.PASSWORD}'
          type: SECRET_TEXT
          description: 'Microsoft Azure password.'
          config:
            type: TEXT
            priority: '4'
            label: 'Azure password'
            description: 'Microsoft Azure password.'
            required: 'YES'
        - macro: '{$AZURE.PROXY}'
          description: 'Sets the HTTP proxy value. If this macro is empty, then no proxy is used.'
          config:
            type: TEXT
            priority: '8'
            section_name: Other
            label: 'HTTP proxy'
            description: 'HTTP proxy to use for requests.'
        - macro: '{$AZURE.RESOURCE.ID}'
          description: 'Microsoft Azure virtual machine ID.'
          config:
            type: TEXT
            priority: '5'
            label: 'Azure virtual machine ID'
            description: 'Microsoft Azure VM ID.'
            required: 'YES'
        - macro: '{$AZURE.SUBSCRIPTION.ID}'
          description: 'Microsoft Azure subscription ID.'
          config:
            type: TEXT
            priority: '1'
            label: 'Azure subscription ID'
            description: 'Microsoft Azure subscription ID.'
            required: 'YES'
        - macro: '{$AZURE.TENANT.ID}'
          description: 'Microsoft Azure tenant ID.'
          config:
            type: TEXT
            priority: '2'
            label: 'Azure tenant ID'
            description: 'Microsoft Azure tenant ID.'
            required: 'YES'
        - macro: '{$AZURE.VM.CPU.UTIL.CRIT}'
          value: '90'
          description: 'The critical threshold of CPU utilization, expressed in %.'
          config:
            type: TEXT
            priority: '6'
            section_name: Other
            label: 'CPU utilization critical threshold'
            description: 'Critical threshold of CPU utilization, expressed in %. In the range from 0 to 100 inclusive.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
      dashboards:
        - uuid: 527e3c432d3842d0968480d8f91a712e
          name: 'Overview Azure Virtual Machine'
          pages:
            - widgets:
                - type: clock
                  name: 'Local time'
                  width: '12'
                  height: '3'
                - type: item
                  name: 'CPU credits consumed'
                  'y': '3'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure Virtual Machine by HTTP'
                        key: azure.vm.cpu.credits.consumed
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'Network in'
                  'y': '6'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure Virtual Machine by HTTP'
                        key: azure.vm.network.in.total
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'Disk read rate'
                  'y': '9'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure Virtual Machine by HTTP'
                        key: azure.vm.disk.read.bytes
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'OS disk read operations/sec'
                  'y': '12'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure Virtual Machine by HTTP'
                        key: azure.vm.os.disk.read.ops
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'Inbound flows'
                  'y': '15'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure Virtual Machine by HTTP'
                        key: azure.vm.flows.inbound
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'Available memory'
                  x: '12'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure Virtual Machine by HTTP'
                        key: azure.vm.memory.available
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'CPU credits remaining'
                  x: '12'
                  'y': '3'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure Virtual Machine by HTTP'
                        key: azure.vm.cpu.credits.remaining
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'Network out'
                  x: '12'
                  'y': '6'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure Virtual Machine by HTTP'
                        key: azure.vm.network.out.total
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'Disk write rate'
                  x: '12'
                  'y': '9'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure Virtual Machine by HTTP'
                        key: azure.vm.disk.write.bytes
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'OS disk write operations/sec'
                  x: '12'
                  'y': '12'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure Virtual Machine by HTTP'
                        key: azure.vm.os.disk.write.ops
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'Outbound flows'
                  x: '12'
                  'y': '15'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure Virtual Machine by HTTP'
                        key: azure.vm.flows.outbound
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'Availability state'
                  x: '24'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure Virtual Machine by HTTP'
                        key: azure.vm.availability.state
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: STRING
                      name: up_color
                      value: FF0000
                - type: graph
                  name: 'Percentage CPU'
                  x: '24'
                  'y': '3'
                  width: '48'
                  height: '3'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Azure Virtual Machine by HTTP'
                        name: 'Azure: Percentage CPU'
                    - type: STRING
                      name: reference
                      value: AAAAA
                - type: graph
                  name: 'Network traffic'
                  x: '24'
                  'y': '6'
                  width: '48'
                  height: '3'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Azure Virtual Machine by HTTP'
                        name: 'Azure: Network traffic'
                    - type: STRING
                      name: reference
                      value: AAAAB
                - type: graph
                  name: 'Disk read/write bytes'
                  x: '24'
                  'y': '9'
                  width: '48'
                  height: '3'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Azure Virtual Machine by HTTP'
                        name: 'Azure: Disk read/write bytes'
                    - type: STRING
                      name: reference
                      value: AAAAC
                - type: graph
                  name: 'OS disk read/write rates'
                  x: '24'
                  'y': '12'
                  width: '48'
                  height: '3'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Azure Virtual Machine by HTTP'
                        name: 'Azure: OS disk read/write IOPS'
                    - type: STRING
                      name: reference
                      value: AAAAD
                - type: graph
                  name: Flows
                  x: '24'
                  'y': '15'
                  width: '48'
                  height: '3'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Azure Virtual Machine by HTTP'
                        name: 'Azure: Flows'
                    - type: STRING
                      name: reference
                      value: AAAAE
                - type: itemhistory
                  name: 'Availability status detailed'
                  x: '36'
                  width: '36'
                  height: '3'
                  fields:
                    - type: INTEGER
                      name: columns.0.display
                      value: '4'
                    - type: ITEM
                      name: columns.0.itemid
                      value:
                        host: 'Azure Virtual Machine by HTTP'
                        key: azure.vm.availability.details
                    - type: INTEGER
                      name: columns.0.monospace_font
                      value: '1'
                    - type: STRING
                      name: columns.0.name
                      value: 'Azure: Availability status detailed'
                    - type: STRING
                      name: reference
                      value: BAAAA
                    - type: INTEGER
                      name: show_timestamp
                      value: '1'
      valuemaps:
        - uuid: 38c8ce1516704ec2a6f1ea9686db56b9
          name: 'Azure resource health state'
          mappings:
            - value: '0'
              newvalue: Available
            - value: '1'
              newvalue: Degraded
            - value: '2'
              newvalue: Unavailable
            - value: '3'
              newvalue: Unknown
    - uuid: d0fd5d346b1740dda9d3a976371789dd
      template: 'Azure VM Scale Set by HTTP'
      name: 'Azure VM Scale Set by HTTP'
      description: |
        This template is designed to monitor Microsoft Azure virtual machine scale sets 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"
      wizard_ready: 'YES'
      readme: |
        ## Overview
        
        This template is designed to monitor Microsoft Azure virtual machine scale sets 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 [Azure documentation](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 host wizard configuration fields: `Azure App ID`, `Azure password`, `Azure tenant ID`, `Azure subscription ID`, and `Azure scale set ID`.
      vendor:
        name: Zabbix
        version: 8.0-2
      groups:
        - name: Templates/Cloud
      items:
        - uuid: eea82baaa0684ba688a69da62bf1eec5
          name: 'VM availability metric'
          type: DEPENDENT
          key: azure.scaleset.availability
          value_type: FLOAT
          description: 'Measure of availability of the virtual machines over time.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.VmAvailabilityMetric.average
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.scaleset.data.get
          tags:
            - tag: component
              value: health
        - uuid: 21740af2abca461f88a81f07ba297929
          name: 'Availability status detailed'
          type: DEPENDENT
          key: azure.scaleset.availability.details
          value_type: CHAR
          description: 'The summary description of availability status.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.health.summary
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.scaleset.data.get
          tags:
            - tag: component
              value: health
        - uuid: 65e1ca0b38e04adca069388a4c5e3869
          name: 'Availability state'
          type: DEPENDENT
          key: azure.scaleset.availability.state
          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.scaleset.data.get
          tags:
            - tag: component
              value: health
          triggers:
            - uuid: a1aadc807a6d40bd8dd2049c0ead6e38
              expression: 'last(/Azure VM Scale Set by HTTP/azure.scaleset.availability.state)=1'
              name: 'Azure VM Scale: Virtual machine scale set is degraded'
              opdata: '{ITEM.LASTVALUE1}'
              priority: AVERAGE
              description: 'The resource is in a degraded state.'
              tags:
                - tag: scope
                  value: availability
            - uuid: c09bb8da8bb54c45b6d424a63ec892ae
              expression: 'last(/Azure VM Scale Set by HTTP/azure.scaleset.availability.state)=3'
              name: 'Azure VM Scale: Virtual machine scale set is in unknown state'
              opdata: '{ITEM.LASTVALUE1}'
              priority: WARNING
              description: 'The resource state is unknown.'
              tags:
                - tag: scope
                  value: availability
            - uuid: eff890c95f574ad09af82ad79803e733
              expression: 'last(/Azure VM Scale Set by HTTP/azure.scaleset.availability.state)=2'
              name: 'Azure VM Scale: Virtual machine scale set is unavailable'
              opdata: '{ITEM.LASTVALUE1}'
              priority: HIGH
              description: 'The resource state is unavailable.'
              tags:
                - tag: scope
                  value: availability
        - uuid: dd6bac4dda51446e9a16450c61b8e23e
          name: 'CPU credits consumed'
          type: DEPENDENT
          key: azure.scaleset.cpu.credits.consumed
          value_type: FLOAT
          description: 'Total number of credits consumed by the virtual machine. Only available on B-series burstable VMs.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.CPUCreditsConsumed.average
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.scaleset.data.get
          tags:
            - tag: component
              value: cpu
        - uuid: e05426408c9f448a9f8df40a52b6502a
          name: 'CPU credits remaining'
          type: DEPENDENT
          key: azure.scaleset.cpu.credits.remaining
          value_type: FLOAT
          description: 'Total number of credits available to burst. Only available on B-series burstable VMs.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.CPUCreditsRemaining.average
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.scaleset.data.get
          tags:
            - tag: component
              value: cpu
        - uuid: 0883913383d54b81b5c67b65dc595ae3
          name: 'CPU utilization'
          type: DEPENDENT
          key: azure.scaleset.cpu.utilization
          value_type: FLOAT
          units: '%'
          description: 'The percentage of allocated compute units that are currently in use by the virtual machine(s).'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.PercentageCPU.average
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.scaleset.data.get
          tags:
            - tag: component
              value: cpu
          triggers:
            - uuid: a3706a6c3349429b89b6915a6b0fb5c1
              expression: 'min(/Azure VM Scale Set by HTTP/azure.scaleset.cpu.utilization,5m)>{$AZURE.SCALESET.CPU.UTIL.CRIT}'
              name: 'Azure VM Scale: High CPU utilization'
              event_name: 'Azure VM Scale: CPU utilization is high (over {$AZURE.SCALESET.CPU.UTIL.CRIT}% for last 5m)'
              opdata: '{ITEM.LASTVALUE1}'
              priority: HIGH
              description: 'The CPU utilization is too high. The system might be slow to respond.'
              tags:
                - tag: scope
                  value: performance
        - uuid: bc342d5b3c42487887df3a82cd65e265
          name: 'Data disk max burst bandwidth'
          type: DEPENDENT
          key: azure.scaleset.data.disk.bandwidth.burst.max
          value_type: FLOAT
          units: Bps
          description: 'Maximum byte-per-second throughput the data disk can achieve with bursting.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.DataDiskMaxBurstBandwidth.average
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.scaleset.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 1d19657c420b4a0a9e601a4effefa58f
          name: 'Data disk used burst BPS credits'
          type: DEPENDENT
          key: azure.scaleset.data.disk.bandwidth.burst.used
          value_type: FLOAT
          units: '%'
          description: 'Percentage of data disk burst bandwidth credits used so far.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.DataDiskUsedBurstBPSCreditsPercentage.average
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.scaleset.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 76a0d87846b74a128d63f62da04050ab
          name: 'Data disk bandwidth consumed'
          type: DEPENDENT
          key: azure.scaleset.data.disk.bandwidth.consumed
          value_type: FLOAT
          units: '%'
          description: 'Percentage of data disk bandwidth consumed per minute.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.DataDiskBandwidthConsumedPercentage.average
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.scaleset.data.get
          tags:
            - tag: component
              value: storage
        - uuid: dd3994c9e83f48d395e61c91aae2f17d
          name: 'Data disk target bandwidth'
          type: DEPENDENT
          key: azure.scaleset.data.disk.bandwidth.target
          value_type: FLOAT
          units: Bps
          description: 'Baseline byte-per-second throughput the data disk can achieve without bursting.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.DataDiskTargetBandwidth.average
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.scaleset.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 53ab6e4d0dcd46d48c6ede579ca00366
          name: 'Data disk max burst IOPS'
          type: DEPENDENT
          key: azure.scaleset.data.disk.iops.burst.max
          value_type: FLOAT
          units: '!iops'
          description: 'Maximum IOPS the data disk can achieve with bursting.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.DataDiskMaxBurstIOPS.average
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.scaleset.data.get
          tags:
            - tag: component
              value: storage
        - uuid: e4bfd5f8c13d44e69facf507a10db553
          name: 'Data disk used burst IO credits'
          type: DEPENDENT
          key: azure.scaleset.data.disk.iops.burst.used
          value_type: FLOAT
          units: '%'
          description: 'Percentage of data disk burst I/O credits used so far.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.DataDiskUsedBurstIOCreditsPercentage.average
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.scaleset.data.get
          tags:
            - tag: component
              value: storage
        - uuid: d7633aaf087741ec8558198dc382df1a
          name: 'Data disk IOPS consumed'
          type: DEPENDENT
          key: azure.scaleset.data.disk.iops.consumed
          value_type: FLOAT
          units: '%'
          description: 'Percentage of data disk I/Os consumed per minute.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.DataDiskIOPSConsumedPercentage.average
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.scaleset.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 86123a1bff83403a8190fc5f61c4edd7
          name: 'Data disk target IOPS'
          type: DEPENDENT
          key: azure.scaleset.data.disk.iops.target
          value_type: FLOAT
          units: '!iops'
          description: 'Baseline IOPS the data disk can achieve without bursting.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.DataDiskTargetIOPS.average
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.scaleset.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 72cadbd3a3ae409b8f192217c2ff6cb1
          name: 'Data disk queue depth'
          type: DEPENDENT
          key: azure.scaleset.data.disk.queue.depth
          description: 'Data disk queue depth (or queue length).'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.DataDiskQueueDepth.average
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.scaleset.data.get
          tags:
            - tag: component
              value: storage
        - uuid: d42c402ec613423287335538136bcd05
          name: 'Data disk read rate'
          type: DEPENDENT
          key: azure.scaleset.data.disk.read.bps
          value_type: FLOAT
          units: Bps
          description: 'Bytes/sec read from a single disk during the monitoring period.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.DataDiskReadBytessec.average
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.scaleset.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 2e265f80dccd4542a0f4b0adf462fec0
          name: 'Data disk IOPS read'
          type: DEPENDENT
          key: azure.scaleset.data.disk.read.ops
          value_type: FLOAT
          units: '!iops'
          description: 'Read IOPS from a single disk during the monitoring period.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.DataDiskReadOperationsSec.average
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.scaleset.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 99b8c634131d49b7828e88a44342e2b6
          name: 'Data disk write rate'
          type: DEPENDENT
          key: azure.scaleset.data.disk.write.bps
          value_type: FLOAT
          units: Bps
          description: 'Bytes/sec written to a single disk during the monitoring period.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.DataDiskWriteBytessec.average
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.scaleset.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 0c46306040db41af895ab9a82d55ad31
          name: 'Data disk IOPS write'
          type: DEPENDENT
          key: azure.scaleset.data.disk.write.ops
          value_type: FLOAT
          units: '!iops'
          description: 'Write IOPS from a single disk during the monitoring period.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.DataDiskWriteOperationsSec.average
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.scaleset.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 14a25a861b9f491194ea055c189cc2f9
          name: 'Get errors'
          type: DEPENDENT
          key: azure.scaleset.data.errors
          value_type: TEXT
          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.scaleset.data.get
          tags:
            - tag: component
              value: error
          triggers:
            - uuid: 1d114800a6534498b52a2dd25e93d719
              expression: 'length(last(/Azure VM Scale Set by HTTP/azure.scaleset.data.errors))>0'
              name: 'Azure VM Scale: 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: f783d047862144f2baed76bb281cec5b
          name: 'Get data'
          type: SCRIPT
          key: azure.scaleset.data.get
          history: '0'
          value_type: TEXT
          params: |
            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;
            	},
            
            	login: function () {
            		var response, login = new HttpRequest();
            
            		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();
            
            		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, '[ AzureVMSS ] 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('Available Memory Bytes,CPU Credits Consumed,CPU Credits Remaining,Percentage CPU,Inbound Flows,Inbound Flows Maximum Creation Rate,Network In,Network In Total,Network Out,Network Out Total,Outbound Flows,Outbound Flows Maximum Creation Rate,VmAvailabilityMetric') + '&api-version=2021-05-01&timespan=PT1M',
            				'disks_metrics': '/providers/Microsoft.Insights/metrics?metricnames=' + encodeURIComponent('Data Disk Bandwidth Consumed Percentage,Data Disk IOPS Consumed Percentage,Data Disk Max Burst Bandwidth,Data Disk Max Burst IOPS,Data Disk Queue Depth,Data Disk Read Bytes/sec,Data Disk Read Operations/Sec,Data Disk Target Bandwidth,Data Disk Target IOPS,Data Disk Used Burst BPS Credits Percentage,Data Disk Used Burst IO Credits Percentage,Data Disk Write Bytes/sec,Data Disk Write Operations/Sec,Disk Read Bytes,Disk Read Operations/Sec,Disk Write Bytes,Disk Write Operations/Sec') + '&api-version=2021-05-01&timespan=PT1M',
            				'os_disk_metrics': '/providers/Microsoft.Insights/metrics?metricnames=' + encodeURIComponent('OS Disk Bandwidth Consumed Percentage,OS Disk IOPS Consumed Percentage,OS Disk Max Burst Bandwidth,OS Disk Max Burst IOPS,OS Disk Queue Depth,OS Disk Read Bytes/sec,OS Disk Read Operations/Sec,OS Disk Target Bandwidth,OS Disk Target IOPS,OS Disk Used Burst BPS Credits Percentage,OS Disk Used Burst IO Credits Percentage,OS Disk Write Bytes/sec,OS Disk Write Operations/Sec') + '&api-version=2021-05-01&timespan=PT1M',
            				'premium_and_vm_metrics': '/providers/Microsoft.Insights/metrics?metricnames=' + encodeURIComponent('Premium Data Disk Cache Read Hit,Premium Data Disk Cache Read Miss,Premium OS Disk Cache Read Hit,Premium OS Disk Cache Read Miss,VM Cached Bandwidth Consumed Percentage,VM Cached IOPS Consumed Percentage,VM Local Used Burst BPS Credits Percentage,VM Local Used Burst IO Credits Percentage,VM Remote Used Burst BPS Credits Percentage,VM Remote Used Burst IO Credits Percentage,VM Uncached Bandwidth Consumed Percentage,VM Uncached IOPS Consumed Percentage') + '&api-version=2021-05-01&timespan=PT1M'
            			};
            
            		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'] })
            				}
            				data.metrics[key] = Azure.getField(metrics[k], 'timeseries.0.data.0');
            			}
            		});
            
            		data.capacity = Azure.getField(Azure.request('https://management.azure.com' + Azure.params.resource_id + '?api-version=2024-03-01'), 'sku.capacity');
            		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');
            
            		return data
            	}
            };
            
            try {
            	Azure.setParams(JSON.parse(value));
            	Azure.login();
            	return JSON.stringify(Azure.getMetricsData());
            }
            catch (error) {
            	error += (String(error).endsWith('.')) ? '' : '.';
            	Zabbix.log(3, '[ AzureVMSS ] ERROR: ' + error);
            	return JSON.stringify({ 'error': error });
            }
          description: 'Gathers data of the virtual machine scale set.'
          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}'
          tags:
            - tag: component
              value: raw
        - uuid: aa8675f8f0fa454db27d46308ab92c79
          name: 'Disk read'
          type: DEPENDENT
          key: azure.scaleset.disk.read
          value_type: FLOAT
          units: B
          description: 'Bytes read from the disk during the monitoring period.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.DiskReadBytes.total
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.scaleset.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 39f1d8154bc540b78f3d1c04ea68144f
          name: 'Disk IOPS read'
          type: DEPENDENT
          key: azure.scaleset.disk.read.ops
          value_type: FLOAT
          units: '!iops'
          description: 'Disk read IOPS.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.DiskReadOperationsSec.average
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.scaleset.data.get
          tags:
            - tag: component
              value: storage
        - uuid: a419f2280662418abe7692d22a5344fb
          name: 'Disk write'
          type: DEPENDENT
          key: azure.scaleset.disk.write
          value_type: FLOAT
          units: B
          description: 'Bytes written to the disk during the monitoring period.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.DiskWriteBytes.total
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.scaleset.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 96ac2287bae3415cae1b0a8590954d02
          name: 'Disk IOPS write'
          type: DEPENDENT
          key: azure.scaleset.disk.write.ops
          value_type: FLOAT
          units: '!iops'
          description: 'Write IOPS from a single disk during the monitoring period.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.DiskWriteOperationsSec.average
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.scaleset.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 7f0cb52d4db84c2b8d8ef8f82cc6d77b
          name: 'Inbound flows'
          type: DEPENDENT
          key: azure.scaleset.flows.inbound
          value_type: FLOAT
          description: 'Inbound Flows are the number of current flows in the inbound direction (traffic going into the VMs).'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.InboundFlows.average
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.scaleset.data.get
          tags:
            - tag: component
              value: network
        - uuid: dacfd47b3c3142ce9ca043ebda4e7614
          name: 'Inbound flow maximum creation rate'
          type: DEPENDENT
          key: azure.scaleset.flows.inbound.max
          value_type: FLOAT
          description: 'The maximum creation rate of inbound flows (traffic going into the VM).'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.InboundFlowsMaximumCreationRate.average
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.scaleset.data.get
          tags:
            - tag: component
              value: network
        - uuid: 8ef6bb3bc1884426ab3fe9998acf4e25
          name: 'Outbound flows'
          type: DEPENDENT
          key: azure.scaleset.flows.outbound
          value_type: FLOAT
          description: 'Outbound Flows are the number of current flows in the outbound direction (traffic going out of the VMs).'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.OutboundFlows.average
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.scaleset.data.get
          tags:
            - tag: component
              value: network
        - uuid: 15b8f8fde6e4458e8904428537a8b32a
          name: 'Outbound flow maximum creation rate'
          type: DEPENDENT
          key: azure.scaleset.flows.outbound.max
          value_type: FLOAT
          description: 'The maximum creation rate of outbound flows (traffic going out of the VM).'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.OutboundFlowsMaximumCreationRate.average
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.scaleset.data.get
          tags:
            - tag: component
              value: network
        - uuid: 4025ada5ba4940b88b48b7b71efbe07b
          name: 'Network in total'
          type: DEPENDENT
          key: azure.scaleset.network.in.total
          value_type: FLOAT
          units: B
          description: 'The number of bytes received on all network interfaces by the virtual machine(s) (incoming traffic).'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.NetworkInTotal.total
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.scaleset.data.get
          tags:
            - tag: component
              value: network
        - uuid: 6bca5eeb39194c5f83f83863f1e6b4c6
          name: 'Network out total'
          type: DEPENDENT
          key: azure.scaleset.network.out.total
          value_type: FLOAT
          units: B
          description: 'The number of bytes out on all network interfaces by the virtual machine(s) (outgoing traffic).'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.NetworkOutTotal.total
              error_handler: DISCARD_VALUE
          master_item:
            key: azure.scaleset.data.get
          tags:
            - tag: component
              value: network
        - uuid: d81be2d243124ebd8efd5fa4fd79d3f6
          name: 'OS disk used burst BPS credits'
          type: DEPENDENT
          key: azure.scaleset.os.disk.bandwidth.burst.used
          value_type: FLOAT
          units: '%'
          description: 'Percentage of OS Disk burst bandwidth credits used so far.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.OSDiskUsedBurstBPSCreditsPercentage.average
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.scaleset.data.get
          tags:
            - tag: component
              value: storage
        - uuid: b66ff8f85e614b9c9db479e8452a3acb
          name: 'OS disk bandwidth consumed'
          type: DEPENDENT
          key: azure.scaleset.os.disk.bandwidth.consumed
          value_type: FLOAT
          units: '%'
          description: 'Percentage of operating system disk bandwidth consumed per minute.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.OSDiskBandwidthConsumedPercentage.average
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.scaleset.data.get
          tags:
            - tag: component
              value: storage
        - uuid: b5f5c9d4040c4b889287658532aec890
          name: 'OS disk max burst bandwidth'
          type: DEPENDENT
          key: azure.scaleset.os.disk.bandwidth.max
          value_type: FLOAT
          units: Bps
          description: 'Maximum byte-per-second throughput the OS Disk can achieve with bursting.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.OSDiskMaxBurstBandwidth.average
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.scaleset.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 4f28508261554a11a858f905160a5db2
          name: 'OS disk target bandwidth'
          type: DEPENDENT
          key: azure.scaleset.os.disk.bandwidth.target
          value_type: FLOAT
          units: Bps
          description: 'Baseline byte-per-second throughput the OS Disk can achieve without bursting.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.OSDiskTargetBandwidth.average
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.scaleset.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 97005b2f1be1455f8002b3f777898163
          name: 'OS disk used burst IO credits'
          type: DEPENDENT
          key: azure.scaleset.os.disk.iops.burst.used
          value_type: FLOAT
          units: '%'
          description: 'Percentage of OS Disk burst I/O credits used so far.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.OSDiskUsedBurstIOCreditsPercentage.average
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.scaleset.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 87e51f85e00646d4bfe12840f444e47a
          name: 'OS disk IOPS consumed'
          type: DEPENDENT
          key: azure.scaleset.os.disk.iops.consumed
          value_type: FLOAT
          units: '%'
          description: 'Percentage of operating system disk I/Os consumed per minute.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.OSDiskIOPSConsumedPercentage.average
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.scaleset.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 1ff472b5cca24332abea886bff44435f
          name: 'OS disk max burst IOPS'
          type: DEPENDENT
          key: azure.scaleset.os.disk.iops.max
          value_type: FLOAT
          units: '!iops'
          description: 'Maximum IOPS the OS Disk can achieve with bursting.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.OSDiskMaxBurstIOPS.average
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.scaleset.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 72b19174782d4905be402e2825098f17
          name: 'OS disk target IOPS'
          type: DEPENDENT
          key: azure.scaleset.os.disk.iops.target
          value_type: FLOAT
          units: '!iops'
          description: 'Baseline IOPS the OS disk can achieve without bursting.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.OSDiskTargetIOPS.average
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.scaleset.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 3bbb425e37894415b002e026e34259a2
          name: 'OS disk queue depth'
          type: DEPENDENT
          key: azure.scaleset.os.disk.queue.depth
          value_type: FLOAT
          description: 'OS Disk queue depth (or queue length).'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.OSDiskQueueDepth.average
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.scaleset.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 7879801b929249d0b266ae905307beee
          name: 'OS disk read rate'
          type: DEPENDENT
          key: azure.scaleset.os.disk.read.bps
          value_type: FLOAT
          units: Bps
          description: 'Bytes/sec read from a single disk during the monitoring period - for an OS disk.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.OSDiskReadBytessec.average
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.scaleset.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 542881bbbb694b1a84befbb772ded703
          name: 'OS disk IOPS read'
          type: DEPENDENT
          key: azure.scaleset.os.disk.read.ops
          value_type: FLOAT
          units: '!iops'
          description: 'Read IOPS from a single disk during the monitoring period - for an OS disk.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.OSDiskReadOperationsSec.average
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.scaleset.data.get
          tags:
            - tag: component
              value: storage
        - uuid: c86371d6f8224b418f003a7fdefe9884
          name: 'OS disk write rate'
          type: DEPENDENT
          key: azure.scaleset.os.disk.write.bps
          value_type: FLOAT
          units: Bps
          description: 'Bytes/sec written to a single disk during the monitoring period - for an OS disk.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.OSDiskWriteBytessec.average
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.scaleset.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 77d95de6fdbd49ba9bae68e75f792560
          name: 'OS disk IOPS write'
          type: DEPENDENT
          key: azure.scaleset.os.disk.write.ops
          value_type: FLOAT
          units: '!iops'
          description: 'Write IOPS from a single disk during the monitoring period - for an OS disk.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.OSDiskWriteOperationsSec.average
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.scaleset.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 25915ce6d37740bf83f656c5cc7b9960
          name: 'Premium data disk cache read hit in %'
          type: DEPENDENT
          key: azure.scaleset.premium.data.disk.cache.read.hit
          value_type: FLOAT
          units: '%'
          description: 'Percentage of premium data disk cache read hit.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.PremiumDataDiskCacheReadHit.average
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.scaleset.data.get
          tags:
            - tag: component
              value: storage
        - uuid: f04f8f7e59ec4786b5ea8765cbf69b82
          name: 'Premium data disk cache read miss in %'
          type: DEPENDENT
          key: azure.scaleset.premium.data.disk.cache.read.miss
          value_type: FLOAT
          units: '%'
          description: 'Percentage of premium data disk cache read miss.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.PremiumDataDiskCacheReadMiss.average
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.scaleset.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 65442659fe944842811638ac04dc998a
          name: 'Premium OS disk cache read hit in %'
          type: DEPENDENT
          key: azure.scaleset.premium.os.disk.cache.read.hit
          value_type: FLOAT
          units: '%'
          description: 'Percentage of premium OS disk cache read hit.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.PremiumOSDiskCacheReadHit.average
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.scaleset.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 981c83a8623c481ca040c66f5d5738ec
          name: 'Premium OS disk cache read miss in %'
          type: DEPENDENT
          key: azure.scaleset.premium.os.disk.cache.read.miss
          value_type: FLOAT
          units: '%'
          description: 'Percentage of premium OS disk cache read miss.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.PremiumOSDiskCacheReadMiss.average
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.scaleset.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 8bfbc99e09314aeea7c0d0563d148c11
          name: 'VM cached bandwidth consumed'
          type: DEPENDENT
          key: azure.scaleset.vm.cached.bandwidth.consumed
          value_type: FLOAT
          units: '%'
          description: 'Percentage of cached disk bandwidth consumed by the VM.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.VMCachedBandwidthConsumedPercentage.average
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.scaleset.data.get
          tags:
            - tag: component
              value: storage
        - uuid: ae97e2890b5844749913f3a1d650091d
          name: 'VM cached IOPS consumed'
          type: DEPENDENT
          key: azure.scaleset.vm.cached.iops.consumed
          value_type: FLOAT
          units: '%'
          description: 'Percentage of cached disk IOPS consumed by the VM.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.VMCachedIOPSConsumedPercentage.average
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.scaleset.data.get
          tags:
            - tag: component
              value: storage
        - uuid: 7124d8d7d2b246feaa8959fd6d5aba0f
          name: 'Virtual machine count'
          type: DEPENDENT
          key: azure.scaleset.vm.count
          description: 'Current amount of virtual machines in the scale set.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.capacity
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.scaleset.data.get
          tags:
            - tag: component
              value: health
          triggers:
            - uuid: cd77906ed04a42f28bb702bc513504a0
              expression: 'min(/Azure VM Scale Set by HTTP/azure.scaleset.vm.count,5m)>{$AZURE.SCALESET.VM.COUNT.CRIT}'
              name: 'Azure VM Scale: High amount of VMs in the scale set'
              event_name: 'Azure VM Scale: Number of VMs is high (over {$AZURE.SCALESET.VM.COUNT.CRIT} for last 5m)'
              opdata: '{ITEM.LASTVALUE1}'
              priority: HIGH
              description: 'High amount of VMs in the scale set.'
              tags:
                - tag: scope
                  value: performance
        - uuid: 31f742e4476f4ab09d3a2bd46f820098
          name: 'Available memory'
          type: DEPENDENT
          key: azure.scaleset.vm.memory
          value_type: FLOAT
          units: B
          description: 'Amount of physical memory, in bytes, immediately available for allocation to a process or for system use in the virtual machine.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.AvailableMemoryBytes.average
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.scaleset.data.get
          tags:
            - tag: component
              value: memory
        - uuid: 8271a3a47a744e23bd239919760fb9b4
          name: 'VM uncached bandwidth consumed'
          type: DEPENDENT
          key: azure.scaleset.vm.uncached.bandwidth.consumed
          value_type: FLOAT
          units: '%'
          description: 'Percentage of uncached disk bandwidth consumed by the VM.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.VMUncachedBandwidthConsumedPercentage.average
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.scaleset.data.get
          tags:
            - tag: component
              value: storage
        - uuid: dd8f8111b6914ba38f6fe2f707dbb9f1
          name: 'VM uncached IOPS consumed'
          type: DEPENDENT
          key: azure.scaleset.vm.uncached.iops.consumed
          value_type: FLOAT
          units: '%'
          description: 'Percentage of uncached disk IOPS consumed by the VM.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.metrics.VMUncachedIOPSConsumedPercentage.average
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.scaleset.data.get
          tags:
            - tag: component
              value: storage
      tags:
        - tag: class
          value: cloud
        - tag: subclass
          value: automation
        - tag: subclass
          value: virtualization
        - tag: target
          value: azure
      macros:
        - macro: '{$AZURE.APP.ID}'
          description: 'The App ID of Microsoft Azure.'
          config:
            type: TEXT
            priority: '3'
            label: 'Azure App ID'
            description: 'Microsoft Azure App ID.'
            required: 'YES'
        - macro: '{$AZURE.DATA.TIMEOUT}'
          value: 15s
          description: 'API response timeout.'
          config:
            type: TEXT
            priority: '8'
            section_name: Other
            label: 'API timeout'
            description: 'API response timeout, in seconds.'
        - macro: '{$AZURE.PASSWORD}'
          type: SECRET_TEXT
          description: 'Microsoft Azure password.'
          config:
            type: TEXT
            priority: '4'
            label: 'Azure password'
            description: 'Microsoft Azure password.'
            required: 'YES'
        - macro: '{$AZURE.PROXY}'
          description: 'Sets the HTTP proxy value. If this macro is empty, then no proxy is used.'
          config:
            type: TEXT
            priority: '9'
            section_name: Other
            label: 'HTTP proxy'
            description: 'HTTP proxy to use for requests.'
        - macro: '{$AZURE.RESOURCE.ID}'
          description: 'Microsoft Azure scale set ID.'
          config:
            type: TEXT
            priority: '5'
            label: 'Azure scale set ID'
            description: 'Microsoft Azure scale set ID.'
            required: 'YES'
        - macro: '{$AZURE.SCALESET.CPU.UTIL.CRIT}'
          value: '90'
          description: 'The critical threshold of CPU utilization, expressed in %.'
          config:
            type: TEXT
            priority: '7'
            section_name: Thresholds
            label: 'CPU utilization critical threshold'
            description: 'Critical threshold of CPU utilization, expressed in %. In the range from 0 to 100 inclusive.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$AZURE.SCALESET.VM.COUNT.CRIT}'
          value: '100'
          description: 'The critical amount of virtual machines in the scale set.'
          config:
            type: TEXT
            priority: '6'
            section_name: Thresholds
            label: 'Critical amount of VMs'
            description: 'Critical amount of virtual machines in the scale set. No less than 0.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$AZURE.SUBSCRIPTION.ID}'
          description: 'Microsoft Azure subscription ID.'
          config:
            type: TEXT
            priority: '1'
            label: 'Azure subscription ID'
            description: 'Microsoft Azure subscription ID.'
            required: 'YES'
        - macro: '{$AZURE.TENANT.ID}'
          description: 'Microsoft Azure tenant ID.'
          config:
            type: TEXT
            priority: '2'
            label: 'Azure tenant ID'
            description: 'Microsoft Azure tenant ID.'
            required: 'YES'
      dashboards:
        - uuid: 1a38b3783a6b41cca3e5cfadd64d4534
          name: 'Overview Azure VM Scale Set'
          pages:
            - widgets:
                - type: item
                  name: 'Virtual machine count'
                  width: '12'
                  height: '3'
                  fields:
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure VM Scale Set by HTTP'
                        key: azure.scaleset.vm.count
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'CPU credits consumed'
                  'y': '3'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure VM Scale Set by HTTP'
                        key: azure.scaleset.cpu.credits.consumed
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'Network in'
                  'y': '6'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure VM Scale Set by HTTP'
                        key: azure.scaleset.network.in.total
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'Disk read'
                  'y': '9'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure VM Scale Set by HTTP'
                        key: azure.scaleset.disk.read
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'OS disk read operations/sec'
                  'y': '12'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure VM Scale Set by HTTP'
                        key: azure.scaleset.disk.read.ops
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'Inbound flows'
                  'y': '15'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure VM Scale Set by HTTP'
                        key: azure.scaleset.flows.inbound
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'Available memory'
                  x: '12'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure VM Scale Set by HTTP'
                        key: azure.scaleset.vm.memory
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'CPU credits remaining'
                  x: '12'
                  'y': '3'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure VM Scale Set by HTTP'
                        key: azure.scaleset.cpu.credits.remaining
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'Network out'
                  x: '12'
                  'y': '6'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure VM Scale Set by HTTP'
                        key: azure.scaleset.network.out.total
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'Disk write'
                  x: '12'
                  'y': '9'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure VM Scale Set by HTTP'
                        key: azure.scaleset.disk.write
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'OS disk write operations/sec'
                  x: '12'
                  'y': '12'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure VM Scale Set by HTTP'
                        key: azure.scaleset.disk.write.ops
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'Outbound flows'
                  x: '12'
                  'y': '15'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure VM Scale Set by HTTP'
                        key: azure.scaleset.flows.outbound
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: 'Availability state'
                  x: '24'
                  width: '12'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Azure VM Scale Set by HTTP'
                        key: azure.scaleset.availability.state
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: STRING
                      name: up_color
                      value: FF0000
                - type: graph
                  name: 'CPU Utilization'
                  x: '24'
                  'y': '3'
                  width: '48'
                  height: '3'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Azure VM Scale Set by HTTP'
                        name: 'CPU Utilization'
                    - type: STRING
                      name: reference
                      value: AAAAA
                - type: graph
                  name: 'Network traffic'
                  x: '24'
                  'y': '6'
                  width: '48'
                  height: '3'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Azure VM Scale Set by HTTP'
                        name: 'Network traffic, bytes'
                    - type: STRING
                      name: reference
                      value: AAAAB
                - type: graph
                  name: 'Disk read/write bytes'
                  x: '24'
                  'y': '9'
                  width: '48'
                  height: '3'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Azure VM Scale Set by HTTP'
                        name: 'Disk read/write bytes'
                    - type: STRING
                      name: reference
                      value: AAAAC
                - type: graph
                  name: 'OS disk read/write rates'
                  x: '24'
                  'y': '12'
                  width: '48'
                  height: '3'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Azure VM Scale Set by HTTP'
                        name: 'OS disk IOPS read/write'
                    - type: STRING
                      name: reference
                      value: AAAAD
                - type: graph
                  name: Flows
                  x: '24'
                  'y': '15'
                  width: '48'
                  height: '3'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Azure VM Scale Set by HTTP'
                        name: Flows
                    - type: STRING
                      name: reference
                      value: AAAAE
                - type: itemhistory
                  name: 'Availability status detailed'
                  x: '36'
                  width: '36'
                  height: '3'
                  fields:
                    - type: INTEGER
                      name: columns.0.display
                      value: '4'
                    - type: ITEM
                      name: columns.0.itemid
                      value:
                        host: 'Azure VM Scale Set by HTTP'
                        key: azure.scaleset.availability.details
                    - type: INTEGER
                      name: columns.0.monospace_font
                      value: '1'
                    - type: STRING
                      name: columns.0.name
                      value: '|'
                    - type: STRING
                      name: reference
                      value: BAAAA
                    - type: INTEGER
                      name: show_column_header
                      value: '0'
                    - type: INTEGER
                      name: show_timestamp
                      value: '1'
      valuemaps:
        - uuid: fc7ca60876144ac8b240db81537920a6
          name: 'Azure resource health state'
          mappings:
            - value: '0'
              newvalue: Available
            - value: '1'
              newvalue: Degraded
            - value: '2'
              newvalue: Unavailable
            - value: '3'
              newvalue: Unknown
    - uuid: f01bd64eef4049fabe087cccae590226
      template: 'Intel SR1530 IPMI'
      name: 'Intel SR1530 IPMI'
      description: |
        Template for monitoring Intel SR1530 server system.
        
        Generated by official Zabbix template tool "Templator"
      wizard_ready: 'YES'
      readme: |
        ## Overview
        
        Template for monitoring Intel SR1530 server system.
      vendor:
        name: Zabbix
        version: 8.0-1
      groups:
        - name: 'Templates/Server hardware'
      items:
        - uuid: f1d7b90d87c6411e9d887d223b4f9022
          name: 'BB +1.8V SM'
          type: IPMI
          key: bb_1.8v_sm
          value_type: FLOAT
          units: V
          ipmi_sensor: 'BB +1.8V SM'
          tags:
            - tag: component
              value: system
            - tag: component
              value: voltage
          triggers:
            - uuid: 55cc8ccf46954499a9c274ab301dd857
              expression: 'last(/Intel SR1530 IPMI/bb_1.8v_sm)<1.597 or last(/Intel SR1530 IPMI/bb_1.8v_sm)>2.019'
              name: 'Intel SR1530: BB +1.8V SM Critical [{ITEM.VALUE}]'
              priority: DISASTER
              dependencies:
                - name: 'Intel SR1530: Power'
                  expression: 'last(/Intel SR1530 IPMI/power)=0'
              tags:
                - tag: scope
                  value: availability
            - uuid: 55e3dc7d5bd34da0862d724ab5d18bb7
              expression: 'last(/Intel SR1530 IPMI/bb_1.8v_sm)<1.646 or last(/Intel SR1530 IPMI/bb_1.8v_sm)>1.960'
              name: 'Intel SR1530: BB +1.8V SM Non-Critical [{ITEM.VALUE}]'
              priority: HIGH
              dependencies:
                - name: 'Intel SR1530: BB +1.8V SM Critical [{ITEM.VALUE}]'
                  expression: 'last(/Intel SR1530 IPMI/bb_1.8v_sm)<1.597 or last(/Intel SR1530 IPMI/bb_1.8v_sm)>2.019'
                - name: 'Intel SR1530: Power'
                  expression: 'last(/Intel SR1530 IPMI/power)=0'
              tags:
                - tag: scope
                  value: availability
        - uuid: 21820c76180446ff9965f8937e6d1ba0
          name: 'BB +3.3V'
          type: IPMI
          key: bb_3.3v
          value_type: FLOAT
          units: V
          ipmi_sensor: 'BB +3.3V'
          tags:
            - tag: component
              value: system
            - tag: component
              value: voltage
          triggers:
            - uuid: 35a0dedd6fb244759a4feca2c1aff961
              expression: 'last(/Intel SR1530 IPMI/bb_3.3v)<2.876 or last(/Intel SR1530 IPMI/bb_3.3v)>3.729'
              name: 'Intel SR1530: BB +3.3V Critical [{ITEM.VALUE}]'
              priority: DISASTER
              dependencies:
                - name: 'Intel SR1530: Power'
                  expression: 'last(/Intel SR1530 IPMI/power)=0'
              tags:
                - tag: scope
                  value: availability
            - uuid: bd2472feb90f40429fbbcd0bddbdd455
              expression: 'last(/Intel SR1530 IPMI/bb_3.3v)<2.970 or last(/Intel SR1530 IPMI/bb_3.3v)>3.618'
              name: 'Intel SR1530: BB +3.3V Non-Critical [{ITEM.VALUE}]'
              priority: HIGH
              dependencies:
                - name: 'Intel SR1530: BB +3.3V Critical [{ITEM.VALUE}]'
                  expression: 'last(/Intel SR1530 IPMI/bb_3.3v)<2.876 or last(/Intel SR1530 IPMI/bb_3.3v)>3.729'
                - name: 'Intel SR1530: Power'
                  expression: 'last(/Intel SR1530 IPMI/power)=0'
              tags:
                - tag: scope
                  value: availability
        - uuid: 7bd5269be38c417aba374c9e8af28f8c
          name: 'BB +3.3V STBY'
          type: IPMI
          key: bb_3.3v_stby
          value_type: FLOAT
          units: V
          ipmi_sensor: 'BB +3.3V STBY'
          tags:
            - tag: component
              value: system
            - tag: component
              value: voltage
          triggers:
            - uuid: c0f82f508d38405d978c746f5c95a178
              expression: 'last(/Intel SR1530 IPMI/bb_3.3v_stby)<2.876 or last(/Intel SR1530 IPMI/bb_3.3v_stby)>3.729'
              name: 'Intel SR1530: BB +3.3V STBY Critical [{ITEM.VALUE}]'
              priority: DISASTER
              tags:
                - tag: scope
                  value: availability
            - uuid: 8f957e674af84229aa2e1ee78bf941a0
              expression: 'last(/Intel SR1530 IPMI/bb_3.3v_stby)<2.970 or last(/Intel SR1530 IPMI/bb_3.3v_stby)>3.618'
              name: 'Intel SR1530: BB +3.3V STBY Non-Critical [{ITEM.VALUE}]'
              priority: HIGH
              dependencies:
                - name: 'Intel SR1530: BB +3.3V STBY Critical [{ITEM.VALUE}]'
                  expression: 'last(/Intel SR1530 IPMI/bb_3.3v_stby)<2.876 or last(/Intel SR1530 IPMI/bb_3.3v_stby)>3.729'
              tags:
                - tag: scope
                  value: availability
        - uuid: 7931e499e1894942a4763432a6a446fd
          name: 'BB +5.0V'
          type: IPMI
          key: bb_5.0v
          value_type: FLOAT
          units: V
          ipmi_sensor: 'BB +5.0V'
          tags:
            - tag: component
              value: system
            - tag: component
              value: voltage
          triggers:
            - uuid: dec3da3d68b04f3c9ea16fabe17b8faa
              expression: 'last(/Intel SR1530 IPMI/bb_5.0v)<4.362 or last(/Intel SR1530 IPMI/bb_5.0v)>5.663'
              name: 'Intel SR1530: BB +5.0V Critical [{ITEM.VALUE}]'
              priority: DISASTER
              dependencies:
                - name: 'Intel SR1530: Power'
                  expression: 'last(/Intel SR1530 IPMI/power)=0'
              tags:
                - tag: scope
                  value: availability
            - uuid: e2683b71d36b4ab4ad8a98c964b19118
              expression: 'last(/Intel SR1530 IPMI/bb_5.0v)<4.483 or last(/Intel SR1530 IPMI/bb_5.0v)>5.495'
              name: 'Intel SR1530: BB +5.0V Non-Critical [{ITEM.VALUE}]'
              priority: HIGH
              dependencies:
                - name: 'Intel SR1530: BB +5.0V Critical [{ITEM.VALUE}]'
                  expression: 'last(/Intel SR1530 IPMI/bb_5.0v)<4.362 or last(/Intel SR1530 IPMI/bb_5.0v)>5.663'
                - name: 'Intel SR1530: Power'
                  expression: 'last(/Intel SR1530 IPMI/power)=0'
              tags:
                - tag: scope
                  value: availability
        - uuid: 2e6d7059cbb349889c639e9fba09bd8c
          name: 'BB Ambient Temp'
          type: IPMI
          key: bb_ambient_temp
          value_type: FLOAT
          units: C
          ipmi_sensor: 'BB Ambient Temp'
          tags:
            - tag: component
              value: system
            - tag: component
              value: temperature
          triggers:
            - uuid: 0adcefe86a99468d9d7f0db2021ec8c9
              expression: 'last(/Intel SR1530 IPMI/bb_ambient_temp)<5 or last(/Intel SR1530 IPMI/bb_ambient_temp)>66'
              name: 'Intel SR1530: BB Ambient Temp Critical [{ITEM.VALUE}]'
              priority: DISASTER
              tags:
                - tag: scope
                  value: availability
                - tag: scope
                  value: performance
            - uuid: 6630637c02224bacbe3456a388233775
              expression: 'last(/Intel SR1530 IPMI/bb_ambient_temp)<10 or last(/Intel SR1530 IPMI/bb_ambient_temp)>61'
              name: 'Intel SR1530: BB Ambient Temp Non-Critical [{ITEM.VALUE}]'
              priority: HIGH
              dependencies:
                - name: 'Intel SR1530: BB Ambient Temp Critical [{ITEM.VALUE}]'
                  expression: 'last(/Intel SR1530 IPMI/bb_ambient_temp)<5 or last(/Intel SR1530 IPMI/bb_ambient_temp)>66'
              tags:
                - tag: scope
                  value: availability
                - tag: scope
                  value: performance
        - uuid: 1821294a921d401f822678ce1d246163
          name: Power
          type: IPMI
          key: power
          ipmi_sensor: power
          tags:
            - tag: component
              value: system
            - tag: component
              value: voltage
          triggers:
            - uuid: 85722b8734df45d589afd69262a498a4
              expression: 'last(/Intel SR1530 IPMI/power)=0'
              name: 'Intel SR1530: Power'
              priority: WARNING
              tags:
                - tag: scope
                  value: availability
        - uuid: efc577d6deba4f46b1fe79e6a1a26fdd
          name: 'Processor Vcc'
          type: IPMI
          key: processor_vcc
          value_type: FLOAT
          units: V
          ipmi_sensor: 'Processor Vcc'
          tags:
            - tag: component
              value: system
            - tag: component
              value: voltage
        - uuid: 89e5edc9cd6d4984a7a76320f7800ae9
          name: 'System Fan 3'
          type: IPMI
          key: system_fan_3
          value_type: FLOAT
          units: RPM
          ipmi_sensor: 'System Fan 3'
          tags:
            - tag: component
              value: fan
            - tag: component
              value: system
      tags:
        - tag: class
          value: hardware
        - tag: subclass
          value: server
        - tag: target
          value: intel
        - tag: target
          value: intel-sr1530
      dashboards:
        - uuid: f298fb0b3cee40e6b2588c6b8b078a8a
          name: 'Intel SR1530 IPMI Overview'
          pages:
            - widgets:
                - type: graph
                  width: '36'
                  height: '5'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Intel SR1530 IPMI'
                        name: 'Intel SR1530 IPMI: Voltage'
                    - type: STRING
                      name: reference
                      value: AAAAA
                - type: graph
                  x: '36'
                  width: '36'
                  height: '5'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Intel SR1530 IPMI'
                        name: 'Intel SR1530 IPMI: Fan speed and ambient temperature'
                    - type: STRING
                      name: reference
                      value: AAAAB
    - uuid: 1945f22f8ba84ce89454d9513979a3c6
      template: 'Stormshield SNS by SNMP'
      name: 'Stormshield SNS by SNMP'
      description: |
        The template for monitoring SNS firewall by SNMP.
        
        MIBs used:
        HOST-RESOURCES-MIB
        UCD-SNMP-MIB
        STORMSHIELD-ASQ-STATS-MIB
        STORMSHIELD-AUTOUPDATE-MIB
        STORMSHIELD-HA-MIB
        STORMSHIELD-PROPERTY-MIB
        STORMSHIELD-HEALTH-MONITOR-MIB
        STORMSHIELD-IF-MIB
        STORMSHIELD-SYSTEM-MONITOR-MIB
        STORMSHIELD-IPSEC-STATS-MIB
        
        Generated by official Zabbix template tool "Templator"
      wizard_ready: 'YES'
      vendor:
        name: Zabbix
        version: 8.0-1
      groups:
        - name: 'Templates/Network devices'
        - name: 'Templates/Operating systems'
      items:
        - uuid: 3b54cafc125347c1987be674fd38d01c
          name: 'ASQ TCP connection count'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.11256.1.12.1.23.0]'
          key: 'asq.alarm.stateful.tcp[snsASQStatsStatefulTcpConn.0]'
          delay: '{$SNS.SNMP.INTERVAL}'
          description: |
            MIB: STORMSHIELD-ASQ-STATS-MIB
            ASQ stateful TCP connection count.
          tags:
            - tag: component
              value: asq
        - uuid: 8ecf661fe8904c41a03ea2153ae10622
          name: 'ASQ UDP connection count'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.11256.1.12.1.33.0]'
          key: 'asq.alarm.stateful.udp[snsASQStatsStatefulUdpConn.0]'
          delay: '{$SNS.SNMP.INTERVAL}'
          description: |
            MIB: STORMSHIELD-ASQ-STATS-MIB
            ASQ stateful UDP connection count.
          tags:
            - tag: component
              value: asq
        - uuid: d5045cd3a7714e8088b7cdc5dbf55a36
          name: 'ASQ major alarm count'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.11256.1.12.1.12.0]'
          key: 'asq.alarm.stateful[snsASQStatsStatefulMajorAlarm.0]'
          delay: '{$SNS.SNMP.INTERVAL}'
          description: |
            MIB: STORMSHIELD-ASQ-STATS-MIB
            ASQ major alarm count.
          tags:
            - tag: component
              value: asq
        - uuid: 6c18d83d5cdf463c94f587295b416291
          name: 'ASQ minor alarm count'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.11256.1.12.1.11.0]'
          key: 'asq.alarm.stateful[snsASQStatsStatefulMinorAlarm.0]'
          delay: '{$SNS.SNMP.INTERVAL}'
          value_type: CHAR
          description: |
            MIB: STORMSHIELD-ASQ-STATS-MIB
            ASQ minor alarm count.
          tags:
            - tag: component
              value: asq
        - uuid: fc06ecf1f0f74692a43bdf15b569ffcd
          name: 'HA: Faulty HA links'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.11256.1.11.6.0]'
          key: 'ha.links.faulty[snsNbFaultyHALinks.0]'
          delay: '{$SNS.SNMP.INTERVAL}'
          description: |
            MIB: STORMSHIELD-HA-MIB
            Number of faulty HA links.
          tags:
            - tag: component
              value: ha
          triggers:
            - uuid: 93808f7abb4f40fdad41a174557de441
              expression: 'last(/Stormshield SNS by SNMP/ha.links.faulty[snsNbFaultyHALinks.0],#1)>0'
              name: 'SNS: Faulty HA link'
              event_name: 'SNS: Faulty HA link'
              priority: AVERAGE
              description: 'There is at least one faulty HA link.'
              tags:
                - tag: scope
                  value: availability
        - uuid: 0e0ce46444494ec08d2217ca8cf4f304
          name: 'HA: Active firewalls'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.11256.1.11.3.0]'
          key: 'ha.node.active[snsNbActiveNode.0]'
          delay: '{$SNS.SNMP.INTERVAL}'
          description: |
            MIB: STORMSHIELD-HA-MIB
            Number of active firewalls.
          tags:
            - tag: component
              value: ha
        - uuid: 95e8d34b1bc9469f8eaa82c86b6be35a
          name: 'HA: Firewalls in the cluster'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.11256.1.11.1.0]'
          key: 'ha.node.count[snsNbNode.0]'
          delay: '{$SNS.SNMP.INTERVAL}'
          description: |
            MIB: STORMSHIELD-HA-MIB
            Number of firewalls in the HA cluster.
          tags:
            - tag: component
              value: ha
        - uuid: a9a90c5a38914dfbbd07441a0e5ee711
          name: 'HA: Firewalls not replying'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.11256.1.11.2.0]'
          key: 'ha.node.dead[snsNbDeadNode.0]'
          delay: '{$SNS.SNMP.INTERVAL}'
          description: |
            MIB: STORMSHIELD-HA-MIB
            Number of firewalls registered in the HA cluster but not replying.
          tags:
            - tag: component
              value: ha
        - uuid: dd16514bb5114dd5bee0686bd23f107c
          name: 'HA: Synchronization status'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.11256.1.11.8.0]'
          key: 'ha.sync.status[snsHASyncStatus.0]'
          delay: '{$SNS.SNMP.INTERVAL}'
          description: |
            MIB: STORMSHIELD-HA-MIB
            Firewall configuration synchronization status:
              1: Synced, 
              0: Not synced, 
              -1: Unknown/Error.
          valuemap:
            name: 'STORMSHIELD-HA-MIB::snsHASyncStatus'
          tags:
            - tag: component
              value: ha
          triggers:
            - uuid: c03dce70e912493d8a65942d381ab734
              expression: 'last(/Stormshield SNS by SNMP/ha.sync.status[snsHASyncStatus.0],#1)<0'
              name: 'SNS: HA synchronization error'
              event_name: 'SNS: HA synchronization error'
              priority: AVERAGE
              description: 'The cluster HA is not synchronized properly.'
              tags:
                - tag: scope
                  value: availability
        - uuid: 34d96118f6a64fb2aa9a5a042e00ad7c
          name: 'Available memory'
          type: CALCULATED
          key: host.memory.available
          value_type: FLOAT
          units: B
          params: '(last(//host.memory.buffer[memBuffer.0]))+(last(//host.memory.cached[memCached.0]))+(last(//host.memory.free[memAvailReal.0]))'
          description: |
            Available memory in bytes
            (Available = Free + Cached + Buffer).
          tags:
            - tag: component
              value: memory
        - uuid: b2b597c8671b450c807423a9982efdb1
          name: 'Buffer memory'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.2021.4.14.0]'
          key: 'host.memory.buffer[memBuffer.0]'
          delay: '{$SNS.SNMP.INTERVAL}'
          value_type: FLOAT
          units: B
          description: |
            MIB: UCD-SNMP-MIB
            Buffer memory in bytes.
          preprocessing:
            - type: MULTIPLIER
              parameters:
                - '1000'
          tags:
            - tag: component
              value: memory
        - uuid: 81305b3e1e1340c1b22b8d15d7c0771f
          name: 'Cached memory'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.2021.4.15.0]'
          key: 'host.memory.cached[memCached.0]'
          delay: '{$SNS.SNMP.INTERVAL}'
          value_type: FLOAT
          units: B
          description: |
            MIB: UCD-SNMP-MIB
            Cached memory in bytes.
          preprocessing:
            - type: MULTIPLIER
              parameters:
                - '1000'
          tags:
            - tag: component
              value: memory
        - uuid: 98722552df3840e4947f102c0df6b46e
          name: 'Free memory'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.2021.4.6.0]'
          key: 'host.memory.free[memAvailReal.0]'
          delay: '{$SNS.SNMP.INTERVAL}'
          value_type: FLOAT
          units: B
          description: |
            MIB: UCD-SNMP-MIB
            Free memory in bytes.
          preprocessing:
            - type: MULTIPLIER
              parameters:
                - '1000'
          tags:
            - tag: component
              value: memory
        - uuid: d3c0c7c5bc54493398327d0d6b5f546a
          name: 'Total memory'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.2021.4.5.0]'
          key: 'host.memory.total[memTotalReal.0]'
          delay: '{$SNS.SNMP.INTERVAL}'
          units: B
          description: |
            MIB: UCD-SNMP-MIB
            Total physical memory (RAM) installed in bytes.
          preprocessing:
            - type: MULTIPLIER
              parameters:
                - '1000'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          tags:
            - tag: component
              value: memory
        - uuid: 5a51165096db494ba71c909aa04528be
          name: 'Used memory'
          type: CALCULATED
          key: host.memory.used
          value_type: FLOAT
          units: B
          params: '(last(//host.memory.total[memTotalReal.0]))-(last(//host.memory.available))'
          description: 'Used memory in bytes.'
          tags:
            - tag: component
              value: memory
        - uuid: c5cab917e3834f4691b8961bc8d7156d
          name: 'Memory utilization'
          type: CALCULATED
          key: host.memory.utilization
          units: '%'
          params: '(last(//host.memory.used)/last(//host.memory.total[memTotalReal.0]))*100'
          description: 'Memory utilization in %.'
          tags:
            - tag: component
              value: memory
          triggers:
            - uuid: aefdc86298f3437d8b16233515818d16
              expression: 'min(/Stormshield SNS by SNMP/host.memory.utilization,5m)>{$SNS.MEMORY.UTIL.MAX}'
              name: 'SNS: High memory utilization'
              event_name: 'SNS: High memory utilization (>{$SNS.MEMORY.UTIL.MAX}% for 5m)'
              priority: AVERAGE
              description: 'The system is running out of free memory.'
              tags:
                - tag: scope
                  value: capacity
                - tag: scope
                  value: performance
        - uuid: 3d1ab35757d446a3931e8104089e014d
          name: 'ICMP ping'
          type: SIMPLE
          key: icmpping
          description: |
            Host accessibility by ICMP.
            0 - ICMP ping failed.
            1 - ICMP ping successful.
          valuemap:
            name: 'Service state'
          tags:
            - tag: component
              value: health
            - tag: component
              value: network
          triggers:
            - uuid: ab962296020f44f08f1bd8eacce24723
              expression: 'max(/Stormshield SNS by SNMP/icmpping,#3)=0'
              name: 'SNS: Unavailable by ICMP ping'
              priority: HIGH
              description: 'Last three attempts returned timeout. Please check device connectivity.'
              tags:
                - tag: scope
                  value: availability
        - uuid: f2aabf4cde2d4f109e2de2b7c2db3db8
          name: 'ICMP loss'
          type: SIMPLE
          key: icmppingloss
          value_type: FLOAT
          units: '%'
          description: 'Percentage of lost packets.'
          tags:
            - tag: component
              value: health
            - tag: component
              value: network
          triggers:
            - uuid: 02dfe125bff5452f8916962a407b0975
              expression: 'min(/Stormshield SNS by SNMP/icmppingloss,5m)>{$SNS.ICMP.LOSS.WARN} and min(/Stormshield SNS by SNMP/icmppingloss,5m)<100'
              name: 'SNS: High ICMP ping loss'
              priority: WARNING
              description: 'ICMP ping loss detected.'
              dependencies:
                - name: 'SNS: Unavailable by ICMP ping'
                  expression: 'max(/Stormshield SNS by SNMP/icmpping,#3)=0'
              tags:
                - tag: scope
                  value: availability
                - tag: scope
                  value: performance
        - uuid: 67b9296c12284844844ac2da201946d3
          name: 'ICMP response time'
          type: SIMPLE
          key: icmppingsec
          value_type: FLOAT
          units: s
          description: 'ICMP ping response time (in seconds).'
          tags:
            - tag: component
              value: health
            - tag: component
              value: network
          triggers:
            - uuid: f4de52338acf4e4baf91c328688bb0ab
              expression: 'avg(/Stormshield SNS by SNMP/icmppingsec,5m)>{$SNS.ICMP.RESPONSE.TIME.WARN}'
              name: 'SNS: High ICMP ping response time'
              priority: WARNING
              description: 'Average ICMP response time is too high.'
              dependencies:
                - name: 'SNS: High ICMP ping loss'
                  expression: 'min(/Stormshield SNS by SNMP/icmppingloss,5m)>{$SNS.ICMP.LOSS.WARN} and min(/Stormshield SNS by SNMP/icmppingloss,5m)<100'
                - name: 'SNS: Unavailable by ICMP ping'
                  expression: 'max(/Stormshield SNS by SNMP/icmpping,#3)=0'
              tags:
                - tag: scope
                  value: availability
                - tag: scope
                  value: performance
        - uuid: ef452e74af2e470bb5f5eea1b6180567
          name: 'VPN: Incoming policies'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.11256.1.13.1.1.0]'
          key: 'ipsec.policies.in[snsIPSECStatsSPDIn.0]'
          delay: '{$SNS.SNMP.INTERVAL}'
          description: |
            MIB: STORMSHIELD-IPSEC-STATS-MIB
            Number of incoming security policies.
          tags:
            - tag: component
              value: policy
            - tag: component
              value: vpn
        - uuid: 0ca1adf24df84b67bfa7324885ccf3e4
          name: 'VPN: Outgoing policies'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.11256.1.13.1.2.0]'
          key: 'ipsec.policies.out[snsIPSECStatsSPDOut.0]'
          delay: '{$SNS.SNMP.INTERVAL}'
          description: |
            MIB: STORMSHIELD-IPSEC-STATS-MIB
            Number of outgoing security policies.
          tags:
            - tag: component
              value: policy
            - tag: component
              value: vpn
        - uuid: e220854737454a1e80f0bfbb1064cfc4
          name: 'Active filtering policy name'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.11256.1.8.1.1.3.1]'
          key: 'policy.filter[snsPolicySlotName]'
          delay: '{$SNS.SNMP.INTERVAL}'
          value_type: CHAR
          description: |
            MIB: STORMSHIELD-POLICY-MIB
            Active filtering policy name.
          preprocessing:
            - type: NOT_MATCHES_REGEX
              parameters:
                - ^$
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 6h
          tags:
            - tag: component
              value: policy
        - uuid: 7c2bc4cbe7384538bb15a479a2b73151
          name: 'Active IPsec policy name'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.11256.1.8.1.1.3.2]'
          key: 'policy.ipsec[snsPolicySlotNameIPsec]'
          delay: '{$SNS.SNMP.INTERVAL}'
          value_type: CHAR
          description: |
            MIB: STORMSHIELD-POLICY-MIB
            Active IPsec policy name.
          preprocessing:
            - type: NOT_MATCHES_REGEX
              parameters:
                - ^$
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 6h
          tags:
            - tag: component
              value: policy
        - uuid: e4c3c5803ec2484e92abd589798b5c69
          name: Model
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.11256.1.0.1.0]'
          key: 'property.hardware.model[snsModel.0]'
          delay: '{$SNS.SNMP.INTERVAL}'
          value_type: CHAR
          description: |
            MIB: STORMSHIELD-PROPERTY-MIB
            Firewall model.
          preprocessing:
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 6h
          tags:
            - tag: component
              value: hardware
        - uuid: 079208ed1d684585863ab7f142b6e70d
          name: 'System name'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.11256.1.18.4.0]'
          key: 'property.hardware.name[snsSystemName.0]'
          delay: '{$SNS.SNMP.INTERVAL}'
          value_type: CHAR
          description: |
            MIB: STORMSHIELD-PROPERTY-MIB
            Stormshield Firewall system name.
          tags:
            - tag: component
              value: hardware
          triggers:
            - uuid: 15f4897a3e544effbfc99ce75a8e9d7a
              expression: 'last(/Stormshield SNS by SNMP/property.hardware.name[snsSystemName.0],#1)<>last(/Stormshield SNS by SNMP/property.hardware.name[snsSystemName.0],#2) and length(last(/Stormshield SNS by SNMP/property.hardware.name[snsSystemName.0]))>0'
              name: 'SNS: System name has changed'
              event_name: 'SNS: System name has changed (new name: {ITEM.VALUE})'
              priority: INFO
              description: 'The name of the system has changed. Acknowledge to close the problem manually.'
              manual_close: 'YES'
              tags:
                - tag: scope
                  value: notice
                - tag: scope
                  value: security
        - uuid: 2ff5ef13ef154f56b4ab1b964afe17b7
          name: 'System node name'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.11256.1.18.16.0]'
          key: 'property.hardware.node_name[snsSystemNodeName.0]'
          delay: '{$SNS.SNMP.INTERVAL}'
          value_type: CHAR
          description: |
            MIB: STORMSHIELD-PROPERTY-MIB
            Stormshield Firewall system node name.
          preprocessing:
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 6h
          tags:
            - tag: component
              value: hardware
        - uuid: 437da1f0d02849569ef252800b95ff53
          name: 'Serial number'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.11256.1.0.3.0]'
          key: 'property.hardware.serial[snsSerialNumber.0]'
          delay: '{$SNS.SNMP.INTERVAL}'
          value_type: CHAR
          description: |
            MIB: STORMSHIELD-PROPERTY-MIB
            Stormshield Firewall serial number.
          tags:
            - tag: component
              value: hardware
          triggers:
            - uuid: 4220ad1db8134603958030547495591c
              expression: 'last(/Stormshield SNS by SNMP/property.hardware.serial[snsSerialNumber.0],#1)<>last(/Stormshield SNS by SNMP/property.hardware.serial[snsSerialNumber.0],#2) and length(last(/Stormshield SNS by SNMP/property.hardware.serial[snsSerialNumber.0]))>0'
              name: 'SNS: Device has been replaced'
              event_name: 'SNS: Device has been replaced (new serial number received)'
              priority: INFO
              description: 'Device serial number has changed. Acknowledge to close the problem manually.'
              manual_close: 'YES'
              tags:
                - tag: scope
                  value: notice
        - uuid: e80718fcb8534828abc87998911931cd
          name: Version
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.11256.1.0.2.0]'
          key: 'property.hardware.version[snsVersion.0]'
          delay: '{$SNS.SNMP.INTERVAL}'
          value_type: CHAR
          description: |
            MIB: STORMSHIELD-PROPERTY-MIB
            Stormshield Firewall version.
          preprocessing:
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 6h
          tags:
            - tag: component
              value: hardware
        - uuid: 2582b2562a514db782e2eaf71c81ac93
          name: 'SNMP traps (fallback)'
          type: SNMP_TRAP
          key: snmptrap.fallback
          value_type: LOG
          description: 'Used for collecting all SNMP traps unmatched by other `snmptrap` items.'
          tags:
            - tag: component
              value: network
        - uuid: af3ce032c24e4f55b86e98ad2a5e7726
          name: 'SNMP walk CPU temperature'
          type: SNMP_AGENT
          snmp_oid: 'walk[1.3.6.1.4.1.11256.1.10.7.1]'
          key: sns.cpu.temp.walk
          delay: '{$SNS.SNMP.INTERVAL}'
          history: '0'
          value_type: TEXT
          description: 'Used for discovering CPU temperature from the Stormshield MIB.'
          tags:
            - tag: component
              value: raw
        - uuid: 95ccc4d528f74321bafa41b5e575b458
          name: 'SNMP walk CPU usage'
          type: SNMP_AGENT
          snmp_oid: 'walk[1.3.6.1.2.1.25.3.3.1]'
          key: sns.cpu.usage.walk
          delay: '{$SNS.SNMP.INTERVAL}'
          history: '0'
          value_type: TEXT
          description: 'Used for discovering CPU usage from the HOST-RESOURCES-MIB.'
          tags:
            - tag: component
              value: raw
        - uuid: deab9f5bf0ee4e3bbfc9a3238d1aa04a
          name: 'SNMP walk disk'
          type: SNMP_AGENT
          snmp_oid: 'walk[1.3.6.1.4.1.11256.1.10.5.1]'
          key: sns.disk.walk
          delay: '{$SNS.SNMP.INTERVAL}'
          history: '0'
          value_type: TEXT
          description: 'Used for discovering disks from the Stormshield MIB.'
          tags:
            - tag: component
              value: raw
        - uuid: 4fe3286ec83043818baada4d5db6b264
          name: 'SNMP walk fan'
          type: SNMP_AGENT
          snmp_oid: 'walk[1.3.6.1.4.1.11256.1.10.9.1]'
          key: sns.fan.walk
          delay: '{$SNS.SNMP.INTERVAL}'
          history: '0'
          value_type: TEXT
          description: 'Used for discovering fans from the Stormshield MIB.'
          tags:
            - tag: component
              value: raw
        - uuid: f54b159bee384956ab4f92af6f5ce947
          name: 'SNMP walk HA members'
          type: SNMP_AGENT
          snmp_oid: 'walk[1.3.6.1.4.1.11256.1.11.7.1]'
          key: sns.ha.members.walk
          delay: '{$SNS.SNMP.INTERVAL}'
          history: '0'
          value_type: TEXT
          description: 'Used for discovering HA members from the Stormshield MIB.'
          tags:
            - tag: component
              value: raw
        - uuid: e7492893d8ff4bf7981a3fe6ee4f8ddc
          name: 'SNMP walk health'
          type: SNMP_AGENT
          snmp_oid: 'walk[1.3.6.1.4.1.11256.1.16.2.1]'
          key: sns.health.walk
          delay: '{$SNS.SNMP.INTERVAL}'
          history: '0'
          value_type: TEXT
          description: 'Used for discovering health status from the Stormshield MIB.'
          tags:
            - tag: component
              value: raw
        - uuid: 4ee4c13cd9fa482faecf88f67eed0dc2
          name: 'SNMP walk memory'
          type: SNMP_AGENT
          snmp_oid: 'walk[1.3.6.1.4.1.11256.1.10.10.1]'
          key: sns.memory.util.walk
          delay: '{$SNS.SNMP.INTERVAL}'
          history: '0'
          value_type: TEXT
          description: 'Used for discovering system memory utilization from the STORMSHIELD-SYSTEM-MONITOR-MIB.'
          tags:
            - tag: component
              value: raw
        - uuid: 70868b549569460b8e293a2c20123779
          name: 'SNMP walk network interfaces'
          type: SNMP_AGENT
          snmp_oid: 'walk[1.3.6.1.4.1.11256.1.4.1.1]'
          key: sns.net.if.walk
          delay: '{$SNS.SNMP.INTERVAL}'
          history: '0'
          value_type: TEXT
          description: 'Used for discovering network interfaces from the Stormshield MIB.'
          tags:
            - tag: component
              value: raw
        - uuid: df01ada741ee489cad6282fce353b660
          name: 'SNMP walk power supply'
          type: SNMP_AGENT
          snmp_oid: 'walk[1.3.6.1.4.1.11256.1.10.6.1]'
          key: sns.psu.walk
          delay: '{$SNS.SNMP.INTERVAL}'
          history: '0'
          value_type: TEXT
          description: 'Used for discovering the power supply from the Stormshield MIB.'
          tags:
            - tag: component
              value: raw
        - uuid: 2296efb070324644bd699e1d1f96c262
          name: 'SNMP walk storage'
          type: SNMP_AGENT
          snmp_oid: 'walk[1.3.6.1.2.1.25.2.3.1.2,1.3.6.1.2.1.25.2.3.1.3,1.3.6.1.2.1.25.2.3.1.5,1.3.6.1.2.1.25.2.3.1.6]'
          key: sns.storage.walk
          delay: '{$SNS.SNMP.INTERVAL}'
          history: '0'
          value_type: TEXT
          description: 'Used for discovering storage from the HOST-RESOURCES-MIB.'
          tags:
            - tag: component
              value: raw
        - uuid: 5d468c2d00d84fb39ba8f03e6c89c7a5
          name: 'SNMP walk autoupdate'
          type: SNMP_AGENT
          snmp_oid: 'walk[1.3.6.1.4.1.11256.1.9.1.1]'
          key: sns.update.auto.walk
          delay: '{$SNS.SNMP.INTERVAL}'
          history: '0'
          value_type: TEXT
          description: 'Used for discovering updates from the Stormshield MIB.'
          tags:
            - tag: component
              value: raw
        - uuid: 921c52d6d3884b10bdd3f3fa73c392d8
          name: Date
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.11256.1.10.1.0]'
          key: 'system.date[snsDate.0]'
          delay: '{$SNS.SNMP.INTERVAL}'
          value_type: CHAR
          description: |
            MIB: STORMSHIELD-SYSTEM-MONITOR-MIB
            Stormshield Firewall current date (%Y-%m-%d %T).
          tags:
            - tag: component
              value: system
        - uuid: e48ced68e7584aeaacde9995d8d0c634
          name: Uptime
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.11256.1.10.2.0]'
          key: 'system.hardware.uptime[snsUptime.0]'
          delay: '{$SNS.SNMP.INTERVAL}'
          value_type: FLOAT
          units: uptime
          description: |
            MIB: STORMSHIELD-SYSTEM-MONITOR-MIB
            Stormshield Firewall uptime.
          preprocessing:
            - type: JAVASCRIPT
              parameters:
                - |
                  function toTimestamp(value) {
                  	var parts = value.split(":");
                  
                  	var d = parseInt(parts[0], 10);
                  	var h = parseInt(parts[1], 10);
                  	var mi = parseInt(parts[2], 10);
                  	var s = parseInt(parts[3], 10);
                  
                  	if ([d, h, mi, s].some(isNaN)) return 0;
                  
                  	return (d*86400+h*3600+mi*60+s);
                  }
                  
                  return toTimestamp(value);
          tags:
            - tag: component
              value: hardware
          triggers:
            - uuid: baf8de16b11b4f408c7a34869ebf53b8
              expression: 'last(/Stormshield SNS by SNMP/system.hardware.uptime[snsUptime.0])<10m'
              name: 'SNS: Device has been restarted'
              event_name: 'SNS: {HOST.NAME} has been restarted (uptime < 10m)'
              priority: INFO
              description: 'Uptime is less than 10 minutes.'
              tags:
                - tag: scope
                  value: notice
        - uuid: 97be1dab5f934083bcc112c7ca5ab440
          name: 'ASQ connection memory utilization'
          type: DEPENDENT
          key: 'system.memory.conn[snsMemConn.0]'
          units: '%'
          description: |
            MIB: STORMSHIELD-SYSTEM-MONITOR-MIB
            Utilization percentage of ASQ connection memory.
            
            Warning: This OID might not be functional for SNS versions lower than 5.0.
          preprocessing:
            - type: SNMP_WALK_VALUE
              parameters:
                - 1.3.6.1.4.1.11256.1.10.10.1.5.0
                - '0'
              error_handler: DISCARD_VALUE
          master_item:
            key: sns.memory.util.walk
          tags:
            - tag: component
              value: memory
        - uuid: cd8b2605feb8410ab871a393128c89bb
          name: 'Data tracking memory utilization'
          type: DEPENDENT
          key: 'system.memory.data_track[snsMemDataTrack.0]'
          units: '%'
          description: |
            MIB: STORMSHIELD-SYSTEM-MONITOR-MIB
            Utilization percentage of data tracking memory.
            
            Warning: This OID might not be functional for SNS versions lower than 5.0.
          preprocessing:
            - type: SNMP_WALK_VALUE
              parameters:
                - 1.3.6.1.4.1.11256.1.10.10.1.7.0
                - '0'
              error_handler: DISCARD_VALUE
          master_item:
            key: sns.memory.util.walk
          tags:
            - tag: component
              value: memory
        - uuid: 442f3113a21d4041964eeb3a37c9db94
          name: 'Etherstate connection memory utilization'
          type: DEPENDENT
          key: 'system.memory.ether[snsMemEther.0]'
          units: '%'
          description: |
            MIB: STORMSHIELD-SYSTEM-MONITOR-MIB
            Utilization percentage of etherstate connection memory.
            
            Warning: This OID might not be functional for SNS versions lower than 5.0.
          preprocessing:
            - type: SNMP_WALK_VALUE
              parameters:
                - 1.3.6.1.4.1.11256.1.10.10.1.6.0
                - '0'
              error_handler: DISCARD_VALUE
          master_item:
            key: sns.memory.util.walk
          tags:
            - tag: component
              value: memory
        - uuid: 99aafd4514434990ae54bbfabb28057e
          name: 'Fragment memory utilization'
          type: DEPENDENT
          key: 'system.memory.frag[snsMemFrag.0]'
          units: '%'
          description: |
            MIB: STORMSHIELD-SYSTEM-MONITOR-MIB
            Fragment memory utilization percentage.
            
            Warning: This OID might not be functional for SNS versions lower than 5.0.
          preprocessing:
            - type: SNMP_WALK_VALUE
              parameters:
                - 1.3.6.1.4.1.11256.1.10.10.1.3.0
                - '0'
              error_handler: DISCARD_VALUE
          master_item:
            key: sns.memory.util.walk
          tags:
            - tag: component
              value: memory
        - uuid: 686ed185b40e433892951539d3305a4d
          name: 'Protected host memory utilization'
          type: DEPENDENT
          key: 'system.memory.host[snsMemHost.0]'
          units: '%'
          description: |
            MIB: STORMSHIELD-SYSTEM-MONITOR-MIB
            Protected host memory utilization percentage.
            
            Warning: This OID might not be functional for SNS versions lower than 5.0.
          preprocessing:
            - type: SNMP_WALK_VALUE
              parameters:
                - 1.3.6.1.4.1.11256.1.10.10.1.2.0
                - '0'
              error_handler: DISCARD_VALUE
          master_item:
            key: sns.memory.util.walk
          tags:
            - tag: component
              value: memory
        - uuid: 80a0a595776d461384e12834b7f43098
          name: 'ICMP memory utilization'
          type: DEPENDENT
          key: 'system.memory.icmp[snsMemIcmp.0]'
          units: '%'
          description: |
            MIB: STORMSHIELD-SYSTEM-MONITOR-MIB
            ICMP memory utilization percentage.
            
            Warning: This OID might not be functional for SNS versions lower than 5.0.
          preprocessing:
            - type: SNMP_WALK_VALUE
              parameters:
                - 1.3.6.1.4.1.11256.1.10.10.1.4.0
                - '0'
              error_handler: DISCARD_VALUE
          master_item:
            key: sns.memory.util.walk
          tags:
            - tag: component
              value: memory
        - uuid: 86300acc41ba4a84b947ff9e24360083
          name: 'Socket memory utilization'
          type: DEPENDENT
          key: 'system.memory.mbuf[snsMemMbuf.0]'
          units: '%'
          description: |
            MIB: STORMSHIELD-SYSTEM-MONITOR-MIB
            Socket memory utilization percentage.
            
            Warning: This OID might not be functional for SNS versions lower than 5.0.
          preprocessing:
            - type: SNMP_WALK_VALUE
              parameters:
                - 1.3.6.1.4.1.11256.1.10.10.1.10.0
                - '0'
              error_handler: DISCARD_VALUE
          master_item:
            key: sns.memory.util.walk
          tags:
            - tag: component
              value: memory
        - uuid: f3cab29a36104841bb8215d65eabe8bb
          name: 'System memory utilization'
          type: DEPENDENT
          key: 'system.memory.system[snsMemSystem.0]'
          units: '%'
          description: |
            MIB: STORMSHIELD-SYSTEM-MONITOR-MIB
            Current memory utilization percentage.
            
            Warning: This OID might not be functional for SNS versions lower than 5.0.
          preprocessing:
            - type: SNMP_WALK_VALUE
              parameters:
                - 1.3.6.1.4.1.11256.1.10.10.1.8.0
                - '0'
              error_handler: DISCARD_VALUE
          master_item:
            key: sns.memory.util.walk
          tags:
            - tag: component
              value: memory
        - uuid: 56a9edbf6b0a4f0b95d3a5388cce4aad
          name: 'User memory utilization'
          type: DEPENDENT
          key: 'system.memory.user[snsMemUser.0]'
          units: '%'
          description: |
            MIB: STORMSHIELD-SYSTEM-MONITOR-MIB
            User-space memory utilization percentage.
            
            Warning: This OID might not be functional for SNS versions lower than 5.0.
          preprocessing:
            - type: SNMP_WALK_VALUE
              parameters:
                - 1.3.6.1.4.1.11256.1.10.10.1.9.0
                - '0'
              error_handler: DISCARD_VALUE
          master_item:
            key: sns.memory.util.walk
          tags:
            - tag: component
              value: memory
        - uuid: b079600b3bbe455c9b64ac1a474a4c9a
          name: 'VPN: Number of dead VPN tunnels'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.11256.1.13.2.4.0]'
          key: 'vpn.tunnel.dead[snsIPSECStatsSADDead.0]'
          delay: '{$SNS.SNMP.INTERVAL}'
          description: |
            MIB: STORMSHIELD-IPSEC-STATS-MIB
            Number of dead security associations.
          tags:
            - tag: component
              value: vpn
        - uuid: 277fd3430bff4ee79d61a2b87609d075
          name: 'VPN: Number of dying VPN tunnels'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.11256.1.13.2.3.0]'
          key: 'vpn.tunnel.dying[snsIPSECStatsSADDying.0]'
          delay: '{$SNS.SNMP.INTERVAL}'
          description: |
            MIB: STORMSHIELD-IPSEC-STATS-MIB
            Number of security associations at end of life.
          tags:
            - tag: component
              value: vpn
        - uuid: bd0aa23c91f74d8f98a479c106bc37c4
          name: 'VPN: Number of mature VPN tunnels'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.11256.1.13.2.2.0]'
          key: 'vpn.tunnel.mature[snsIPSECStatsSADMature.0]'
          delay: '{$SNS.SNMP.INTERVAL}'
          description: |
            MIB: STORMSHIELD-IPSEC-STATS-MIB
            Number of established security associations.
          tags:
            - tag: component
              value: vpn
        - uuid: fdbf9cb6403846d98c6f9c3bd51a5c47
          name: 'SNMP agent availability'
          type: INTERNAL
          key: 'zabbix[host,snmp,available]'
          description: |
            Availability of SNMP checks on the host. The value of this item corresponds to the availability icons in the host list.
            Possible values:
            0 - not available
            1 - available
            2 - unknown.
          valuemap:
            name: 'Host availability'
          tags:
            - tag: component
              value: health
            - tag: component
              value: network
          triggers:
            - uuid: e300402891ea46be8cfd697d3936a339
              expression: 'max(/Stormshield SNS by SNMP/zabbix[host,snmp,available],{$SNS.SNMP.TIMEOUT})=0'
              name: 'SNS: No SNMP data collection'
              priority: WARNING
              description: 'SNMP is not available for polling. Please check device connectivity and SNMP settings.'
              dependencies:
                - name: 'SNS: Unavailable by ICMP ping'
                  expression: 'max(/Stormshield SNS by SNMP/icmpping,#3)=0'
              tags:
                - tag: scope
                  value: availability
      discovery_rules:
        - uuid: 2fc5de70139442aebc59a445a4abee21
          name: 'CPU temperature discovery'
          type: DEPENDENT
          key: cpu.temperature.discovery
          description: 'Used for discovering the CPU temperature from the Stormshield MIB.'
          item_prototypes:
            - uuid: ff474617c5024f369d6612278215632b
              name: 'CPU [{#CPU_ID}]: Temperature'
              type: DEPENDENT
              key: 'system.cpu.temperature[snsCpuTemp.{#SNMPINDEX}]'
              units: °C
              description: |
                MIB: STORMSHIELD-SYSTEM-MONITOR-MIB
                Temperature in degrees Celsius.
              preprocessing:
                - type: SNMP_WALK_VALUE
                  parameters:
                    - '1.3.6.1.4.1.11256.1.10.7.1.2.{#SNMPINDEX}'
                    - '0'
              master_item:
                key: sns.cpu.temp.walk
              tags:
                - tag: component
                  value: CPU
          graph_prototypes:
            - uuid: 3009cfbebcea42289116107645cc08ea
              name: 'SNS: CPU [{#CPU_ID}]: Temperature degrees in celsius'
              graph_items:
                - color: 1A7C11
                  calc_fnc: ALL
                  item:
                    host: 'Stormshield SNS by SNMP'
                    key: 'system.cpu.temperature[snsCpuTemp.{#SNMPINDEX}]'
          master_item:
            key: sns.cpu.temp.walk
          preprocessing:
            - type: SNMP_WALK_TO_JSON
              parameters:
                - '{#CPU_ID}'
                - 1.3.6.1.4.1.11256.1.10.7.1.1
                - '0'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
        - uuid: 94e616ac778d476897743bc0cd065572
          name: 'CPU usage discovery'
          type: DEPENDENT
          key: cpu.usage.discovery
          description: 'Used for discovering the CPU usage from the Stormshield MIB.'
          item_prototypes:
            - uuid: e9ea57097a134d7f8541200e533d4039
              name: 'CPU [{#SNMPINDEX}]: Usage'
              type: DEPENDENT
              key: 'system.cpu.usage[hrProcessorLoad.{#SNMPINDEX}]'
              value_type: FLOAT
              units: '%'
              description: |
                MIB: HOST-RESOURCES-MIB
                The average percentage of time that this processor was not idle over the last minute.
                Implementations may approximate this one minute smoothing period if necessary.
                Note that cpu 196608 = cpu 0, 196609 = 1, ...
              preprocessing:
                - type: SNMP_WALK_VALUE
                  parameters:
                    - '1.3.6.1.2.1.25.3.3.1.2.{#SNMPINDEX}'
                    - '0'
              master_item:
                key: sns.cpu.usage.walk
              tags:
                - tag: component
                  value: CPU
              trigger_prototypes:
                - uuid: b5196431336b42b08b0beab3208c19de
                  expression: 'min(/Stormshield SNS by SNMP/system.cpu.usage[hrProcessorLoad.{#SNMPINDEX}],5m)>{$SNS.CPU.UTIL.CRIT}'
                  name: 'SNS: CPU [{#SNMPINDEX}]: CPU utilization too high'
                  event_name: 'SNS: CPU utilization too high (over {$SNS.CPU.UTIL.CRIT}% for 5m)'
                  opdata: 'Current utilization: {ITEM.LASTVALUE1}'
                  priority: HIGH
                  description: 'The CPU utilization is too high. The system might be slow to respond.'
                  tags:
                    - tag: scope
                      value: availability
                - uuid: 889712b67ab549eaa8e76370d20dcddd
                  expression: 'min(/Stormshield SNS by SNMP/system.cpu.usage[hrProcessorLoad.{#SNMPINDEX}],5m)>{$SNS.CPU.UTIL.WARN}'
                  name: 'SNS: CPU [{#SNMPINDEX}]: High CPU utilization'
                  event_name: 'SNS: High CPU utilization (over {$SNS.CPU.UTIL.WARN}% for 5m)'
                  priority: WARNING
                  description: 'The CPU utilization is high. The system might be slow to respond.'
                  dependencies:
                    - name: 'SNS: CPU [{#SNMPINDEX}]: CPU utilization too high'
                      expression: 'min(/Stormshield SNS by SNMP/system.cpu.usage[hrProcessorLoad.{#SNMPINDEX}],5m)>{$SNS.CPU.UTIL.CRIT}'
                  tags:
                    - tag: scope
                      value: availability
          graph_prototypes:
            - uuid: f5eebe195e3141019a1dace85415cf23
              name: 'SNS: CPU [{#SNMPINDEX}]: Usage in %'
              graph_items:
                - color: 1A7C11
                  calc_fnc: ALL
                  item:
                    host: 'Stormshield SNS by SNMP'
                    key: 'system.cpu.usage[hrProcessorLoad.{#SNMPINDEX}]'
          master_item:
            key: sns.cpu.usage.walk
          preprocessing:
            - type: SNMP_WALK_TO_JSON
              parameters:
                - '{#CPU_ID}'
                - 1.3.6.1.2.1.25.3.3.1.1
                - '0'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
        - uuid: 205bfdee322c49bfb35bd718620425e1
          name: 'Disk discovery'
          type: DEPENDENT
          key: disk.discovery
          description: 'Used for discovering disks from the Stormshield MIB.'
          item_prototypes:
            - uuid: d0c7739d80ca41d793827d2e1bc726c0
              name: 'Disk [{#DISK_ID}]: Disk name'
              type: DEPENDENT
              key: 'system.disk.name[snsDiskEntryDiskName.{#SNMPINDEX}]'
              value_type: CHAR
              description: |
                MIB: STORMSHIELD-SYSTEM-MONITOR-MIB
                Name of the disk.
              preprocessing:
                - type: SNMP_WALK_VALUE
                  parameters:
                    - '1.3.6.1.4.1.11256.1.10.5.1.2.{#SNMPINDEX}'
                    - '0'
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 6h
              master_item:
                key: sns.disk.walk
              tags:
                - tag: component
                  value: system
            - uuid: 91a7e52635df431b9ef03323c86cf342
              name: 'Disk [{#DISK_ID}]: Member of a RAID array'
              type: DEPENDENT
              key: 'system.disk.RAID[snsDiskEntryIsRaid.{#SNMPINDEX}]'
              trends: '0'
              description: |
                MIB: STORMSHIELD-SYSTEM-MONITOR-MIB
                Indicates whether the disk is part of a RAID array.
              valuemap:
                name: 'STORMSHIELD-SYSTEM-MONITOR-MIB::snsDiskEntryIsRaid'
              preprocessing:
                - type: SNMP_WALK_VALUE
                  parameters:
                    - '1.3.6.1.4.1.11256.1.10.5.1.4.{#SNMPINDEX}'
                    - '0'
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: sns.disk.walk
              tags:
                - tag: component
                  value: system
            - uuid: 18bd74399fd54991ad7de633f33bc5a6
              name: 'Disk [{#DISK_ID}]: SMART info test result'
              type: DEPENDENT
              key: 'system.disk.result[snsDiskEntrySmartResult.{#SNMPINDEX}]'
              description: |
                MIB: STORMSHIELD-SYSTEM-MONITOR-MIB
                Result of the SMART diagnostic tests.
              valuemap:
                name: 'STORMSHIELD-SYSTEM-MONITOR-MIB::snsDiskEntrySmartResult'
              preprocessing:
                - type: SNMP_WALK_VALUE
                  parameters:
                    - '1.3.6.1.4.1.11256.1.10.5.1.3.{#SNMPINDEX}'
                    - '0'
                - type: JAVASCRIPT
                  parameters:
                    - |
                      const idx = {
                      	'passed': 1,
                      	'failed': 2
                      };
                      
                      return typeof idx[value.toLowerCase()] === 'undefined' ? 0 : idx[value.toLowerCase()];
              master_item:
                key: sns.disk.walk
              tags:
                - tag: component
                  value: system
            - uuid: 3ed28b431dd24952b07378a51e3adb69
              name: 'Disk [{#DISK_ID}]: RAID status'
              type: DEPENDENT
              key: 'system.disk.status[snsDiskEntryRaidStatus.{#SNMPINDEX}]'
              description: |
                MIB: STORMSHIELD-SYSTEM-MONITOR-MIB
                RAID status.
              valuemap:
                name: 'STORMSHIELD-SYSTEM-MONITOR-MIB::snsDiskEntryRaidStatus'
              preprocessing:
                - type: SNMP_WALK_VALUE
                  parameters:
                    - '1.3.6.1.4.1.11256.1.10.5.1.5.{#SNMPINDEX}'
                    - '0'
                - type: JAVASCRIPT
                  parameters:
                    - |
                      const idx = {
                      	'degraded': 1,
                      	'missing': 2,
                      	'optimal': 3
                      };
                      
                      return typeof idx[value.toLowerCase()] === 'undefined' ? 0 : idx[value.toLowerCase()];
              master_item:
                key: sns.disk.walk
              tags:
                - tag: component
                  value: system
          master_item:
            key: sns.disk.walk
          preprocessing:
            - type: SNMP_WALK_TO_JSON
              parameters:
                - '{#DISK_ID}'
                - 1.3.6.1.4.1.11256.1.10.5.1.1
                - '0'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
        - uuid: 98ffa94f4d634dd9a43711c7c2aecd88
          name: 'Fan discovery'
          type: DEPENDENT
          key: fan.discovery
          description: 'Used for discovering the fan from the Stormshield MIB.'
          item_prototypes:
            - uuid: 6773438fe2934437be8444414b2dd725
              name: 'Fan [{#FAN_ID}]: Fan name'
              type: DEPENDENT
              key: 'system.fan.name[snsFanName.{#SNMPINDEX}]'
              value_type: CHAR
              description: |
                MIB: STORMSHIELD-SYSTEM-MONITOR-MIB
                Name of the fan.
              preprocessing:
                - type: SNMP_WALK_VALUE
                  parameters:
                    - '1.3.6.1.4.1.11256.1.10.9.1.2.{#SNMPINDEX}'
                    - '0'
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 6h
              master_item:
                key: sns.fan.walk
              tags:
                - tag: component
                  value: system
            - uuid: 333faca808f948fc99bc2f54f58c7658
              name: 'Fan [{#FAN_ID}]: Fan speed'
              type: DEPENDENT
              key: 'system.fan.speed[snsFanRpm.{#SNMPINDEX}]'
              units: '!rpm'
              description: |
                MIB: STORMSHIELD-SYSTEM-MONITOR-MIB
                Speed of the fan.
              preprocessing:
                - type: SNMP_WALK_VALUE
                  parameters:
                    - '1.3.6.1.4.1.11256.1.10.9.1.4.{#SNMPINDEX}'
                    - '0'
              master_item:
                key: sns.fan.walk
              tags:
                - tag: component
                  value: system
            - uuid: f6d54e9b53b14c179208e25f11d91c17
              name: 'Fan [{#FAN_ID}]: Fan status'
              type: DEPENDENT
              key: 'system.fan.status[snsFanStatus.{#SNMPINDEX}]'
              description: |
                MIB: STORMSHIELD-SYSTEM-MONITOR-MIB
                Status of the fan.
              valuemap:
                name: 'STORMSHIELD-SYSTEM-MONITOR-MIB::snsFanStatus'
              preprocessing:
                - type: SNMP_WALK_VALUE
                  parameters:
                    - '1.3.6.1.4.1.11256.1.10.9.1.3.{#SNMPINDEX}'
                    - '0'
                - type: JAVASCRIPT
                  parameters:
                    - |
                      const idx = {
                      	'failure': 1,
                      	'running': 2,
                      };
                      
                      return typeof idx[value.toLowerCase()] === 'undefined' ? 0 : idx[value.toLowerCase()];
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: sns.fan.walk
              tags:
                - tag: component
                  value: system
          master_item:
            key: sns.fan.walk
          preprocessing:
            - type: SNMP_WALK_TO_JSON
              parameters:
                - '{#FAN_ID}'
                - 1.3.6.1.4.1.11256.1.10.9.1.1
                - '0'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
        - uuid: f467d602ecf6428b8e270d2847d029ae
          name: 'HA members discovery'
          type: DEPENDENT
          key: ha.members.discovery
          description: 'Used for discovering HA members from the Stormshield MIB.'
          item_prototypes:
            - uuid: b8cd8cf98e31467d8f9f76255b99b67b
              name: 'HA members [{#HA_ID}]: Firewall active/passive'
              type: DEPENDENT
              key: 'ha.active[snsHAActive.{#SNMPINDEX}]'
              description: |
                MIB: STORMSHIELD-HA-MIB
                Indicates whether the firewall is active.
              preprocessing:
                - type: SNMP_WALK_VALUE
                  parameters:
                    - '1.3.6.1.4.1.11256.1.11.7.1.10.{#SNMPINDEX}'
                    - '0'
              master_item:
                key: sns.ha.members.walk
              tags:
                - tag: component
                  value: ha
            - uuid: 0f1f82c877a545749006e96e41e3eec5
              name: 'HA members [{#HA_ID}]: HA licence'
              type: DEPENDENT
              key: 'ha.license[snsHALicence.{#SNMPINDEX}]'
              description: |
                MIB: STORMSHIELD-HA-MIB
                HA licence.
              valuemap:
                name: 'STORMSHIELD-HA-MIB::snsHALicence'
              preprocessing:
                - type: SNMP_WALK_VALUE
                  parameters:
                    - '1.3.6.1.4.1.11256.1.11.7.1.6.{#SNMPINDEX}'
                    - '0'
                - type: JAVASCRIPT
                  parameters:
                    - |
                      const idx = {
                      	'slave': 1,
                      	'master': 2
                      };
                      
                      return typeof idx[value.toLowerCase()] === 'undefined' ? 0 : idx[value.toLowerCase()];
              master_item:
                key: sns.ha.members.walk
              tags:
                - tag: component
                  value: ha
            - uuid: 49c2856094884edfaf1a8aabe9f5695d
              name: 'HA members [{#HA_ID}]: Firewall model'
              type: DEPENDENT
              key: 'ha.model[snsModel.{#SNMPINDEX}]'
              value_type: CHAR
              description: |
                MIB: STORMSHIELD-HA-MIB
                Firewall model.
              preprocessing:
                - type: SNMP_WALK_VALUE
                  parameters:
                    - '1.3.6.1.4.1.11256.1.11.7.1.4.{#SNMPINDEX}'
                    - '0'
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 6h
              master_item:
                key: sns.ha.members.walk
              tags:
                - tag: component
                  value: ha
            - uuid: 6acd9f4e764046558918dea106f15cc2
              name: 'HA members [{#HA_ID}]: Is online'
              type: DEPENDENT
              key: 'ha.online[snsOnline.{#SNMPINDEX}]'
              description: |
                MIB: STORMSHIELD-HA-MIB
                Firewall is online.
              valuemap:
                name: 'STORMSHIELD-HA-MIB::snsOnline'
              preprocessing:
                - type: SNMP_WALK_VALUE
                  parameters:
                    - '1.3.6.1.4.1.11256.1.11.7.1.3.{#SNMPINDEX}'
                    - '0'
              master_item:
                key: sns.ha.members.walk
              tags:
                - tag: component
                  value: ha
            - uuid: 025487d110d945b79e1fb7450b7a2de2
              name: 'HA members [{#HA_ID}]: HA priority'
              type: DEPENDENT
              key: 'ha.priority[snsHAPriority.{#SNMPINDEX}]'
              description: |
                MIB: STORMSHIELD-HA-MIB
                HA priority.
              preprocessing:
                - type: SNMP_WALK_VALUE
                  parameters:
                    - '1.3.6.1.4.1.11256.1.11.7.1.8.{#SNMPINDEX}'
                    - '0'
              master_item:
                key: sns.ha.members.walk
              tags:
                - tag: component
                  value: ha
            - uuid: f1799047cb354bf38b9ff737206f60db
              name: 'HA members [{#HA_ID}]: HA quality'
              type: DEPENDENT
              key: 'ha.quality[snsHAQuality.{#SNMPINDEX}]'
              description: |
                MIB: STORMSHIELD-HA-MIB
                HA quality.
              preprocessing:
                - type: SNMP_WALK_VALUE
                  parameters:
                    - '1.3.6.1.4.1.11256.1.11.7.1.7.{#SNMPINDEX}'
                    - '0'
              master_item:
                key: sns.ha.members.walk
              tags:
                - tag: component
                  value: ha
            - uuid: d2c5605f753646779e010830401c74e4
              name: 'HA members [{#HA_ID}]: Firewall serial'
              type: DEPENDENT
              key: 'ha.serial[snsFwSerial.{#SNMPINDEX}]'
              value_type: CHAR
              description: |
                MIB: STORMSHIELD-HA-MIB
                Firewall serial number.
              preprocessing:
                - type: SNMP_WALK_VALUE
                  parameters:
                    - '1.3.6.1.4.1.11256.1.11.7.1.2.{#SNMPINDEX}'
                    - '0'
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 6h
              master_item:
                key: sns.ha.members.walk
              tags:
                - tag: component
                  value: ha
            - uuid: 364ebaf569d14b0ab26998fab81ae368
              name: 'HA members [{#HA_ID}]: Firewall status'
              type: DEPENDENT
              key: 'ha.status[snsHAStatusForced.{#SNMPINDEX}]'
              description: |
                MIB: STORMSHIELD-HA-MIB
                HA status forced:
                  -2: Unknown forced status
                  -1: No peer found
                  0: No forced status
                  1: Forced active
                  2: Forced passive
              valuemap:
                name: 'STORMSHIELD-HA-MIB::snsHAStatusForced'
              preprocessing:
                - type: SNMP_WALK_VALUE
                  parameters:
                    - '1.3.6.1.4.1.11256.1.11.7.1.9.{#SNMPINDEX}'
                    - '0'
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: sns.ha.members.walk
              tags:
                - tag: component
                  value: ha
            - uuid: 333309281fa74231a2276b6b2af0edf5
              name: 'HA members [{#HA_ID}]: Firewall uptime'
              type: DEPENDENT
              key: 'ha.uptime[snsHAUptime.{#SNMPINDEX}]'
              value_type: FLOAT
              units: uptime
              description: |
                MIB: STORMSHIELD-HA-MIB
                Firewall uptime.
              preprocessing:
                - type: SNMP_WALK_VALUE
                  parameters:
                    - '1.3.6.1.4.1.11256.1.11.7.1.11.{#SNMPINDEX}'
                    - '0'
              master_item:
                key: sns.ha.members.walk
              tags:
                - tag: component
                  value: ha
          master_item:
            key: sns.ha.members.walk
          preprocessing:
            - type: SNMP_WALK_TO_JSON
              parameters:
                - '{#HA_ID}'
                - 1.3.6.1.4.1.11256.1.11.7.1.1
                - '0'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
        - uuid: eb1bbc3d5f2545b29a20ec6fe7d04265
          name: 'Health status discovery'
          type: DEPENDENT
          key: health.discovery
          description: 'Used for discovering the health status from the Stormshield MIB.'
          item_prototypes:
            - uuid: b595804c6b4c420f9520aed3a0cd034b
              name: 'Health status firewall [{#HEALTH_ID}]: Certificates'
              type: DEPENDENT
              key: 'health.certificates.status[snsCertHealth.{#SNMPINDEX}]'
              description: |
                MIB: STORMSHIELD-HEALTH-MONITOR-MIB
                Current health status of Stormshield Firewall.
              valuemap:
                name: 'STORMSHIELD-HEALTH-MONITOR-MIB::*'
              preprocessing:
                - type: SNMP_WALK_VALUE
                  parameters:
                    - '1.3.6.1.4.1.11256.1.16.2.1.11.{#SNMPINDEX}'
                    - '0'
                - type: JAVASCRIPT
                  parameters:
                    - |
                      const idx = {
                      	'n/a': 1,
                      	'none': 2,
                      	'active': 3,
                      	'passive': 4,
                      	'major': 5,
                      	'minor': 6,
                      	'good': 7
                      };
                      
                      return typeof idx[value.toLowerCase()] === 'undefined' ? 0 : idx[value.toLowerCase()];
              master_item:
                key: sns.health.walk
              tags:
                - tag: component
                  value: health
            - uuid: 1642f7cde504440eb8a90506074010eb
              name: 'Health status firewall [{#HEALTH_ID}]: CPU'
              type: DEPENDENT
              key: 'health.cpu.status[snsCpuHealth.{#SNMPINDEX}]'
              description: |
                MIB: STORMSHIELD-HEALTH-MONITOR-MIB
                Current health status of Stormshield Firewall CPU:
                  - `Good` if CPU load is 90% or lower
                  - `Minor` if CPU load is above 90% for less than 5 minutes
                  - `Major` if CPU load is above 90% for more than 5 minutes
              valuemap:
                name: 'STORMSHIELD-HEALTH-MONITOR-MIB::*'
              preprocessing:
                - type: SNMP_WALK_VALUE
                  parameters:
                    - '1.3.6.1.4.1.11256.1.16.2.1.7.{#SNMPINDEX}'
                    - '0'
                - type: JAVASCRIPT
                  parameters:
                    - |
                      const idx = {
                      	'n/a': 1,
                      	'none': 2,
                      	'active': 3,
                      	'passive': 4,
                      	'major': 5,
                      	'minor': 6,
                      	'good': 7
                      };
                      
                      return typeof idx[value.toLowerCase()] === 'undefined' ? 0 : idx[value.toLowerCase()];
              master_item:
                key: sns.health.walk
              tags:
                - tag: component
                  value: health
            - uuid: a726528c1db14fefb41eb9ec3b76f2e1
              name: 'Health status firewall [{#HEALTH_ID}]: CPU temperature'
              type: DEPENDENT
              key: 'health.cpu.temperature[snsCpuTempHealth.{#SNMPINDEX}]'
              description: |
                MIB: STORMSHIELD-HEALTH-MONITOR-MIB
                Current health status of Stormshield Firewall CPU temperature:
                  - `Good`; at least 20°C below max temperature
                  - `Minor`; less than 20°C below max temperature
                  - `Major`; 5°C below max temperature
              valuemap:
                name: 'STORMSHIELD-HEALTH-MONITOR-MIB::*'
              preprocessing:
                - type: SNMP_WALK_VALUE
                  parameters:
                    - '1.3.6.1.4.1.11256.1.16.2.1.15.{#SNMPINDEX}'
                    - '0'
                - type: JAVASCRIPT
                  parameters:
                    - |
                      const idx = {
                      	'n/a': 1,
                      	'none': 2,
                      	'active': 3,
                      	'passive': 4,
                      	'major': 5,
                      	'minor': 6,
                      	'good': 7
                      };
                      
                      return typeof idx[value.toLowerCase()] === 'undefined' ? 0 : idx[value.toLowerCase()];
              master_item:
                key: sns.health.walk
              tags:
                - tag: component
                  value: health
              trigger_prototypes:
                - uuid: d2480be0a3d44a89bc27f3560bbe1e77
                  expression: 'last(/Stormshield SNS by SNMP/health.cpu.temperature[snsCpuTempHealth.{#SNMPINDEX}])=5'
                  name: 'SNS: Health status firewall [{#HEALTH_ID}]: CPU is overheating'
                  event_name: 'SNS: The CPU is overheating'
                  priority: HIGH
                  description: 'The CPU is not working correctly and has raised an alarm.'
                  tags:
                    - tag: scope
                      value: availability
            - uuid: 9ace914f22e64f27b974bcfb6076a78c
              name: 'Health status firewall [{#HEALTH_ID}]: CRLs'
              type: DEPENDENT
              key: 'health.crl.status[snsCRLHealth.{#SNMPINDEX}]'
              description: |
                MIB: STORMSHIELD-HEALTH-MONITOR-MIB
                Current health status of Stormshield firewall CRLs.
              valuemap:
                name: 'STORMSHIELD-HEALTH-MONITOR-MIB::*'
              preprocessing:
                - type: SNMP_WALK_VALUE
                  parameters:
                    - '1.3.6.1.4.1.11256.1.16.2.1.12.{#SNMPINDEX}'
                    - '0'
                - type: JAVASCRIPT
                  parameters:
                    - |
                      const idx = {
                      	'n/a': 1,
                      	'none': 2,
                      	'active': 3,
                      	'passive': 4,
                      	'major': 5,
                      	'minor': 6,
                      	'good': 7
                      };
                      
                      return typeof idx[value.toLowerCase()] === 'undefined' ? 0 : idx[value.toLowerCase()];
              master_item:
                key: sns.health.walk
              tags:
                - tag: component
                  value: health
            - uuid: 34219ae916b849f0b1c7dec26f153694
              name: 'Health status firewall [{#HEALTH_ID}]: Disk'
              type: DEPENDENT
              key: 'health.disk.status[snsDiskHealth.{#SNMPINDEX}]'
              description: |
                MIB: STORMSHIELD-HEALTH-MONITOR-MIB
                Current health status of Stormshield Firewall disk:
                  - `Good` if the disks are working correctly
                  - `Minor` if the disks are not working correctly
                  - `Major` if the disks are not working correctly and have raised an alarm
              valuemap:
                name: 'STORMSHIELD-HEALTH-MONITOR-MIB::*'
              preprocessing:
                - type: SNMP_WALK_VALUE
                  parameters:
                    - '1.3.6.1.4.1.11256.1.16.2.1.9.{#SNMPINDEX}'
                    - '0'
                - type: JAVASCRIPT
                  parameters:
                    - |
                      const idx = {
                      	'n/a': 1,
                      	'none': 2,
                      	'active': 3,
                      	'passive': 4,
                      	'major': 5,
                      	'minor': 6,
                      	'good': 7
                      };
                      
                      return typeof idx[value.toLowerCase()] === 'undefined' ? 0 : idx[value.toLowerCase()];
              master_item:
                key: sns.health.walk
              tags:
                - tag: component
                  value: health
              trigger_prototypes:
                - uuid: f9403a9d6f354c32ae42c719e8f2f4df
                  expression: 'last(/Stormshield SNS by SNMP/health.disk.status[snsDiskHealth.{#SNMPINDEX}])=5'
                  name: 'SNS: Health status firewall [{#HEALTH_ID}]: The disk is not working correctly'
                  event_name: 'SNS: The disk is not working correctly'
                  priority: HIGH
                  description: 'The disks are not working correctly and have raised an alarm.'
                  tags:
                    - tag: scope
                      value: availability
            - uuid: 6b1b1a042fb040b6a7aaaa29b7666b9d
              name: 'Health status firewall [{#HEALTH_ID}]: Fans'
              type: DEPENDENT
              key: 'health.fan.status[snsFanHealth.{#SNMPINDEX}]'
              description: |
                MIB: STORMSHIELD-HEALTH-MONITOR-MIB
                Current health status of Stormshield Firewall fans:
                  - `Good` if the fans are working correctly
                  - `Minor` if the fans are not working correctly
                  - `Major` if the fans are not working correctly and have raised an alarm
              valuemap:
                name: 'STORMSHIELD-HEALTH-MONITOR-MIB::*'
              preprocessing:
                - type: SNMP_WALK_VALUE
                  parameters:
                    - '1.3.6.1.4.1.11256.1.16.2.1.6.{#SNMPINDEX}'
                    - '0'
                - type: JAVASCRIPT
                  parameters:
                    - |
                      const idx = {
                      	'n/a': 1,
                      	'none': 2,
                      	'active': 3,
                      	'passive': 4,
                      	'major': 5,
                      	'minor': 6,
                      	'good': 7
                      };
                      
                      return typeof idx[value.toLowerCase()] === 'undefined' ? 0 : idx[value.toLowerCase()];
              master_item:
                key: sns.health.walk
              tags:
                - tag: component
                  value: health
              trigger_prototypes:
                - uuid: 925e62403192466b9e5d79340fff7f18
                  expression: 'last(/Stormshield SNS by SNMP/health.fan.status[snsFanHealth.{#SNMPINDEX}])=5'
                  name: 'SNS: Health status firewall [{#HEALTH_ID}]: The fan is not working correctly'
                  event_name: 'SNS: The fan is not working correctly'
                  priority: AVERAGE
                  description: 'The fans are not working correctly and have raised an alarm.'
                  tags:
                    - tag: scope
                      value: availability
            - uuid: 26ed671f5dc641e8abee510e05f4f351
              name: 'Health status firewall [{#HEALTH_ID}]: HA link'
              type: DEPENDENT
              key: 'health.ha.link.status[snsHaLinkHealth.{#SNMPINDEX}]'
              description: |
                MIB: STORMSHIELD-HEALTH-MONITOR-MIB
                Current health status of Stormshield Firewall HA link:
                  - `Good` if the HA link is working correctly
                  - `Minor` if the HA link is not working correctly (may be down)
                  - `Major` if the HA link is not working (is down)
              valuemap:
                name: 'STORMSHIELD-HEALTH-MONITOR-MIB::*'
              preprocessing:
                - type: SNMP_WALK_VALUE
                  parameters:
                    - '1.3.6.1.4.1.11256.1.16.2.1.4.{#SNMPINDEX}'
                    - '0'
                - type: JAVASCRIPT
                  parameters:
                    - |
                      const idx = {
                      	'n/a': 1,
                      	'none': 2,
                      	'active': 3,
                      	'passive': 4,
                      	'major': 5,
                      	'minor': 6,
                      	'good': 7
                      };
                      
                      return typeof idx[value.toLowerCase()] === 'undefined' ? 0 : idx[value.toLowerCase()];
              master_item:
                key: sns.health.walk
              tags:
                - tag: component
                  value: health
              trigger_prototypes:
                - uuid: a8a3b2d803b64242a68c5dd66fdc7b38
                  expression: 'last(/Stormshield SNS by SNMP/health.ha.link.status[snsHaLinkHealth.{#SNMPINDEX}])=5'
                  name: 'SNS: Health status firewall [{#HEALTH_ID}]: HA link is down'
                  event_name: 'SNS: HA link is down'
                  priority: HIGH
                  description: 'The HA link is not working (is down).'
                  tags:
                    - tag: scope
                      value: availability
            - uuid: 219821bed46641cbbdf3270e3529e3fd
              name: 'Health status firewall [{#HEALTH_ID}]: HA mode'
              type: DEPENDENT
              key: 'health.ha.mode.status[snsHaModeHealth.{#SNMPINDEX}]'
              description: |
                MIB: STORMSHIELD-HEALTH-MONITOR-MIB
                Current status of Stormshield Firewall HA mode:
                  - `None` if HA is not active
                  - `Active` if the firewall is the active status
                  - `Passive` if the firewall is the passive status
              valuemap:
                name: 'STORMSHIELD-HEALTH-MONITOR-MIB::*'
              preprocessing:
                - type: SNMP_WALK_VALUE
                  parameters:
                    - '1.3.6.1.4.1.11256.1.16.2.1.3.{#SNMPINDEX}'
                    - '0'
                - type: JAVASCRIPT
                  parameters:
                    - |
                      const idx = {
                      	'n/a': 1,
                      	'none': 2,
                      	'active': 3,
                      	'passive': 4,
                      	'major': 5,
                      	'minor': 6,
                      	'good': 7
                      };
                      
                      return typeof idx[value.toLowerCase()] === 'undefined' ? 0 : idx[value.toLowerCase()];
              master_item:
                key: sns.health.walk
              tags:
                - tag: component
                  value: health
            - uuid: 149b3ce5f5f649789395b08ff794a66e
              name: 'Health status firewall [{#HEALTH_ID}]: Memory'
              type: DEPENDENT
              key: 'health.memory.status[snsMemHealth.{#SNMPINDEX}]'
              description: |
                MIB: STORMSHIELD-HEALTH-MONITOR-MIB
                Current health status of Stormshield Firewall memory:
                  - `Good` if memory load is 80% or lower
                  - `Minor` if memory load is above 80% for less than 15 minutes
                  - `Major` if memory load is above 80% for more than 15 minutes
              valuemap:
                name: 'STORMSHIELD-HEALTH-MONITOR-MIB::*'
              preprocessing:
                - type: SNMP_WALK_VALUE
                  parameters:
                    - '1.3.6.1.4.1.11256.1.16.2.1.8.{#SNMPINDEX}'
                    - '0'
                - type: JAVASCRIPT
                  parameters:
                    - |
                      const idx = {
                      	'n/a': 1,
                      	'none': 2,
                      	'active': 3,
                      	'passive': 4,
                      	'major': 5,
                      	'minor': 6,
                      	'good': 7
                      };
                      
                      return typeof idx[value.toLowerCase()] === 'undefined' ? 0 : idx[value.toLowerCase()];
              master_item:
                key: sns.health.walk
              tags:
                - tag: component
                  value: health
            - uuid: 3c96db8dddb148478a58c6261a06a2d8
              name: 'Health status firewall [{#HEALTH_ID}]: Admin password'
              type: DEPENDENT
              key: 'health.password.status[snsPasswdHealth.{#SNMPINDEX}]'
              description: |
                MIB: STORMSHIELD-HEALTH-MONITOR-MIB
                Current health status of Stormshield Firewall Admin Password:
                  - `Good` if the date when the admin password was last changed is less than a year ago
                  - `Minor` if the date when the admin password was last changed is more than a year ago
                  - `Major` if the admin password is the default password
              valuemap:
                name: 'STORMSHIELD-HEALTH-MONITOR-MIB::*'
              preprocessing:
                - type: SNMP_WALK_VALUE
                  parameters:
                    - '1.3.6.1.4.1.11256.1.16.2.1.14.{#SNMPINDEX}'
                    - '0'
                - type: JAVASCRIPT
                  parameters:
                    - |
                      const idx = {
                      	'n/a': 1,
                      	'none': 2,
                      	'active': 3,
                      	'passive': 4,
                      	'major': 5,
                      	'minor': 6,
                      	'good': 7
                      };
                      
                      return typeof idx[value.toLowerCase()] === 'undefined' ? 0 : idx[value.toLowerCase()];
              master_item:
                key: sns.health.walk
              tags:
                - tag: component
                  value: health
              trigger_prototypes:
                - uuid: 1eb323d145f246b48b0ca194b29f3638
                  expression: 'last(/Stormshield SNS by SNMP/health.password.status[snsPasswdHealth.{#SNMPINDEX}])=5'
                  name: 'SNS: Health status firewall [{#HEALTH_ID}]: Admin password is not secured'
                  event_name: 'SNS: Admin password is not secured'
                  priority: HIGH
                  description: 'The admin password is the default password; please change it.'
                  tags:
                    - tag: scope
                      value: notice
            - uuid: db9d21f5b3fb42abbe8a6c776fd1a269
              name: 'Health status firewall [{#HEALTH_ID}]: Power supply'
              type: DEPENDENT
              key: 'health.power.status[snsPowerSupplyHealth.{#SNMPINDEX}]'
              description: |
                MIB: STORMSHIELD-HEALTH-MONITOR-MIB
                Current health status of Stormshield Firewall power supply:
                  - `Good` if the power supply is working correctly
                  - `Minor` if the power supply is not working correctly
                  - `Major` if the power supply is not working correctly and has raised an alarm.
              valuemap:
                name: 'STORMSHIELD-HEALTH-MONITOR-MIB::*'
              preprocessing:
                - type: SNMP_WALK_VALUE
                  parameters:
                    - '1.3.6.1.4.1.11256.1.16.2.1.5.{#SNMPINDEX}'
                    - '0'
                - type: JAVASCRIPT
                  parameters:
                    - |
                      const idx = {
                      	'n/a': 1,
                      	'none': 2,
                      	'active': 3,
                      	'passive': 4,
                      	'major': 5,
                      	'minor': 6,
                      	'good': 7
                      };
                      
                      return typeof idx[value.toLowerCase()] === 'undefined' ? 0 : idx[value.toLowerCase()];
              master_item:
                key: sns.health.walk
              tags:
                - tag: component
                  value: health
              trigger_prototypes:
                - uuid: 816a07c6a4ca4da7990a5d345a17a4cb
                  expression: 'last(/Stormshield SNS by SNMP/health.power.status[snsPowerSupplyHealth.{#SNMPINDEX}])=5'
                  name: 'SNS: Health status firewall [{#HEALTH_ID}]: The power supply is not working correctly'
                  event_name: 'SNS: The power supply is not working correctly'
                  priority: HIGH
                  description: 'The power supply is not working correctly and has raised an alarm.'
                  tags:
                    - tag: scope
                      value: availability
            - uuid: 5e6662ef9c5940cb972547886413a5e2
              name: 'Health status firewall [{#HEALTH_ID}]: RAID'
              type: DEPENDENT
              key: 'health.raid.status[snsRaidHealth.{#SNMPINDEX}]'
              description: |
                MIB: STORMSHIELD-HEALTH-MONITOR-MIB
                Current health status of Stormshield Firewall RAID:
                  - `Good` if the RAID is working in optimal mode
                  - `Minor` if the RAID is not working in optimal mode
                  - `Major` if the RAID is not working in optimal mode and has raised an alarm
              valuemap:
                name: 'STORMSHIELD-HEALTH-MONITOR-MIB::*'
              preprocessing:
                - type: SNMP_WALK_VALUE
                  parameters:
                    - '1.3.6.1.4.1.11256.1.16.2.1.10.{#SNMPINDEX}'
                    - '0'
                - type: JAVASCRIPT
                  parameters:
                    - |
                      const idx = {
                      	'n/a': 1,
                      	'none': 2,
                      	'active': 3,
                      	'passive': 4,
                      	'major': 5,
                      	'minor': 6,
                      	'good': 7
                      };
                      
                      return typeof idx[value.toLowerCase()] === 'undefined' ? 0 : idx[value.toLowerCase()];
              master_item:
                key: sns.health.walk
              tags:
                - tag: component
                  value: health
              trigger_prototypes:
                - uuid: 305c5ab2338349efad3bedcda622922d
                  expression: 'last(/Stormshield SNS by SNMP/health.raid.status[snsRaidHealth.{#SNMPINDEX}])=5'
                  name: 'SNS: Health status firewall [{#HEALTH_ID}]: The RAID is not working correctly'
                  event_name: 'SNS: The RAID is not working correctly'
                  priority: AVERAGE
                  description: 'The RAID is not working in optimal mode and has raised an alarm.'
                  tags:
                    - tag: scope
                      value: availability
          master_item:
            key: sns.health.walk
          preprocessing:
            - type: SNMP_WALK_TO_JSON
              parameters:
                - '{#HEALTH_ID}'
                - 1.3.6.1.4.1.11256.1.16.2.1.1
                - '0'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
        - uuid: 3d44b2c118aa49cf84db72090d56386d
          name: 'Network interface discovery'
          type: DEPENDENT
          key: network.discovery
          filter:
            evaltype: AND
            conditions:
              - macro: '{#IF_NAME}'
                value: '{$SNS.NET.IF.IFNAME.MATCHES}'
              - macro: '{#IF_NAME}'
                value: '{$SNS.NET.IF.IFNAME.NOT_MATCHES}'
                operator: NOT_MATCHES_REGEX
          description: 'Used for discovering network interfaces from the Stormshield MIB.'
          item_prototypes:
            - uuid: 2856ed811ce94fcdb7e1f0a53ee137dd
              name: 'Interface [{#IF_NAME}]: Accepted packets'
              type: DEPENDENT
              key: 'net.if.accepted[snsifPktAccepted.{#SNMPINDEX}]'
              description: |
                MIB: STORMSHIELD-IF-MIB
                Number of accepted packets.
              preprocessing:
                - type: SNMP_WALK_VALUE
                  parameters:
                    - '1.3.6.1.4.1.11256.1.4.1.1.11.{#SNMPINDEX}'
                    - '0'
              master_item:
                key: sns.net.if.walk
              tags:
                - tag: component
                  value: network
                - tag: interface
                  value: '{#IF_NAME}'
            - uuid: 6c8fa9e6b6c844c1a0e6cc459e113a2d
              name: 'Interface [{#IF_NAME}]: Blocked packets'
              type: DEPENDENT
              key: 'net.if.blocked[snsifPktBlocked.{#SNMPINDEX}]'
              description: |
                MIB: STORMSHIELD-IF-MIB
                Number of packets that have been blocked.
              preprocessing:
                - type: SNMP_WALK_VALUE
                  parameters:
                    - '1.3.6.1.4.1.11256.1.4.1.1.12.{#SNMPINDEX}'
                    - '0'
              master_item:
                key: sns.net.if.walk
              tags:
                - tag: component
                  value: network
                - tag: interface
                  value: '{#IF_NAME}'
            - uuid: 0f09154ae902486480f851250c97eef6
              name: 'Interface [{#IF_NAME}]: TCP connection established'
              type: DEPENDENT
              key: 'net.if.established[snsifTcpConn.{#SNMPINDEX}]'
              description: |
                MIB: STORMSHIELD-IF-MIB
                TCP connection established.
              preprocessing:
                - type: SNMP_WALK_VALUE
                  parameters:
                    - '1.3.6.1.4.1.11256.1.4.1.1.21.{#SNMPINDEX}'
                    - '0'
              master_item:
                key: sns.net.if.walk
              tags:
                - tag: component
                  value: network
                - tag: interface
                  value: '{#IF_NAME}'
            - uuid: f5c0c2563007456b8499e54ccfb40f5c
              name: 'Interface [{#IF_NAME}]: UDP connection established'
              type: DEPENDENT
              key: 'net.if.established[snsifUdpConn.{#SNMPINDEX}]'
              description: |
                MIB: STORMSHIELD-IF-MIB
                UDP connection established.
              preprocessing:
                - type: SNMP_WALK_VALUE
                  parameters:
                    - '1.3.6.1.4.1.11256.1.4.1.1.22.{#SNMPINDEX}'
                    - '0'
              master_item:
                key: sns.net.if.walk
              tags:
                - tag: component
                  value: network
                - tag: interface
                  value: '{#IF_NAME}'
            - uuid: 22e48329645347aab3ea9d4e59020522
              name: 'Interface [{#IF_NAME}]: Max input flow rate'
              type: DEPENDENT
              key: 'net.if.in.max[snsifInMaxThroughput.{#SNMPINDEX}]'
              units: Bps
              description: |
                MIB: STORMSHIELD-IF-MIB
                Maximum incoming throughput in B/s.
              preprocessing:
                - type: SNMP_WALK_VALUE
                  parameters:
                    - '1.3.6.1.4.1.11256.1.4.1.1.27.{#SNMPINDEX}'
                    - '0'
              master_item:
                key: sns.net.if.walk
              tags:
                - tag: component
                  value: network
                - tag: interface
                  value: '{#IF_NAME}'
            - uuid: 9ff9c28639d64ab8bbb3fdf923af6674
              name: 'Interface [{#IF_NAME}]: Incoming current throughput'
              type: DEPENDENT
              key: 'net.if.in[snsifInCurThroughput.{#SNMPINDEX}]'
              units: bps
              description: |
                MIB: STORMSHIELD-IF-MIB
                Current incoming throughput in B/s.
              preprocessing:
                - type: SNMP_WALK_VALUE
                  parameters:
                    - '1.3.6.1.4.1.11256.1.4.1.1.25.{#SNMPINDEX}'
                    - '0'
              master_item:
                key: sns.net.if.walk
              tags:
                - tag: component
                  value: network
                - tag: interface
                  value: '{#IF_NAME}'
            - uuid: d8a307f9d7de43a69715603bc3d5234f
              name: 'Interface [{#IF_NAME}]: Incoming TCP data bytes'
              type: DEPENDENT
              key: 'net.if.in[snsifInTcpBytes.{#SNMPINDEX}]'
              units: B
              description: |
                MIB: STORMSHIELD-IF-MIB
                Incoming TCP data bytes.
              preprocessing:
                - type: SNMP_WALK_VALUE
                  parameters:
                    - '1.3.6.1.4.1.11256.1.4.1.1.31.{#SNMPINDEX}'
                    - '0'
              master_item:
                key: sns.net.if.walk
              tags:
                - tag: component
                  value: network
                - tag: interface
                  value: '{#IF_NAME}'
            - uuid: 9217cb7c112d4fc3bfdccacb665f17a0
              name: 'Interface [{#IF_NAME}]: Incoming data bytes'
              type: DEPENDENT
              key: 'net.if.in[snsifInTotalBytes.{#SNMPINDEX}]'
              units: B
              description: |
                MIB: STORMSHIELD-IF-MIB
                Incoming data bytes.
              preprocessing:
                - type: SNMP_WALK_VALUE
                  parameters:
                    - '1.3.6.1.4.1.11256.1.4.1.1.29.{#SNMPINDEX}'
                    - '0'
              master_item:
                key: sns.net.if.walk
              tags:
                - tag: component
                  value: network
                - tag: interface
                  value: '{#IF_NAME}'
            - uuid: f7d9c2ee246d4e228572bbb26f9fc6a9
              name: 'Interface [{#IF_NAME}]: Incoming UDP data bytes'
              type: DEPENDENT
              key: 'net.if.in[snsifInUdpBytes.{#SNMPINDEX}]'
              units: B
              description: |
                MIB: STORMSHIELD-IF-MIB
                Incoming UDP data bytes.
              preprocessing:
                - type: SNMP_WALK_VALUE
                  parameters:
                    - '1.3.6.1.4.1.11256.1.4.1.1.33.{#SNMPINDEX}'
                    - '0'
              master_item:
                key: sns.net.if.walk
              tags:
                - tag: component
                  value: network
                - tag: interface
                  value: '{#IF_NAME}'
            - uuid: 3658031cb71f49db9d8165a2ccc362e5
              name: 'Interface [{#IF_NAME}]: Max output flow rate'
              type: DEPENDENT
              key: 'net.if.max_out[snsifOutMaxThroughput.{#SNMPINDEX}]'
              units: Bps
              description: |
                MIB: STORMSHIELD-IF-MIB
                Maximum outgoing throughput in B/s.
              preprocessing:
                - type: SNMP_WALK_VALUE
                  parameters:
                    - '1.3.6.1.4.1.11256.1.4.1.1.28.{#SNMPINDEX}'
                    - '0'
              master_item:
                key: sns.net.if.walk
              tags:
                - tag: component
                  value: network
                - tag: interface
                  value: '{#IF_NAME}'
            - uuid: e18aa78ed6cc4445a80aa663d302efda
              name: 'Interface [{#IF_NAME}]: System interface name'
              type: DEPENDENT
              key: 'net.if.name[snsifName.{#SNMPINDEX}]'
              value_type: CHAR
              description: |
                MIB: STORMSHIELD-IF-MIB
                System interface name.
              preprocessing:
                - type: SNMP_WALK_VALUE
                  parameters:
                    - '1.3.6.1.4.1.11256.1.4.1.1.3.{#SNMPINDEX}'
                    - '0'
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 6h
              master_item:
                key: sns.net.if.walk
              tags:
                - tag: component
                  value: network
                - tag: interface
                  value: '{#IF_NAME}'
            - uuid: b08262d794224dd596f475f839309369
              name: 'Interface [{#IF_NAME}]: Outgoing current throughput'
              type: DEPENDENT
              key: 'net.if.out[snsifOutCurThroughput.{#SNMPINDEX}]'
              units: bps
              description: |
                MIB: STORMSHIELD-IF-MIB
                Current outgoing throughput in B/s.
              preprocessing:
                - type: SNMP_WALK_VALUE
                  parameters:
                    - '1.3.6.1.4.1.11256.1.4.1.1.26.{#SNMPINDEX}'
                    - '0'
              master_item:
                key: sns.net.if.walk
              tags:
                - tag: component
                  value: network
                - tag: interface
                  value: '{#IF_NAME}'
            - uuid: 8c79eda2435c4333b18150006825e32d
              name: 'Interface [{#IF_NAME}]: Outgoing TCP data bytes'
              type: DEPENDENT
              key: 'net.if.out[snsifOutTcpBytes.{#SNMPINDEX}]'
              units: B
              description: |
                MIB: STORMSHIELD-IF-MIB
                Outgoing TCP data bytes.
              preprocessing:
                - type: SNMP_WALK_VALUE
                  parameters:
                    - '1.3.6.1.4.1.11256.1.4.1.1.32.{#SNMPINDEX}'
                    - '0'
              master_item:
                key: sns.net.if.walk
              tags:
                - tag: component
                  value: network
                - tag: interface
                  value: '{#IF_NAME}'
            - uuid: e2017818401f4cb6badd3d1ef1027f87
              name: 'Interface [{#IF_NAME}]: Outgoing data bytes'
              type: DEPENDENT
              key: 'net.if.out[snsifOutTotalBytes.{#SNMPINDEX}]'
              units: B
              description: |
                MIB: STORMSHIELD-IF-MIB
                Outgoing data bytes.
              preprocessing:
                - type: SNMP_WALK_VALUE
                  parameters:
                    - '1.3.6.1.4.1.11256.1.4.1.1.30.{#SNMPINDEX}'
                    - '0'
              master_item:
                key: sns.net.if.walk
              tags:
                - tag: component
                  value: network
                - tag: interface
                  value: '{#IF_NAME}'
            - uuid: 0edacb02864046b799966b8f0eb3222f
              name: 'Interface [{#IF_NAME}]: Outgoing UDP data bytes'
              type: DEPENDENT
              key: 'net.if.out[snsifOutUdpBytes.{#SNMPINDEX}]'
              units: B
              description: |
                MIB: STORMSHIELD-IF-MIB
                Outgoing UDP data bytes.
              preprocessing:
                - type: SNMP_WALK_VALUE
                  parameters:
                    - '1.3.6.1.4.1.11256.1.4.1.1.34.{#SNMPINDEX}'
                    - '0'
              master_item:
                key: sns.net.if.walk
              tags:
                - tag: component
                  value: network
                - tag: interface
                  value: '{#IF_NAME}'
            - uuid: 2d6d2437279c4373b3c400f47b225be5
              name: 'Interface [{#IF_NAME}]: Interface protected'
              type: DEPENDENT
              key: 'net.if.protected[snsifProtected.{#SNMPINDEX}]'
              description: |
                MIB: STORMSHIELD-IF-MIB
                Indicates whether the interface is protected.
              preprocessing:
                - type: SNMP_WALK_VALUE
                  parameters:
                    - '1.3.6.1.4.1.11256.1.4.1.1.37.{#SNMPINDEX}'
                    - '0'
              master_item:
                key: sns.net.if.walk
              tags:
                - tag: component
                  value: network
                - tag: interface
                  value: '{#IF_NAME}'
            - uuid: 24d06317e62d443aab02954cc1ef13f8
              name: 'Interface [{#IF_NAME}]: Current TCP connection count'
              type: DEPENDENT
              key: 'net.if.TCP_count[snsifTcpConnCount.{#SNMPINDEX}]'
              description: |
                MIB: STORMSHIELD-IF-MIB
                Current TCP connection count.
              preprocessing:
                - type: SNMP_WALK_VALUE
                  parameters:
                    - '1.3.6.1.4.1.11256.1.4.1.1.23.{#SNMPINDEX}'
                    - '0'
              master_item:
                key: sns.net.if.walk
              tags:
                - tag: component
                  value: network
                - tag: interface
                  value: '{#IF_NAME}'
            - uuid: cd41efc0083b4b1da6771ee8489c6631
              name: 'Interface [{#IF_NAME}]: Current UDP connection count'
              type: DEPENDENT
              key: 'net.if.UDP_count[snsifUdpConnCount.{#SNMPINDEX}]'
              description: |
                MIB: STORMSHIELD-IF-MIB
                Current UDP connection count.
              preprocessing:
                - type: SNMP_WALK_VALUE
                  parameters:
                    - '1.3.6.1.4.1.11256.1.4.1.1.24.{#SNMPINDEX}'
                    - '0'
              master_item:
                key: sns.net.if.walk
              tags:
                - tag: component
                  value: network
                - tag: interface
                  value: '{#IF_NAME}'
          graph_prototypes:
            - uuid: e4ab949e8b4d4fe09aab03740e12864d
              name: 'SNS: Interface [{#IF_NAME}]: Network traffic'
              graph_items:
                - color: 1A7C11
                  calc_fnc: ALL
                  item:
                    host: 'Stormshield SNS by SNMP'
                    key: 'net.if.in[snsifInTotalBytes.{#SNMPINDEX}]'
                - sortorder: '1'
                  color: '274482'
                  calc_fnc: ALL
                  item:
                    host: 'Stormshield SNS by SNMP'
                    key: 'net.if.out[snsifOutTotalBytes.{#SNMPINDEX}]'
                - sortorder: '2'
                  color: F63100
                  calc_fnc: ALL
                  item:
                    host: 'Stormshield SNS by SNMP'
                    key: 'net.if.in[snsifInTcpBytes.{#SNMPINDEX}]'
                - sortorder: '3'
                  color: 2774A4
                  calc_fnc: ALL
                  item:
                    host: 'Stormshield SNS by SNMP'
                    key: 'net.if.out[snsifOutTcpBytes.{#SNMPINDEX}]'
                - sortorder: '4'
                  color: 6C59DC
                  calc_fnc: ALL
                  item:
                    host: 'Stormshield SNS by SNMP'
                    key: 'net.if.in[snsifInUdpBytes.{#SNMPINDEX}]'
                - sortorder: '5'
                  color: AC8C14
                  calc_fnc: ALL
                  item:
                    host: 'Stormshield SNS by SNMP'
                    key: 'net.if.out[snsifOutUdpBytes.{#SNMPINDEX}]'
                - sortorder: '6'
                  color: A54F10
                  calc_fnc: ALL
                  item:
                    host: 'Stormshield SNS by SNMP'
                    key: 'net.if.accepted[snsifPktAccepted.{#SNMPINDEX}]'
                - sortorder: '7'
                  color: FC6EA3
                  calc_fnc: ALL
                  item:
                    host: 'Stormshield SNS by SNMP'
                    key: 'net.if.blocked[snsifPktBlocked.{#SNMPINDEX}]'
          master_item:
            key: sns.net.if.walk
          preprocessing:
            - type: SNMP_WALK_TO_JSON
              parameters:
                - '{#IF_ID}'
                - 1.3.6.1.4.1.11256.1.4.1.1.1
                - '0'
                - '{#IF_NAME}'
                - 1.3.6.1.4.1.11256.1.4.1.1.2
                - '0'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
        - uuid: bcc8c701b453409b8d00006fcc7515bb
          name: 'Power supply discovery'
          type: DEPENDENT
          key: psu.discovery
          description: 'Used for discovering power supplies from the Stormshield MIB.'
          item_prototypes:
            - uuid: df7dd3abb56542dcb9e94bf05ab49bea
              name: 'PSU [{#POWER_ID}]: Power status'
              type: DEPENDENT
              key: 'system.psu.power[snsPowerSupplyPowered.{#SNMPINDEX}]'
              description: |
                MIB: STORMSHIELD-SYSTEM-MONITOR-MIB
                Indicates whether the power supply is powered by electricity.
              valuemap:
                name: 'STORMSHIELD-SYSTEM-MONITOR-MIB::snsPowerSupplyPowered'
              preprocessing:
                - type: SNMP_WALK_VALUE
                  parameters:
                    - '1.3.6.1.4.1.11256.1.10.6.1.2.{#SNMPINDEX}'
                    - '0'
              master_item:
                key: sns.psu.walk
              tags:
                - tag: component
                  value: system
            - uuid: bd32f31d949f4f7cb36a181942ac69bb
              name: 'PSU [{#POWER_ID}]: Status'
              type: DEPENDENT
              key: 'system.psu.status[snsPowerSupplyStatus.{#SNMPINDEX}]'
              description: |
                MIB: STORMSHIELD-SYSTEM-MONITOR-MIB
                Indicates the status of the power supply.
              valuemap:
                name: 'STORMSHIELD-SYSTEM-MONITOR-MIB::snsPowerSupplyStatus'
              preprocessing:
                - type: SNMP_WALK_VALUE
                  parameters:
                    - '1.3.6.1.4.1.11256.1.10.6.1.3.{#SNMPINDEX}'
                    - '0'
                - type: JAVASCRIPT
                  parameters:
                    - |
                      const idx = {
                      	'notfound': 1,
                      	'dummy': 2,
                      	'optional_not_powered': 3,
                      	'failed': 4,
                      	'ok': 5
                      };
                      
                      return typeof idx[value.toLowerCase()] === 'undefined' ? 0 : idx[value.toLowerCase()];
              master_item:
                key: sns.psu.walk
              tags:
                - tag: component
                  value: system
          master_item:
            key: sns.psu.walk
          preprocessing:
            - type: SNMP_WALK_TO_JSON
              parameters:
                - '{#POWER_ID}'
                - 1.3.6.1.4.1.11256.1.10.6.1.1
                - '0'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
        - uuid: 4e129e7982214b58855c3cdb42a9f91e
          name: 'Storage discovery'
          type: DEPENDENT
          key: storage.discovery
          filter:
            evaltype: AND
            conditions:
              - macro: '{#STORAGE_DESCR}'
                value: '{$SNS.STORAGE.DESCR.MATCHES}'
              - macro: '{#STORAGE_DESCR}'
                value: '{$SNS.STORAGE.DESCR.NOT_MATCHES}'
                operator: NOT_MATCHES_REGEX
              - macro: '{#STORAGE_TYPE}'
                value: '{$SNS.STORAGE.TYPE.MATCHES}'
              - macro: '{#STORAGE_TYPE}'
                value: '{$SNS.STORAGE.TYPE.NOT_MATCHES}'
                operator: NOT_MATCHES_REGEX
          description: 'Used for discovering storage from the Stormshield MIB.'
          item_prototypes:
            - uuid: 78657f8ffd554090bb46d55cdf06c730
              name: 'Storage [{#STORAGE_DESCR}]: Storage size'
              type: DEPENDENT
              key: 'host.storage.size[hrStorageSizedata.{#SNMPINDEX}]'
              value_type: FLOAT
              units: B
              description: |
                MIB: HOST-RESOURCES-MIB
                Total memory in the data file in bytes.
              preprocessing:
                - type: SNMP_WALK_VALUE
                  parameters:
                    - '1.3.6.1.2.1.25.2.3.1.5.{#SNMPINDEX}'
                    - '0'
                - type: MULTIPLIER
                  parameters:
                    - '4096'
              master_item:
                key: sns.storage.walk
              tags:
                - tag: component
                  value: storage
            - uuid: 90825a58e4a7428e955638492cb654b6
              name: 'Storage [{#STORAGE_DESCR}]: Used storage'
              type: DEPENDENT
              key: 'host.storage.used[hrStorageUseddata.{#SNMPINDEX}]'
              value_type: FLOAT
              units: B
              description: |
                MIB: HOST-RESOURCES-MIB
                Used memory in the data file in bytes.
              preprocessing:
                - type: SNMP_WALK_VALUE
                  parameters:
                    - '1.3.6.1.2.1.25.2.3.1.6.{#SNMPINDEX}'
                    - '0'
                - type: MULTIPLIER
                  parameters:
                    - '4096'
              master_item:
                key: sns.storage.walk
              tags:
                - tag: component
                  value: storage
            - uuid: 3f24a44e6b194774af99b1570e9043b3
              name: 'Storage [{#STORAGE_DESCR}]: Utilization'
              type: CALCULATED
              key: 'host.storage.utilization[.{#SNMPINDEX}]'
              units: '%'
              params: '(last(//host.storage.used[hrStorageUseddata.{#SNMPINDEX}])/last(//host.storage.size[hrStorageSizedata.{#SNMPINDEX}]))*100'
              description: 'Memory utilization in %.'
              tags:
                - tag: component
                  value: storage
              trigger_prototypes:
                - uuid: 3e69f180bb9f4ae8a28a9d3433723f1f
                  expression: 'min(/Stormshield SNS by SNMP/host.storage.utilization[.{#SNMPINDEX}],5m)>{$SNS.MEMORY.UTIL.MAX}'
                  name: 'SNS: Storage [{#STORAGE_DESCR}]: Utilization is high'
                  event_name: 'SNS: High storage utilization (>{$SNS.MEMORY.UTIL.MAX}% for 5m)'
                  priority: AVERAGE
                  description: 'The data file is running out of free memory.'
                  tags:
                    - tag: scope
                      value: capacity
                    - tag: scope
                      value: performance
          master_item:
            key: sns.storage.walk
          preprocessing:
            - type: SNMP_WALK_TO_JSON
              parameters:
                - '{#STORAGE_TYPE}'
                - 1.3.6.1.2.1.25.2.3.1.2
                - '0'
                - '{#STORAGE_DESCR}'
                - 1.3.6.1.2.1.25.2.3.1.3
                - '0'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
        - uuid: 53f93c7ce4d940609334343031dc7705
          name: 'Autoupdate discovery'
          type: DEPENDENT
          key: update.auto.discovery
          description: 'Used for discovering updates from the Stormshield MIB.'
          item_prototypes:
            - uuid: 1ca1980a3dc7400b98235b18ecb4fc9c
              name: 'Autoupdate [{#UPDATE_NAME}]: Last update date'
              type: DEPENDENT
              key: 'system.update.last[snsAutoupdateLast.{#SNMPINDEX}]'
              value_type: CHAR
              description: |
                MIB: STORMSHIELD-AUTOUPDATE-MIB
                Date of the last update of a subsystem.
              preprocessing:
                - type: SNMP_WALK_VALUE
                  parameters:
                    - '1.3.6.1.4.1.11256.1.9.1.1.4.{#SNMPINDEX}'
                    - '0'
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 6h
              master_item:
                key: sns.update.auto.walk
              tags:
                - tag: component
                  value: system
            - uuid: 144fdb66d21647b99ca67908c5b240cd
              name: 'Autoupdate [{#UPDATE_NAME}]: Update state'
              type: DEPENDENT
              key: 'system.update.state[snsAutoupdateState.{#SNMPINDEX}]'
              description: |
                MIB: STORMSHIELD-AUTOUPDATE-MIB
                State of the update of a subsystem.
              valuemap:
                name: 'STORMSHIELD-AUTOUPDATE-MIB::snsAutoupdateState'
              preprocessing:
                - type: SNMP_WALK_VALUE
                  parameters:
                    - '1.3.6.1.4.1.11256.1.9.1.1.3.{#SNMPINDEX}'
                    - '0'
                - type: JAVASCRIPT
                  parameters:
                    - |
                      const idx = {
                      	'never started': 1,
                      	'not available': 2,
                      	'running': 3,
                      	'broken': 4,
                      	'failed': 5,
                      	'uptodate': 6,
                      	'manually uptodate': 7
                      };
                      
                      return typeof idx[value.toLowerCase()] === 'undefined' ? 0 : idx[value.toLowerCase()];
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 6h
              master_item:
                key: sns.update.auto.walk
              tags:
                - tag: component
                  value: system
              trigger_prototypes:
                - uuid: 7226b9ba8d3947a59bf0d709b843b472
                  expression: '(last(/Stormshield SNS by SNMP/system.update.state[snsAutoupdateState.{#SNMPINDEX}])=4) or (last(/Stormshield SNS by SNMP/system.update.state[snsAutoupdateState.{#SNMPINDEX}])=5)'
                  name: 'SNS: Autoupdate [{#UPDATE_NAME}]: Not up to date'
                  event_name: 'SNS: Autoupdate not up to date'
                  priority: INFO
                  description: 'The autoupdate is not up to date (never started or started more than a year ago).'
                  tags:
                    - tag: scope
                      value: notice
          master_item:
            key: sns.update.auto.walk
          preprocessing:
            - type: SNMP_WALK_TO_JSON
              parameters:
                - '{#UPDATE_ID}'
                - 1.3.6.1.4.1.11256.1.9.1.1.1
                - '0'
                - '{#UPDATE_NAME}'
                - 1.3.6.1.4.1.11256.1.9.1.1.2
                - '0'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
      tags:
        - tag: class
          value: network
        - tag: subclass
          value: firewall
        - tag: subclass
          value: security
        - tag: target
          value: sns
        - tag: target
          value: stormshield
      macros:
        - macro: '{$SNS.CPU.UTIL.CRIT}'
          value: '95'
          description: 'Threshold of CPU utilization for Critical trigger in %.'
          config:
            type: TEXT
            priority: '1'
            section_name: Thresholds
            label: 'Threshold for CPU utilization (critical)'
            description: 'Threshold of CPU utilization for Critical trigger in %. In the range from 0 to 100 inclusive.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$SNS.CPU.UTIL.WARN}'
          value: '85'
          description: 'Threshold of CPU utilization for Warning trigger in %.'
          config:
            type: TEXT
            priority: '2'
            section_name: Thresholds
            label: 'Threshold for CPU utilization (warning)'
            description: 'Threshold of CPU utilization for Warning trigger in %. In the range from 0 to 100 inclusive.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$SNS.DISK.FREE.CRIT}'
          value: '10'
          description: 'Threshold of free disk space for Critical trigger in %.'
          config:
            type: TEXT
            priority: '3'
            section_name: Thresholds
            label: 'Threshold for disk free space (critical)'
            description: 'Threshold of disk free space for Critical trigger in %. In the range from 0 to 100 inclusive.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$SNS.DISK.FREE.WARN}'
          value: '20'
          description: 'Threshold of free disk space for Warning trigger in %.'
          config:
            type: TEXT
            priority: '4'
            section_name: Thresholds
            label: 'Threshold for disk free space (warning)'
            description: 'Threshold of disk free space for Warning trigger in %. In the range from 0 to 100 inclusive.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$SNS.ICMP.LOSS.WARN}'
          value: '20'
          description: 'Threshold of ICMP packet loss for Warning trigger in %.'
          config:
            type: TEXT
            priority: '5'
            section_name: Thresholds
            label: 'Threshold for ICMP packet loss (warning)'
            description: 'Threshold of ICMP packet loss for Warning trigger in %. In the range from 0 to 100 inclusive.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$SNS.ICMP.RESPONSE.TIME.WARN}'
          value: '0.15'
          description: 'Threshold of average ICMP response time for Warning trigger in seconds.'
          config:
            type: TEXT
            priority: '6'
            section_name: Thresholds
            label: 'Threshold for average ICMP response time (warning)'
            description: 'Threshold of average ICMP response time for Warning trigger in seconds. In the range from 0 to 100 inclusive.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$SNS.MEMORY.UTIL.MAX}'
          value: '90'
          description: 'Threshold for memory utilization trigger in %.'
          config:
            type: TEXT
            priority: '7'
            section_name: Thresholds
            label: 'Threshold for memory utilization (average)'
            description: 'Threshold of memory utilization for trigger in %. In the range from 0 to 100 inclusive.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$SNS.NET.IF.IFNAME.MATCHES}'
          value: '.*'
          description: 'Sets regex string of network interface names to allow in discovery.'
          config:
            type: TEXT
            priority: '8'
            section_name: Filters
            label: 'Network interface IFNAME matches filter'
            description: 'Sets the regex string of network interface names to allow in discovery.'
        - macro: '{$SNS.NET.IF.IFNAME.NOT_MATCHES}'
          value: ^(sslvpn|ipsec)
          description: 'Sets regex string of network interface names to ignore in discovery.'
          config:
            type: TEXT
            priority: '9'
            section_name: Filters
            label: 'Network interface IFNAME not matches filter'
            description: 'Sets the regex string of network interface names to ignore in discovery.'
        - macro: '{$SNS.SNMP.INTERVAL}'
          value: 1m
          description: 'Time interval for SNMP agent items.'
          config:
            type: TEXT
            priority: '15'
            section_name: Other
            label: 'SNMP item update interval'
            description: 'Time interval for SNMP agent items.'
        - macro: '{$SNS.SNMP.TIMEOUT}'
          value: 5m
          description: 'Time interval for SNMP availability trigger.'
          config:
            type: TEXT
            priority: '14'
            section_name: Other
            label: 'SNMP availability timeout'
            description: 'The time interval for SNMP availability trigger.'
        - macro: '{$SNS.STORAGE.DESCR.MATCHES}'
          value: ^(/data|/log)$
          description: 'Sets regex string of storage descriptions to allow in discovery.'
          config:
            type: TEXT
            priority: '12'
            section_name: Filters
            label: 'Storage description matches filter'
            description: 'Sets regex string of storage descriptions to allow in discovery.'
        - macro: '{$SNS.STORAGE.DESCR.NOT_MATCHES}'
          value: CHANGE_IF_NEEDED
          description: 'Sets regex string of storage descriptions to ignore in discovery.'
          config:
            type: TEXT
            priority: '13'
            section_name: Filters
            label: 'Storage description not matches filter'
            description: 'Sets regex string of storage descriptions to ignore in discovery.'
        - macro: '{$SNS.STORAGE.TYPE.MATCHES}'
          value: .1.3.6.1.2.1.25.2.1.4
          description: 'Sets regex string of storage types to allow in discovery.'
          config:
            type: TEXT
            priority: '10'
            section_name: Filters
            label: 'Storage type matches filter'
            description: 'Sets regex string of storage types to allow in discovery.'
        - macro: '{$SNS.STORAGE.TYPE.NOT_MATCHES}'
          value: CHANGE_IF_NEEDED
          description: 'Sets regex string of storage types to ignore in discovery.'
          config:
            type: TEXT
            priority: '11'
            section_name: Filters
            label: 'Storage type not matches filter'
            description: 'Sets regex string of storage types to ignore in discovery.'
      dashboards:
        - uuid: 68b246ab40c24a9f9057d58bcea37cac
          name: Main
          auto_start: 'NO'
          pages:
            - name: Overview
              display_period: '60'
              widgets:
                - type: item
                  name: Name
                  width: '12'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: description
                      value: Name
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Stormshield SNS by SNMP'
                        key: 'property.hardware.name[snsSystemName.0]'
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: INTEGER
                      name: units_show
                      value: '0'
                    - type: INTEGER
                      name: value_size
                      value: '25'
                - type: item
                  name: 'Firmware version'
                  'y': '2'
                  width: '12'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: description
                      value: 'Firmware version'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Stormshield SNS by SNMP'
                        key: 'property.hardware.version[snsVersion.0]'
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: INTEGER
                      name: units_show
                      value: '0'
                    - type: INTEGER
                      name: value_size
                      value: '25'
                - type: item
                  name: 'System date'
                  'y': '4'
                  width: '12'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: description
                      value: 'System date'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Stormshield SNS by SNMP'
                        key: 'system.date[snsDate.0]'
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: INTEGER
                      name: units_show
                      value: '0'
                    - type: INTEGER
                      name: value_size
                      value: '25'
                - type: gauge
                  name: 'Memory utilization'
                  'y': '6'
                  width: '24'
                  height: '4'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: description
                      value: 'Memory utilization'
                    - type: INTEGER
                      name: desc_size
                      value: '8'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Stormshield SNS by SNMP'
                        key: host.memory.utilization
                    - type: STRING
                      name: thresholds.0.color
                      value: 0EC9AC
                    - type: STRING
                      name: thresholds.0.threshold
                      value: '0'
                    - type: STRING
                      name: thresholds.1.color
                      value: FFD54F
                    - type: STRING
                      name: thresholds.1.threshold
                      value: '70'
                    - type: STRING
                      name: thresholds.2.color
                      value: FF465C
                    - type: STRING
                      name: thresholds.2.threshold
                      value: '90'
                    - type: INTEGER
                      name: th_show_arc
                      value: '1'
                    - type: INTEGER
                      name: th_show_labels
                      value: '1'
                    - type: STRING
                      name: units
                      value: '%'
                    - type: INTEGER
                      name: units_bold
                      value: '1'
                    - type: INTEGER
                      name: value_arc_size
                      value: '35'
                    - type: INTEGER
                      name: value_bold
                      value: '1'
                - type: item
                  name: 'Total memory'
                  'y': '10'
                  width: '12'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_size
                      value: '25'
                    - type: STRING
                      name: description
                      value: 'Total memory'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Stormshield SNS by SNMP'
                        key: 'host.memory.total[memTotalReal.0]'
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: INTEGER
                      name: value_size
                      value: '35'
                - type: item
                  name: 'Buffer memory'
                  'y': '12'
                  width: '12'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_size
                      value: '25'
                    - type: STRING
                      name: description
                      value: 'Buffer memory'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Stormshield SNS by SNMP'
                        key: 'host.memory.buffer[memBuffer.0]'
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: INTEGER
                      name: value_size
                      value: '35'
                - type: item
                  name: Model
                  x: '12'
                  width: '12'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: description
                      value: Model
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Stormshield SNS by SNMP'
                        key: 'property.hardware.model[snsModel.0]'
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: INTEGER
                      name: units_show
                      value: '0'
                    - type: INTEGER
                      name: value_size
                      value: '25'
                - type: item
                  name: 'Serial number'
                  x: '12'
                  'y': '2'
                  width: '12'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: description
                      value: 'Serial number'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Stormshield SNS by SNMP'
                        key: 'property.hardware.serial[snsSerialNumber.0]'
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: INTEGER
                      name: units_show
                      value: '0'
                    - type: INTEGER
                      name: value_size
                      value: '25'
                - type: item
                  name: Uptime
                  x: '12'
                  'y': '4'
                  width: '12'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: STRING
                      name: description
                      value: Uptime
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Stormshield SNS by SNMP'
                        key: 'system.hardware.uptime[snsUptime.0]'
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: INTEGER
                      name: value_size
                      value: '25'
                - type: item
                  name: 'Available memory'
                  x: '12'
                  'y': '10'
                  width: '12'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_size
                      value: '25'
                    - type: STRING
                      name: description
                      value: 'Available memory'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Stormshield SNS by SNMP'
                        key: host.memory.available
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: INTEGER
                      name: value_size
                      value: '35'
                - type: item
                  name: 'Cached memory'
                  x: '12'
                  'y': '12'
                  width: '12'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_size
                      value: '25'
                    - type: STRING
                      name: description
                      value: 'Cached memory'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Stormshield SNS by SNMP'
                        key: 'host.memory.cached[memCached.0]'
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: INTEGER
                      name: value_size
                      value: '35'
                - type: problems
                  name: Problems
                  x: '24'
                  width: '48'
                  height: '6'
                - type: honeycomb
                  name: 'CPU utilization'
                  x: '24'
                  'y': '6'
                  width: '48'
                  height: '3'
                  fields:
                    - type: STRING
                      name: items.0
                      value: 'CPU [*]: Usage'
                    - type: STRING
                      name: primary_label
                      value: '{{ITEM.NAME}.regsub("CPU\s\[(\d+)\]:\sUsage", CPU \1)}'
                    - type: INTEGER
                      name: primary_label_size_type
                      value: '1'
                    - type: STRING
                      name: reference
                      value: BBDAB
                    - type: STRING
                      name: thresholds.0.color
                      value: 0EC9AC
                    - type: STRING
                      name: thresholds.0.threshold
                      value: '0'
                    - type: STRING
                      name: thresholds.1.color
                      value: FFD54F
                    - type: STRING
                      name: thresholds.1.threshold
                      value: '70'
                    - type: STRING
                      name: thresholds.2.color
                      value: FF465C
                    - type: STRING
                      name: thresholds.2.threshold
                      value: '90'
                - type: honeycomb
                  name: 'Storage utilization'
                  x: '24'
                  'y': '9'
                  width: '48'
                  height: '3'
                  fields:
                    - type: STRING
                      name: items.0
                      value: 'Storage [*]: Utilization'
                    - type: STRING
                      name: primary_label
                      value: '{{ITEM.NAME}.regsub("Storage\s\[(.+)\]:\sUtilization", \1)}'
                    - type: INTEGER
                      name: primary_label_size_type
                      value: '1'
                    - type: STRING
                      name: reference
                      value: BBDAC
                    - type: STRING
                      name: thresholds.0.color
                      value: 0EC9AC
                    - type: STRING
                      name: thresholds.0.threshold
                      value: '0'
                    - type: STRING
                      name: thresholds.1.color
                      value: FFD54F
                    - type: STRING
                      name: thresholds.1.threshold
                      value: '70'
                    - type: STRING
                      name: thresholds.2.color
                      value: FF465C
                    - type: STRING
                      name: thresholds.2.threshold
                      value: '90'
                - type: item
                  name: 'SNMP agent availability'
                  x: '24'
                  'y': '12'
                  width: '12'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: STRING
                      name: description
                      value: 'SNMP agent availability'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Stormshield SNS by SNMP'
                        key: 'zabbix[host,snmp,available]'
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: thresholds.0.color
                      value: FF465C
                    - type: STRING
                      name: thresholds.0.threshold
                      value: '0'
                    - type: STRING
                      name: thresholds.1.color
                      value: 0EC9AC
                    - type: STRING
                      name: thresholds.1.threshold
                      value: '1'
                    - type: STRING
                      name: thresholds.2.color
                      value: FFD54F
                    - type: STRING
                      name: thresholds.2.threshold
                      value: '2'
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: INTEGER
                      name: value_size
                      value: '35'
                - type: item
                  name: 'ICMP ping'
                  x: '36'
                  'y': '12'
                  width: '12'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: STRING
                      name: description
                      value: 'ICMP ping'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Stormshield SNS by SNMP'
                        key: icmpping
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: thresholds.0.color
                      value: FF465C
                    - type: STRING
                      name: thresholds.0.threshold
                      value: '0'
                    - type: STRING
                      name: thresholds.1.color
                      value: 0EC9AC
                    - type: STRING
                      name: thresholds.1.threshold
                      value: '1'
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: INTEGER
                      name: value_size
                      value: '35'
                - type: item
                  name: 'ICMP response time'
                  x: '48'
                  'y': '12'
                  width: '12'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_size
                      value: '25'
                    - type: STRING
                      name: description
                      value: 'ICMP response time'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Stormshield SNS by SNMP'
                        key: icmppingsec
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: INTEGER
                      name: value_size
                      value: '35'
                - type: item
                  name: 'ICMP loss'
                  x: '60'
                  'y': '12'
                  width: '12'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_size
                      value: '25'
                    - type: STRING
                      name: description
                      value: 'ICMP loss'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Stormshield SNS by SNMP'
                        key: icmppingloss
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: INTEGER
                      name: value_size
                      value: '35'
            - name: 'Interfaces: Traffic'
              widgets:
                - type: honeycomb
                  name: 'Incoming current throughput'
                  width: '72'
                  height: '3'
                  fields:
                    - type: STRING
                      name: items.0
                      value: 'Interface*: Incoming current throughput'
                    - type: STRING
                      name: primary_label
                      value: '{{ITEM.NAME}.regsub("^Interface\s\[(.+)\].*$","\1")}'
                    - type: INTEGER
                      name: primary_label_size
                      value: '25'
                    - type: INTEGER
                      name: primary_label_size_type
                      value: '1'
                    - type: STRING
                      name: reference
                      value: IFTRX
                    - type: INTEGER
                      name: secondary_label_size_type
                      value: '1'
                    - type: STRING
                      name: secondary_label_units
                      value: bps
                    - type: STRING
                      name: thresholds.0.color
                      value: 8BCC3A
                    - type: STRING
                      name: thresholds.0.threshold
                      value: '100'
                - type: honeycomb
                  name: 'Outgoing current throughput'
                  'y': '3'
                  width: '72'
                  height: '3'
                  fields:
                    - type: STRING
                      name: items.0
                      value: 'Interface*: Outgoing current throughput'
                    - type: STRING
                      name: primary_label
                      value: '{{ITEM.NAME}.regsub("^Interface\s\[(.+)\].*$","\1")}'
                    - type: INTEGER
                      name: primary_label_size
                      value: '25'
                    - type: INTEGER
                      name: primary_label_size_type
                      value: '1'
                    - type: STRING
                      name: reference
                      value: IFTTX
                    - type: INTEGER
                      name: secondary_label_size_type
                      value: '1'
                    - type: STRING
                      name: secondary_label_units
                      value: bps
                    - type: STRING
                      name: thresholds.0.color
                      value: 00A2E5
                    - type: STRING
                      name: thresholds.0.threshold
                      value: '100'
                - type: svggraph
                  name: 'Network interfaces traffic'
                  'y': '6'
                  width: '72'
                  height: '7'
                  fields:
                    - type: STRING
                      name: ds.0.color.0
                      value: 8BCC3A
                    - type: STRING
                      name: ds.0.color.1
                      value: 00A2E5
                    - type: INTEGER
                      name: ds.0.dataset_type
                      value: '0'
                    - type: STRING
                      name: ds.0.itemids.0._reference
                      value: IFTRX._itemid
                    - type: STRING
                      name: ds.0.itemids.1._reference
                      value: IFTTX._itemid
                    - type: INTEGER
                      name: ds.0.width
                      value: '2'
                    - type: STRING
                      name: reference
                      value: IFTGR
                    - type: INTEGER
                      name: working_time
                      value: '1'
            - name: 'Interfaces: Packets'
              widgets:
                - type: honeycomb
                  name: 'Accepted packets'
                  width: '72'
                  height: '3'
                  fields:
                    - type: STRING
                      name: items.0
                      value: 'Interface*: Accepted packets'
                    - type: STRING
                      name: primary_label
                      value: '{{ITEM.NAME}.regsub("^Interface\s\[(.+)\].*$","\1")}'
                    - type: INTEGER
                      name: primary_label_size
                      value: '25'
                    - type: INTEGER
                      name: primary_label_size_type
                      value: '1'
                    - type: STRING
                      name: reference
                      value: IFPAC
                    - type: INTEGER
                      name: secondary_label_decimal_places
                      value: '0'
                    - type: INTEGER
                      name: secondary_label_size_type
                      value: '1'
                    - type: INTEGER
                      name: secondary_label_units_show
                      value: '0'
                    - type: STRING
                      name: thresholds.0.color
                      value: 0EC9AC
                    - type: STRING
                      name: thresholds.0.threshold
                      value: '1'
                - type: honeycomb
                  name: 'Blocked packets'
                  'y': '3'
                  width: '72'
                  height: '3'
                  fields:
                    - type: STRING
                      name: items.0
                      value: 'Interface*: Blocked packets'
                    - type: STRING
                      name: primary_label
                      value: '{{ITEM.NAME}.regsub("^Interface\s\[(.+)\].*$","\1")}'
                    - type: INTEGER
                      name: primary_label_size
                      value: '25'
                    - type: INTEGER
                      name: primary_label_size_type
                      value: '1'
                    - type: STRING
                      name: reference
                      value: IFPBL
                    - type: INTEGER
                      name: secondary_label_decimal_places
                      value: '0'
                    - type: INTEGER
                      name: secondary_label_size_type
                      value: '1'
                    - type: INTEGER
                      name: secondary_label_units_show
                      value: '0'
                    - type: STRING
                      name: thresholds.0.color
                      value: FF465C
                    - type: STRING
                      name: thresholds.0.threshold
                      value: '1'
                - type: svggraph
                  name: 'Accepted/Blocked packets'
                  'y': '6'
                  width: '72'
                  height: '7'
                  fields:
                    - type: STRING
                      name: ds.0.color.0
                      value: 0EC9AC
                    - type: STRING
                      name: ds.0.color.1
                      value: FF465C
                    - type: INTEGER
                      name: ds.0.dataset_type
                      value: '0'
                    - type: STRING
                      name: ds.0.itemids.0._reference
                      value: IFPAC._itemid
                    - type: STRING
                      name: ds.0.itemids.1._reference
                      value: IFPBL._itemid
                    - type: INTEGER
                      name: ds.0.width
                      value: '2'
                    - type: STRING
                      name: reference
                      value: IFTGR
                    - type: INTEGER
                      name: working_time
                      value: '1'
            - name: CPU
              widgets:
                - type: honeycomb
                  name: 'CPU usage'
                  width: '72'
                  height: '3'
                  fields:
                    - type: STRING
                      name: items.0
                      value: 'CPU [*]: Usage'
                    - type: STRING
                      name: primary_label
                      value: '{{ITEM.NAME}.regsub("CPU\s\[(\d+)\]:\sUsage", CPU \1)}'
                    - type: INTEGER
                      name: primary_label_size_type
                      value: '1'
                    - type: STRING
                      name: reference
                      value: CPUUS
                    - type: INTEGER
                      name: secondary_label_size_type
                      value: '1'
                    - type: STRING
                      name: secondary_label_units
                      value: '%'
                    - type: STRING
                      name: thresholds.0.color
                      value: 0EC9AC
                    - type: STRING
                      name: thresholds.0.threshold
                      value: '0'
                    - type: STRING
                      name: thresholds.1.color
                      value: FFD54F
                    - type: STRING
                      name: thresholds.1.threshold
                      value: '70'
                    - type: STRING
                      name: thresholds.2.color
                      value: FF465C
                    - type: STRING
                      name: thresholds.2.threshold
                      value: '90'
                - type: honeycomb
                  name: 'CPU temperature'
                  'y': '3'
                  width: '72'
                  height: '3'
                  fields:
                    - type: STRING
                      name: items.0
                      value: 'CPU*: Temperature'
                    - type: STRING
                      name: primary_label
                      value: '{{ITEM.NAME}.regsub("CPU\s\[(\d+)\]:\sTemperature", CPU \1)}'
                    - type: INTEGER
                      name: primary_label_size_type
                      value: '1'
                    - type: STRING
                      name: reference
                      value: CPUTM
                    - type: INTEGER
                      name: secondary_label_decimal_places
                      value: '0'
                    - type: INTEGER
                      name: secondary_label_size_type
                      value: '1'
                    - type: STRING
                      name: secondary_label_units
                      value: °C
                - type: svggraph
                  name: CPU
                  'y': '6'
                  width: '72'
                  height: '7'
                  fields:
                    - type: STRING
                      name: ds.0.color.0
                      value: 0EC9AC
                    - type: INTEGER
                      name: ds.0.dataset_type
                      value: '0'
                    - type: STRING
                      name: ds.0.itemids.0._reference
                      value: CPUUS._itemid
                    - type: INTEGER
                      name: ds.0.width
                      value: '2'
                    - type: INTEGER
                      name: ds.1.axisy
                      value: '1'
                    - type: STRING
                      name: ds.1.color.0
                      value: FF465C
                    - type: INTEGER
                      name: ds.1.dataset_type
                      value: '0'
                    - type: STRING
                      name: ds.1.itemids.0._reference
                      value: CPUTM._itemid
                    - type: INTEGER
                      name: ds.1.width
                      value: '2'
                    - type: STRING
                      name: reference
                      value: CPUGR
                    - type: INTEGER
                      name: righty
                      value: '1'
                    - type: INTEGER
                      name: working_time
                      value: '1'
            - name: Memory
              widgets:
                - type: gauge
                  name: 'Memory utilization'
                  width: '24'
                  height: '4'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: description
                      value: 'Memory utilization'
                    - type: INTEGER
                      name: desc_size
                      value: '8'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Stormshield SNS by SNMP'
                        key: host.memory.utilization
                    - type: STRING
                      name: thresholds.0.color
                      value: 0EC9AC
                    - type: STRING
                      name: thresholds.0.threshold
                      value: '0'
                    - type: STRING
                      name: thresholds.1.color
                      value: FFD54F
                    - type: STRING
                      name: thresholds.1.threshold
                      value: '70'
                    - type: STRING
                      name: thresholds.2.color
                      value: FF465C
                    - type: STRING
                      name: thresholds.2.threshold
                      value: '90'
                    - type: INTEGER
                      name: th_show_arc
                      value: '1'
                    - type: INTEGER
                      name: th_show_labels
                      value: '1'
                    - type: STRING
                      name: units
                      value: '%'
                    - type: INTEGER
                      name: units_bold
                      value: '1'
                    - type: INTEGER
                      name: value_arc_size
                      value: '35'
                    - type: INTEGER
                      name: value_bold
                      value: '1'
                - type: item
                  name: 'Total memory'
                  'y': '4'
                  width: '12'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_size
                      value: '25'
                    - type: STRING
                      name: description
                      value: 'Total memory'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Stormshield SNS by SNMP'
                        key: 'host.memory.total[memTotalReal.0]'
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: INTEGER
                      name: value_size
                      value: '35'
                - type: item
                  name: 'Buffer memory'
                  'y': '6'
                  width: '12'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_size
                      value: '25'
                    - type: STRING
                      name: description
                      value: 'Buffer memory'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Stormshield SNS by SNMP'
                        key: 'host.memory.buffer[memBuffer.0]'
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: INTEGER
                      name: value_size
                      value: '35'
                - type: item
                  name: 'Available memory'
                  x: '12'
                  'y': '4'
                  width: '12'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_size
                      value: '25'
                    - type: STRING
                      name: description
                      value: 'Available memory'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Stormshield SNS by SNMP'
                        key: host.memory.available
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: INTEGER
                      name: value_size
                      value: '35'
                - type: item
                  name: 'Cached memory'
                  x: '12'
                  'y': '6'
                  width: '12'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_size
                      value: '25'
                    - type: STRING
                      name: description
                      value: 'Cached memory'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Stormshield SNS by SNMP'
                        key: 'host.memory.cached[memCached.0]'
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: INTEGER
                      name: value_size
                      value: '35'
                - type: honeycomb
                  name: 'Memory utilization'
                  x: '24'
                  width: '48'
                  height: '6'
                  fields:
                    - type: STRING
                      name: items.0
                      value: '* memory utilization'
                    - type: STRING
                      name: primary_label
                      value: '{{ITEM.NAME}.regsub("(.+) memory utilization", \1)}'
                    - type: INTEGER
                      name: primary_label_size
                      value: '15'
                    - type: INTEGER
                      name: primary_label_size_type
                      value: '1'
                    - type: STRING
                      name: reference
                      value: MEMUH
                    - type: INTEGER
                      name: secondary_label_size_type
                      value: '1'
                    - type: STRING
                      name: secondary_label_units
                      value: '%'
                    - type: STRING
                      name: thresholds.0.color
                      value: 0EC9AC
                    - type: STRING
                      name: thresholds.0.threshold
                      value: '0'
                    - type: STRING
                      name: thresholds.1.color
                      value: FFD54F
                    - type: STRING
                      name: thresholds.1.threshold
                      value: '70'
                    - type: STRING
                      name: thresholds.2.color
                      value: FF465C
                    - type: STRING
                      name: thresholds.2.threshold
                      value: '90'
                - type: svggraph
                  name: 'Memory utilization'
                  x: '24'
                  'y': '6'
                  width: '48'
                  height: '8'
                  fields:
                    - type: STRING
                      name: ds.0.color.0
                      value: 0EC9AC
                    - type: INTEGER
                      name: ds.0.dataset_type
                      value: '0'
                    - type: STRING
                      name: ds.0.itemids.0._reference
                      value: MEMUH._itemid
                    - type: INTEGER
                      name: ds.0.width
                      value: '2'
                    - type: STRING
                      name: reference
                      value: MEMGR
                    - type: INTEGER
                      name: working_time
                      value: '1'
            - name: Disk
              widgets:
                - type: honeycomb
                  name: 'Disk name'
                  width: '72'
                  height: '3'
                  fields:
                    - type: STRING
                      name: items.0
                      value: 'Disk*: Disk name'
                    - type: STRING
                      name: primary_label
                      value: '{{ITEM.NAME}.regsub("Disk\s\[(.+)\].*", Disk \1)}'
                    - type: INTEGER
                      name: primary_label_size_type
                      value: '1'
                    - type: STRING
                      name: reference
                      value: DSKNA
                    - type: INTEGER
                      name: secondary_label_size_type
                      value: '1'
                    - type: INTEGER
                      name: secondary_label_units_show
                      value: '0'
                    - type: STRING
                      name: thresholds.0.color
                      value: 0EC9AC
                    - type: STRING
                      name: thresholds.0.threshold
                      value: '0'
                    - type: STRING
                      name: thresholds.1.color
                      value: FFD54F
                    - type: STRING
                      name: thresholds.1.threshold
                      value: '70'
                    - type: STRING
                      name: thresholds.2.color
                      value: FF465C
                    - type: STRING
                      name: thresholds.2.threshold
                      value: '90'
                - type: honeycomb
                  name: 'Member of a RAID array'
                  'y': '3'
                  width: '72'
                  height: '3'
                  fields:
                    - type: STRING
                      name: items.0
                      value: 'Disk*: Member of a RAID array'
                    - type: STRING
                      name: primary_label
                      value: '{{ITEM.NAME}.regsub("Disk\s\[(.+)\].*", Disk \1)}'
                    - type: INTEGER
                      name: primary_label_size
                      value: '25'
                    - type: INTEGER
                      name: primary_label_size_type
                      value: '1'
                    - type: STRING
                      name: reference
                      value: DSKRM
                    - type: INTEGER
                      name: secondary_label_decimal_places
                      value: '0'
                    - type: INTEGER
                      name: secondary_label_size
                      value: '25'
                    - type: INTEGER
                      name: secondary_label_size_type
                      value: '1'
                    - type: INTEGER
                      name: secondary_label_units_show
                      value: '0'
                    - type: STRING
                      name: thresholds.0.color
                      value: 0EC9AC
                    - type: STRING
                      name: thresholds.0.threshold
                      value: '1'
                - type: honeycomb
                  name: 'RAID status'
                  'y': '6'
                  width: '72'
                  height: '3'
                  fields:
                    - type: STRING
                      name: items.0
                      value: 'Disk*: RAID status'
                    - type: STRING
                      name: primary_label
                      value: '{{ITEM.NAME}.regsub("Disk\s\[(.+)\].*", Disk \1)}'
                    - type: INTEGER
                      name: primary_label_size
                      value: '25'
                    - type: INTEGER
                      name: primary_label_size_type
                      value: '1'
                    - type: STRING
                      name: reference
                      value: DSKRS
                    - type: INTEGER
                      name: secondary_label_decimal_places
                      value: '0'
                    - type: INTEGER
                      name: secondary_label_size
                      value: '25'
                    - type: INTEGER
                      name: secondary_label_size_type
                      value: '1'
                    - type: INTEGER
                      name: secondary_label_units_show
                      value: '0'
                    - type: STRING
                      name: thresholds.0.color
                      value: FF465C
                    - type: STRING
                      name: thresholds.0.threshold
                      value: '1'
                    - type: STRING
                      name: thresholds.1.color
                      value: FFD54F
                    - type: STRING
                      name: thresholds.1.threshold
                      value: '2'
                    - type: STRING
                      name: thresholds.2.color
                      value: 0EC9AC
                    - type: STRING
                      name: thresholds.2.threshold
                      value: '3'
                - type: honeycomb
                  name: 'SMART info test result'
                  'y': '9'
                  width: '72'
                  height: '3'
                  fields:
                    - type: STRING
                      name: items.0
                      value: 'Disk*: SMART info test result'
                    - type: STRING
                      name: primary_label
                      value: '{{ITEM.NAME}.regsub("Disk\s\[(.+)\].*", Disk \1)}'
                    - type: INTEGER
                      name: primary_label_size
                      value: '25'
                    - type: INTEGER
                      name: primary_label_size_type
                      value: '1'
                    - type: STRING
                      name: reference
                      value: DSKSM
                    - type: INTEGER
                      name: secondary_label_decimal_places
                      value: '0'
                    - type: INTEGER
                      name: secondary_label_size
                      value: '25'
                    - type: INTEGER
                      name: secondary_label_size_type
                      value: '1'
                    - type: INTEGER
                      name: secondary_label_units_show
                      value: '0'
                    - type: STRING
                      name: thresholds.0.color
                      value: 0EC9AC
                    - type: STRING
                      name: thresholds.0.threshold
                      value: '1'
                    - type: STRING
                      name: thresholds.1.color
                      value: FF465C
                    - type: STRING
                      name: thresholds.1.threshold
                      value: '2'
            - name: Fan
              widgets:
                - type: honeycomb
                  name: 'Fan status'
                  width: '72'
                  height: '3'
                  fields:
                    - type: STRING
                      name: items.0
                      value: 'Fan*: Fan status'
                    - type: STRING
                      name: primary_label
                      value: '{{ITEM.NAME}.regsub("Fan\s\[(.+)\].*", Fan \1)}'
                    - type: INTEGER
                      name: primary_label_size
                      value: '25'
                    - type: INTEGER
                      name: primary_label_size_type
                      value: '1'
                    - type: STRING
                      name: reference
                      value: FANST
                    - type: INTEGER
                      name: secondary_label_decimal_places
                      value: '0'
                    - type: INTEGER
                      name: secondary_label_size
                      value: '25'
                    - type: INTEGER
                      name: secondary_label_size_type
                      value: '1'
                    - type: INTEGER
                      name: secondary_label_units_show
                      value: '0'
                    - type: STRING
                      name: thresholds.0.color
                      value: FF465C
                    - type: STRING
                      name: thresholds.0.threshold
                      value: '1'
                    - type: STRING
                      name: thresholds.1.color
                      value: 0EC9AC
                    - type: STRING
                      name: thresholds.1.threshold
                      value: '2'
                - type: honeycomb
                  name: 'Fan speed'
                  'y': '3'
                  width: '72'
                  height: '3'
                  fields:
                    - type: STRING
                      name: items.0
                      value: 'Fan*: Fan speed'
                    - type: STRING
                      name: primary_label
                      value: '{{ITEM.NAME}.regsub("Fan\s\[(.+)\].*", Fan \1)}'
                    - type: INTEGER
                      name: primary_label_size
                      value: '25'
                    - type: INTEGER
                      name: primary_label_size_type
                      value: '1'
                    - type: STRING
                      name: reference
                      value: FANSP
                    - type: INTEGER
                      name: secondary_label_decimal_places
                      value: '0'
                    - type: INTEGER
                      name: secondary_label_size_type
                      value: '1'
                    - type: STRING
                      name: secondary_label_units
                      value: rpm
                - type: svggraph
                  name: 'Fan speed'
                  'y': '6'
                  width: '72'
                  height: '7'
                  fields:
                    - type: STRING
                      name: ds.0.color.0
                      value: 0EC9AC
                    - type: INTEGER
                      name: ds.0.dataset_type
                      value: '0'
                    - type: STRING
                      name: ds.0.itemids.0._reference
                      value: FANSP._itemid
                    - type: INTEGER
                      name: ds.0.width
                      value: '2'
                    - type: STRING
                      name: reference
                      value: FANGR
                    - type: INTEGER
                      name: working_time
                      value: '1'
            - name: PSU
              widgets:
                - type: honeycomb
                  name: 'PSU power status'
                  width: '72'
                  height: '3'
                  fields:
                    - type: STRING
                      name: items.0
                      value: 'PSU*: Power status'
                    - type: STRING
                      name: primary_label
                      value: '{{ITEM.NAME}.regsub("PSU\s\[(.+)\].*", PSU \1)}'
                    - type: INTEGER
                      name: primary_label_size
                      value: '25'
                    - type: INTEGER
                      name: primary_label_size_type
                      value: '1'
                    - type: STRING
                      name: reference
                      value: PSUPS
                    - type: INTEGER
                      name: secondary_label_decimal_places
                      value: '0'
                    - type: INTEGER
                      name: secondary_label_size
                      value: '25'
                    - type: INTEGER
                      name: secondary_label_size_type
                      value: '1'
                    - type: INTEGER
                      name: secondary_label_units_show
                      value: '0'
                    - type: STRING
                      name: thresholds.0.color
                      value: FF465C
                    - type: STRING
                      name: thresholds.0.threshold
                      value: '0'
                    - type: STRING
                      name: thresholds.1.color
                      value: 0EC9AC
                    - type: STRING
                      name: thresholds.1.threshold
                      value: '1'
                - type: honeycomb
                  name: 'PSU status'
                  'y': '3'
                  width: '72'
                  height: '3'
                  fields:
                    - type: STRING
                      name: items.0
                      value: 'PSU*: Status'
                    - type: STRING
                      name: primary_label
                      value: '{{ITEM.NAME}.regsub("PSU\s\[(.+)\].*", PSU \1)}'
                    - type: INTEGER
                      name: primary_label_size
                      value: '25'
                    - type: INTEGER
                      name: primary_label_size_type
                      value: '1'
                    - type: STRING
                      name: reference
                      value: PSUST
                    - type: INTEGER
                      name: secondary_label_decimal_places
                      value: '0'
                    - type: INTEGER
                      name: secondary_label_size
                      value: '25'
                    - type: INTEGER
                      name: secondary_label_size_type
                      value: '1'
                    - type: INTEGER
                      name: secondary_label_units_show
                      value: '0'
                    - type: STRING
                      name: thresholds.0.color
                      value: FF465C
                    - type: STRING
                      name: thresholds.0.threshold
                      value: '4'
                    - type: STRING
                      name: thresholds.1.color
                      value: 0EC9AC
                    - type: STRING
                      name: thresholds.1.threshold
                      value: '5'
            - name: HA
              widgets:
                - type: item
                  name: 'Active firewalls'
                  width: '12'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: STRING
                      name: description
                      value: 'Active firewalls'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Stormshield SNS by SNMP'
                        key: 'ha.node.active[snsNbActiveNode.0]'
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: INTEGER
                      name: units_show
                      value: '0'
                    - type: INTEGER
                      name: value_size
                      value: '35'
                - type: item
                  name: 'Firewalls in the cluster'
                  'y': '2'
                  width: '12'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: STRING
                      name: description
                      value: 'Firewalls in the cluster'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Stormshield SNS by SNMP'
                        key: 'ha.node.count[snsNbNode.0]'
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: INTEGER
                      name: units_show
                      value: '0'
                    - type: INTEGER
                      name: value_size
                      value: '35'
                - type: item
                  name: 'Synchronization status'
                  'y': '4'
                  width: '24'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: STRING
                      name: description
                      value: 'Synchronization status'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Stormshield SNS by SNMP'
                        key: 'ha.sync.status[snsHASyncStatus.0]'
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: INTEGER
                      name: units_show
                      value: '0'
                    - type: INTEGER
                      name: value_size
                      value: '35'
                - type: svggraph
                  name: 'HA quality'
                  'y': '6'
                  width: '24'
                  height: '6'
                  fields:
                    - type: STRING
                      name: ds.0.color.0
                      value: 0EC9AC
                    - type: INTEGER
                      name: ds.0.dataset_type
                      value: '0'
                    - type: STRING
                      name: ds.0.itemids.0._reference
                      value: HAHQL._itemid
                    - type: INTEGER
                      name: ds.0.width
                      value: '2'
                    - type: STRING
                      name: reference
                      value: HAHQG
                    - type: INTEGER
                      name: working_time
                      value: '1'
                - type: item
                  name: 'Faulty HA links'
                  x: '12'
                  width: '12'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: STRING
                      name: description
                      value: 'Faulty HA links'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Stormshield SNS by SNMP'
                        key: 'ha.links.faulty[snsNbFaultyHALinks.0]'
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: thresholds.0.color
                      value: 0EC9AC
                    - type: STRING
                      name: thresholds.0.threshold
                      value: '0'
                    - type: STRING
                      name: thresholds.1.color
                      value: FFD54F
                    - type: STRING
                      name: thresholds.1.threshold
                      value: '1'
                    - type: INTEGER
                      name: units_show
                      value: '0'
                    - type: INTEGER
                      name: value_size
                      value: '35'
                - type: item
                  name: 'Firewalls not replying'
                  x: '12'
                  'y': '2'
                  width: '12'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: STRING
                      name: description
                      value: 'Firewalls not replying'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Stormshield SNS by SNMP'
                        key: 'ha.node.dead[snsNbDeadNode.0]'
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: thresholds.0.color
                      value: 0EC9AC
                    - type: STRING
                      name: thresholds.0.threshold
                      value: '0'
                    - type: STRING
                      name: thresholds.1.color
                      value: FFD54F
                    - type: STRING
                      name: thresholds.1.threshold
                      value: '1'
                    - type: INTEGER
                      name: units_show
                      value: '0'
                    - type: INTEGER
                      name: value_size
                      value: '35'
                - type: honeycomb
                  name: 'Is online'
                  x: '24'
                  width: '48'
                  height: '3'
                  fields:
                    - type: STRING
                      name: items.0
                      value: 'HA members*: Is online'
                    - type: STRING
                      name: primary_label
                      value: '{{ITEM.NAME}.regsub("HA members\s\[(.+)\].*", HA \1)}'
                    - type: INTEGER
                      name: primary_label_size
                      value: '25'
                    - type: INTEGER
                      name: primary_label_size_type
                      value: '1'
                    - type: STRING
                      name: reference
                      value: HAHON
                    - type: INTEGER
                      name: secondary_label_decimal_places
                      value: '0'
                    - type: INTEGER
                      name: secondary_label_size_type
                      value: '1'
                    - type: INTEGER
                      name: secondary_label_units_show
                      value: '0'
                    - type: STRING
                      name: thresholds.0.color
                      value: FF465C
                    - type: STRING
                      name: thresholds.0.threshold
                      value: '0'
                    - type: STRING
                      name: thresholds.1.color
                      value: 0EC9AC
                    - type: STRING
                      name: thresholds.1.threshold
                      value: '1'
                - type: honeycomb
                  name: 'HA quality'
                  x: '24'
                  'y': '3'
                  width: '48'
                  height: '3'
                  fields:
                    - type: STRING
                      name: items.0
                      value: 'HA members*: HA quality'
                    - type: STRING
                      name: primary_label
                      value: '{{ITEM.NAME}.regsub("HA members\s\[(.+)\].*", HA \1)}'
                    - type: INTEGER
                      name: primary_label_size
                      value: '25'
                    - type: INTEGER
                      name: primary_label_size_type
                      value: '1'
                    - type: STRING
                      name: reference
                      value: HAHQL
                    - type: INTEGER
                      name: secondary_label_decimal_places
                      value: '0'
                    - type: INTEGER
                      name: secondary_label_size_type
                      value: '1'
                    - type: INTEGER
                      name: secondary_label_units_show
                      value: '0'
                - type: honeycomb
                  name: 'HA priority'
                  x: '24'
                  'y': '6'
                  width: '48'
                  height: '3'
                  fields:
                    - type: STRING
                      name: items.0
                      value: 'HA members*: HA priority'
                    - type: STRING
                      name: primary_label
                      value: '{{ITEM.NAME}.regsub("HA members\s\[(.+)\].*", HA \1)}'
                    - type: INTEGER
                      name: primary_label_size
                      value: '25'
                    - type: INTEGER
                      name: primary_label_size_type
                      value: '1'
                    - type: STRING
                      name: reference
                      value: HAHPR
                    - type: INTEGER
                      name: secondary_label_decimal_places
                      value: '0'
                    - type: INTEGER
                      name: secondary_label_size_type
                      value: '1'
                    - type: INTEGER
                      name: secondary_label_units_show
                      value: '0'
                - type: honeycomb
                  name: 'Firewall status'
                  x: '24'
                  'y': '9'
                  width: '48'
                  height: '3'
                  fields:
                    - type: STRING
                      name: items.0
                      value: 'HA members*: Firewall status'
                    - type: STRING
                      name: primary_label
                      value: '{{ITEM.NAME}.regsub("HA members\s\[(.+)\].*", HA \1)}'
                    - type: INTEGER
                      name: primary_label_size
                      value: '25'
                    - type: INTEGER
                      name: primary_label_size_type
                      value: '1'
                    - type: STRING
                      name: reference
                      value: HAHFS
                    - type: INTEGER
                      name: secondary_label_decimal_places
                      value: '0'
                    - type: INTEGER
                      name: secondary_label_units_show
                      value: '0'
            - name: Autoupdate
              widgets:
                - type: honeycomb
                  name: 'Update state'
                  width: '72'
                  height: '6'
                  fields:
                    - type: STRING
                      name: items.0
                      value: 'Autoupdate*: Update state'
                    - type: STRING
                      name: primary_label
                      value: '{{ITEM.NAME}.regsub("Autoupdate\s\[(.+)\].*", \1)}'
                    - type: INTEGER
                      name: primary_label_size_type
                      value: '1'
                    - type: STRING
                      name: reference
                      value: AUUST
                    - type: INTEGER
                      name: secondary_label_decimal_places
                      value: '0'
                    - type: INTEGER
                      name: secondary_label_size
                      value: '20'
                    - type: INTEGER
                      name: secondary_label_size_type
                      value: '1'
                    - type: INTEGER
                      name: secondary_label_units_show
                      value: '0'
                    - type: STRING
                      name: thresholds.0.color
                      value: FF465C
                    - type: STRING
                      name: thresholds.0.threshold
                      value: '4'
                    - type: STRING
                      name: thresholds.1.color
                      value: 0EC9AC
                    - type: STRING
                      name: thresholds.1.threshold
                      value: '6'
                - type: honeycomb
                  name: 'Last update date'
                  'y': '6'
                  width: '72'
                  height: '6'
                  fields:
                    - type: STRING
                      name: items.0
                      value: 'Autoupdate*: Last update date'
                    - type: STRING
                      name: primary_label
                      value: '{{ITEM.NAME}.regsub("Autoupdate\s\[(.+)\].*", \1)}'
                    - type: INTEGER
                      name: primary_label_size_type
                      value: '1'
                    - type: STRING
                      name: reference
                      value: AUUDT
                    - type: INTEGER
                      name: secondary_label_units_show
                      value: '0'
            - name: VPN
              widgets:
                - type: item
                  name: 'Incoming policies'
                  width: '14'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: STRING
                      name: description
                      value: 'Incoming policies'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Stormshield SNS by SNMP'
                        key: 'ipsec.policies.in[snsIPSECStatsSPDIn.0]'
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: INTEGER
                      name: units_show
                      value: '0'
                    - type: INTEGER
                      name: value_size
                      value: '25'
                - type: svggraph
                  name: 'VPN data'
                  'y': '2'
                  width: '72'
                  height: '7'
                  fields:
                    - type: STRING
                      name: ds.0.color.0
                      value: F5B218
                    - type: STRING
                      name: ds.0.color.1
                      value: F57018
                    - type: STRING
                      name: ds.0.color.2
                      value: 18A5F5
                    - type: STRING
                      name: ds.0.color.3
                      value: '466475'
                    - type: STRING
                      name: ds.0.color.4
                      value: '756746'
                    - type: INTEGER
                      name: ds.0.dataset_type
                      value: '0'
                    - type: ITEM
                      name: ds.0.itemids.0
                      value:
                        host: 'Stormshield SNS by SNMP'
                        key: 'ipsec.policies.in[snsIPSECStatsSPDIn.0]'
                    - type: ITEM
                      name: ds.0.itemids.1
                      value:
                        host: 'Stormshield SNS by SNMP'
                        key: 'ipsec.policies.out[snsIPSECStatsSPDOut.0]'
                    - type: ITEM
                      name: ds.0.itemids.2
                      value:
                        host: 'Stormshield SNS by SNMP'
                        key: 'vpn.tunnel.mature[snsIPSECStatsSADMature.0]'
                    - type: ITEM
                      name: ds.0.itemids.3
                      value:
                        host: 'Stormshield SNS by SNMP'
                        key: 'vpn.tunnel.dying[snsIPSECStatsSADDying.0]'
                    - type: ITEM
                      name: ds.0.itemids.4
                      value:
                        host: 'Stormshield SNS by SNMP'
                        key: 'vpn.tunnel.dead[snsIPSECStatsSADDead.0]'
                    - type: INTEGER
                      name: ds.0.width
                      value: '2'
                    - type: STRING
                      name: reference
                      value: FANGR
                    - type: INTEGER
                      name: working_time
                      value: '1'
                - type: item
                  name: 'Outgoing policies'
                  x: '14'
                  width: '14'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: STRING
                      name: description
                      value: 'Outgoing policies'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Stormshield SNS by SNMP'
                        key: 'ipsec.policies.in[snsIPSECStatsSPDIn.0]'
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: INTEGER
                      name: units_show
                      value: '0'
                    - type: INTEGER
                      name: value_size
                      value: '25'
                - type: item
                  name: 'Number of mature VPN tunnels'
                  x: '28'
                  width: '14'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: STRING
                      name: description
                      value: 'Number of mature VPN tunnels'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Stormshield SNS by SNMP'
                        key: 'vpn.tunnel.mature[snsIPSECStatsSADMature.0]'
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: INTEGER
                      name: units_show
                      value: '0'
                    - type: INTEGER
                      name: value_size
                      value: '25'
                - type: item
                  name: 'Number of dying VPN tunnels'
                  x: '42'
                  width: '14'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: STRING
                      name: description
                      value: 'Number of dying VPN tunnels'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Stormshield SNS by SNMP'
                        key: 'vpn.tunnel.dying[snsIPSECStatsSADDying.0]'
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: INTEGER
                      name: units_show
                      value: '0'
                    - type: INTEGER
                      name: value_size
                      value: '25'
                - type: item
                  name: 'Number of dead VPN tunnels'
                  x: '56'
                  width: '16'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: STRING
                      name: description
                      value: 'Number of dead VPN tunnels'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Stormshield SNS by SNMP'
                        key: 'vpn.tunnel.dead[snsIPSECStatsSADDead.0]'
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: INTEGER
                      name: units_show
                      value: '0'
                    - type: INTEGER
                      name: value_size
                      value: '25'
            - name: 'Policies & ASQ'
              widgets:
                - type: item
                  name: Policies
                  width: '14'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: description
                      value: Policies
                    - type: INTEGER
                      name: desc_bold
                      value: '1'
                    - type: INTEGER
                      name: desc_size
                      value: '35'
                    - type: INTEGER
                      name: desc_v_pos
                      value: '1'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Stormshield SNS by SNMP'
                        key: 'policy.filter[snsPolicySlotName]'
                    - type: INTEGER
                      name: show.0
                      value: '1'
                - type: item
                  name: 'Active filtering policy name'
                  'y': '2'
                  width: '14'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: description
                      value: 'Active filtering policy name'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Stormshield SNS by SNMP'
                        key: 'policy.filter[snsPolicySlotName]'
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: INTEGER
                      name: units_show
                      value: '0'
                    - type: INTEGER
                      name: value_size
                      value: '25'
                - type: item
                  name: 'Active IPsec policy name'
                  'y': '4'
                  width: '14'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: description
                      value: 'Active IPsec policy name'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Stormshield SNS by SNMP'
                        key: 'policy.ipsec[snsPolicySlotNameIPsec]'
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: INTEGER
                      name: units_show
                      value: '0'
                    - type: INTEGER
                      name: value_size
                      value: '25'
                - type: item
                  name: ASQ
                  x: '16'
                  width: '28'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: description
                      value: ASQ
                    - type: INTEGER
                      name: desc_bold
                      value: '1'
                    - type: INTEGER
                      name: desc_size
                      value: '35'
                    - type: INTEGER
                      name: desc_v_pos
                      value: '1'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Stormshield SNS by SNMP'
                        key: 'asq.alarm.stateful[snsASQStatsStatefulMajorAlarm.0]'
                    - type: INTEGER
                      name: show.0
                      value: '1'
                - type: item
                  name: 'ASQ major alarm count'
                  x: '16'
                  'y': '2'
                  width: '14'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: STRING
                      name: description
                      value: 'ASQ major alarm count'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Stormshield SNS by SNMP'
                        key: 'asq.alarm.stateful[snsASQStatsStatefulMajorAlarm.0]'
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: INTEGER
                      name: units_show
                      value: '0'
                    - type: INTEGER
                      name: value_size
                      value: '25'
                - type: item
                  name: 'ASQ minor alarm count'
                  x: '16'
                  'y': '4'
                  width: '14'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: STRING
                      name: description
                      value: 'ASQ minor alarm count'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Stormshield SNS by SNMP'
                        key: 'asq.alarm.stateful[snsASQStatsStatefulMinorAlarm.0]'
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: INTEGER
                      name: units_show
                      value: '0'
                    - type: INTEGER
                      name: value_size
                      value: '25'
                - type: item
                  name: 'ASQ TCP connection count'
                  x: '30'
                  'y': '2'
                  width: '14'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: STRING
                      name: description
                      value: 'ASQ TCP connection count'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Stormshield SNS by SNMP'
                        key: 'asq.alarm.stateful.tcp[snsASQStatsStatefulTcpConn.0]'
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: INTEGER
                      name: units_show
                      value: '0'
                    - type: INTEGER
                      name: value_size
                      value: '25'
                - type: item
                  name: 'ASQ UDP connection count'
                  x: '30'
                  'y': '4'
                  width: '14'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: STRING
                      name: description
                      value: 'ASQ UDP connection count'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Stormshield SNS by SNMP'
                        key: 'asq.alarm.stateful.udp[snsASQStatsStatefulUdpConn.0]'
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: INTEGER
                      name: units_show
                      value: '0'
                    - type: INTEGER
                      name: value_size
                      value: '25'
            - name: 'Health status'
              widgets:
                - type: honeycomb
                  name: 'Admin password'
                  width: '24'
                  height: '3'
                  fields:
                    - type: STRING
                      name: items.0
                      value: 'Health status firewall [*]: Admin password'
                    - type: STRING
                      name: primary_label
                      value: '{{ITEM.NAME}.regsub("Health status firewall\s\[(.+)\]:\s(.*)", #\1 \2)}'
                    - type: INTEGER
                      name: primary_label_size_type
                      value: '1'
                    - type: STRING
                      name: reference
                      value: HSTAP
                    - type: INTEGER
                      name: secondary_label_decimal_places
                      value: '0'
                    - type: INTEGER
                      name: secondary_label_size
                      value: '20'
                    - type: INTEGER
                      name: secondary_label_size_type
                      value: '1'
                    - type: INTEGER
                      name: secondary_label_units_show
                      value: '0'
                    - type: STRING
                      name: thresholds.0.color
                      value: FF465C
                    - type: STRING
                      name: thresholds.0.threshold
                      value: '5'
                    - type: STRING
                      name: thresholds.1.color
                      value: FFD54F
                    - type: STRING
                      name: thresholds.1.threshold
                      value: '6'
                    - type: STRING
                      name: thresholds.2.color
                      value: 0EC9AC
                    - type: STRING
                      name: thresholds.2.threshold
                      value: '7'
                - type: honeycomb
                  name: Certificates
                  'y': '3'
                  width: '24'
                  height: '3'
                  fields:
                    - type: STRING
                      name: items.0
                      value: 'Health status firewall [*]: Certificates'
                    - type: STRING
                      name: primary_label
                      value: '{{ITEM.NAME}.regsub("Health status firewall\s\[(.+)\]:\s(.*)", #\1 \2)}'
                    - type: INTEGER
                      name: primary_label_size_type
                      value: '1'
                    - type: STRING
                      name: reference
                      value: HSTCR
                    - type: INTEGER
                      name: secondary_label_decimal_places
                      value: '0'
                    - type: INTEGER
                      name: secondary_label_size
                      value: '20'
                    - type: INTEGER
                      name: secondary_label_size_type
                      value: '1'
                    - type: INTEGER
                      name: secondary_label_units_show
                      value: '0'
                    - type: STRING
                      name: thresholds.0.color
                      value: FF465C
                    - type: STRING
                      name: thresholds.0.threshold
                      value: '5'
                    - type: STRING
                      name: thresholds.1.color
                      value: FFD54F
                    - type: STRING
                      name: thresholds.1.threshold
                      value: '6'
                    - type: STRING
                      name: thresholds.2.color
                      value: 0EC9AC
                    - type: STRING
                      name: thresholds.2.threshold
                      value: '7'
                - type: honeycomb
                  name: CPU
                  'y': '6'
                  width: '24'
                  height: '3'
                  fields:
                    - type: STRING
                      name: items.0
                      value: 'Health status firewall [*]: CPU'
                    - type: STRING
                      name: primary_label
                      value: '{{ITEM.NAME}.regsub("Health status firewall\s\[(.+)\]:\s(.*)", #\1 \2)}'
                    - type: INTEGER
                      name: primary_label_size_type
                      value: '1'
                    - type: STRING
                      name: reference
                      value: HSTCU
                    - type: INTEGER
                      name: secondary_label_decimal_places
                      value: '0'
                    - type: INTEGER
                      name: secondary_label_size
                      value: '20'
                    - type: INTEGER
                      name: secondary_label_size_type
                      value: '1'
                    - type: INTEGER
                      name: secondary_label_units_show
                      value: '0'
                    - type: STRING
                      name: thresholds.0.color
                      value: FF465C
                    - type: STRING
                      name: thresholds.0.threshold
                      value: '5'
                    - type: STRING
                      name: thresholds.1.color
                      value: FFD54F
                    - type: STRING
                      name: thresholds.1.threshold
                      value: '6'
                    - type: STRING
                      name: thresholds.2.color
                      value: 0EC9AC
                    - type: STRING
                      name: thresholds.2.threshold
                      value: '7'
                - type: honeycomb
                  name: 'CPU temperature'
                  'y': '9'
                  width: '24'
                  height: '3'
                  fields:
                    - type: STRING
                      name: items.0
                      value: 'Health status firewall [*]: CPU temperature'
                    - type: STRING
                      name: primary_label
                      value: '{{ITEM.NAME}.regsub("Health status firewall\s\[(.+)\]:\s(.*)", #\1 \2)}'
                    - type: INTEGER
                      name: primary_label_size_type
                      value: '1'
                    - type: STRING
                      name: reference
                      value: HSTCT
                    - type: INTEGER
                      name: secondary_label_decimal_places
                      value: '0'
                    - type: INTEGER
                      name: secondary_label_size
                      value: '20'
                    - type: INTEGER
                      name: secondary_label_size_type
                      value: '1'
                    - type: INTEGER
                      name: secondary_label_units_show
                      value: '0'
                    - type: STRING
                      name: thresholds.0.color
                      value: FF465C
                    - type: STRING
                      name: thresholds.0.threshold
                      value: '5'
                    - type: STRING
                      name: thresholds.1.color
                      value: FFD54F
                    - type: STRING
                      name: thresholds.1.threshold
                      value: '6'
                    - type: STRING
                      name: thresholds.2.color
                      value: 0EC9AC
                    - type: STRING
                      name: thresholds.2.threshold
                      value: '7'
                - type: honeycomb
                  name: CRLs
                  x: '24'
                  width: '24'
                  height: '3'
                  fields:
                    - type: STRING
                      name: items.0
                      value: 'Health status firewall [*]: CRLs'
                    - type: STRING
                      name: primary_label
                      value: '{{ITEM.NAME}.regsub("Health status firewall\s\[(.+)\]:\s(.*)", #\1 \2)}'
                    - type: INTEGER
                      name: primary_label_size_type
                      value: '1'
                    - type: STRING
                      name: reference
                      value: HSTCL
                    - type: INTEGER
                      name: secondary_label_decimal_places
                      value: '0'
                    - type: INTEGER
                      name: secondary_label_size
                      value: '20'
                    - type: INTEGER
                      name: secondary_label_size_type
                      value: '1'
                    - type: INTEGER
                      name: secondary_label_units_show
                      value: '0'
                    - type: STRING
                      name: thresholds.0.color
                      value: FF465C
                    - type: STRING
                      name: thresholds.0.threshold
                      value: '5'
                    - type: STRING
                      name: thresholds.1.color
                      value: FFD54F
                    - type: STRING
                      name: thresholds.1.threshold
                      value: '6'
                    - type: STRING
                      name: thresholds.2.color
                      value: 0EC9AC
                    - type: STRING
                      name: thresholds.2.threshold
                      value: '7'
                - type: honeycomb
                  name: Disk
                  x: '24'
                  'y': '3'
                  width: '24'
                  height: '3'
                  fields:
                    - type: STRING
                      name: items.0
                      value: 'Health status firewall [*]: Disk'
                    - type: STRING
                      name: primary_label
                      value: '{{ITEM.NAME}.regsub("Health status firewall\s\[(.+)\]:\s(.*)", #\1 \2)}'
                    - type: INTEGER
                      name: primary_label_size_type
                      value: '1'
                    - type: STRING
                      name: reference
                      value: HSTDS
                    - type: INTEGER
                      name: secondary_label_decimal_places
                      value: '0'
                    - type: INTEGER
                      name: secondary_label_size
                      value: '20'
                    - type: INTEGER
                      name: secondary_label_size_type
                      value: '1'
                    - type: INTEGER
                      name: secondary_label_units_show
                      value: '0'
                    - type: STRING
                      name: thresholds.0.color
                      value: FF465C
                    - type: STRING
                      name: thresholds.0.threshold
                      value: '5'
                    - type: STRING
                      name: thresholds.1.color
                      value: FFD54F
                    - type: STRING
                      name: thresholds.1.threshold
                      value: '6'
                    - type: STRING
                      name: thresholds.2.color
                      value: 0EC9AC
                    - type: STRING
                      name: thresholds.2.threshold
                      value: '7'
                - type: honeycomb
                  name: Fans
                  x: '24'
                  'y': '6'
                  width: '24'
                  height: '3'
                  fields:
                    - type: STRING
                      name: items.0
                      value: 'Health status firewall [*]: Fans'
                    - type: STRING
                      name: primary_label
                      value: '{{ITEM.NAME}.regsub("Health status firewall\s\[(.+)\]:\s(.*)", #\1 \2)}'
                    - type: INTEGER
                      name: primary_label_size_type
                      value: '1'
                    - type: STRING
                      name: reference
                      value: HSTFN
                    - type: INTEGER
                      name: secondary_label_decimal_places
                      value: '0'
                    - type: INTEGER
                      name: secondary_label_size
                      value: '20'
                    - type: INTEGER
                      name: secondary_label_size_type
                      value: '1'
                    - type: INTEGER
                      name: secondary_label_units_show
                      value: '0'
                    - type: STRING
                      name: thresholds.0.color
                      value: FF465C
                    - type: STRING
                      name: thresholds.0.threshold
                      value: '5'
                    - type: STRING
                      name: thresholds.1.color
                      value: FFD54F
                    - type: STRING
                      name: thresholds.1.threshold
                      value: '6'
                    - type: STRING
                      name: thresholds.2.color
                      value: 0EC9AC
                    - type: STRING
                      name: thresholds.2.threshold
                      value: '7'
                - type: honeycomb
                  name: 'HA link'
                  x: '24'
                  'y': '9'
                  width: '24'
                  height: '3'
                  fields:
                    - type: STRING
                      name: items.0
                      value: 'Health status firewall [*]: HA link'
                    - type: STRING
                      name: primary_label
                      value: '{{ITEM.NAME}.regsub("Health status firewall\s\[(.+)\]:\s(.*)", #\1 \2)}'
                    - type: INTEGER
                      name: primary_label_size_type
                      value: '1'
                    - type: STRING
                      name: reference
                      value: HSTHL
                    - type: INTEGER
                      name: secondary_label_decimal_places
                      value: '0'
                    - type: INTEGER
                      name: secondary_label_size
                      value: '20'
                    - type: INTEGER
                      name: secondary_label_size_type
                      value: '1'
                    - type: INTEGER
                      name: secondary_label_units_show
                      value: '0'
                    - type: STRING
                      name: thresholds.0.color
                      value: FF465C
                    - type: STRING
                      name: thresholds.0.threshold
                      value: '5'
                    - type: STRING
                      name: thresholds.1.color
                      value: FFD54F
                    - type: STRING
                      name: thresholds.1.threshold
                      value: '6'
                    - type: STRING
                      name: thresholds.2.color
                      value: 0EC9AC
                    - type: STRING
                      name: thresholds.2.threshold
                      value: '7'
                - type: honeycomb
                  name: 'HA mode'
                  x: '48'
                  width: '24'
                  height: '3'
                  fields:
                    - type: STRING
                      name: items.0
                      value: 'Health status firewall [*]: HA mode'
                    - type: STRING
                      name: primary_label
                      value: '{{ITEM.NAME}.regsub("Health status firewall\s\[(.+)\]:\s(.*)", #\1 \2)}'
                    - type: INTEGER
                      name: primary_label_size_type
                      value: '1'
                    - type: STRING
                      name: reference
                      value: HSTHM
                    - type: INTEGER
                      name: secondary_label_decimal_places
                      value: '0'
                    - type: INTEGER
                      name: secondary_label_size
                      value: '20'
                    - type: INTEGER
                      name: secondary_label_size_type
                      value: '1'
                    - type: INTEGER
                      name: secondary_label_units_show
                      value: '0'
                    - type: STRING
                      name: thresholds.0.color
                      value: FF465C
                    - type: STRING
                      name: thresholds.0.threshold
                      value: '5'
                    - type: STRING
                      name: thresholds.1.color
                      value: FFD54F
                    - type: STRING
                      name: thresholds.1.threshold
                      value: '6'
                    - type: STRING
                      name: thresholds.2.color
                      value: 0EC9AC
                    - type: STRING
                      name: thresholds.2.threshold
                      value: '7'
                - type: honeycomb
                  name: Memory
                  x: '48'
                  'y': '3'
                  width: '24'
                  height: '3'
                  fields:
                    - type: STRING
                      name: items.0
                      value: 'Health status firewall [*]: Memory'
                    - type: STRING
                      name: primary_label
                      value: '{{ITEM.NAME}.regsub("Health status firewall\s\[(.+)\]:\s(.*)", #\1 \2)}'
                    - type: INTEGER
                      name: primary_label_size_type
                      value: '1'
                    - type: STRING
                      name: reference
                      value: HSTMM
                    - type: INTEGER
                      name: secondary_label_decimal_places
                      value: '0'
                    - type: INTEGER
                      name: secondary_label_size
                      value: '20'
                    - type: INTEGER
                      name: secondary_label_size_type
                      value: '1'
                    - type: INTEGER
                      name: secondary_label_units_show
                      value: '0'
                    - type: STRING
                      name: thresholds.0.color
                      value: FF465C
                    - type: STRING
                      name: thresholds.0.threshold
                      value: '5'
                    - type: STRING
                      name: thresholds.1.color
                      value: FFD54F
                    - type: STRING
                      name: thresholds.1.threshold
                      value: '6'
                    - type: STRING
                      name: thresholds.2.color
                      value: 0EC9AC
                    - type: STRING
                      name: thresholds.2.threshold
                      value: '7'
                - type: honeycomb
                  name: 'Power supply'
                  x: '48'
                  'y': '6'
                  width: '24'
                  height: '3'
                  fields:
                    - type: STRING
                      name: items.0
                      value: 'Health status firewall [*]: Power supply'
                    - type: STRING
                      name: primary_label
                      value: '{{ITEM.NAME}.regsub("Health status firewall\s\[(.+)\]:\s(.*)", #\1 \2)}'
                    - type: INTEGER
                      name: primary_label_size_type
                      value: '1'
                    - type: STRING
                      name: reference
                      value: HSTPS
                    - type: INTEGER
                      name: secondary_label_decimal_places
                      value: '0'
                    - type: INTEGER
                      name: secondary_label_size
                      value: '20'
                    - type: INTEGER
                      name: secondary_label_size_type
                      value: '1'
                    - type: INTEGER
                      name: secondary_label_units_show
                      value: '0'
                    - type: STRING
                      name: thresholds.0.color
                      value: FF465C
                    - type: STRING
                      name: thresholds.0.threshold
                      value: '5'
                    - type: STRING
                      name: thresholds.1.color
                      value: FFD54F
                    - type: STRING
                      name: thresholds.1.threshold
                      value: '6'
                    - type: STRING
                      name: thresholds.2.color
                      value: 0EC9AC
                    - type: STRING
                      name: thresholds.2.threshold
                      value: '7'
                - type: honeycomb
                  name: RAID
                  x: '48'
                  'y': '9'
                  width: '24'
                  height: '3'
                  fields:
                    - type: STRING
                      name: items.0
                      value: 'Health status firewall [*]: RAID'
                    - type: STRING
                      name: primary_label
                      value: '{{ITEM.NAME}.regsub("Health status firewall\s\[(.+)\]:\s(.*)", #\1 \2)}'
                    - type: INTEGER
                      name: primary_label_size_type
                      value: '1'
                    - type: STRING
                      name: reference
                      value: HSTRD
                    - type: INTEGER
                      name: secondary_label_decimal_places
                      value: '0'
                    - type: INTEGER
                      name: secondary_label_size
                      value: '20'
                    - type: INTEGER
                      name: secondary_label_size_type
                      value: '1'
                    - type: INTEGER
                      name: secondary_label_units_show
                      value: '0'
                    - type: STRING
                      name: thresholds.0.color
                      value: FF465C
                    - type: STRING
                      name: thresholds.0.threshold
                      value: '5'
                    - type: STRING
                      name: thresholds.1.color
                      value: FFD54F
                    - type: STRING
                      name: thresholds.1.threshold
                      value: '6'
                    - type: STRING
                      name: thresholds.2.color
                      value: 0EC9AC
                    - type: STRING
                      name: thresholds.2.threshold
                      value: '7'
      valuemaps:
        - uuid: 1ba10b4dfec646359ae363d8c374667c
          name: 'Host availability'
          mappings:
            - value: '0'
              newvalue: 'Not available'
            - value: '1'
              newvalue: Available
            - value: '2'
              newvalue: Unknown
        - uuid: 30e84601ccc9488c9f1c81dbf02df4b3
          name: 'Service state'
          mappings:
            - value: '0'
              newvalue: Down
            - value: '1'
              newvalue: Up
        - uuid: afd4fdd6212547a281a842b806f9b520
          name: 'STORMSHIELD-AUTOUPDATE-MIB::snsAutoupdateState'
          mappings:
            - value: '0'
              newvalue: Unknown
            - value: '1'
              newvalue: 'Never started'
            - value: '2'
              newvalue: 'Not available'
            - value: '3'
              newvalue: Running
            - value: '4'
              newvalue: Broken
            - value: '5'
              newvalue: Failed
            - value: '6'
              newvalue: 'Up to date'
            - value: '7'
              newvalue: 'Manually up to date'
        - uuid: ee09eb3b1fa049b7bcd9ad51a49d39f4
          name: 'STORMSHIELD-HA-MIB::snsHALicence'
          mappings:
            - value: '0'
              newvalue: Unknown
            - value: '1'
              newvalue: Slave
            - value: '2'
              newvalue: Master
        - uuid: 2063c82a4fd54f228655d1c42dd249ce
          name: 'STORMSHIELD-HA-MIB::snsHAStatusForced'
          mappings:
            - value: '-2'
              newvalue: 'Unknown forced status'
            - value: '-1'
              newvalue: 'No peer found'
            - value: '0'
              newvalue: 'No forced status'
            - value: '1'
              newvalue: 'Forced active'
            - value: '2'
              newvalue: 'Forced passive'
        - uuid: 1c7e7fe23de34086b5009a995ee4e71f
          name: 'STORMSHIELD-HA-MIB::snsHASyncStatus'
          mappings:
            - value: '-1'
              newvalue: 'Unknown / Error'
            - value: '0'
              newvalue: 'Not synced'
            - value: '1'
              newvalue: Synced
        - uuid: 0761fc9c63674cf6914d2d0c36df4391
          name: 'STORMSHIELD-HA-MIB::snsOnline'
          mappings:
            - value: '0'
              newvalue: 'Not online'
            - value: '1'
              newvalue: Online
        - uuid: 278a31a580424daebcc73cc0f7f75764
          name: 'STORMSHIELD-HEALTH-MONITOR-MIB::*'
          mappings:
            - value: '0'
              newvalue: Unknown
            - value: '1'
              newvalue: N/A
            - value: '2'
              newvalue: None
            - value: '3'
              newvalue: Active
            - value: '4'
              newvalue: Passive
            - value: '5'
              newvalue: Major
            - value: '6'
              newvalue: Minor
            - value: '7'
              newvalue: Good
        - uuid: 0c3077b6a7ab46f29226e493fbf7f60a
          name: 'STORMSHIELD-SYSTEM-MONITOR-MIB::snsDiskEntryIsRaid'
          mappings:
            - value: '0'
              newvalue: 'Not in RAID'
            - value: '1'
              newvalue: 'In RAID'
        - uuid: 72383baf0804476fb75d1451a344554d
          name: 'STORMSHIELD-SYSTEM-MONITOR-MIB::snsDiskEntryRaidStatus'
          mappings:
            - value: '0'
              newvalue: Unknown
            - value: '1'
              newvalue: Degraded
            - value: '2'
              newvalue: Missing
            - value: '3'
              newvalue: Optimal
        - uuid: ac297c469fb348d4ab231e43f935f682
          name: 'STORMSHIELD-SYSTEM-MONITOR-MIB::snsDiskEntrySmartResult'
          mappings:
            - value: '0'
              newvalue: Unknown
            - value: '1'
              newvalue: Passed
            - value: '2'
              newvalue: Failed
        - uuid: 5ae9550fd2cf4c3f8361ca95b82b3c2f
          name: 'STORMSHIELD-SYSTEM-MONITOR-MIB::snsFanStatus'
          mappings:
            - value: '0'
              newvalue: Unknown
            - value: '1'
              newvalue: Failure
            - value: '2'
              newvalue: Running
        - uuid: fc9b6cf135884b0d8dcd4b159304751b
          name: 'STORMSHIELD-SYSTEM-MONITOR-MIB::snsPowerSupplyPowered'
          mappings:
            - value: '0'
              newvalue: 'Not powered'
            - value: '1'
              newvalue: Powered
        - uuid: 5a30cfb4e78742b0bc421abc334b7953
          name: 'STORMSHIELD-SYSTEM-MONITOR-MIB::snsPowerSupplyStatus'
          mappings:
            - value: '0'
              newvalue: Unknown
            - value: '1'
              newvalue: 'Not found'
            - value: '2'
              newvalue: Dummy
            - value: '3'
              newvalue: 'Optional not powered'
            - value: '4'
              newvalue: Failed
            - value: '5'
              newvalue: OK
  triggers:
    - uuid: f4b2492d4a154c74b79509bc6b08752e
      expression: 'change(/Azure Sentinel by HTTP/azure.sentinel.alert_rules.disabled)>0 and change(/Azure Sentinel by HTTP/azure.sentinel.alert_rules.total)=0'
      name: 'Azure Sentinel: Alert rule was disabled.'
      event_name: 'Azure Sentinel: The number of disabled alert rules has increased from {ITEM.LASTVALUE2} to {ITEM.LASTVALUE1}.'
      opdata: 'Current number: {ITEM.LASTVALUE1}'
      priority: WARNING
      description: 'The number of disabled alert rules has increased.'
      manual_close: 'YES'
      tags:
        - tag: scope
          value: notice
    - uuid: 303a3693df714946819ee182a5b51acc
      expression: 'change(/Azure Sentinel by HTTP/azure.sentinel.alert_rules.enabled)>0 and change(/Azure Sentinel by HTTP/azure.sentinel.alert_rules.total)=0'
      name: 'Azure Sentinel: Alert rule was enabled.'
      event_name: 'Azure Sentinel: The number of enabled alert rules has increased from {ITEM.LASTVALUE2} to {ITEM.LASTVALUE1}.'
      opdata: 'Current number: {ITEM.LASTVALUE1}'
      priority: WARNING
      description: 'The number of enabled alert rules has increased.'
      manual_close: 'YES'
      tags:
        - tag: scope
          value: notice
    - uuid: 015e4e55aab6437ab04f0551664d59cc
      expression: 'change(/Azure Sentinel by HTTP/azure.sentinel.data_connectors.disabled)>0 and change(/Azure Sentinel by HTTP/azure.sentinel.data_connectors.total)=0'
      name: 'Azure Sentinel: Data connector was disabled.'
      event_name: 'Azure Sentinel: The number of disabled data connectors has increased from {ITEM.LASTVALUE2} to {ITEM.LASTVALUE1}.'
      opdata: 'Current number: {ITEM.LASTVALUE1}'
      priority: WARNING
      description: 'The number of disabled data connectors has increased.'
      manual_close: 'YES'
      tags:
        - tag: scope
          value: notice
    - uuid: 98d63b4c52e3417aa2796bc2fcdad5c7
      expression: 'change(/Azure Sentinel by HTTP/azure.sentinel.data_connectors.enabled)>0 and change(/Azure Sentinel by HTTP/azure.sentinel.data_connectors.total)=0'
      name: 'Azure Sentinel: Data connector was enabled.'
      event_name: 'Azure Sentinel: The number of enabled data connectors has increased from {ITEM.LASTVALUE2} to {ITEM.LASTVALUE1}.'
      opdata: 'Current number: {ITEM.LASTVALUE1}'
      priority: WARNING
      description: 'The number of enabled data connectors has increased.'
      manual_close: 'YES'
      tags:
        - tag: scope
          value: notice
    - uuid: fe60cca0faa14160bf0d94dc67833a0a
      expression: 'change(/Azure Sentinel by HTTP/azure.sentinel.incidents.high)>={$AZURE.SENTINEL.INCIDENTS.NEW:high} and change(/Azure Sentinel by HTTP/azure.sentinel.incidents.total)>0'
      name: 'Azure Sentinel: High-severity incident total has increased.'
      event_name: 'Azure Sentinel: The number of high-severity incidents has increased from {ITEM.LASTVALUE2} to {ITEM.LASTVALUE1}.'
      opdata: 'Current number: {ITEM.LASTVALUE1}'
      priority: HIGH
      description: 'The number of high-severity incidents has increased.'
      manual_close: 'YES'
      tags:
        - tag: scope
          value: notice
    - uuid: 57ff21dd46f142b0ab1f6ab728f290de
      expression: 'change(/Azure Sentinel by HTTP/azure.sentinel.incidents.active)>0 and change(/Azure Sentinel by HTTP/azure.sentinel.incidents.total)=0'
      name: 'Azure Sentinel: Incident become active.'
      opdata: 'Current number: {ITEM.LASTVALUE1}'
      priority: INFO
      description: 'The number of active incidents has increased.'
      manual_close: 'YES'
      tags:
        - tag: scope
          value: notice
    - uuid: 617eb0510ee64147ab0805b5c9d751f1
      expression: 'change(/Azure Sentinel by HTTP/azure.sentinel.incidents.info)>={$AZURE.SENTINEL.INCIDENTS.NEW:info} and change(/Azure Sentinel by HTTP/azure.sentinel.incidents.total)>0'
      name: 'Azure Sentinel: Informational severity incident total has increased.'
      event_name: 'Azure Sentinel: The number of informational severity incidents has increased from {ITEM.LASTVALUE2} to {ITEM.LASTVALUE1}.'
      opdata: 'Current number: {ITEM.LASTVALUE1}'
      priority: INFO
      description: 'The number of informational severity incidents has increased.'
      manual_close: 'YES'
      tags:
        - tag: scope
          value: notice
    - uuid: da793fc1259e444c9bdd01c8230ea42e
      expression: 'change(/Azure Sentinel by HTTP/azure.sentinel.incidents.low)>={$AZURE.SENTINEL.INCIDENTS.NEW:low} and change(/Azure Sentinel by HTTP/azure.sentinel.incidents.total)>0'
      name: 'Azure Sentinel: Low-severity incident total has increased.'
      event_name: 'Azure Sentinel: The number of low-severity incidents has increased from {ITEM.LASTVALUE2} to {ITEM.LASTVALUE1}.'
      opdata: 'Current number: {ITEM.LASTVALUE1}'
      priority: WARNING
      description: 'The number of low-severity incidents has increased.'
      manual_close: 'YES'
      tags:
        - tag: scope
          value: notice
    - uuid: c7e38512100b4ee0aab6e59c83a8f0a7
      expression: 'change(/Azure Sentinel by HTTP/azure.sentinel.incidents.medium)>={$AZURE.SENTINEL.INCIDENTS.NEW:medium} and change(/Azure Sentinel by HTTP/azure.sentinel.incidents.total)>0'
      name: 'Azure Sentinel: Medium-severity incident total has increased.'
      event_name: 'Azure Sentinel: The number of medium-severity incidents has increased from {ITEM.LASTVALUE2} to {ITEM.LASTVALUE1}.'
      opdata: 'Current number: {ITEM.LASTVALUE1}'
      priority: AVERAGE
      description: 'The number of medium-severity incidents has increased.'
      manual_close: 'YES'
      tags:
        - tag: scope
          value: notice
    - uuid: b308b2240dc8462f815dee6034200672
      expression: 'change(/Azure Sentinel by HTTP/azure.sentinel.incidents.new)>={$AZURE.SENTINEL.INCIDENTS.NEW} and change(/Azure Sentinel by HTTP/azure.sentinel.incidents.total)>0'
      name: 'Azure Sentinel: New incident total has increased.'
      event_name: 'Azure Sentinel: The number of new incidents has increased from {ITEM.LASTVALUE2} to {ITEM.LASTVALUE1}.'
      opdata: 'Current number: {ITEM.LASTVALUE1}'
      priority: INFO
      description: 'The number of new incidents has increased.'
      manual_close: 'YES'
      tags:
        - tag: scope
          value: notice
    - uuid: e2f4997866724c8887cbb8e6f8e10c97
      expression: 'change(/Azure Sentinel by HTTP/azure.sentinel.watchlist.failed)>0 and change(/Azure Sentinel by HTTP/azure.sentinel.watchlist.total)=0'
      name: 'Azure Sentinel: Watchlist has failed.'
      event_name: 'Azure Sentinel: The number of failed watchlists has increased from {ITEM.LASTVALUE2} to {ITEM.LASTVALUE1}.'
      opdata: 'Current number: {ITEM.LASTVALUE1}'
      priority: WARNING
      description: 'The number of failed watchlists has increased.'
      manual_close: 'YES'
      tags:
        - tag: scope
          value: notice
    - uuid: 545d4d35d9024c00b830df762ee84c2a
      expression: 'change(/Azure Sentinel by HTTP/azure.sentinel.watchlist.canceled)>0 and change(/Azure Sentinel by HTTP/azure.sentinel.watchlist.total)=0'
      name: 'Azure Sentinel: Watchlist was disabled.'
      event_name: 'Azure Sentinel: The number of cancelled watchlists has increased from {ITEM.LASTVALUE2} to {ITEM.LASTVALUE1}.'
      opdata: 'Current number: {ITEM.LASTVALUE1}'
      priority: WARNING
      description: 'The number of canceled watchlists has increased.'
      manual_close: 'YES'
      tags:
        - tag: scope
          value: notice
  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: 781dd83ed494465bbf2c16efbc753a51
      name: 'Azure: Data disk read/write Bps'
      graph_items:
        - color: 199C0D
          item:
            host: 'Azure Virtual Machine by HTTP'
            key: azure.vm.data.disk.read.bps
        - sortorder: '1'
          color: F63100
          item:
            host: 'Azure Virtual Machine by HTTP'
            key: azure.vm.data.disk.write.bps
    - uuid: 7d198b2f6186498ab39ece80f3f7b30e
      name: 'Azure: Data disk read/write IOPS'
      graph_items:
        - color: 199C0D
          item:
            host: 'Azure Virtual Machine by HTTP'
            key: azure.vm.data.disk.read.ops
        - sortorder: '1'
          color: F63100
          item:
            host: 'Azure Virtual Machine by HTTP'
            key: azure.vm.data.disk.write.ops
    - uuid: a2d0eb282276486896067f8a30f8ea51
      name: 'Azure: Disk read/write bytes'
      graph_items:
        - color: 199C0D
          item:
            host: 'Azure Virtual Machine by HTTP'
            key: azure.vm.disk.read.bytes
        - sortorder: '1'
          color: F63100
          item:
            host: 'Azure Virtual Machine by HTTP'
            key: azure.vm.disk.write.bytes
    - uuid: 58a8c6942314408ab0e88b15d53f67e5
      name: 'Azure: Disk read/write IOPS'
      graph_items:
        - color: 199C0D
          item:
            host: 'Azure Virtual Machine by HTTP'
            key: azure.vm.disk.read.ops
        - sortorder: '1'
          color: F63100
          item:
            host: 'Azure Virtual Machine by HTTP'
            key: azure.vm.disk.write.ops
    - uuid: b427ad3dbb8d4f8caf1edfb0cab04733
      name: 'Azure: Flows'
      graph_items:
        - color: 199C0D
          item:
            host: 'Azure Virtual Machine by HTTP'
            key: azure.vm.flows.inbound
        - sortorder: '1'
          color: F63100
          item:
            host: 'Azure Virtual Machine by HTTP'
            key: azure.vm.flows.outbound
        - sortorder: '2'
          color: 00611C
          item:
            host: 'Azure Virtual Machine by HTTP'
            key: azure.vm.flows.inbound.max
        - sortorder: '3'
          color: F7941D
          item:
            host: 'Azure Virtual Machine by HTTP'
            key: azure.vm.flows.outbound.max
    - uuid: f0f37dc8840a45ba8e8cb62f5fea6804
      name: 'Azure: Network traffic'
      graph_items:
        - color: 199C0D
          item:
            host: 'Azure Virtual Machine by HTTP'
            key: azure.vm.network.in.total
        - sortorder: '1'
          color: F63100
          item:
            host: 'Azure Virtual Machine by HTTP'
            key: azure.vm.network.out.total
    - uuid: 41bd1642704c4d3fbe4fb34c8c389320
      name: 'Azure: OS disk read/write Bps'
      graph_items:
        - color: 199C0D
          item:
            host: 'Azure Virtual Machine by HTTP'
            key: azure.vm.os.disk.read.bps
        - sortorder: '1'
          color: F63100
          item:
            host: 'Azure Virtual Machine by HTTP'
            key: azure.vm.os.disk.write.bps
    - uuid: df77fe1de4ae46f98744ff73ed427b3b
      name: 'Azure: OS disk read/write IOPS'
      graph_items:
        - color: 199C0D
          item:
            host: 'Azure Virtual Machine by HTTP'
            key: azure.vm.os.disk.read.ops
        - sortorder: '1'
          color: F63100
          item:
            host: 'Azure Virtual Machine by HTTP'
            key: azure.vm.os.disk.write.ops
    - uuid: 39ca70fc12cf4c6d9fdc23e8562b2f13
      name: 'Azure: Percentage CPU'
      graph_items:
        - color: 199C0D
          item:
            host: 'Azure Virtual Machine by HTTP'
            key: azure.vm.cpu.utilization
    - uuid: 3051d683b44b48ee94030465254abc7f
      name: 'Azure: Premium data disk cache read'
      graph_items:
        - color: 199C0D
          item:
            host: 'Azure Virtual Machine by HTTP'
            key: azure.vm.premium.data.disk.cache.read.hit
        - sortorder: '1'
          color: F63100
          item:
            host: 'Azure Virtual Machine by HTTP'
            key: azure.vm.premium.data.disk.cache.read.miss
    - uuid: d727dc11deaa46b282892552c9b03752
      name: 'Azure: Premium OS disk cache read'
      graph_items:
        - color: 199C0D
          item:
            host: 'Azure Virtual Machine by HTTP'
            key: azure.vm.premium.os.disk.cache.read.hit
        - sortorder: '1'
          color: F63100
          item:
            host: 'Azure Virtual Machine by HTTP'
            key: azure.vm.premium.os.disk.cache.read.miss
    - uuid: 3b278de1b81a4be7acc865568962c323
      name: 'Azure Microsoft SQL: Connections'
      graph_items:
        - color: 199C0D
          item:
            host: 'Azure Microsoft SQL Database by HTTP'
            key: azure.db.mssql.connections.successful
        - sortorder: '1'
          color: F63100
          item:
            host: 'Azure Microsoft SQL Database by HTTP'
            key: azure.db.mssql.connections.failed.system
        - sortorder: '2'
          color: 00611C
          item:
            host: 'Azure Microsoft SQL Database by HTTP'
            key: azure.db.mssql.firewall.blocked
    - uuid: a266fd856e0f49288ee96b98c6fce4b9
      name: 'Azure Microsoft SQL: Connections'
      graph_items:
        - color: 199C0D
          item:
            host: 'Azure Microsoft SQL DTU Database by HTTP'
            key: azure.db.mssql.connections.successful
        - sortorder: '1'
          color: F63100
          item:
            host: 'Azure Microsoft SQL DTU Database by HTTP'
            key: azure.db.mssql.connections.failed.system
        - sortorder: '2'
          color: 00611C
          item:
            host: 'Azure Microsoft SQL DTU Database by HTTP'
            key: azure.db.mssql.firewall.blocked
    - uuid: 62a9a5e1fb044a52a0b534bd4eeea914
      name: 'Azure Microsoft SQL: Connections'
      graph_items:
        - color: 199C0D
          item:
            host: 'Azure Microsoft SQL Serverless Database by HTTP'
            key: azure.db.mssql.connections.successful
        - sortorder: '1'
          color: F63100
          item:
            host: 'Azure Microsoft SQL Serverless Database by HTTP'
            key: azure.db.mssql.connections.failed.system
        - sortorder: '2'
          color: 00611C
          item:
            host: 'Azure Microsoft SQL Serverless Database by HTTP'
            key: azure.db.mssql.firewall.blocked
    - uuid: fe250a5f509d45babea9fcd12accbcac
      name: 'Azure Microsoft SQL: CPU usage'
      graph_items:
        - color: 199C0D
          item:
            host: 'Azure Microsoft SQL Database by HTTP'
            key: azure.db.mssql.cpu.limit
        - sortorder: '1'
          color: F63100
          item:
            host: 'Azure Microsoft SQL Database by HTTP'
            key: azure.db.mssql.cpu.used
    - uuid: 083d307db8954fc59e8e5cfccefc16c1
      name: 'Azure Microsoft SQL: CPU usage'
      graph_items:
        - color: 199C0D
          item:
            host: 'Azure Microsoft SQL Serverless Database by HTTP'
            key: azure.db.mssql.cpu.limit
        - sortorder: '1'
          color: F63100
          item:
            host: 'Azure Microsoft SQL Serverless Database by HTTP'
            key: azure.db.mssql.cpu.used
    - uuid: 0849698704cb40cab4ce62d3eb093717
      name: 'Azure Microsoft SQL: DTU usage'
      graph_items:
        - color: 199C0D
          item:
            host: 'Azure Microsoft SQL DTU Database by HTTP'
            key: azure.db.mssql.dtu.limit
        - sortorder: '1'
          color: F63100
          item:
            host: 'Azure Microsoft SQL DTU Database by HTTP'
            key: azure.db.mssql.dtu.used
    - uuid: ec5714017c744484be8c264d24a0e694
      name: 'Azure Microsoft SQL: Storage utilization'
      graph_items:
        - color: 199C0D
          item:
            host: 'Azure Microsoft SQL Database by HTTP'
            key: azure.db.mssql.storage.used
        - sortorder: '1'
          color: F63100
          item:
            host: 'Azure Microsoft SQL Database by HTTP'
            key: azure.db.mssql.storage.allocated
    - uuid: 3aebd39180de4314a7129d2c5deb6b6a
      name: 'Azure Microsoft SQL: Storage utilization'
      graph_items:
        - color: 199C0D
          item:
            host: 'Azure Microsoft SQL DTU Database by HTTP'
            key: azure.db.mssql.storage.used
        - sortorder: '1'
          color: F63100
          item:
            host: 'Azure Microsoft SQL DTU Database by HTTP'
            key: azure.db.mssql.storage.allocated
    - uuid: f541b6591683433aba4b3e58a8ad1e5c
      name: 'Azure Microsoft SQL: Storage utilization'
      graph_items:
        - color: 199C0D
          item:
            host: 'Azure Microsoft SQL Serverless Database by HTTP'
            key: azure.db.mssql.storage.used
        - sortorder: '1'
          color: F63100
          item:
            host: 'Azure Microsoft SQL Serverless Database by HTTP'
            key: azure.db.mssql.storage.allocated
    - uuid: 89256a1eba8c49d2b7469a68ff050ac5
      name: 'Azure MongoDB: Latency'
      graph_items:
        - color: 199C0D
          item:
            host: 'Azure Cosmos DB for MongoDB by HTTP'
            key: azure.cosmosdb.server.side.latency.gateway
        - sortorder: '1'
          color: F63100
          item:
            host: 'Azure Cosmos DB for MongoDB by HTTP'
            key: azure.cosmosdb.server.side.latency
        - sortorder: '2'
          color: 00611C
          item:
            host: 'Azure Cosmos DB for MongoDB by HTTP'
            key: azure.cosmosdb.server.side.latency.direct
        - sortorder: '3'
          color: F7941D
          item:
            host: 'Azure Cosmos DB for MongoDB by HTTP'
            key: azure.cosmosdb.replication.latency
    - uuid: a1225fc27d334c5bbb5043e3d468bf02
      name: 'Azure MongoDB: Requests'
      graph_items:
        - color: 199C0D
          item:
            host: 'Azure Cosmos DB for MongoDB by HTTP'
            key: azure.cosmosdb.total.requests
        - sortorder: '1'
          color: F63100
          item:
            host: 'Azure Cosmos DB for MongoDB by HTTP'
            key: azure.cosmosdb.total.request.units
        - sortorder: '2'
          color: 00611C
          item:
            host: 'Azure Cosmos DB for MongoDB by HTTP'
            key: azure.cosmosdb.metadata.requests
        - sortorder: '3'
          color: F7941D
          item:
            host: 'Azure Cosmos DB for MongoDB by HTTP'
            key: azure.cosmosdb.mongo.requests
        - sortorder: '4'
          color: FC6EA3
          item:
            host: 'Azure Cosmos DB for MongoDB by HTTP'
            key: azure.cosmosdb.mongo.requests.charge
    - uuid: 07168aaf3abb42f6b61746cc6e2d2910
      name: 'Azure MongoDB: Usage'
      graph_items:
        - color: 199C0D
          item:
            host: 'Azure Cosmos DB for MongoDB by HTTP'
            key: azure.cosmosdb.data.usage
        - sortorder: '1'
          color: F63100
          item:
            host: 'Azure Cosmos DB for MongoDB by HTTP'
            key: azure.cosmosdb.index.usage
        - sortorder: '2'
          color: 00611C
          item:
            host: 'Azure Cosmos DB for MongoDB by HTTP'
            key: azure.cosmosdb.document.quota
    - uuid: 750ae48e6ef749c19a06f4bbe716f92f
      name: 'Azure MySQL: Connections'
      graph_items:
        - color: 199C0D
          item:
            host: 'Azure MySQL Flexible Server by HTTP'
            key: azure.db.mysql.connections.active
        - sortorder: '1'
          color: F63100
          item:
            host: 'Azure MySQL Flexible Server by HTTP'
            key: azure.db.mysql.connections.total
        - sortorder: '2'
          color: 00611C
          item:
            host: 'Azure MySQL Flexible Server by HTTP'
            key: azure.db.mysql.connections.aborted
    - uuid: 360a24b56be74cf48df3135008437824
      name: 'Azure MySQL: Connections'
      graph_items:
        - color: 199C0D
          item:
            host: 'Azure MySQL Single Server by HTTP'
            key: azure.db.mysql.connections.active
        - sortorder: '1'
          color: F63100
          item:
            host: 'Azure MySQL Single Server by HTTP'
            key: azure.db.mysql.connections.failed
    - uuid: f929f47602734f82a79f22a5f4446f61
      name: 'Azure MySQL: Network traffic'
      graph_items:
        - color: 199C0D
          item:
            host: 'Azure MySQL Flexible Server by HTTP'
            key: azure.db.mysql.network.egress
        - sortorder: '1'
          color: F63100
          item:
            host: 'Azure MySQL Flexible Server by HTTP'
            key: azure.db.mysql.network.ingress
    - uuid: dc6840162405481ebc1c3c98fdfcaef1
      name: 'Azure MySQL: Network traffic'
      graph_items:
        - color: 199C0D
          item:
            host: 'Azure MySQL Single Server by HTTP'
            key: azure.db.mysql.network.egress
        - sortorder: '1'
          color: F63100
          item:
            host: 'Azure MySQL Single Server by HTTP'
            key: azure.db.mysql.network.ingress
    - uuid: 3fcf43fd338e4902874d940fc0bec8b9
      name: 'Azure MySQL: Server log storage utilization'
      graph_items:
        - color: 199C0D
          item:
            host: 'Azure MySQL Single Server by HTTP'
            key: azure.db.mysql.storage.server.log.used
        - sortorder: '1'
          color: F63100
          item:
            host: 'Azure MySQL Single Server by HTTP'
            key: azure.db.mysql.storage.server.log.limit
    - uuid: 4210e6b4ed8744589dce88217e961a56
      name: 'Azure MySQL: Storage utilization'
      graph_items:
        - color: 199C0D
          item:
            host: 'Azure MySQL Flexible Server by HTTP'
            key: azure.db.mysql.storage.used
        - sortorder: '1'
          color: F63100
          item:
            host: 'Azure MySQL Flexible Server by HTTP'
            key: azure.db.mysql.storage.limit
    - uuid: bdc178e6faaa4850badc0c60c7c80d40
      name: 'Azure MySQL: Storage utilization'
      graph_items:
        - color: 199C0D
          item:
            host: 'Azure MySQL Single Server by HTTP'
            key: azure.db.mysql.storage.used
        - sortorder: '1'
          color: F63100
          item:
            host: 'Azure MySQL Single Server by HTTP'
            key: azure.db.mysql.storage.limit
    - uuid: 2b60e8b1fd7c43f4ac61812e43c0e1ca
      name: 'Azure PostgreSQL: Connections'
      graph_items:
        - color: 199C0D
          item:
            host: 'Azure PostgreSQL Flexible Server by HTTP'
            key: azure.db.pgsql.connections.active
        - sortorder: '1'
          color: F63100
          item:
            host: 'Azure PostgreSQL Flexible Server by HTTP'
            key: azure.db.pgsql.connections.succeeded
        - sortorder: '2'
          color: 00611C
          item:
            host: 'Azure PostgreSQL Flexible Server by HTTP'
            key: azure.db.pgsql.connections.failed
    - uuid: c76cf8ec6a584af6be815ec4a9257a8c
      name: 'Azure PostgreSQL: Connections'
      graph_items:
        - color: 199C0D
          item:
            host: 'Azure PostgreSQL Single Server by HTTP'
            key: azure.db.pgsql.connections.active
        - sortorder: '1'
          color: F63100
          item:
            host: 'Azure PostgreSQL Single Server by HTTP'
            key: azure.db.pgsql.connections.failed
    - uuid: a4679d243b574bea84397c980723c68b
      name: 'Azure PostgreSQL: Network traffic'
      graph_items:
        - color: 199C0D
          item:
            host: 'Azure PostgreSQL Flexible Server by HTTP'
            key: azure.db.pgsql.network.egress
        - sortorder: '1'
          color: F63100
          item:
            host: 'Azure PostgreSQL Flexible Server by HTTP'
            key: azure.db.pgsql.network.ingress
    - uuid: 8bc17d843775414ea971e640e1fe5ec0
      name: 'Azure PostgreSQL: Network traffic'
      graph_items:
        - color: 199C0D
          item:
            host: 'Azure PostgreSQL Single Server by HTTP'
            key: azure.db.pgsql.network.egress
        - sortorder: '1'
          color: F63100
          item:
            host: 'Azure PostgreSQL Single Server by HTTP'
            key: azure.db.pgsql.network.ingress
    - uuid: 9e750a5a462b4429ac5a36a72bd60c66
      name: 'Azure PostgreSQL: Server log storage utilization'
      graph_items:
        - color: 199C0D
          item:
            host: 'Azure PostgreSQL Single Server by HTTP'
            key: azure.db.pgsql.storage.server.log.used
        - sortorder: '1'
          color: F63100
          item:
            host: 'Azure PostgreSQL Single Server by HTTP'
            key: azure.db.pgsql.storage.server.log.limit
    - uuid: 5fa13cfbdd784475818fae06ff94f879
      name: 'Azure PostgreSQL: Storage utilization'
      graph_items:
        - color: 199C0D
          item:
            host: 'Azure PostgreSQL Flexible Server by HTTP'
            key: azure.db.pgsql.storage.used
        - sortorder: '1'
          color: F63100
          item:
            host: 'Azure PostgreSQL Flexible Server by HTTP'
            key: azure.db.pgsql.storage.free
    - uuid: 9ecd071a77364c4486fa5f63125cd985
      name: 'Azure PostgreSQL: Storage utilization'
      graph_items:
        - color: 199C0D
          item:
            host: 'Azure PostgreSQL Single Server by HTTP'
            key: azure.db.pgsql.storage.used
        - sortorder: '1'
          color: F63100
          item:
            host: 'Azure PostgreSQL Single Server by HTTP'
            key: azure.db.pgsql.storage.limit
    - uuid: 36ff6447ea4f403eb0f13dc6322c99ea
      name: 'CPU Utilization'
      graph_items:
        - color: 199C0D
          item:
            host: 'Azure VM Scale Set by HTTP'
            key: azure.scaleset.cpu.utilization
    - uuid: 66b7d2f063064a1b8912e2b2e57d2d40
      name: 'Data disk IOPS read/write'
      graph_items:
        - color: 199C0D
          item:
            host: 'Azure VM Scale Set by HTTP'
            key: azure.scaleset.data.disk.read.ops
        - sortorder: '1'
          color: F63100
          item:
            host: 'Azure VM Scale Set by HTTP'
            key: azure.scaleset.data.disk.write.ops
    - uuid: 9bbdd448793e41b6b8aef38c7cad41c6
      name: 'Data disk read/write Bps'
      graph_items:
        - color: 199C0D
          item:
            host: 'Azure VM Scale Set by HTTP'
            key: azure.scaleset.data.disk.read.bps
        - sortorder: '1'
          color: F63100
          item:
            host: 'Azure VM Scale Set by HTTP'
            key: azure.scaleset.data.disk.write.bps
    - uuid: 2d0a30934cf7444f89fe031178599abc
      name: 'Disk IOPS read/write'
      graph_items:
        - color: 199C0D
          item:
            host: 'Azure VM Scale Set by HTTP'
            key: azure.scaleset.disk.read.ops
        - sortorder: '1'
          color: F63100
          item:
            host: 'Azure VM Scale Set by HTTP'
            key: azure.scaleset.disk.write.ops
    - uuid: 7b724a3805d84dbb99fcbf5c2fd633b4
      name: 'Disk read/write bytes'
      graph_items:
        - color: 199C0D
          item:
            host: 'Azure VM Scale Set by HTTP'
            key: azure.scaleset.disk.read
        - sortorder: '1'
          color: F63100
          item:
            host: 'Azure VM Scale Set by HTTP'
            key: azure.scaleset.disk.write
    - uuid: e4d6ccffbf274347a3fdade920467ae2
      name: Flows
      graph_items:
        - color: 199C0D
          item:
            host: 'Azure VM Scale Set by HTTP'
            key: azure.scaleset.flows.inbound
        - sortorder: '1'
          color: F63100
          item:
            host: 'Azure VM Scale Set by HTTP'
            key: azure.scaleset.flows.outbound
        - sortorder: '2'
          color: 00611C
          item:
            host: 'Azure VM Scale Set by HTTP'
            key: azure.scaleset.flows.inbound.max
        - sortorder: '3'
          color: F7941D
          item:
            host: 'Azure VM Scale Set by HTTP'
            key: azure.scaleset.flows.outbound.max
    - uuid: e1fff55999a6420f987659ca0dc8c102
      name: 'Intel SR1530 IPMI: Fan speed and ambient temperature'
      graph_items:
        - color: 199C0D
          item:
            host: 'Intel SR1530 IPMI'
            key: bb_ambient_temp
        - sortorder: '1'
          color: F63100
          item:
            host: 'Intel SR1530 IPMI'
            key: system_fan_3
    - uuid: bec82c29b93c4841a89d0978a899c70b
      name: 'Intel SR1530 IPMI: Voltage'
      graph_items:
        - color: 199C0D
          item:
            host: 'Intel SR1530 IPMI'
            key: power
        - sortorder: '1'
          color: F63100
          item:
            host: 'Intel SR1530 IPMI'
            key: bb_1.8v_sm
        - sortorder: '2'
          color: 00611C
          item:
            host: 'Intel SR1530 IPMI'
            key: bb_3.3v
        - sortorder: '3'
          color: F7941D
          item:
            host: 'Intel SR1530 IPMI'
            key: bb_3.3v_stby
        - sortorder: '4'
          color: FC6EA3
          item:
            host: 'Intel SR1530 IPMI'
            key: bb_5.0v
        - sortorder: '5'
          color: 6C59DC
          item:
            host: 'Intel SR1530 IPMI'
            key: processor_vcc
    - 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: 9109c16ec3b540118aff0e458fb00580
      name: 'Network traffic, bytes'
      graph_items:
        - color: 199C0D
          item:
            host: 'Azure VM Scale Set by HTTP'
            key: azure.scaleset.network.in.total
        - sortorder: '1'
          color: F63100
          item:
            host: 'Azure VM Scale Set by HTTP'
            key: azure.scaleset.network.out.total
    - uuid: 079e812dd9af48cda80993ad9b3a59d0
      name: 'OS disk IOPS read/write'
      graph_items:
        - color: 199C0D
          item:
            host: 'Azure VM Scale Set by HTTP'
            key: azure.scaleset.os.disk.read.ops
        - sortorder: '1'
          color: F63100
          item:
            host: 'Azure VM Scale Set by HTTP'
            key: azure.scaleset.os.disk.write.ops
    - uuid: de643aefc3b340e3a4cd81216a78709d
      name: 'OS disk read/write Bps'
      graph_items:
        - color: 199C0D
          item:
            host: 'Azure VM Scale Set by HTTP'
            key: azure.scaleset.os.disk.read.bps
        - sortorder: '1'
          color: F63100
          item:
            host: 'Azure VM Scale Set by HTTP'
            key: azure.scaleset.os.disk.write.bps
    - uuid: dd3b9363272949d8a1fef02f6c14229d
      name: 'Premium data disk cache read'
      graph_items:
        - color: 199C0D
          item:
            host: 'Azure VM Scale Set by HTTP'
            key: azure.scaleset.premium.data.disk.cache.read.hit
        - sortorder: '1'
          color: F63100
          item:
            host: 'Azure VM Scale Set by HTTP'
            key: azure.scaleset.premium.data.disk.cache.read.miss
    - uuid: 8a432a338a9540b4888f9f019164acdb
      name: 'Premium OS disk cache read'
      graph_items:
        - color: 199C0D
          item:
            host: 'Azure VM Scale Set by HTTP'
            key: azure.scaleset.premium.os.disk.cache.read.hit
        - sortorder: '1'
          color: F63100
          item:
            host: 'Azure VM Scale Set by HTTP'
            key: azure.scaleset.premium.os.disk.cache.read.miss
    - uuid: b975fcc533c24f2d99f03b424cf23779
      name: 'SNS: Memory usage'
      graph_items:
        - color: '274482'
          calc_fnc: ALL
          item:
            host: 'Stormshield SNS by SNMP'
            key: 'host.memory.total[memTotalReal.0]'
        - sortorder: '1'
          color: 1A7C11
          calc_fnc: ALL
          item:
            host: 'Stormshield SNS by SNMP'
            key: host.memory.available
        - sortorder: '2'
          color: F63100
          calc_fnc: ALL
          item:
            host: 'Stormshield SNS by SNMP'
            key: host.memory.used
    - uuid: 1f8d7ea4dd0f4a5ea68b6ff3174c4c7f
      name: 'SNS: Memory utilization'
      graph_items:
        - color: 1A7C11
          calc_fnc: ALL
          item:
            host: 'Stormshield SNS by SNMP'
            key: host.memory.utilization
    - 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
    - uuid: 8d04afa2c9d2459e926a9c20af37e4f8
      name: 'Virtual machine count'
      graph_items:
        - color: 199C0D
          item:
            host: 'Azure VM Scale Set by HTTP'
            key: azure.scaleset.vm.count
