zabbix_export:
  version: '8.0'
  template_groups:
    - uuid: a571c0d144b14fd4a87a9d9b2aa9fcd6
      name: Templates/Applications
    - uuid: c2c162144c2d4c5491c8801193af4945
      name: Templates/Cloud
  host_groups:
    - uuid: a571c0d144b14fd4a87a9d9b2aa9fcd6
      name: Applications
    - uuid: 748ad4d098d447d492bb935c907f652f
      name: Databases
    - uuid: 137f19e6e2dc4219b33553b812627bc2
      name: 'Virtual machines'
  templates:
    - uuid: b6027e374e424481951ca2256099515c
      template: 'Nutanix Cluster Prism Element by HTTP'
      name: 'Nutanix Cluster Prism Element by HTTP'
      description: |
        Prism Element: It is a service already built into the platform for every Nutanix cluster deployed. It provides the ability to fully configure, manage, and monitor Nutanix clusters running any hypervisors, however, It only manages the cluster it is part of.
        
        This template is designed for the effortless deployment of Nutanix Cluster Prism Element monitoring and doesn't require any external scripts.
        
        This template can be used in discovery, as well as manually linked to a host - to do so, attach it to the host and manually set the value of the '{$NUTANIX.CLUSTER.UUID}' macro.
        
        More details can be found in the official documentation:
          - on retrieving UUIDs: https://www.nutanixbible.com/19b-cli.html
          - on the Nutanix Prism Element REST API: https://www.nutanix.dev/api_reference/apis/prism_v2.html
          - on differences between Nutanix API versions: https://www.nutanix.dev/api-versions/
        
        Generated by official Zabbix template tool "Templator"
      wizard_ready: 'YES'
      readme: |
        ## Overview
        
        This template is designed for the effortless deployment of Nutanix Cluster Prism Element monitoring and doesn't require any external scripts.
        
        This template can be used in discovery, as well as manually linked to a host - to do so, attach it to the host and manually set the value of the `Cluster UUID` host wizard configuration field.
        
        More details can be found in the official documentation:
        - on retrieving [UUIDs](https://www.nutanixbible.com/19b-cli.html);
        - on the [Nutanix Prism Element REST API](https://www.nutanix.dev/api_reference/apis/prism_v2.html);
        - on differences between [Nutanix API versions](https://www.nutanix.dev/api-versions/).
        
        ## Setup
        
        1. Create a new Nutanix user and add the role "Viewer"
        2. Create a new host
        3. Link the template to the host created earlier
        4. Set the host wizard configuration fields required for getting data:
        ```text
        API IP
        API port
        ```
        5. Set the host wizard configuration fields with the login and password of the Nutanix user created earlier:
        ```text
        API username
        API password
        ```
        6. Set the host wizard configuration fields with the UUID of the Nutanix Cluster:
        ```text
        Cluster UUID
        ```
      vendor:
        name: Zabbix
        version: 8.0-1
      groups:
        - name: Templates/Applications
      items:
        - uuid: 3761d4da912749c7a84f11a5cfbcf761
          name: 'Get alert'
          type: SCRIPT
          key: nutanix.cluster.alert.get
          history: '0'
          value_type: TEXT
          params: |
            var Nutanix = {
            	params: {},
            
            	setParams: function (requiredParams, allParams) {
            		requiredParams.forEach(function (field) {
            			if (typeof allParams !== 'object' || typeof allParams[field] === 'undefined' || allParams[field] === '') {
            				throw 'Required param is not set: ' + field + '.';
            			}
            		});
            
            		Nutanix.params = allParams;
            	},
            
            	request: function (url) {
            
            		var request = new HttpRequest();
            
            		if (typeof Nutanix.params.proxy !== 'undefined' && Nutanix.params.proxy !== '') {
            			request.setProxy(Nutanix.params.proxy);
            		}
            
            		request.setHttpAuth(HTTPAUTH_BASIC, Nutanix.params.username, Nutanix.params.password);
            
            		Zabbix.log(4, '[ Nutanix ] Sending request: ' + url);
            
            		const response = request.get(url);
            
            		Zabbix.log(4, '[ Nutanix ] Received response with status code ' + request.getStatus() + ': ' + response);
            
            		if (request.getStatus() < 200 || request.getStatus() >= 300) {
            			throw 'Request failed with status code ' + request.getStatus() + ': ' + response;
            		}
            
            		try {
            			response = JSON.parse(response);
            		}
            		catch (error) {
            			throw 'Failed to parse response received from Nutanix PRISM API. Check debug log for more information.';
            		}
            
            		return response;
            	},
            
            	deduplicateAlerts: function (full_data) {
            		const severity_mapping = [
            			'kinfo',
            			'kwarning',
            			'kcritical'
            		]
            
            		var output_data = {};
            		for (var entity in full_data.entities) {
            	
            			if (Nutanix.params.api_method === 'clusters') {
            				if (result.entities[entity].node_uuid.split('-').length == 5) continue;
            			}
            
            			var severity = severity_mapping.indexOf(full_data.entities[entity].severity.toLowerCase()),
            				message = full_data.entities[entity].message,
            				title = full_data.entities[entity].alert_title;
            	
            			full_data.entities[entity].context_types.forEach(function(context, index) {
            				message = message.replace('{' + context + '}', full_data.entities[entity].context_values[index]);
            				title = title.replace('{' + context + '}', full_data.entities[entity].context_values[index]);
            			});
            	
            			key = md5(title + message);
            			if (key in output_data) {
            				if (full_data.entities[entity].created_time_stamp_in_usecs > output_data[key].created) {
            					output_data[key].created = full_data.entities[entity].created_time_stamp_in_usecs;
            					output_data[key].severity = severity !== -1 ? severity : 3;
            					output_data[key].state = full_data.entities[entity].resolved ? 0 : 1;
            					output_data[key].message = full_data.entities[entity].detailed_message != '' ? full_data.entities[entity].detailed_message : message;
            					output_data[key].last_id = full_data.entities[entity].id;
            				}
            				output_data[key].count += 1;
            			} else {
            				output_data[key] = {
            					"name": title + ' - ' + message,
            					"title": title != '' ? title : message,
            					"created": full_data.entities[entity].created_time_stamp_in_usecs,
            					"severity": severity !== -1 ? severity : 3,
            					"state": full_data.entities[entity].resolved ? 0 : 1,
            					"message": full_data.entities[entity].detailed_message != '' ? full_data.entities[entity].detailed_message : message,
            					"last_id": full_data.entities[entity].id,
            					"count": 1
            				}
            			}
            		}
            
            		return output_data;
            	},
            
            	cleanUnsupported: function (full_stat) {
            		var output_stat = {};
            		for (var element in full_stat) {
            			if (full_stat[element] !== '-1') {
            				output_stat[element] = full_stat[element];
            			}
            		};
            		
            		return output_stat;
            	}
            };
            
            try {
            	const params = JSON.parse(value);
            	Nutanix.setParams(['endpoint_host', 'endpoint_port', 'username', 'password', 'auth_type', 'api_method', 'target_uuid'], params);
            
            	const url = 'https://' + Nutanix.params.endpoint_host + ':' + Nutanix.params.endpoint_port + '/PrismGateway/services/rest/v2.0/' + Nutanix.params.api_method + '/' + Nutanix.params.target_uuid + '/alerts',
            		result = Nutanix.request(url);
            
            	return JSON.stringify(Nutanix.deduplicateAlerts(result));
            }
            catch (error) {
            	error += (String(error).endsWith('.')) ? '' : '.';
            	Zabbix.log(4, '[ Nutanix ] ERROR: ' + error);
            
            	return JSON.stringify({ 'error': error });
            }
          description: 'Get data about alerts.'
          timeout: '{$NUTANIX.TIMEOUT}'
          parameters:
            - name: api_method
              value: clusters
            - name: auth_type
              value: basic
            - name: endpoint_host
              value: '{$NUTANIX.PRISM.ELEMENT.IP}'
            - name: endpoint_port
              value: '{$NUTANIX.PRISM.ELEMENT.PORT}'
            - name: password
              value: '{$NUTANIX.PASSWORD}'
            - name: proxy
              value: '{$NUTANIX.PROXY}'
            - name: target_uuid
              value: '{$NUTANIX.CLUSTER.UUID}'
            - name: username
              value: '{$NUTANIX.USER}'
          tags:
            - tag: component
              value: raw
        - uuid: 1dc2ba69aa5440d8830313157499179e
          name: 'Get alert check'
          type: DEPENDENT
          key: nutanix.cluster.alert.get.check
          value_type: TEXT
          description: 'Data collection check. Check the latest values for details.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.error
              error_handler: CUSTOM_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 3h
          master_item:
            key: nutanix.cluster.alert.get
          tags:
            - tag: component
              value: status
          triggers:
            - uuid: 741e1271a7454b9ab0214ae39b04f9cb
              expression: 'length(last(/Nutanix Cluster Prism Element by HTTP/nutanix.cluster.alert.get.check))>0'
              name: 'Nutanix: Failed to get alert data from the API'
              priority: HIGH
              description: 'Failed to get data from the API. Check the latest values for details.'
              tags:
                - tag: scope
                  value: availability
        - uuid: 5567209755544223bf83e977ec209eaa
          name: 'General: Cluster operation mode'
          type: DEPENDENT
          key: nutanix.cluster.cluster.operation.mode
          description: |
            The cluster operation mode. One of the following:
            - NORMAL;
            - OVERRIDE;
            - READONLY;
            - STANDALONE;
            - SWITCH_TO_TWO_NODE;
            - UNKNOWN.
          valuemap:
            name: 'Nutanix: Cluster operation mode'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.operation_mode
              error_handler: DISCARD_VALUE
            - type: JAVASCRIPT
              parameters:
                - |
                  const idx = [
                    'NORMAL',
                    'OVERRIDE',
                    'READONLY',
                    'STANDALONE',
                    'SWITCH_TO_TWO_NODE'
                  ].indexOf(value.toUpperCase());
                  return idx !== -1 ? idx : 5;
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: application
        - uuid: c11c24fa7c7047f5ba5f7f39bccb656e
          name: 'Content Cache: References'
          type: DEPENDENT
          key: nutanix.cluster.content.cache.dedup.ref.num
          description: 'Average number of content cache references.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.content_cache_num_dedup_ref_count_pph
              error_handler: DISCARD_VALUE
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: application
        - uuid: e1696a8e6028406e8e9005ebc295a4fa
          name: 'Content Cache: Hit rate, %'
          type: DEPENDENT
          key: nutanix.cluster.content.cache.hit.percent
          value_type: FLOAT
          units: '%'
          description: 'Content cache hits over all lookups.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.content_cache_hit_ppm
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '0.0001'
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: application
        - uuid: fc40402b8e51471fb3299796c62a9669
          name: 'Content Cache: Logical memory usage, bytes'
          type: DEPENDENT
          key: nutanix.cluster.content.cache.logical.memory.usage.bytes
          units: B
          description: 'Logical memory used to cache data without deduplication in bytes.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.content_cache_logical_memory_usage_bytes
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: application
            - tag: component
              value: memory
        - uuid: 24b35405698e4e4d95ef2be9c5d0d44f
          name: 'Content Cache: Logical SSD usage, bytes'
          type: DEPENDENT
          key: nutanix.cluster.content.cache.logical.ssd.usage.bytes
          units: B
          description: 'Logical SSD memory used to cache data without deduplication in bytes.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.content_cache_logical_ssd_usage_bytes
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: application
            - tag: component
              value: memory
        - uuid: 91b14b7aec844e38805b003b89059304
          name: 'Content Cache: Number of lookups'
          type: DEPENDENT
          key: nutanix.cluster.content.cache.lookups.num
          description: 'Number of lookups on the content cache.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.content_cache_num_lookups
              error_handler: DISCARD_VALUE
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: application
        - uuid: 95f4f380b95945d182fd99053477b592
          name: 'Content Cache: Physical memory usage, bytes'
          type: DEPENDENT
          key: nutanix.cluster.content.cache.physical.memory.usage.bytes
          units: B
          description: 'Real memory used to cache data via the content cache in bytes.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.content_cache_physical_memory_usage_bytes
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: application
            - tag: component
              value: memory
        - uuid: f2ecb476122e4289972b3132178c969e
          name: 'Content Cache: Physical SSD usage, bytes'
          type: DEPENDENT
          key: nutanix.cluster.content.cache.physical.ssd.usage.bytes
          units: B
          description: 'Real SSD usage used to cache data via the content cache in bytes.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.content_cache_physical_ssd_usage_bytes
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: application
            - tag: component
              value: memory
        - uuid: aa48c01e28d840e6a2bb87b892835f48
          name: 'Content Cache: Logical saved memory usage, bytes'
          type: DEPENDENT
          key: nutanix.cluster.content.cache.saved.memory.usage.bytes
          units: B
          description: 'Memory saved due to content cache deduplication in bytes.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.content_cache_saved_memory_usage_bytes
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: application
            - tag: component
              value: memory
        - uuid: 894a313d9eb5409ba7c198c62cf7d9f9
          name: 'Content Cache: Saved SSD usage, bytes'
          type: DEPENDENT
          key: nutanix.cluster.content.cache.saved.ssd.usage.bytes
          units: B
          description: 'SSD usage saved due to content cache deduplication in bytes.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.content_cache_saved_ssd_usage_bytes
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: application
            - tag: component
              value: memory
        - uuid: c107dffc846940f2b32e1d7d01a22cb6
          name: 'Controller: Random IO'
          type: DEPENDENT
          key: nutanix.cluster.controller.io.random
          description: 'The number of random Input/Output operations from the controller.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.controller_num_random_io
              error_handler: DISCARD_VALUE
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: application
        - uuid: eea230e867044336a10f8308f05b5c32
          name: 'Controller: Random IO, %'
          type: DEPENDENT
          key: nutanix.cluster.controller.io.random.percent
          value_type: FLOAT
          units: '%'
          description: 'The percentage of random Input/Output from the controller.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.controller_random_io_ppm
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '0.0001'
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: application
        - uuid: ef919d4e2bff4cbc94bd59be2cfb50f4
          name: 'Controller: Sequence IO'
          type: DEPENDENT
          key: nutanix.cluster.controller.io.sequence
          description: 'The number of sequential Input/Output operations from the controller.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.controller_num_seq_io
              error_handler: DISCARD_VALUE
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: application
        - uuid: 058564b6e59f470c9ef74a9d6b68d8d9
          name: 'Controller: Sequence IO, %'
          type: DEPENDENT
          key: nutanix.cluster.controller.io.sequence.percent
          value_type: FLOAT
          units: '%'
          description: 'The percentage of sequential Input/Output from the controller.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.controller_seq_io_ppm
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '0.0001'
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: application
        - uuid: f9a5a272fad04acb8d5fc1d806e01d60
          name: 'General: IO'
          type: DEPENDENT
          key: nutanix.cluster.general.io
          description: 'The number of Input/Output operations from the disk.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.num_io
              error_handler: DISCARD_VALUE
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: application
        - uuid: 642236ff71de4ead98e8f738e8524694
          name: 'General: IO, bandwidth'
          type: DEPENDENT
          key: nutanix.cluster.general.io.bandwidth
          units: Bps
          description: 'Data transferred in B/sec from the disk.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.io_bandwidth_kBps
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1024'
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: application
        - uuid: bedecc8f97b74f7287a4a094fe26cfe7
          name: 'General: IO, latency'
          type: DEPENDENT
          key: nutanix.cluster.general.io.latency
          value_type: FLOAT
          units: s
          description: 'Input/Output latency from the disk.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.avg_io_latency_usecs
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1.0E-6'
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: application
        - uuid: ee2c4b096f0f4ac1b60b6441094fe076
          name: 'General: Random IO'
          type: DEPENDENT
          key: nutanix.cluster.general.io.random
          description: 'The number of random Input/Output operations.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.num_random_io
              error_handler: DISCARD_VALUE
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: application
        - uuid: c03b24dc56ae4c23a82578479ae2eb6d
          name: 'General: Random IO, %'
          type: DEPENDENT
          key: nutanix.cluster.general.io.random.percent
          value_type: FLOAT
          units: '%'
          description: 'The percentage of random Input/Output operations.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.random_io_ppm
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '0.0001'
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: application
        - uuid: 78e01fe5d2dd4f07b9ee34b49fac9ca4
          name: 'General: Read IO'
          type: DEPENDENT
          key: nutanix.cluster.general.io.read
          description: 'Total number of Input/Output read operations.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.num_read_io
              error_handler: DISCARD_VALUE
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: application
        - uuid: 6fb8985279ff4aeb932270322a4e41f6
          name: 'General: Read IO, bandwidth'
          type: DEPENDENT
          key: nutanix.cluster.general.io.read.bandwidth
          units: Bps
          description: 'Read data transferred in B/sec from the disk.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.read_io_bandwidth_kBps
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1024'
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: application
        - uuid: a6fcbeca6b1648659e0e74225d40863a
          name: 'General: Read IO, latency'
          type: DEPENDENT
          key: nutanix.cluster.general.io.read.latency
          value_type: FLOAT
          units: s
          description: 'Average Input/Output read latency.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.avg_read_io_latency_usecs
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1.0E-6'
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: application
        - uuid: d2b762b0b9b74e8a8e8a8e40a3e932cf
          name: 'General: Read IO, %'
          type: DEPENDENT
          key: nutanix.cluster.general.io.read.percent
          value_type: FLOAT
          units: '%'
          description: 'The total percentage of Input/Output operations that are reads.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.read_io_ppm
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '0.0001'
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: application
        - uuid: ba49928014e64b8d8f90dbc76c2b6b57
          name: 'General: IO total read, bytes'
          type: DEPENDENT
          key: nutanix.cluster.general.io.read.total.bytes
          units: B
          description: 'Total size of Input/Output read operations.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.total_read_io_size_kbytes
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1024'
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: application
        - uuid: 30a67ff848484e4e9552a1bcd66c1f68
          name: 'General: IO total read, sec'
          type: DEPENDENT
          key: nutanix.cluster.general.io.read.total.sec
          value_type: FLOAT
          units: s
          description: 'Total time of Input/Output read operations.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.total_read_io_time_usecs
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1.0E-6'
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: application
        - uuid: 9ce271586ac249d2b2fa27fa9b3e3878
          name: 'General: Sequence IO'
          type: DEPENDENT
          key: nutanix.cluster.general.io.sequence
          description: 'The number of sequential Input/Output operations.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.num_seq_io
              error_handler: DISCARD_VALUE
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: application
        - uuid: 97990e2fb53b464cadc13d0038f21199
          name: 'General: Sequence IO, %'
          type: DEPENDENT
          key: nutanix.cluster.general.io.sequence.percent
          value_type: FLOAT
          units: '%'
          description: 'The percentage of sequential Input/Output.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.seq_io_ppm
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '0.0001'
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: application
        - uuid: a01ae646308045d3b88d8e917000018c
          name: 'General: IO total, bytes'
          type: DEPENDENT
          key: nutanix.cluster.general.io.total.bytes
          units: B
          description: 'Total size of Input/Output operations.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.total_io_size_kbytes
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1024'
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: application
        - uuid: 108356c5fd5c49c79840b7a6d9de8659
          name: 'General: IO total, sec'
          type: DEPENDENT
          key: nutanix.cluster.general.io.total.sec
          value_type: FLOAT
          units: s
          description: 'Total time of Input/Output operations.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.total_io_time_usecs
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1.0E-6'
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: application
        - uuid: f9b61618e2e545ac9e859d101bc10651
          name: 'General: Write IO'
          type: DEPENDENT
          key: nutanix.cluster.general.io.write
          description: 'Input/Output write operations from the disk.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.num_write_io
              error_handler: DISCARD_VALUE
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: application
        - uuid: 86dea3be95e44cac9b4a7ab8b5105681
          name: 'General: Write IO, bandwidth'
          type: DEPENDENT
          key: nutanix.cluster.general.io.write.bandwidth
          units: Bps
          description: 'Write data transferred in B/sec from the disk.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.write_io_bandwidth_kBps
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1024'
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: application
        - uuid: 700b81f909c1471eb2fc0611e74876f3
          name: 'General: Write IO, latency'
          type: DEPENDENT
          key: nutanix.cluster.general.io.write.latency
          value_type: FLOAT
          units: s
          description: 'Average Input/Output write operation latency.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.avg_write_io_latency_usecs
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1.0E-6'
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: application
        - uuid: 41950b93ee44469c8589bb5c0f8c0911
          name: 'General: Write IO, %'
          type: DEPENDENT
          key: nutanix.cluster.general.io.write.percent
          value_type: FLOAT
          units: '%'
          description: 'Total percentage of Input/Output operations that are writes.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.write_io_ppm
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '0.0001'
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: application
        - uuid: 4aedd6caaa014e42a7bacac34e9809ac
          name: 'General: IOPS'
          type: DEPENDENT
          key: nutanix.cluster.general.iops
          units: '!iops'
          description: 'Input/Output operations per second from the disk.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.num_iops
              error_handler: DISCARD_VALUE
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: application
        - uuid: c9e26c8d0e2f44089a9591769ab2eceb
          name: 'General: Read IOPS'
          type: DEPENDENT
          key: nutanix.cluster.general.iops.read
          units: '!iops'
          description: 'Input/Output read operations per second from the disk.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.num_read_iops
              error_handler: DISCARD_VALUE
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: application
        - uuid: 96182d97edac497883185899cd978f26
          name: 'General: Write IOPS'
          type: DEPENDENT
          key: nutanix.cluster.general.iops.write
          value_type: FLOAT
          units: '!iops'
          description: 'Total number of Input/Output write operations per second.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.num_write_iops
              error_handler: DISCARD_VALUE
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: application
        - uuid: f9433014206a42d3aecf207448f6dee0
          name: 'General: Storage capacity, bytes'
          type: DEPENDENT
          key: nutanix.cluster.general.storage.capacity.bytes
          units: B
          description: 'Total size of the datastores used by this system in bytes.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$.usage_stats.[''storage.capacity_bytes'']'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: storage
        - uuid: 702544e35ca1490cb401d7730df044fd
          name: 'General: Storage free, bytes'
          type: DEPENDENT
          key: nutanix.cluster.general.storage.free.bytes
          units: B
          description: 'Total free space of the datastores used by this system in bytes.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$.usage_stats.[''storage.free_bytes'']'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: storage
        - uuid: 87a495b3a7e246e187d034166ec9e19d
          name: 'General: Storage logical usage, bytes'
          type: DEPENDENT
          key: nutanix.cluster.general.storage.logical.usage.bytes
          units: B
          description: 'Total logical space used by the datastores of this system in bytes.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$.usage_stats.[''storage.logical_usage_bytes'']'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: storage
        - uuid: 02809b0e347d49eeb1f8a8deac32af86
          name: 'General: Storage usage, bytes'
          type: DEPENDENT
          key: nutanix.cluster.general.storage.usage.bytes
          units: B
          description: 'Total physical datastore space used by this host and all its snapshots on the datastores.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$.usage_stats.[''storage.usage_bytes'']'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: storage
        - uuid: 4df3faff926b4d92bffd46949e6443bf
          name: 'General: Timespan, sec'
          type: DEPENDENT
          key: nutanix.cluster.general.timespan.sec
          value_type: FLOAT
          units: s
          description: 'Cluster timespan.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.timespan_usecs
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1.0E-6'
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: application
        - uuid: 9b9d93d4a09c45d2bd61a530f5e35fe9
          name: 'General: Total transformed usage, bytes'
          type: DEPENDENT
          key: nutanix.cluster.general.transformed.usage.total.bytes
          units: B
          description: 'Actual usage of storage.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.total_transformed_usage_bytes
              error_handler: DISCARD_VALUE
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: application
        - uuid: 1d7c83bbf00149b2a37c1f983d44f403
          name: 'General: Total untransformed usage, bytes'
          type: DEPENDENT
          key: nutanix.cluster.general.untransformed.usage.total.bytes
          units: B
          description: 'Logical usage of storage (physical usage divided by the replication factor).'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.total_untransformed_usage_bytes
              error_handler: DISCARD_VALUE
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: application
        - uuid: 252f167e9e7d4db1abcfa9808a0c06d9
          name: 'General: Upgrade progress'
          type: DEPENDENT
          key: nutanix.cluster.general.upgrade.progress
          description: 'Indicates whether the cluster is currently in an update state.'
          valuemap:
            name: 'Nutanix: Boolean'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.is_upgrade_in_progress
              error_handler: DISCARD_VALUE
            - type: BOOL_TO_DECIMAL
              error_handler: CUSTOM_VALUE
              error_handler_params: '2'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: application
        - uuid: 400a5d3e0f1c47cd881c1dfe04b65948
          name: 'General: Version'
          type: DEPENDENT
          key: nutanix.cluster.general.upgrade.version
          value_type: CHAR
          description: 'Current software version in the cluster.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.version
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 12h
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: application
        - uuid: 4f03001a7caa42d29cc2213137fbbb16
          name: 'Hypervisor: CPU usage, %'
          type: DEPENDENT
          key: nutanix.cluster.hypervisor.cpu.usage.percent
          value_type: FLOAT
          units: '%'
          description: 'Percentage of CPU used by the Hypervisor.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.hypervisor_cpu_usage_ppm
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '0.0001'
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: cpu
        - uuid: a5338864811a4e5795ead521cbcf875e
          name: 'Hypervisor: IO'
          type: DEPENDENT
          key: nutanix.cluster.hypervisor.io
          value_type: FLOAT
          description: 'The number of Input/Output operations from the Hypervisor.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.hypervisor_num_io
              error_handler: DISCARD_VALUE
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: application
        - uuid: 1f56c2405992402e8897cde88f36284e
          name: 'Hypervisor: IO, bandwidth'
          type: DEPENDENT
          key: nutanix.cluster.hypervisor.io.bandwidth
          units: Bps
          description: 'Data transferred in B/sec from the Hypervisor.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.hypervisor_io_bandwidth_kBps
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1024'
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: application
        - uuid: f4a46c9187584d88a256eb364884303f
          name: 'Hypervisor: IO, latency'
          type: DEPENDENT
          key: nutanix.cluster.hypervisor.io.latency
          value_type: FLOAT
          units: s
          description: 'Input/Output operation latency from the Hypervisor.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.hypervisor_avg_io_latency_usecs
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1.0E-6'
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: application
        - uuid: 58fe88d634a045f0ba0259ea2e55e757
          name: 'Hypervisor: Read IO'
          type: DEPENDENT
          key: nutanix.cluster.hypervisor.io.read
          description: 'The number of Input/Output read operations from the Hypervisor.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.hypervisor_num_read_io
              error_handler: DISCARD_VALUE
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: application
        - uuid: cbf141d09f7347b2b3fdb16ccd6e172c
          name: 'Hypervisor: Read IO, bandwidth'
          type: DEPENDENT
          key: nutanix.cluster.hypervisor.io.read.bandwidth
          units: Bps
          description: 'Read data transferred in B/sec from the Hypervisor.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.hypervisor_read_io_bandwidth_kBps
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1024'
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: application
        - uuid: 8e163e2751cb43a098a0cbfb6405c1d3
          name: 'Hypervisor: Read IO, latency'
          type: DEPENDENT
          key: nutanix.cluster.hypervisor.io.read.latency
          value_type: FLOAT
          units: s
          description: 'Input/Output read latency from the Hypervisor.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.hypervisor_avg_read_io_latency_usecs
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1.0E-6'
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: application
        - uuid: 7b43893117524aaf823baafa3dd42e0a
          name: 'Hypervisor: IO total read, bytes'
          type: DEPENDENT
          key: nutanix.cluster.hypervisor.io.read.total.bytes
          units: B
          description: 'Total Input/Output read operation size from the Hypervisor.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.hypervisor_total_read_io_size_kbytes
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1024'
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: application
        - uuid: e60bc882d8024ca59b9b6719be60fb65
          name: 'Hypervisor: IO total read, sec'
          type: DEPENDENT
          key: nutanix.cluster.hypervisor.io.read.total.sec
          value_type: FLOAT
          units: s
          description: 'Total Input/Output read operation time from the Hypervisor.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.hypervisor_total_read_io_time_usecs
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1.0E-6'
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: application
        - uuid: 91517ef954de4a0892bac9091b0ac09a
          name: 'Hypervisor: IO total, bytes'
          type: DEPENDENT
          key: nutanix.cluster.hypervisor.io.total.bytes
          units: B
          description: 'Total Input/Output operation size from the Hypervisor.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.hypervisor_total_io_size_kbytes
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1024'
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: application
        - uuid: dcc89d2d7d2e4d0c9c46b369af90b17a
          name: 'Hypervisor: IO total, sec'
          type: DEPENDENT
          key: nutanix.cluster.hypervisor.io.total.sec
          value_type: FLOAT
          units: s
          description: 'Total Input/Output operation time from the Hypervisor.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.hypervisor_total_io_time_usecs
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1.0E-6'
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: application
        - uuid: ee50c946b2a9490fafc2c25abd7c39e1
          name: 'Hypervisor: Write IO'
          type: DEPENDENT
          key: nutanix.cluster.hypervisor.io.write
          description: 'Input/Output write operations from the Hypervisor.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.hypervisor_num_write_io
              error_handler: DISCARD_VALUE
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: application
        - uuid: 13a6557f9bce4e5094d35537da7c48a7
          name: 'Hypervisor: Write IO, bandwidth'
          type: DEPENDENT
          key: nutanix.cluster.hypervisor.io.write.bandwidth
          units: Bps
          description: 'Write data transferred in B/sec from the Hypervisor.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.hypervisor_write_io_bandwidth_kBps
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1024'
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: application
        - uuid: a161c827020740e28edf2c223f1c498b
          name: 'Hypervisor: Write IO, latency'
          type: DEPENDENT
          key: nutanix.cluster.hypervisor.io.write.latency
          value_type: FLOAT
          units: s
          description: 'Input/Output write latency from the Hypervisor.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.hypervisor_avg_write_io_latency_usecs
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1.0E-6'
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: application
        - uuid: e51fd2cd48a441d1a5699581ccab53fb
          name: 'Hypervisor: IOPS'
          type: DEPENDENT
          key: nutanix.cluster.hypervisor.iops
          units: '!iops'
          description: 'Input/Output operations per second from the Hypervisor.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.hypervisor_num_iops
              error_handler: DISCARD_VALUE
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: application
        - uuid: 01241090d9f743d9bf8532c950506a2a
          name: 'Hypervisor: Read IOPS'
          type: DEPENDENT
          key: nutanix.cluster.hypervisor.iops.read
          description: 'Input/Output read operations per second from the Hypervisor.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.hypervisor_num_read_iops
              error_handler: DISCARD_VALUE
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: application
        - uuid: c85d41ca89f2438fb9b4c06da9ae0bc7
          name: 'Hypervisor: Write IOPS'
          type: DEPENDENT
          key: nutanix.cluster.hypervisor.iops.write
          units: '!iops'
          description: 'Input/Output write operations per second from the Hypervisor.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.hypervisor_num_write_iops
              error_handler: DISCARD_VALUE
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: application
        - uuid: 6c7717cbf8f44c0dbc69f6b4bd845d65
          name: 'Hypervisor: Memory usage, %'
          type: DEPENDENT
          key: nutanix.cluster.hypervisor.memory.usage.percent
          value_type: FLOAT
          units: '%'
          description: 'Percentage of memory used by the Hypervisor.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.hypervisor_memory_usage_ppm
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '0.0001'
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: memory
        - uuid: 41f4cfc6eb7746799e4bb05306527995
          name: 'Hypervisor: Timespan, sec'
          type: DEPENDENT
          key: nutanix.cluster.hypervisor.timespan.sec
          value_type: FLOAT
          units: s
          description: 'Hypervisor timespan.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.hypervisor_timespan_usecs
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1.0E-6'
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: application
        - uuid: 95a5fd893da84a7098cba12ffa1743ca
          name: 'Get metric'
          type: SCRIPT
          key: nutanix.cluster.metric.get
          history: '0'
          value_type: TEXT
          params: |
            var Nutanix = {
            	params: {},
            
            	setParams: function (requiredParams, allParams) {
            		requiredParams.forEach(function (field) {
            			if (typeof allParams !== 'object' || typeof allParams[field] === 'undefined' || allParams[field] === '') {
            				throw 'Required param is not set: ' + field + '.';
            			}
            		});
            
            		Nutanix.params = allParams;
            	},
            
            	request: function (url) {
            
            		var request = new HttpRequest();
            
            		if (typeof Nutanix.params.proxy !== 'undefined' && Nutanix.params.proxy !== '') {
            			request.setProxy(Nutanix.params.proxy);
            		}
            
            		request.setHttpAuth(HTTPAUTH_BASIC, Nutanix.params.username, Nutanix.params.password);
            
            		Zabbix.log(4, '[ Nutanix ] Sending request: ' + url);
            
            		const response = request.get(url);
            
            		Zabbix.log(4, '[ Nutanix ] Received response with status code ' + request.getStatus() + ': ' + response);
            
            		if (request.getStatus() < 200 || request.getStatus() >= 300) {
            			throw 'Request failed with status code ' + request.getStatus() + ': ' + response;
            		}
            
            		try {
            			response = JSON.parse(response);
            		}
            		catch (error) {
            			throw 'Failed to parse response received from Nutanix PRISM API. Check debug log for more information.';
            		}
            
            		return response;
            	},
            
            	deduplicateAlerts: function (full_data) {
            		const severity_mapping = [
            			'kinfo',
            			'kwarning',
            			'kcritical'
            		]
            
            		var output_data = {};
            		for (var entity in full_data.entities) {
            	
            			if (Nutanix.params.api_method === 'clusters') {
            				if (result.entities[entity].node_uuid.split('-').length == 5) continue;
            			}
            
            			var severity = severity_mapping.indexOf(full_data.entities[entity].severity.toLowerCase()),
            				message = full_data.entities[entity].message,
            				title = full_data.entities[entity].alert_title;
            	
            			full_data.entities[entity].context_types.forEach(function(context, index) {
            				message = message.replace('{' + context + '}', full_data.entities[entity].context_values[index]);
            				title = title.replace('{' + context + '}', full_data.entities[entity].context_values[index]);
            			});
            	
            			key = md5(title + message);
            			if (key in output_data) {
            				if (full_data.entities[entity].created_time_stamp_in_usecs > output_data[key].created) {
            					output_data[key].created = full_data.entities[entity].created_time_stamp_in_usecs;
            					output_data[key].severity = severity !== -1 ? severity : 3;
            					output_data[key].state = full_data.entities[entity].resolved ? 0 : 1;
            					output_data[key].message = full_data.entities[entity].detailed_message != '' ? full_data.entities[entity].detailed_message : message;
            					output_data[key].last_id = full_data.entities[entity].id;
            				}
            				output_data[key].count += 1;
            			} else {
            				output_data[key] = {
            					"name": title + ' - ' + message,
            					"title": title != '' ? title : message,
            					"created": full_data.entities[entity].created_time_stamp_in_usecs,
            					"severity": severity !== -1 ? severity : 3,
            					"state": full_data.entities[entity].resolved ? 0 : 1,
            					"message": full_data.entities[entity].detailed_message != '' ? full_data.entities[entity].detailed_message : message,
            					"last_id": full_data.entities[entity].id,
            					"count": 1
            				}
            			}
            		}
            
            		return output_data;
            	},
            
            	cleanUnsupported: function (full_stat) {
            		var output_stat = {};
            		for (var element in full_stat) {
            			if (full_stat[element] !== '-1') {
            				output_stat[element] = full_stat[element];
            			}
            		};
            		
            		return output_stat;
            	}
            };
            
            try {
            	const params = JSON.parse(value);
            	Nutanix.setParams(['endpoint_host', 'endpoint_port', 'username', 'password', 'auth_type', 'api_method', 'target_uuid'], params);
            
            	const url = 'https://' + Nutanix.params.endpoint_host + ':' + Nutanix.params.endpoint_port + '/PrismGateway/services/rest/v2.0/' + Nutanix.params.api_method + '/' + Nutanix.params.target_uuid;
            	var result = Nutanix.request(url);
            
            	result.stats = Nutanix.cleanUnsupported(result.stats);
            
            	return JSON.stringify(result);
            }
            catch (error) {
            	error += (String(error).endsWith('.')) ? '' : '.';
            	Zabbix.log(4, '[ Nutanix ] ERROR: ' + error);
            
            	return JSON.stringify({ 'error': error });
            }
          description: 'Get data about basic metrics.'
          timeout: '{$NUTANIX.TIMEOUT}'
          parameters:
            - name: api_method
              value: clusters
            - name: auth_type
              value: basic
            - name: endpoint_host
              value: '{$NUTANIX.PRISM.ELEMENT.IP}'
            - name: endpoint_port
              value: '{$NUTANIX.PRISM.ELEMENT.PORT}'
            - name: password
              value: '{$NUTANIX.PASSWORD}'
            - name: proxy
              value: '{$NUTANIX.PROXY}'
            - name: target_uuid
              value: '{$NUTANIX.CLUSTER.UUID}'
            - name: username
              value: '{$NUTANIX.USER}'
          tags:
            - tag: component
              value: raw
        - uuid: e8f1b3e3920b46cfa96ff0602fb30e6b
          name: 'Get metric check'
          type: DEPENDENT
          key: nutanix.cluster.metric.get.check
          value_type: TEXT
          description: 'Data collection check. Check the latest values for details.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.error
              error_handler: CUSTOM_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 3h
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: status
          triggers:
            - uuid: 5ac8ddec162b4668b1df1493216792d6
              expression: 'length(last(/Nutanix Cluster Prism Element by HTTP/nutanix.cluster.metric.get.check))>0'
              name: 'Nutanix: Failed to get metric data from the API'
              priority: HIGH
              description: 'Failed to get data from the API. Check the latest values for details.'
              tags:
                - tag: scope
                  value: availability
        - uuid: fc9cc5b7999241e4ae0e097826633569
          name: 'General: Current redundancy factor'
          type: DEPENDENT
          key: nutanix.cluster.redundancy.factor.current
          description: 'Current value of the redundancy factor on the cluster.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.cluster_redundancy_state.current_redundancy_factor
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: application
        - uuid: df508a0e13a843e492d32ffd36eb99e8
          name: 'General: Desired redundancy factor'
          type: DEPENDENT
          key: nutanix.cluster.redundancy.factor.desired
          description: 'The desired value of the redundancy factor on the cluster.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.cluster_redundancy_state.desired_redundancy_factor
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: application
        - uuid: b6c6cc1e1a62485fb5b4a1ea3c0b0c4b
          name: 'Storage Controller: IO'
          type: DEPENDENT
          key: nutanix.cluster.storage.controller.io
          description: 'Input/Output operations from the Storage Controller.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.controller_num_io
              error_handler: DISCARD_VALUE
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: storage
        - uuid: 2146014b3f00416ab56149329ebf1ca3
          name: 'Storage Controller: IO, bandwidth'
          type: DEPENDENT
          key: nutanix.cluster.storage.controller.io.bandwidth
          units: Bps
          description: 'Data transferred in B/sec from the Storage Controller.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.controller_io_bandwidth_kBps
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1024'
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: storage
        - uuid: 6538913d53aa4c0da0b882a42b73faa0
          name: 'Storage Controller: IO, latency'
          type: DEPENDENT
          key: nutanix.cluster.storage.controller.io.latency
          value_type: FLOAT
          units: s
          description: 'Input/Output latency from the Storage Controller.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.controller_avg_io_latency_usecs
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1.0E-6'
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: storage
        - uuid: 315905ef6b2f497294ccf4702ab5aadf
          name: 'Storage Controller: Read IO'
          type: DEPENDENT
          key: nutanix.cluster.storage.controller.io.read
          description: 'Input/Output read operations from the Storage Controller.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.controller_num_read_io
              error_handler: DISCARD_VALUE
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: storage
        - uuid: 7871d52184994b799f58e180f7dd89a7
          name: 'Storage Controller: Read IO, bandwidth'
          type: DEPENDENT
          key: nutanix.cluster.storage.controller.io.read.bandwidth
          units: Bps
          description: 'Read data transferred in B/sec from the Storage Controller.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.controller_read_io_bandwidth_kBps
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1024'
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: storage
        - uuid: f4709e46e4684dfe95951705a3462e42
          name: 'Storage Controller: Read IO, bytes'
          type: DEPENDENT
          key: nutanix.cluster.storage.controller.io.read.bytes
          units: B
          description: 'Storage controller average read Input/Output in bytes.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.controller_avg_read_io_size_kbytes
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1024'
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: storage
        - uuid: 57c98e0c2d8c426d91f02320b140a3b0
          name: 'Storage Controller: Read IO, latency'
          type: DEPENDENT
          key: nutanix.cluster.storage.controller.io.read.latency
          value_type: FLOAT
          units: s
          description: 'Input/Output read latency from the Storage Controller.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.controller_avg_read_io_latency_usecs
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1.0E-6'
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: storage
        - uuid: d57e65a31e8047bd83064913b0f0fc96
          name: 'Storage Controller: Read IO, %'
          type: DEPENDENT
          key: nutanix.cluster.storage.controller.io.read.percent
          value_type: FLOAT
          units: '%'
          description: 'Percentage of Input/Output operations from the Storage Controller that are reads.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.controller_read_io_ppm
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '0.0001'
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: storage
        - uuid: dc7f96ef1c814eb6900bd0bb41405c4f
          name: 'Storage Controller: IO total read, bytes'
          type: DEPENDENT
          key: nutanix.cluster.storage.controller.io.read.total.bytes
          units: B
          description: 'Total controller read Input/Output size.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.controller_total_read_io_size_kbytes
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1024'
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: storage
        - uuid: 9084bbeefa514342bc6550b20145ae87
          name: 'Storage Controller: IO total read, sec'
          type: DEPENDENT
          key: nutanix.cluster.storage.controller.io.read.total.sec
          value_type: FLOAT
          units: s
          description: 'Total controller read Input/Output time.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.controller_total_read_io_time_usecs
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1.0E-6'
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: storage
        - uuid: cb3d76f22bec49959d17f827e1fda1b5
          name: 'Storage Controller: IO total, bytes'
          type: DEPENDENT
          key: nutanix.cluster.storage.controller.io.total.bytes
          units: B
          description: 'Total controller Input/Output size.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.controller_total_io_size_kbytes
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1024'
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: storage
        - uuid: a5716932dcc3468f812c77b28f29bf01
          name: 'Storage Controller: IO total, sec'
          type: DEPENDENT
          key: nutanix.cluster.storage.controller.io.total.sec
          units: s
          description: 'Total controller Input/Output time.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.controller_total_io_time_usecs
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1.0E-6'
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: storage
        - uuid: ecde6b6bd4344b819a39b0d3e2d4e3dc
          name: 'Storage Controller: Write IO'
          type: DEPENDENT
          key: nutanix.cluster.storage.controller.io.write
          description: 'Input/Output write operations to the Storage Controller.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.controller_num_write_io
              error_handler: DISCARD_VALUE
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: storage
        - uuid: 6d973393007a4851a96f1a2208c99ac0
          name: 'Storage Controller: Write IO, bandwidth'
          type: DEPENDENT
          key: nutanix.cluster.storage.controller.io.write.bandwidth
          units: Bps
          description: 'Write data transferred in B/sec to the Storage Controller.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.controller_write_io_bandwidth_kBps
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1024'
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: storage
        - uuid: 829dfe75c62c4770acd8889d5e0f8f61
          name: 'Storage Controller: Write IO, bytes'
          type: DEPENDENT
          key: nutanix.cluster.storage.controller.io.write.bytes
          units: B
          description: 'Storage Controller average write Input/Output in bytes.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.controller_avg_write_io_size_kbytes
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1024'
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: storage
        - uuid: a940bb2ff5d549f085997200eb1d09e7
          name: 'Storage Controller: Write IO, latency'
          type: DEPENDENT
          key: nutanix.cluster.storage.controller.io.write.latency
          value_type: FLOAT
          units: s
          description: 'Input/Output write latency to the Storage Controller.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.controller_avg_write_io_latency_usecs
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1.0E-6'
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: storage
        - uuid: dfda9f9c6f40488e8a47e591a75775de
          name: 'Storage Controller: Write IO, %'
          type: DEPENDENT
          key: nutanix.cluster.storage.controller.io.write.percent
          value_type: FLOAT
          units: '%'
          description: 'Percentage of Input/Output operations to the Storage Controller that are writes.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.controller_write_io_ppm
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '0.0001'
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: storage
        - uuid: b4c5601a57d34fd886a508523f297a49
          name: 'Storage Controller: IOPS'
          type: DEPENDENT
          key: nutanix.cluster.storage.controller.iops
          units: '!iops'
          description: 'Input/Output operations per second from the Storage Controller.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.controller_num_iops
              error_handler: DISCARD_VALUE
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: storage
        - uuid: f963f424f6644d46b109293108a011b2
          name: 'Storage Controller: Read IOPS'
          type: DEPENDENT
          key: nutanix.cluster.storage.controller.iops.read
          units: '!iops'
          description: 'Input/Output read operations per second from the Storage Controller.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.controller_num_read_iops
              error_handler: DISCARD_VALUE
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: storage
        - uuid: 298dee7b25e044edb4657855b0ec3ae7
          name: 'Storage Controller: Write IOPS'
          type: DEPENDENT
          key: nutanix.cluster.storage.controller.iops.write
          units: '!iops'
          description: 'Input/Output write operations per second to the Storage Controller.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.controller_num_write_iops
              error_handler: DISCARD_VALUE
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: storage
        - uuid: 3d48b9ed84164fabb18db28be446c933
          name: 'Storage Tier: Das-sata capacity, bytes'
          type: DEPENDENT
          key: nutanix.cluster.storage.controller.tier.das_sata.capacity.bytes
          units: B
          description: 'The total capacity of Das-sata in bytes.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$.usage_stats.[''storage_tier.das-sata.capacity_bytes'']'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: storage
        - uuid: b3b933a4a7284d788095f2f98700a75a
          name: 'Storage Tier: Das-sata free, bytes'
          type: DEPENDENT
          key: nutanix.cluster.storage.controller.tier.das_sata.free.bytes
          units: B
          description: 'The free space of Das-sata in bytes.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$.usage_stats.[''storage_tier.das-sata.free_bytes'']'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: storage
        - uuid: 81e208fb9c4949919091c18325557fd9
          name: 'Storage Tier: Das-sata usage, bytes'
          type: DEPENDENT
          key: nutanix.cluster.storage.controller.tier.das_sata.usage.bytes
          units: B
          description: 'The used space of Das-sata in bytes.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$.usage_stats.[''storage_tier.das-sata.usage_bytes'']'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: storage
        - uuid: 95c826ea031b462ea1e1ae79e3f4966d
          name: 'Storage Tier: SSD capacity, bytes'
          type: DEPENDENT
          key: nutanix.cluster.storage.controller.tier.ssd.capacity.bytes
          units: B
          description: 'The total capacity of SSD in bytes.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$.usage_stats.[''storage_tier.ssd.capacity_bytes'']'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: storage
        - uuid: a17766d845a1410b9b4fe20044d79217
          name: 'Storage Tier: SSD free, bytes'
          type: DEPENDENT
          key: nutanix.cluster.storage.controller.tier.ssd.free.bytes
          units: B
          description: 'The free space of SSD in bytes.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$.usage_stats.[''storage_tier.ssd.free_bytes'']'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: storage
        - uuid: 9a10e8850e5f419d8e600757598435bf
          name: 'Storage Tier: SSD usage, bytes'
          type: DEPENDENT
          key: nutanix.cluster.storage.controller.tier.ssd.usage.bytes
          units: B
          description: 'The used space of SSD in bytes.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$.usage_stats.[''storage_tier.ssd.usage_bytes'']'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: storage
        - uuid: 1d4367a1f30a46818871cd4a105c73dc
          name: 'Storage Controller: Timespan, sec'
          type: DEPENDENT
          key: nutanix.cluster.storage.controller.timespan.sec
          value_type: FLOAT
          units: s
          description: 'Controller timespan.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.controller_timespan_usecs
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1.0E-6'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: storage
        - uuid: eb510c9fa96947b9a3d83ce6ab87d217
          name: 'Storage Controller: Total transformed usage, bytes'
          type: DEPENDENT
          key: nutanix.cluster.storage.controller.transformed.usage.total.bytes
          units: B
          description: 'Actual usage of the Storage Controller.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.controller_total_transformed_usage_bytes
              error_handler: DISCARD_VALUE
          master_item:
            key: nutanix.cluster.metric.get
          tags:
            - tag: component
              value: storage
      discovery_rules:
        - uuid: 7990ed903e40431999d75702d83b2cbb
          name: 'Alert discovery'
          type: DEPENDENT
          key: nutanix.cluster.alert.discovery
          filter:
            evaltype: AND
            conditions:
              - macro: '{#ALERT.NAME}'
                value: '{$NUTANIX.ALERT.DISCOVERY.NAME.MATCHES}'
              - macro: '{#ALERT.NAME}'
                value: '{$NUTANIX.ALERT.DISCOVERY.NAME.NOT_MATCHES}'
                operator: NOT_MATCHES_REGEX
              - macro: '{#ALERT.SEVERITY}'
                value: '{$NUTANIX.ALERT.DISCOVERY.SEVERITY.MATCHES}'
              - macro: '{#ALERT.STATE}'
                value: '{$NUTANIX.ALERT.DISCOVERY.STATE.MATCHES}'
          description: |
            Discovery of all alerts.
            Alerts will be grouped by title. For each alert, in addition to the basic information, the number of activation and last alert ID will be available.
          item_prototypes:
            - uuid: 0bc36bd639ed43548a3d223abecfc9aa
              name: 'Alert [{#ALERT.NAME}]: Count alerts'
              type: DEPENDENT
              key: 'nutanix.cluster.alert.count["{#ALERT.KEY}"]'
              description: 'The number of times this alert was triggered.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.{#ALERT.KEY}.count'
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: nutanix.cluster.alert.get
              tags:
                - tag: component
                  value: alert
            - uuid: eafc52b6bb6741b1b7ac2b55bfcf5150
              name: 'Alert [{#ALERT.NAME}]: Create datetime'
              type: DEPENDENT
              key: 'nutanix.cluster.alert.created["{#ALERT.KEY}"]'
              units: unixtime
              description: 'The alert creation date and time.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.{#ALERT.KEY}.created'
                - type: MULTIPLIER
                  parameters:
                    - '1.0E-6'
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: nutanix.cluster.alert.get
              tags:
                - tag: component
                  value: alert
            - uuid: b5b880f906d24f16a7a6f9eaf301d2f0
              name: 'Alert [{#ALERT.NAME}]: Last alert ID'
              type: DEPENDENT
              key: 'nutanix.cluster.alert.last_id["{#ALERT.KEY}"]'
              value_type: CHAR
              description: 'Latest ID of the alert.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.{#ALERT.KEY}.last_id'
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 12h
              master_item:
                key: nutanix.cluster.alert.get
              tags:
                - tag: component
                  value: alert
            - uuid: ae18c1bc06ea4a429a753b9c6d989cc0
              name: 'Alert [{#ALERT.NAME}]: Detailed message'
              type: DEPENDENT
              key: 'nutanix.cluster.alert.message["{#ALERT.KEY}"]'
              value_type: TEXT
              description: 'Detailed information about the current alert.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.{#ALERT.KEY}.message'
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 12h
              master_item:
                key: nutanix.cluster.alert.get
              tags:
                - tag: component
                  value: alert
            - uuid: 6b72da2095154db1b7561a2bedca8b33
              name: 'Alert [{#ALERT.NAME}]: Severity'
              type: DEPENDENT
              key: 'nutanix.cluster.alert.severity["{#ALERT.KEY}"]'
              description: |
                Alert severity. One of the following:
                - Info;
                - Warning;
                - Critical;
                - Unknown.
              valuemap:
                name: 'Nutanix: Alert severity'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.{#ALERT.KEY}.severity'
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: nutanix.cluster.alert.get
              tags:
                - tag: component
                  value: alert
            - uuid: 269d93010a5c453e9361a15827325743
              name: 'Alert [{#ALERT.NAME}]: State'
              type: DEPENDENT
              key: 'nutanix.cluster.alert.state["{#ALERT.KEY}"]'
              description: |
                Alert state. One of the following:
                - OK;
                - Problem.
              valuemap:
                name: 'Nutanix: Alert state'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.{#ALERT.KEY}.state'
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: nutanix.cluster.alert.get
              tags:
                - tag: component
                  value: alert
            - uuid: d9c2ca71d1a041af83a1b4e9d1df46f2
              name: 'Alert [{#ALERT.NAME}]: Full title'
              type: DEPENDENT
              key: 'nutanix.cluster.alert.title["{#ALERT.KEY}"]'
              value_type: TEXT
              description: 'The full title of the alert.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.{#ALERT.KEY}.title'
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 12h
              master_item:
                key: nutanix.cluster.alert.get
              tags:
                - tag: component
                  value: alert
          master_item:
            key: nutanix.cluster.alert.get
          preprocessing:
            - type: JAVASCRIPT
              parameters:
                - |
                  const json_data = JSON.parse(value);
                  var output_data = [];
                  
                  for (var entity in json_data) {
                  	output_data.push({
                  		"{#ALERT.KEY}": entity,
                  		"{#ALERT.STATE}": json_data[entity].state,
                  		"{#ALERT.TITLE}": json_data[entity].title,
                  		"{#ALERT.SEVERITY}": json_data[entity].severity,
                  		"{#ALERT.NAME}": json_data[entity].name.length > 50 ? json_data[entity].name.substr(0, 50) + '...' : json_data[entity].name
                  	});
                  }
                  
                  return JSON.stringify(output_data);
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
      tags:
        - tag: class
          value: software
        - tag: subclass
          value: automation
        - tag: subclass
          value: containers
        - tag: subclass
          value: security
        - tag: subclass
          value: virtualization
        - tag: target
          value: cluster
        - tag: target
          value: nutanix
        - tag: target
          value: prism-element
      macros:
        - macro: '{$NUTANIX.ALERT.DISCOVERY.NAME.MATCHES}'
          value: '.*'
          description: 'Filter of discoverable Nutanix alerts by name.'
          config:
            type: TEXT
            priority: '8'
            section_name: Filters
            label: 'Alerts filter by name (include)'
            description: 'Filter of discoverable Nutanix alerts by name.'
        - macro: '{$NUTANIX.ALERT.DISCOVERY.NAME.NOT_MATCHES}'
          value: CHANGE_IF_NEEDED
          description: 'Filter to exclude discovered Nutanix alerts by name.'
          config:
            type: TEXT
            priority: '9'
            section_name: Filters
            label: 'Alerts filter by name (exclude)'
            description: 'Filter to exclude discovered Nutanix alerts by name.'
        - macro: '{$NUTANIX.ALERT.DISCOVERY.SEVERITY.MATCHES}'
          value: '.*'
          description: 'Filter to exclude discovered Nutanix alerts by severity. Set all possible severities for filtering in the range 0-2. "0" - Info, "1" - Warning, "2" - Critical.'
          config:
            type: TEXT
            priority: '11'
            section_name: Filters
            label: 'Alerts filter by severity (include)'
            description: 'Filter to exclude discovered Nutanix alerts by severity. Set all possible severities for filtering in the range 0-2. "0" - Info, "1" - Warning, "2" - Critical.'
        - macro: '{$NUTANIX.ALERT.DISCOVERY.STATE.MATCHES}'
          value: '.*'
          description: 'Filter to exclude discovered Nutanix alerts by state. Set "1" for filtering only problem alerts or "0" for resolved ones.'
          config:
            type: TEXT
            priority: '10'
            section_name: Filters
            label: 'Alerts filter by state (include)'
            description: 'Filter to exclude discovered Nutanix alerts by state. Set "1" for filtering only problem alerts or "0" for resolved ones.'
        - macro: '{$NUTANIX.CLUSTER.UUID}'
          description: 'UUID of the cluster.'
          config:
            type: TEXT
            priority: '6'
            label: 'Cluster UUID'
            description: 'UUID of the cluster.'
            required: 'YES'
        - macro: '{$NUTANIX.PASSWORD}'
          type: SECRET_TEXT
          description: 'Nutanix API password.'
          config:
            type: TEXT
            priority: '4'
            label: 'API password'
            description: 'Nutanix API password.'
            required: 'YES'
        - macro: '{$NUTANIX.PRISM.ELEMENT.IP}'
          description: 'Set the Nutanix API IP here.'
          config:
            type: TEXT
            priority: '1'
            label: 'API IP'
            description: 'Set the Nutanix API IP here.'
            required: 'YES'
        - macro: '{$NUTANIX.PRISM.ELEMENT.PORT}'
          value: '9440'
          description: 'Set the Nutanix API port here.'
          config:
            type: TEXT
            priority: '2'
            label: 'API port'
            description: 'Set the Nutanix API port here. In the range from 1 to 65535 inclusive.'
            required: 'YES'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$NUTANIX.PROXY}'
          description: 'Sets the HTTP proxy value. If this macro is empty, then no proxy is used.'
          config:
            type: TEXT
            priority: '5'
            section_name: Other
            label: Proxy
            description: 'Sets the HTTP proxy value. If this macro is empty, then no proxy is used.'
        - macro: '{$NUTANIX.TIMEOUT}'
          value: 10s
          description: 'API response timeout.'
          config:
            type: TEXT
            priority: '7'
            section_name: Other
            label: 'API response timeout'
            description: 'API response timeout.'
        - macro: '{$NUTANIX.USER}'
          description: 'Nutanix API username.'
          config:
            type: TEXT
            priority: '3'
            label: 'API username'
            description: 'Nutanix API username.'
            required: 'YES'
      dashboards:
        - uuid: 5764865624cb41abb5ea6631a9b3dd41
          name: 'Nutanix Cluster Prism Element overview'
          pages:
            - name: Overview
              widgets:
                - type: item
                  name: 'General: Cluster operation mode'
                  width: '18'
                  hide_header: 'YES'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.cluster.operation.mode
                    - type: INTEGER
                      name: show.0
                      value: '1'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: STRING
                      name: thresholds.0.color
                      value: 47A76A
                    - type: STRING
                      name: thresholds.0.threshold
                      value: '0'
                    - type: STRING
                      name: thresholds.1.color
                      value: FDD835
                    - type: STRING
                      name: thresholds.1.threshold
                      value: '1'
                    - type: STRING
                      name: thresholds.2.color
                      value: FDD835
                    - type: STRING
                      name: thresholds.2.threshold
                      value: '2'
                    - type: STRING
                      name: thresholds.3.color
                      value: FDD835
                    - type: STRING
                      name: thresholds.3.threshold
                      value: '3'
                    - type: STRING
                      name: thresholds.4.color
                      value: FDD835
                    - type: STRING
                      name: thresholds.4.threshold
                      value: '4'
                    - type: STRING
                      name: thresholds.5.color
                      value: D2D2D2
                    - type: STRING
                      name: thresholds.5.threshold
                      value: '5'
                    - type: INTEGER
                      name: value_bold
                      value: '0'
                - type: svggraph
                  name: IOPS
                  'y': '2'
                  width: '54'
                  height: '5'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: ds.0.color.0
                      value: 00BFFF
                    - type: STRING
                      name: ds.0.color.1
                      value: FF0080
                    - type: STRING
                      name: ds.0.color.2
                      value: 0040FF
                    - type: INTEGER
                      name: ds.0.dataset_type
                      value: '0'
                    - type: INTEGER
                      name: ds.0.fill
                      value: '4'
                    - type: ITEM
                      name: ds.0.itemids.0
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.general.iops
                    - type: ITEM
                      name: ds.0.itemids.1
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.hypervisor.iops
                    - type: ITEM
                      name: ds.0.itemids.2
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.storage.controller.iops
                    - type: INTEGER
                      name: ds.0.missingdatafunc
                      value: '3'
                    - type: INTEGER
                      name: ds.0.transparency
                      value: '6'
                    - type: INTEGER
                      name: ds.0.width
                      value: '2'
                    - type: INTEGER
                      name: legend_columns
                      value: '1'
                    - type: INTEGER
                      name: legend_lines
                      value: '3'
                    - type: INTEGER
                      name: legend_statistic
                      value: '1'
                    - type: STRING
                      name: reference
                      value: PMVJG
                    - type: INTEGER
                      name: righty
                      value: '0'
                - type: svggraph
                  name: IO
                  'y': '7'
                  width: '54'
                  height: '5'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: ds.0.color.0
                      value: 00BFFF
                    - type: STRING
                      name: ds.0.color.1
                      value: FF0080
                    - type: STRING
                      name: ds.0.color.2
                      value: 0040FF
                    - type: INTEGER
                      name: ds.0.dataset_type
                      value: '0'
                    - type: INTEGER
                      name: ds.0.fill
                      value: '4'
                    - type: ITEM
                      name: ds.0.itemids.0
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.general.io
                    - type: ITEM
                      name: ds.0.itemids.1
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.hypervisor.io
                    - type: ITEM
                      name: ds.0.itemids.2
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.storage.controller.io
                    - type: INTEGER
                      name: ds.0.missingdatafunc
                      value: '3'
                    - type: INTEGER
                      name: ds.0.transparency
                      value: '6'
                    - type: INTEGER
                      name: ds.0.width
                      value: '2'
                    - type: INTEGER
                      name: legend_columns
                      value: '1'
                    - type: INTEGER
                      name: legend_lines
                      value: '3'
                    - type: INTEGER
                      name: legend_statistic
                      value: '1'
                    - type: STRING
                      name: reference
                      value: PQNBF
                    - type: INTEGER
                      name: righty
                      value: '0'
                - type: item
                  name: 'General: Version'
                  x: '18'
                  width: '18'
                  hide_header: 'YES'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.general.upgrade.version
                    - type: INTEGER
                      name: show.0
                      value: '1'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: INTEGER
                      name: value_bold
                      value: '0'
                - type: item
                  name: 'General: Timespan'
                  x: '36'
                  width: '18'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.general.timespan.sec
                    - type: INTEGER
                      name: show.0
                      value: '1'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: INTEGER
                      name: units_bold
                      value: '0'
                    - type: INTEGER
                      name: value_bold
                      value: '0'
                - type: item
                  name: 'General: Current redundancy factor'
                  x: '54'
                  width: '18'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.redundancy.factor.current
                    - type: INTEGER
                      name: show.0
                      value: '1'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: INTEGER
                      name: show.2
                      value: '4'
                    - type: INTEGER
                      name: value_bold
                      value: '0'
                - type: item
                  name: 'General: Desired redundancy factor'
                  x: '54'
                  'y': '2'
                  width: '18'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.redundancy.factor.desired
                    - type: INTEGER
                      name: show.0
                      value: '1'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: INTEGER
                      name: show.2
                      value: '4'
                    - type: INTEGER
                      name: value_bold
                      value: '0'
                - type: svggraph
                  name: 'General: Storage: Total and free'
                  x: '54'
                  'y': '4'
                  width: '18'
                  height: '4'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: ds.0.color.0
                      value: 00BFFF
                    - type: STRING
                      name: ds.0.color.1
                      value: 0040FF
                    - type: INTEGER
                      name: ds.0.dataset_type
                      value: '0'
                    - type: INTEGER
                      name: ds.0.fill
                      value: '4'
                    - type: ITEM
                      name: ds.0.itemids.0
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.general.storage.capacity.bytes
                    - type: ITEM
                      name: ds.0.itemids.1
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.general.storage.free.bytes
                    - type: INTEGER
                      name: ds.0.missingdatafunc
                      value: '3'
                    - type: INTEGER
                      name: ds.0.transparency
                      value: '6'
                    - type: INTEGER
                      name: ds.0.width
                      value: '2'
                    - type: INTEGER
                      name: legend_columns
                      value: '1'
                    - type: INTEGER
                      name: legend_lines
                      value: '3'
                    - type: INTEGER
                      name: legend_statistic
                      value: '1'
                    - type: STRING
                      name: reference
                      value: PMVJF
                    - type: INTEGER
                      name: righty
                      value: '0'
                - type: svggraph
                  name: 'General: Storage: Usage'
                  x: '54'
                  'y': '8'
                  width: '18'
                  height: '4'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: ds.0.color.0
                      value: 00BFFF
                    - type: STRING
                      name: ds.0.color.1
                      value: 0040FF
                    - type: INTEGER
                      name: ds.0.dataset_type
                      value: '0'
                    - type: INTEGER
                      name: ds.0.fill
                      value: '4'
                    - type: ITEM
                      name: ds.0.itemids.0
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.general.storage.logical.usage.bytes
                    - type: ITEM
                      name: ds.0.itemids.1
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.general.storage.usage.bytes
                    - type: INTEGER
                      name: ds.0.missingdatafunc
                      value: '3'
                    - type: INTEGER
                      name: ds.0.transparency
                      value: '6'
                    - type: INTEGER
                      name: ds.0.width
                      value: '2'
                    - type: INTEGER
                      name: legend_columns
                      value: '1'
                    - type: INTEGER
                      name: legend_lines
                      value: '3'
                    - type: INTEGER
                      name: legend_statistic
                      value: '1'
                    - type: STRING
                      name: reference
                      value: PMVJJ
                    - type: INTEGER
                      name: righty
                      value: '0'
            - name: IO
              widgets:
                - type: svggraph
                  name: 'General: IOPS'
                  width: '40'
                  height: '6'
                  fields:
                    - type: STRING
                      name: ds.0.color.0
                      value: 00BFFF
                    - type: STRING
                      name: ds.0.color.1
                      value: FF0080
                    - type: STRING
                      name: ds.0.color.2
                      value: 0040FF
                    - type: INTEGER
                      name: ds.0.dataset_type
                      value: '0'
                    - type: INTEGER
                      name: ds.0.fill
                      value: '4'
                    - type: ITEM
                      name: ds.0.itemids.0
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.general.iops
                    - type: ITEM
                      name: ds.0.itemids.1
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.general.iops.read
                    - type: ITEM
                      name: ds.0.itemids.2
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.general.iops.write
                    - type: INTEGER
                      name: ds.0.missingdatafunc
                      value: '3'
                    - type: INTEGER
                      name: ds.0.transparency
                      value: '6'
                    - type: INTEGER
                      name: ds.0.width
                      value: '2'
                    - type: INTEGER
                      name: legend_columns
                      value: '1'
                    - type: INTEGER
                      name: legend_lines
                      value: '3'
                    - type: INTEGER
                      name: legend_statistic
                      value: '1'
                    - type: STRING
                      name: reference
                      value: TQOEE
                    - type: INTEGER
                      name: righty
                      value: '0'
                - type: svggraph
                  name: 'General: Bandwidth'
                  'y': '6'
                  width: '36'
                  height: '6'
                  fields:
                    - type: STRING
                      name: ds.0.color.0
                      value: 00BFFF
                    - type: STRING
                      name: ds.0.color.1
                      value: FF0080
                    - type: STRING
                      name: ds.0.color.2
                      value: 0040FF
                    - type: INTEGER
                      name: ds.0.dataset_type
                      value: '0'
                    - type: INTEGER
                      name: ds.0.fill
                      value: '4'
                    - type: ITEM
                      name: ds.0.itemids.0
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.general.io.bandwidth
                    - type: ITEM
                      name: ds.0.itemids.1
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.general.io.read.bandwidth
                    - type: ITEM
                      name: ds.0.itemids.2
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.general.io.write.bandwidth
                    - type: INTEGER
                      name: ds.0.missingdatafunc
                      value: '3'
                    - type: INTEGER
                      name: ds.0.transparency
                      value: '6'
                    - type: INTEGER
                      name: ds.0.width
                      value: '2'
                    - type: INTEGER
                      name: legend_columns
                      value: '1'
                    - type: INTEGER
                      name: legend_lines
                      value: '3'
                    - type: INTEGER
                      name: legend_statistic
                      value: '1'
                    - type: STRING
                      name: reference
                      value: CJFZN
                    - type: INTEGER
                      name: righty
                      value: '0'
                - type: svggraph
                  name: 'General: Latency'
                  x: '36'
                  'y': '6'
                  width: '36'
                  height: '6'
                  fields:
                    - type: STRING
                      name: ds.0.color.0
                      value: 00BFFF
                    - type: STRING
                      name: ds.0.color.1
                      value: FF0080
                    - type: STRING
                      name: ds.0.color.2
                      value: 0040FF
                    - type: INTEGER
                      name: ds.0.dataset_type
                      value: '0'
                    - type: INTEGER
                      name: ds.0.fill
                      value: '4'
                    - type: ITEM
                      name: ds.0.itemids.0
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.general.io.latency
                    - type: ITEM
                      name: ds.0.itemids.1
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.general.io.read.latency
                    - type: ITEM
                      name: ds.0.itemids.2
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.general.io.write.latency
                    - type: INTEGER
                      name: ds.0.missingdatafunc
                      value: '3'
                    - type: INTEGER
                      name: ds.0.transparency
                      value: '6'
                    - type: INTEGER
                      name: ds.0.width
                      value: '2'
                    - type: INTEGER
                      name: legend_columns
                      value: '1'
                    - type: INTEGER
                      name: legend_lines
                      value: '3'
                    - type: INTEGER
                      name: legend_statistic
                      value: '1'
                    - type: STRING
                      name: reference
                      value: PDAZX
                    - type: INTEGER
                      name: righty
                      value: '0'
                - type: item
                  name: 'General: IOPS'
                  x: '40'
                  width: '18'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.general.iops
                    - type: INTEGER
                      name: show.0
                      value: '1'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: INTEGER
                      name: show.2
                      value: '4'
                    - type: INTEGER
                      name: units_bold
                      value: '0'
                    - type: INTEGER
                      name: value_bold
                      value: '0'
                - type: item
                  name: 'General: Read IOPS'
                  x: '40'
                  'y': '2'
                  width: '18'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.general.iops.read
                    - type: INTEGER
                      name: show.0
                      value: '1'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: INTEGER
                      name: show.2
                      value: '4'
                    - type: INTEGER
                      name: units_bold
                      value: '0'
                    - type: INTEGER
                      name: value_bold
                      value: '0'
                - type: item
                  name: 'General: Write IOPS'
                  x: '40'
                  'y': '4'
                  width: '18'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.general.iops.write
                    - type: INTEGER
                      name: show.0
                      value: '1'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: INTEGER
                      name: show.2
                      value: '4'
                    - type: INTEGER
                      name: units_bold
                      value: '0'
                    - type: INTEGER
                      name: value_bold
                      value: '0'
                - type: piechart
                  name: 'General: Read IO / Write IO'
                  x: '58'
                  width: '14'
                  height: '6'
                  fields:
                    - type: INTEGER
                      name: draw_type
                      value: '1'
                    - type: STRING
                      name: ds.0.color.0
                      value: 00BFFF
                    - type: STRING
                      name: ds.0.color.1
                      value: 0040FF
                    - type: INTEGER
                      name: ds.0.dataset_type
                      value: '0'
                    - type: ITEM
                      name: ds.0.itemids.0
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.general.io.read.percent
                    - type: ITEM
                      name: ds.0.itemids.1
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.general.io.write.percent
                    - type: INTEGER
                      name: ds.0.type.0
                      value: '0'
                    - type: INTEGER
                      name: ds.0.type.1
                      value: '0'
                    - type: INTEGER
                      name: legend_lines
                      value: '2'
                    - type: INTEGER
                      name: legend_value
                      value: '1'
                    - type: INTEGER
                      name: space
                      value: '7'
                    - type: INTEGER
                      name: width
                      value: '40'
            - name: 'Content Cache'
              widgets:
                - type: svggraph
                  name: 'Content Cache: Memory'
                  width: '54'
                  height: '4'
                  fields:
                    - type: STRING
                      name: ds.0.color.0
                      value: 00BFFF
                    - type: STRING
                      name: ds.0.color.1
                      value: FF0080
                    - type: STRING
                      name: ds.0.color.2
                      value: 0040FF
                    - type: INTEGER
                      name: ds.0.dataset_type
                      value: '0'
                    - type: INTEGER
                      name: ds.0.fill
                      value: '4'
                    - type: ITEM
                      name: ds.0.itemids.0
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.content.cache.logical.memory.usage.bytes
                    - type: ITEM
                      name: ds.0.itemids.1
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.content.cache.saved.memory.usage.bytes
                    - type: ITEM
                      name: ds.0.itemids.2
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.content.cache.physical.memory.usage.bytes
                    - type: INTEGER
                      name: ds.0.missingdatafunc
                      value: '3'
                    - type: INTEGER
                      name: ds.0.transparency
                      value: '6'
                    - type: INTEGER
                      name: ds.0.width
                      value: '2'
                    - type: INTEGER
                      name: legend_columns
                      value: '1'
                    - type: INTEGER
                      name: legend_lines
                      value: '3'
                    - type: INTEGER
                      name: legend_statistic
                      value: '1'
                    - type: STRING
                      name: reference
                      value: HNWKJ
                    - type: INTEGER
                      name: righty
                      value: '0'
                - type: item
                  name: 'Content Cache: Logical memory usage'
                  'y': '4'
                  width: '18'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'Content Cache: Logical memory usage'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.content.cache.logical.memory.usage.bytes
                    - type: INTEGER
                      name: show.0
                      value: '1'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: INTEGER
                      name: units_bold
                      value: '0'
                    - type: INTEGER
                      name: value_bold
                      value: '0'
                - type: svggraph
                  name: 'Content Cache: SSD usage'
                  'y': '6'
                  width: '54'
                  height: '4'
                  fields:
                    - type: STRING
                      name: ds.0.color.0
                      value: 00BFFF
                    - type: STRING
                      name: ds.0.color.1
                      value: FF0080
                    - type: STRING
                      name: ds.0.color.2
                      value: 0040FF
                    - type: INTEGER
                      name: ds.0.dataset_type
                      value: '0'
                    - type: INTEGER
                      name: ds.0.fill
                      value: '4'
                    - type: ITEM
                      name: ds.0.itemids.0
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.content.cache.logical.ssd.usage.bytes
                    - type: ITEM
                      name: ds.0.itemids.1
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.content.cache.physical.ssd.usage.bytes
                    - type: ITEM
                      name: ds.0.itemids.2
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.content.cache.saved.ssd.usage.bytes
                    - type: INTEGER
                      name: ds.0.missingdatafunc
                      value: '3'
                    - type: INTEGER
                      name: ds.0.transparency
                      value: '6'
                    - type: INTEGER
                      name: ds.0.width
                      value: '2'
                    - type: INTEGER
                      name: legend_columns
                      value: '1'
                    - type: INTEGER
                      name: legend_lines
                      value: '3'
                    - type: INTEGER
                      name: legend_statistic
                      value: '1'
                    - type: STRING
                      name: reference
                      value: GCYCT
                    - type: INTEGER
                      name: righty
                      value: '0'
                - type: item
                  name: 'Content Cache: Logical SSD usage'
                  'y': '10'
                  width: '18'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'Content Cache: Logical SSD usage'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.content.cache.logical.ssd.usage.bytes
                    - type: INTEGER
                      name: show.0
                      value: '1'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: INTEGER
                      name: units_bold
                      value: '0'
                    - type: INTEGER
                      name: value_bold
                      value: '0'
                - type: item
                  name: 'Content Cache: Logical saved memory usage'
                  x: '18'
                  'y': '4'
                  width: '18'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'Content Cache: Logical saved memory usage'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.content.cache.saved.memory.usage.bytes
                    - type: INTEGER
                      name: show.0
                      value: '1'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: INTEGER
                      name: units_bold
                      value: '0'
                    - type: INTEGER
                      name: value_bold
                      value: '0'
                - type: item
                  name: 'Content Cache: Physical SSD usage'
                  x: '18'
                  'y': '10'
                  width: '18'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'Content Cache: Physical SSD usage'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.content.cache.physical.ssd.usage.bytes
                    - type: INTEGER
                      name: show.0
                      value: '1'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: INTEGER
                      name: units_bold
                      value: '0'
                    - type: INTEGER
                      name: value_bold
                      value: '0'
                - type: item
                  name: 'Content Cache: Physical memory usage'
                  x: '36'
                  'y': '4'
                  width: '18'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'Content Cache: Physical memory usage'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.content.cache.physical.memory.usage.bytes
                    - type: INTEGER
                      name: show.0
                      value: '1'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: INTEGER
                      name: units_bold
                      value: '0'
                    - type: INTEGER
                      name: value_bold
                      value: '0'
                - type: item
                  name: 'Content Cache: Saved SSD usage'
                  x: '36'
                  'y': '10'
                  width: '18'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'Content Cache: Saved SSD usage'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.content.cache.saved.ssd.usage.bytes
                    - type: INTEGER
                      name: show.0
                      value: '1'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: INTEGER
                      name: units_bold
                      value: '0'
                    - type: INTEGER
                      name: value_bold
                      value: '0'
                - type: gauge
                  name: 'Content Cache: Hit rate'
                  x: '54'
                  width: '18'
                  height: '4'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: empty_color
                      value: E1F5FE
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.content.cache.hit.percent
                    - type: STRING
                      name: units
                      value: '%'
                    - type: STRING
                      name: value_arc_color
                      value: 0040FF
                - type: svggraph
                  name: 'Content Cache: Hit rate'
                  x: '54'
                  'y': '4'
                  width: '18'
                  height: '4'
                  fields:
                    - type: STRING
                      name: ds.0.color.0
                      value: 0040FF
                    - type: INTEGER
                      name: ds.0.dataset_type
                      value: '0'
                    - type: INTEGER
                      name: ds.0.fill
                      value: '4'
                    - type: ITEM
                      name: ds.0.itemids.0
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.content.cache.hit.percent
                    - type: INTEGER
                      name: ds.0.missingdatafunc
                      value: '3'
                    - type: INTEGER
                      name: ds.0.transparency
                      value: '6'
                    - type: INTEGER
                      name: ds.0.width
                      value: '2'
                    - type: STRING
                      name: lefty_max
                      value: '100'
                    - type: STRING
                      name: lefty_min
                      value: '0'
                    - type: STRING
                      name: lefty_static_units
                      value: '%'
                    - type: INTEGER
                      name: lefty_units
                      value: '1'
                    - type: INTEGER
                      name: legend
                      value: '0'
                    - type: STRING
                      name: reference
                      value: ZBMME
                    - type: INTEGER
                      name: righty
                      value: '0'
                - type: item
                  name: 'Content Cache: Number of lookups'
                  x: '54'
                  'y': '8'
                  width: '18'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.content.cache.lookups.num
                    - type: INTEGER
                      name: show.0
                      value: '1'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: INTEGER
                      name: units_bold
                      value: '0'
                    - type: INTEGER
                      name: value_bold
                      value: '0'
                - type: item
                  name: 'Content Cache: References'
                  x: '54'
                  'y': '10'
                  width: '18'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.content.cache.dedup.ref.num
                    - type: INTEGER
                      name: show.0
                      value: '1'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: INTEGER
                      name: units_bold
                      value: '0'
                    - type: INTEGER
                      name: value_bold
                      value: '0'
            - name: Hypervisor
              widgets:
                - type: svggraph
                  name: 'Hypervisor: IOPS'
                  width: '52'
                  height: '4'
                  fields:
                    - type: STRING
                      name: ds.0.color.0
                      value: 00BFFF
                    - type: STRING
                      name: ds.0.color.1
                      value: FF0080
                    - type: STRING
                      name: ds.0.color.2
                      value: 0040FF
                    - type: INTEGER
                      name: ds.0.dataset_type
                      value: '0'
                    - type: INTEGER
                      name: ds.0.fill
                      value: '4'
                    - type: ITEM
                      name: ds.0.itemids.0
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.hypervisor.iops
                    - type: ITEM
                      name: ds.0.itemids.1
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.hypervisor.iops.read
                    - type: ITEM
                      name: ds.0.itemids.2
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.hypervisor.iops.write
                    - type: INTEGER
                      name: ds.0.missingdatafunc
                      value: '3'
                    - type: INTEGER
                      name: ds.0.transparency
                      value: '6'
                    - type: INTEGER
                      name: ds.0.width
                      value: '2'
                    - type: INTEGER
                      name: legend_columns
                      value: '1'
                    - type: INTEGER
                      name: legend_lines
                      value: '3'
                    - type: INTEGER
                      name: legend_statistic
                      value: '1'
                    - type: STRING
                      name: reference
                      value: RUGEL
                    - type: INTEGER
                      name: righty
                      value: '0'
                - type: svggraph
                  name: 'Hypervisor: Latency'
                  'y': '4'
                  width: '52'
                  height: '4'
                  fields:
                    - type: STRING
                      name: ds.0.color.0
                      value: 00BFFF
                    - type: STRING
                      name: ds.0.color.1
                      value: FF0080
                    - type: STRING
                      name: ds.0.color.2
                      value: 0040FF
                    - type: INTEGER
                      name: ds.0.dataset_type
                      value: '0'
                    - type: INTEGER
                      name: ds.0.fill
                      value: '4'
                    - type: ITEM
                      name: ds.0.itemids.0
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.hypervisor.io.latency
                    - type: ITEM
                      name: ds.0.itemids.1
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.hypervisor.io.read.latency
                    - type: ITEM
                      name: ds.0.itemids.2
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.hypervisor.io.write.latency
                    - type: INTEGER
                      name: ds.0.missingdatafunc
                      value: '3'
                    - type: INTEGER
                      name: ds.0.transparency
                      value: '6'
                    - type: INTEGER
                      name: ds.0.width
                      value: '2'
                    - type: INTEGER
                      name: legend_columns
                      value: '1'
                    - type: INTEGER
                      name: legend_lines
                      value: '3'
                    - type: INTEGER
                      name: legend_statistic
                      value: '1'
                    - type: STRING
                      name: reference
                      value: GNBJL
                    - type: INTEGER
                      name: righty
                      value: '0'
                - type: svggraph
                  name: 'Hypervisor: Bandwidth'
                  'y': '8'
                  width: '52'
                  height: '4'
                  fields:
                    - type: STRING
                      name: ds.0.color.0
                      value: 00BFFF
                    - type: STRING
                      name: ds.0.color.1
                      value: FF0080
                    - type: STRING
                      name: ds.0.color.2
                      value: 0040FF
                    - type: INTEGER
                      name: ds.0.dataset_type
                      value: '0'
                    - type: INTEGER
                      name: ds.0.fill
                      value: '4'
                    - type: ITEM
                      name: ds.0.itemids.0
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.hypervisor.io.bandwidth
                    - type: ITEM
                      name: ds.0.itemids.1
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.hypervisor.io.read.bandwidth
                    - type: ITEM
                      name: ds.0.itemids.2
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.hypervisor.io.write.bandwidth
                    - type: INTEGER
                      name: ds.0.missingdatafunc
                      value: '3'
                    - type: INTEGER
                      name: ds.0.transparency
                      value: '6'
                    - type: INTEGER
                      name: ds.0.width
                      value: '2'
                    - type: INTEGER
                      name: legend_columns
                      value: '1'
                    - type: INTEGER
                      name: legend_lines
                      value: '3'
                    - type: INTEGER
                      name: legend_statistic
                      value: '1'
                    - type: STRING
                      name: reference
                      value: BVXJW
                    - type: INTEGER
                      name: righty
                      value: '0'
                - type: gauge
                  name: 'Hypervisor: CPU usage'
                  x: '52'
                  width: '20'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: empty_color
                      value: E1F5FE
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.hypervisor.cpu.usage.percent
                    - type: STRING
                      name: thresholds.0.color
                      value: 29B6F6
                    - type: STRING
                      name: thresholds.0.threshold
                      value: '0'
                    - type: STRING
                      name: thresholds.1.color
                      value: FFF176
                    - type: STRING
                      name: thresholds.1.threshold
                      value: '70'
                    - type: STRING
                      name: thresholds.2.color
                      value: F9A825
                    - type: STRING
                      name: thresholds.2.threshold
                      value: '80'
                    - type: STRING
                      name: thresholds.3.color
                      value: FF465C
                    - type: STRING
                      name: thresholds.3.threshold
                      value: '90'
                    - type: INTEGER
                      name: th_show_arc
                      value: '1'
                    - type: STRING
                      name: units
                      value: '%'
                - type: svggraph
                  name: 'Hypervisor: CPU usage'
                  x: '52'
                  'y': '3'
                  width: '20'
                  height: '3'
                  fields:
                    - type: STRING
                      name: ds.0.color.0
                      value: 0040FF
                    - type: INTEGER
                      name: ds.0.dataset_type
                      value: '0'
                    - type: INTEGER
                      name: ds.0.fill
                      value: '4'
                    - type: ITEM
                      name: ds.0.itemids.0
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.hypervisor.cpu.usage.percent
                    - type: INTEGER
                      name: ds.0.missingdatafunc
                      value: '3'
                    - type: INTEGER
                      name: ds.0.transparency
                      value: '6'
                    - type: INTEGER
                      name: ds.0.width
                      value: '2'
                    - type: STRING
                      name: lefty_max
                      value: '100'
                    - type: STRING
                      name: lefty_min
                      value: '0'
                    - type: STRING
                      name: lefty_static_units
                      value: '%'
                    - type: INTEGER
                      name: lefty_units
                      value: '1'
                    - type: INTEGER
                      name: legend
                      value: '0'
                    - type: STRING
                      name: reference
                      value: LOWCD
                    - type: INTEGER
                      name: righty
                      value: '0'
                - type: gauge
                  name: 'Hypervisor: Memory usage'
                  x: '52'
                  'y': '6'
                  width: '20'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: empty_color
                      value: E1F5FE
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.hypervisor.memory.usage.percent
                    - type: STRING
                      name: thresholds.0.color
                      value: 29B6F6
                    - type: STRING
                      name: thresholds.0.threshold
                      value: '0'
                    - type: STRING
                      name: thresholds.1.color
                      value: FFF176
                    - type: STRING
                      name: thresholds.1.threshold
                      value: '70'
                    - type: STRING
                      name: thresholds.2.color
                      value: F9A825
                    - type: STRING
                      name: thresholds.2.threshold
                      value: '80'
                    - type: STRING
                      name: thresholds.3.color
                      value: FF465C
                    - type: STRING
                      name: thresholds.3.threshold
                      value: '90'
                    - type: INTEGER
                      name: th_show_arc
                      value: '1'
                    - type: STRING
                      name: units
                      value: '%'
                - type: svggraph
                  name: 'Hypervisor: Memory usage'
                  x: '52'
                  'y': '9'
                  width: '20'
                  height: '3'
                  fields:
                    - type: STRING
                      name: ds.0.color.0
                      value: FF465C
                    - type: INTEGER
                      name: ds.0.dataset_type
                      value: '0'
                    - type: INTEGER
                      name: ds.0.fill
                      value: '4'
                    - type: ITEM
                      name: ds.0.itemids.0
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.hypervisor.memory.usage.percent
                    - type: INTEGER
                      name: ds.0.missingdatafunc
                      value: '3'
                    - type: INTEGER
                      name: ds.0.transparency
                      value: '6'
                    - type: INTEGER
                      name: ds.0.width
                      value: '2'
                    - type: STRING
                      name: lefty_max
                      value: '100'
                    - type: STRING
                      name: lefty_min
                      value: '0'
                    - type: STRING
                      name: lefty_static_units
                      value: '%'
                    - type: INTEGER
                      name: lefty_units
                      value: '1'
                    - type: INTEGER
                      name: legend
                      value: '0'
                    - type: STRING
                      name: reference
                      value: WJDEV
                    - type: INTEGER
                      name: righty
                      value: '0'
            - name: 'Storage controller'
              widgets:
                - type: svggraph
                  name: 'Storage controller: IOPS'
                  width: '36'
                  height: '6'
                  fields:
                    - type: STRING
                      name: ds.0.color.0
                      value: 00BFFF
                    - type: STRING
                      name: ds.0.color.1
                      value: FF0080
                    - type: STRING
                      name: ds.0.color.2
                      value: 0040FF
                    - type: INTEGER
                      name: ds.0.dataset_type
                      value: '0'
                    - type: INTEGER
                      name: ds.0.fill
                      value: '4'
                    - type: ITEM
                      name: ds.0.itemids.0
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.storage.controller.iops
                    - type: ITEM
                      name: ds.0.itemids.1
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.storage.controller.iops.read
                    - type: ITEM
                      name: ds.0.itemids.2
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.storage.controller.iops.write
                    - type: INTEGER
                      name: ds.0.missingdatafunc
                      value: '3'
                    - type: INTEGER
                      name: ds.0.transparency
                      value: '6'
                    - type: INTEGER
                      name: ds.0.width
                      value: '2'
                    - type: INTEGER
                      name: legend_columns
                      value: '1'
                    - type: INTEGER
                      name: legend_lines
                      value: '3'
                    - type: INTEGER
                      name: legend_statistic
                      value: '1'
                    - type: STRING
                      name: reference
                      value: VKETQ
                    - type: INTEGER
                      name: righty
                      value: '0'
                - type: svggraph
                  name: 'Storage controller: IO'
                  'y': '6'
                  width: '36'
                  height: '6'
                  fields:
                    - type: STRING
                      name: ds.0.color.0
                      value: 00BFFF
                    - type: STRING
                      name: ds.0.color.1
                      value: FF0080
                    - type: STRING
                      name: ds.0.color.2
                      value: 0040FF
                    - type: INTEGER
                      name: ds.0.dataset_type
                      value: '0'
                    - type: INTEGER
                      name: ds.0.fill
                      value: '4'
                    - type: ITEM
                      name: ds.0.itemids.0
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.storage.controller.io
                    - type: ITEM
                      name: ds.0.itemids.1
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.storage.controller.io.read
                    - type: ITEM
                      name: ds.0.itemids.2
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.storage.controller.io.write
                    - type: INTEGER
                      name: ds.0.missingdatafunc
                      value: '3'
                    - type: INTEGER
                      name: ds.0.transparency
                      value: '6'
                    - type: INTEGER
                      name: ds.0.width
                      value: '2'
                    - type: INTEGER
                      name: legend_columns
                      value: '1'
                    - type: INTEGER
                      name: legend_lines
                      value: '3'
                    - type: INTEGER
                      name: legend_statistic
                      value: '1'
                    - type: STRING
                      name: reference
                      value: RKARE
                    - type: INTEGER
                      name: righty
                      value: '0'
                - type: piechart
                  name: 'Storage controller: Read IO / Write IO'
                  x: '36'
                  width: '12'
                  height: '6'
                  fields:
                    - type: INTEGER
                      name: draw_type
                      value: '1'
                    - type: STRING
                      name: ds.0.color.0
                      value: 00BFFF
                    - type: STRING
                      name: ds.0.color.1
                      value: 0040FF
                    - type: INTEGER
                      name: ds.0.dataset_type
                      value: '0'
                    - type: ITEM
                      name: ds.0.itemids.0
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.storage.controller.io.read.percent
                    - type: ITEM
                      name: ds.0.itemids.1
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.storage.controller.io.write.percent
                    - type: INTEGER
                      name: ds.0.type.0
                      value: '0'
                    - type: INTEGER
                      name: ds.0.type.1
                      value: '0'
                    - type: INTEGER
                      name: legend_lines
                      value: '2'
                    - type: INTEGER
                      name: legend_value
                      value: '1'
                    - type: INTEGER
                      name: space
                      value: '7'
                    - type: INTEGER
                      name: width
                      value: '40'
                - type: svggraph
                  name: 'Storage controller: Bandwidth'
                  x: '36'
                  'y': '6'
                  width: '36'
                  height: '6'
                  fields:
                    - type: STRING
                      name: ds.0.color.0
                      value: 00BFFF
                    - type: STRING
                      name: ds.0.color.1
                      value: FF0080
                    - type: STRING
                      name: ds.0.color.2
                      value: 0040FF
                    - type: INTEGER
                      name: ds.0.dataset_type
                      value: '0'
                    - type: INTEGER
                      name: ds.0.fill
                      value: '4'
                    - type: ITEM
                      name: ds.0.itemids.0
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.storage.controller.io.bandwidth
                    - type: ITEM
                      name: ds.0.itemids.1
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.storage.controller.io.read.bandwidth
                    - type: ITEM
                      name: ds.0.itemids.2
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.storage.controller.io.write.bandwidth
                    - type: INTEGER
                      name: ds.0.missingdatafunc
                      value: '3'
                    - type: INTEGER
                      name: ds.0.transparency
                      value: '6'
                    - type: INTEGER
                      name: ds.0.width
                      value: '2'
                    - type: INTEGER
                      name: legend_columns
                      value: '1'
                    - type: INTEGER
                      name: legend_lines
                      value: '3'
                    - type: INTEGER
                      name: legend_statistic
                      value: '1'
                    - type: STRING
                      name: reference
                      value: FCTEG
                    - type: INTEGER
                      name: righty
                      value: '0'
                - type: svggraph
                  name: 'Storage controller: Read IO / Write IO'
                  x: '48'
                  width: '24'
                  height: '6'
                  fields:
                    - type: STRING
                      name: ds.0.color.0
                      value: 00BFFF
                    - type: STRING
                      name: ds.0.color.1
                      value: 0040FF
                    - type: INTEGER
                      name: ds.0.dataset_type
                      value: '0'
                    - type: INTEGER
                      name: ds.0.fill
                      value: '4'
                    - type: ITEM
                      name: ds.0.itemids.0
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.storage.controller.io.read.percent
                    - type: ITEM
                      name: ds.0.itemids.1
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.storage.controller.io.write.percent
                    - type: INTEGER
                      name: ds.0.missingdatafunc
                      value: '3'
                    - type: INTEGER
                      name: ds.0.stacked
                      value: '1'
                    - type: INTEGER
                      name: ds.0.transparency
                      value: '6'
                    - type: INTEGER
                      name: ds.0.width
                      value: '2'
                    - type: INTEGER
                      name: legend_columns
                      value: '1'
                    - type: INTEGER
                      name: legend_lines
                      value: '2'
                    - type: INTEGER
                      name: legend_statistic
                      value: '1'
                    - type: STRING
                      name: reference
                      value: GVMJA
                    - type: INTEGER
                      name: righty
                      value: '0'
            - name: 'Storage Tier'
              widgets:
                - type: svggraph
                  name: 'Storage Tier: Das-sata'
                  width: '50'
                  height: '4'
                  fields:
                    - type: STRING
                      name: ds.0.color.0
                      value: 00BFFF
                    - type: STRING
                      name: ds.0.color.1
                      value: 0040FF
                    - type: INTEGER
                      name: ds.0.dataset_type
                      value: '0'
                    - type: INTEGER
                      name: ds.0.fill
                      value: '4'
                    - type: ITEM
                      name: ds.0.itemids.0
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.storage.controller.tier.das_sata.free.bytes
                    - type: ITEM
                      name: ds.0.itemids.1
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.storage.controller.tier.das_sata.usage.bytes
                    - type: INTEGER
                      name: ds.0.missingdatafunc
                      value: '3'
                    - type: INTEGER
                      name: ds.0.transparency
                      value: '6'
                    - type: INTEGER
                      name: ds.0.width
                      value: '2'
                    - type: INTEGER
                      name: legend_columns
                      value: '1'
                    - type: INTEGER
                      name: legend_lines
                      value: '2'
                    - type: INTEGER
                      name: legend_statistic
                      value: '1'
                    - type: STRING
                      name: reference
                      value: SCETD
                    - type: INTEGER
                      name: righty
                      value: '0'
                - type: item
                  name: 'Storage Tier: Das-sata free'
                  'y': '4'
                  width: '25'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'Storage Tier: Das-sata free'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.storage.controller.tier.das_sata.free.bytes
                    - type: INTEGER
                      name: show.0
                      value: '1'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: INTEGER
                      name: units_bold
                      value: '0'
                    - type: INTEGER
                      name: value_bold
                      value: '0'
                - type: svggraph
                  name: 'Storage Tier: SSD'
                  'y': '6'
                  width: '50'
                  height: '4'
                  fields:
                    - type: STRING
                      name: ds.0.color.0
                      value: 00BFFF
                    - type: STRING
                      name: ds.0.color.1
                      value: 0040FF
                    - type: INTEGER
                      name: ds.0.dataset_type
                      value: '0'
                    - type: INTEGER
                      name: ds.0.fill
                      value: '4'
                    - type: ITEM
                      name: ds.0.itemids.0
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.storage.controller.tier.ssd.free.bytes
                    - type: ITEM
                      name: ds.0.itemids.1
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.storage.controller.tier.ssd.usage.bytes
                    - type: INTEGER
                      name: ds.0.missingdatafunc
                      value: '3'
                    - type: INTEGER
                      name: ds.0.transparency
                      value: '6'
                    - type: INTEGER
                      name: ds.0.width
                      value: '2'
                    - type: INTEGER
                      name: legend_columns
                      value: '1'
                    - type: INTEGER
                      name: legend_lines
                      value: '2'
                    - type: INTEGER
                      name: legend_statistic
                      value: '1'
                    - type: STRING
                      name: reference
                      value: NEBOH
                    - type: INTEGER
                      name: righty
                      value: '0'
                - type: item
                  name: 'Storage Tier: SSD free'
                  'y': '10'
                  width: '25'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'Storage Tier: SSD free'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.storage.controller.tier.ssd.free.bytes
                    - type: INTEGER
                      name: show.0
                      value: '1'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: INTEGER
                      name: units_bold
                      value: '0'
                    - type: INTEGER
                      name: value_bold
                      value: '0'
                - type: item
                  name: 'Storage Tier: Das-sata usage'
                  x: '25'
                  'y': '4'
                  width: '25'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'Storage Tier: Das-sata usage'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.storage.controller.tier.das_sata.usage.bytes
                    - type: INTEGER
                      name: show.0
                      value: '1'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: INTEGER
                      name: units_bold
                      value: '0'
                    - type: INTEGER
                      name: value_bold
                      value: '0'
                - type: item
                  name: 'Storage Tier: SSD usage'
                  x: '25'
                  'y': '10'
                  width: '25'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'Storage Tier: SSD usage'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.storage.controller.tier.ssd.usage.bytes
                    - type: INTEGER
                      name: show.0
                      value: '1'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: INTEGER
                      name: units_bold
                      value: '0'
                    - type: INTEGER
                      name: value_bold
                      value: '0'
                - type: piechart
                  name: 'Storage Tier: Das-sata Usage / Total'
                  x: '50'
                  width: '22'
                  height: '6'
                  fields:
                    - type: INTEGER
                      name: draw_type
                      value: '1'
                    - type: STRING
                      name: ds.0.color.0
                      value: 00BFFF
                    - type: STRING
                      name: ds.0.color.1
                      value: 0040FF
                    - type: INTEGER
                      name: ds.0.dataset_type
                      value: '0'
                    - type: ITEM
                      name: ds.0.itemids.0
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.storage.controller.tier.das_sata.capacity.bytes
                    - type: ITEM
                      name: ds.0.itemids.1
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.storage.controller.tier.das_sata.usage.bytes
                    - type: INTEGER
                      name: ds.0.type.0
                      value: '1'
                    - type: INTEGER
                      name: ds.0.type.1
                      value: '0'
                    - type: INTEGER
                      name: legend_lines
                      value: '2'
                    - type: INTEGER
                      name: legend_value
                      value: '1'
                    - type: INTEGER
                      name: space
                      value: '7'
                    - type: INTEGER
                      name: width
                      value: '40'
                - type: piechart
                  name: 'Storage Tier: SSD Usage / Total'
                  x: '50'
                  'y': '6'
                  width: '22'
                  height: '6'
                  fields:
                    - type: INTEGER
                      name: draw_type
                      value: '1'
                    - type: STRING
                      name: ds.0.color.0
                      value: 00BFFF
                    - type: STRING
                      name: ds.0.color.1
                      value: 0040FF
                    - type: INTEGER
                      name: ds.0.dataset_type
                      value: '0'
                    - type: ITEM
                      name: ds.0.itemids.0
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.storage.controller.tier.ssd.capacity.bytes
                    - type: ITEM
                      name: ds.0.itemids.1
                      value:
                        host: 'Nutanix Cluster Prism Element by HTTP'
                        key: nutanix.cluster.storage.controller.tier.ssd.usage.bytes
                    - type: INTEGER
                      name: ds.0.type.0
                      value: '1'
                    - type: INTEGER
                      name: ds.0.type.1
                      value: '0'
                    - type: INTEGER
                      name: legend_lines
                      value: '2'
                    - type: INTEGER
                      name: legend_value
                      value: '1'
                    - type: INTEGER
                      name: space
                      value: '7'
                    - type: INTEGER
                      name: width
                      value: '40'
      valuemaps:
        - uuid: 86e15b9ab1e04285a8db065fbdf6eedf
          name: 'Nutanix: Alert severity'
          mappings:
            - value: '0'
              newvalue: Info
            - value: '1'
              newvalue: Warning
            - value: '2'
              newvalue: Critical
            - value: '3'
              newvalue: Unknown
        - uuid: 079d797917c64626af20ce86249c2969
          name: 'Nutanix: Alert state'
          mappings:
            - value: '0'
              newvalue: Ok
            - value: '1'
              newvalue: Problem
        - uuid: 10ec1428fba54eeaabc6503361090761
          name: 'Nutanix: Boolean'
          mappings:
            - value: '0'
              newvalue: 'False'
            - value: '1'
              newvalue: 'True'
            - value: '2'
              newvalue: Unknown
        - uuid: 537aaf6158724960a2535913030f0138
          name: 'Nutanix: Cluster operation mode'
          mappings:
            - value: '0'
              newvalue: Normal
            - value: '1'
              newvalue: Override
            - value: '2'
              newvalue: Readonly
            - value: '3'
              newvalue: Standalone
            - value: '4'
              newvalue: 'Switch to two node'
            - value: '5'
              newvalue: Unknown
    - uuid: 8ab5387c8887435587cce8383b2fc6c5
      template: 'Nutanix Host Prism Element by HTTP'
      name: 'Nutanix Host Prism Element by HTTP'
      description: |
        Prism Element: It is a service already built into the platform for every Nutanix cluster deployed. It provides the ability to fully configure, manage, and monitor Nutanix clusters running any hypervisors, however, It only manages the cluster it is part of.
        
        This template is designed for the effortless deployment of Nutanix Host Prism Element monitoring and doesn't require any external scripts.
        
        This template can be used in discovery, as well as manually linked to a host - to do so, attach it to the host and manually set the value of the '{$NUTANIX.HOST.UUID}' macro.
        
        More details can be found in the official documentation:
          - on retrieving UUIDs: https://www.nutanixbible.com/19b-cli.html
          - on the Nutanix Prism Element REST API: https://www.nutanix.dev/api_reference/apis/prism_v2.html
          - on differences between Nutanix API versions: https://www.nutanix.dev/api-versions/
        
        Generated by official Zabbix template tool "Templator"
      wizard_ready: 'YES'
      readme: |
        ## Overview
        
        This template is designed for the effortless deployment of Nutanix Host Prism Element monitoring and doesn't require any external scripts.
        
        This template can be used in discovery, as well as manually linked to a host - to do so, attach it to the host and manually set the value of the `Host UUID` host wizard configuration field.
        
        More details can be found in the official documentation:
        - on retrieving [UUIDs](https://www.nutanixbible.com/19b-cli.html);
        - on the [Nutanix Prism Element REST API](https://www.nutanix.dev/api_reference/apis/prism_v2.html);
        - on differences between [Nutanix API versions](https://www.nutanix.dev/api-versions/).
        
        ## Setup
        
        1. Create a new Nutanix user and add the role "Viewer"
        2. Create a new host
        3. Link the template to the host created earlier
        4. Set the host wizard configuration fields required for getting data:
        ```text
        API IP
        API port
        ```
        5. Set the host wizard configuration fields with the login and password of the Nutanix user created earlier:
        ```text
        API username
        API password
        ```
        6. Set the host wizard configuration fields with the UUID of the Nutanix Host:
        ```text
        Host UUID
        ```
      vendor:
        name: Zabbix
        version: 8.0-1
      groups:
        - name: Templates/Applications
      items:
        - uuid: 48c5f1f6ea454fd69756268cd613129e
          name: 'Get alert'
          type: SCRIPT
          key: nutanix.host.alert.get
          history: '0'
          value_type: TEXT
          params: |
            var Nutanix = {
            	params: {},
            
            	setParams: function (requiredParams, allParams) {
            		requiredParams.forEach(function (field) {
            			if (typeof allParams !== 'object' || typeof allParams[field] === 'undefined' || allParams[field] === '') {
            				throw 'Required param is not set: ' + field + '.';
            			}
            		});
            
            		Nutanix.params = allParams;
            	},
            
            	request: function (url) {
            
            		var request = new HttpRequest();
            
            		if (typeof Nutanix.params.proxy !== 'undefined' && Nutanix.params.proxy !== '') {
            			request.setProxy(Nutanix.params.proxy);
            		}
            
            		request.setHttpAuth(HTTPAUTH_BASIC, Nutanix.params.username, Nutanix.params.password);
            
            		Zabbix.log(4, '[ Nutanix ] Sending request: ' + url);
            
            		const response = request.get(url);
            
            		Zabbix.log(4, '[ Nutanix ] Received response with status code ' + request.getStatus() + ': ' + response);
            
            		if (request.getStatus() < 200 || request.getStatus() >= 300) {
            			throw 'Request failed with status code ' + request.getStatus() + ': ' + response;
            		}
            
            		try {
            			response = JSON.parse(response);
            		}
            		catch (error) {
            			throw 'Failed to parse response received from Nutanix PRISM API. Check debug log for more information.';
            		}
            
            		return response;
            	},
            
            	deduplicateAlerts: function (full_data) {
            		const severity_mapping = [
            			'kinfo',
            			'kwarning',
            			'kcritical'
            		]
            
            		var output_data = {};
            		for (var entity in full_data.entities) {
            	
            			if (Nutanix.params.api_method === 'clusters') {
            				if (result.entities[entity].node_uuid.split('-').length == 5) continue;
            			}
            
            			var severity = severity_mapping.indexOf(full_data.entities[entity].severity.toLowerCase()),
            				message = full_data.entities[entity].message,
            				title = full_data.entities[entity].alert_title;
            	
            			full_data.entities[entity].context_types.forEach(function(context, index) {
            				message = message.replace('{' + context + '}', full_data.entities[entity].context_values[index]);
            				title = title.replace('{' + context + '}', full_data.entities[entity].context_values[index]);
            			});
            	
            			key = md5(title + message);
            			if (key in output_data) {
            				if (full_data.entities[entity].created_time_stamp_in_usecs > output_data[key].created) {
            					output_data[key].created = full_data.entities[entity].created_time_stamp_in_usecs;
            					output_data[key].severity = severity !== -1 ? severity : 3;
            					output_data[key].state = full_data.entities[entity].resolved ? 0 : 1;
            					output_data[key].message = full_data.entities[entity].detailed_message != '' ? full_data.entities[entity].detailed_message : message;
            					output_data[key].last_id = full_data.entities[entity].id;
            				}
            				output_data[key].count += 1;
            			} else {
            				output_data[key] = {
            					"name": title + ' - ' + message,
            					"title": title != '' ? title : message,
            					"created": full_data.entities[entity].created_time_stamp_in_usecs,
            					"severity": severity !== -1 ? severity : 3,
            					"state": full_data.entities[entity].resolved ? 0 : 1,
            					"message": full_data.entities[entity].detailed_message != '' ? full_data.entities[entity].detailed_message : message,
            					"last_id": full_data.entities[entity].id,
            					"count": 1
            				}
            			}
            		}
            
            		return output_data;
            	},
            
            	cleanUnsupported: function (full_stat) {
            		var output_stat = {};
            		for (var element in full_stat) {
            			if (full_stat[element] !== '-1') {
            				output_stat[element] = full_stat[element];
            			}
            		};
            		
            		return output_stat;
            	}
            };
            
            try {
            	const params = JSON.parse(value);
            	Nutanix.setParams(['endpoint_host', 'endpoint_port', 'username', 'password', 'auth_type', 'api_method', 'target_uuid'], params);
            
            	const url = 'https://' + Nutanix.params.endpoint_host + ':' + Nutanix.params.endpoint_port + '/PrismGateway/services/rest/v2.0/' + Nutanix.params.api_method + '/' + Nutanix.params.target_uuid + '/alerts',
            		result = Nutanix.request(url);
            
            	return JSON.stringify(Nutanix.deduplicateAlerts(result));
            }
            catch (error) {
            	error += (String(error).endsWith('.')) ? '' : '.';
            	Zabbix.log(4, '[ Nutanix ] ERROR: ' + error);
            
            	return JSON.stringify({ 'error': error });
            }
          description: 'Get data about alerts.'
          timeout: '{$NUTANIX.TIMEOUT}'
          parameters:
            - name: api_method
              value: hosts
            - name: auth_type
              value: basic
            - name: endpoint_host
              value: '{$NUTANIX.PRISM.ELEMENT.IP}'
            - name: endpoint_port
              value: '{$NUTANIX.PRISM.ELEMENT.PORT}'
            - name: password
              value: '{$NUTANIX.PASSWORD}'
            - name: proxy
              value: '{$NUTANIX.PROXY}'
            - name: target_uuid
              value: '{$NUTANIX.HOST.UUID}'
            - name: username
              value: '{$NUTANIX.USER}'
          tags:
            - tag: component
              value: raw
        - uuid: fe2d1588c8df4d0e83bf35029a8c0811
          name: 'Get alert check'
          type: DEPENDENT
          key: nutanix.host.alert.get.check
          value_type: TEXT
          description: 'Data collection check. Check the latest values for details.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.error
              error_handler: CUSTOM_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 3h
          master_item:
            key: nutanix.host.alert.get
          tags:
            - tag: component
              value: status
          triggers:
            - uuid: 6dbb467d463e47dca35970591ef1446f
              expression: 'length(last(/Nutanix Host Prism Element by HTTP/nutanix.host.alert.get.check))>0'
              name: 'Nutanix: Failed to get alert data from the API'
              priority: HIGH
              description: 'Failed to get data from the API. Check the latest values for details.'
              tags:
                - tag: scope
                  value: availability
        - uuid: 6b23ddc5bc4149cbbef4feb729ddd7d2
          name: 'Content Cache: References'
          type: DEPENDENT
          key: nutanix.host.content.cache.dedup.ref.num
          description: 'Average number of content cache references.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.content_cache_num_dedup_ref_count_pph
              error_handler: DISCARD_VALUE
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: application
        - uuid: f350acf8979145aca8bff3c26454e2b9
          name: 'Content Cache: Hit rate, %'
          type: DEPENDENT
          key: nutanix.host.content.cache.hit.percent
          value_type: FLOAT
          units: '%'
          description: 'Content cache hits over all lookups.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.content_cache_hit_ppm
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '0.0001'
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: application
        - uuid: 669e026614974b378306a4ce65b67ffb
          name: 'Content Cache: Logical memory usage, bytes'
          type: DEPENDENT
          key: nutanix.host.content.cache.logical.memory.usage.bytes
          units: B
          description: 'Logical memory used to cache data without deduplication in bytes.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.content_cache_logical_memory_usage_bytes
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: application
            - tag: component
              value: memory
        - uuid: 7d8e81cd62d6458a99db1d7aad0f229d
          name: 'Content Cache: Logical SSD usage, bytes'
          type: DEPENDENT
          key: nutanix.host.content.cache.logical.ssd.usage.bytes
          units: B
          description: 'Logical SSD memory used to cache data without deduplication in bytes.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.content_cache_logical_ssd_usage_bytes
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: application
            - tag: component
              value: memory
        - uuid: 8589d38473b04d06a3a7f58dc2513560
          name: 'Content Cache: Number of lookups'
          type: DEPENDENT
          key: nutanix.host.content.cache.lookups.num
          description: 'Number of lookups on the content cache.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.content_cache_num_lookups
              error_handler: DISCARD_VALUE
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: application
        - uuid: 36d0c74bfc3040a68516276e5ce763ac
          name: 'Content Cache: Physical memory usage, bytes'
          type: DEPENDENT
          key: nutanix.host.content.cache.physical.memory.usage.bytes
          units: B
          description: 'Real memory used to cache data via the content cache in bytes.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.content_cache_physical_memory_usage_bytes
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: application
            - tag: component
              value: memory
        - uuid: bc4d165f550f4921ab6b2a622b3c1973
          name: 'Content Cache: Physical SSD usage, bytes'
          type: DEPENDENT
          key: nutanix.host.content.cache.physical.ssd.usage.bytes
          units: B
          description: 'Real SSD usage used to cache data via the content cache in bytes.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.content_cache_physical_ssd_usage_bytes
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: application
            - tag: component
              value: memory
        - uuid: 397007975419415eb70ffe0276cff446
          name: 'Content Cache: Logical saved memory usage, bytes'
          type: DEPENDENT
          key: nutanix.host.content.cache.saved.memory.usage.bytes
          units: B
          description: 'Memory saved due to content cache deduplication in bytes.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.content_cache_saved_memory_usage_bytes
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: application
            - tag: component
              value: memory
        - uuid: 7e25d096fc094f0987d4009efe2074ec
          name: 'Content Cache: Saved SSD usage, bytes'
          type: DEPENDENT
          key: nutanix.host.content.cache.saved.ssd.usage.bytes
          units: B
          description: 'SSD usage saved due to content cache deduplication in bytes.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.content_cache_saved_ssd_usage_bytes
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: application
            - tag: component
              value: memory
        - uuid: 634b72675f5346079d4f3c962a3316b9
          name: 'Controller: Random IO'
          type: DEPENDENT
          key: nutanix.host.controller.io.random
          description: 'The number of random Input/Output operations from the controller.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.controller_num_random_io
              error_handler: DISCARD_VALUE
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: application
        - uuid: d51746d0f49a4631930f7200543254dd
          name: 'Controller: Random IO, %'
          type: DEPENDENT
          key: nutanix.host.controller.io.random.percent
          value_type: FLOAT
          units: '%'
          description: 'The percentage of random Input/Output from the controller.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.controller_random_io_ppm
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '0.0001'
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: application
        - uuid: 4df61338cb7e4044b029187665103b3e
          name: 'Controller: Sequence IO'
          type: DEPENDENT
          key: nutanix.host.controller.io.sequence
          description: 'The number of sequential Input/Output operations from the controller.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.controller_num_seq_io
              error_handler: DISCARD_VALUE
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: application
        - uuid: 946f9ef792c547edb275c7ad08532278
          name: 'Controller: Sequence IO, %'
          type: DEPENDENT
          key: nutanix.host.controller.io.sequence.percent
          value_type: FLOAT
          units: '%'
          description: 'The percentage of sequential Input/Output from the controller.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.controller_seq_io_ppm
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '0.0001'
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: application
        - uuid: a3a11c42c9da4eecb0aefa20792d4514
          name: 'Get disk'
          type: SCRIPT
          key: nutanix.host.disk.get
          history: '0'
          value_type: TEXT
          params: |
            var Nutanix = {
            	params: {},
            
            	setParams: function (requiredParams, allParams) {
            		requiredParams.forEach(function (field) {
            			if (typeof allParams !== 'object' || typeof allParams[field] === 'undefined' || allParams[field] === '') {
            				throw 'Required param is not set: ' + field + '.';
            			}
            		});
            
            		Nutanix.params = allParams;
            	},
            
            	request: function (url) {
            
            		var request = new HttpRequest();
            
            		if (typeof Nutanix.params.proxy !== 'undefined' && Nutanix.params.proxy !== '') {
            			request.setProxy(Nutanix.params.proxy);
            		}
            
            		request.setHttpAuth(HTTPAUTH_BASIC, Nutanix.params.username, Nutanix.params.password);
            
            		Zabbix.log(4, '[ Nutanix ] Sending request: ' + url);
            
            		const response = request.get(url);
            
            		Zabbix.log(4, '[ Nutanix ] Received response with status code ' + request.getStatus() + ': ' + response);
            
            		if (request.getStatus() < 200 || request.getStatus() >= 300) {
            			throw 'Request failed with status code ' + request.getStatus() + ': ' + response;
            		}
            
            		try {
            			response = JSON.parse(response);
            		}
            		catch (error) {
            			throw 'Failed to parse response received from Nutanix PRISM API. Check debug log for more information.';
            		}
            
            		return response;
            	},
            
            	deduplicateAlerts: function (full_data) {
            		const severity_mapping = [
            			'kinfo',
            			'kwarning',
            			'kcritical'
            		]
            
            		var output_data = {};
            		for (var entity in full_data.entities) {
            	
            			if (Nutanix.params.api_method === 'clusters') {
            				if (result.entities[entity].node_uuid.split('-').length == 5) continue;
            			}
            
            			var severity = severity_mapping.indexOf(full_data.entities[entity].severity.toLowerCase()),
            				message = full_data.entities[entity].message,
            				title = full_data.entities[entity].alert_title;
            	
            			full_data.entities[entity].context_types.forEach(function(context, index) {
            				message = message.replace('{' + context + '}', full_data.entities[entity].context_values[index]);
            				title = title.replace('{' + context + '}', full_data.entities[entity].context_values[index]);
            			});
            	
            			key = md5(title + message);
            			if (key in output_data) {
            				if (full_data.entities[entity].created_time_stamp_in_usecs > output_data[key].created) {
            					output_data[key].created = full_data.entities[entity].created_time_stamp_in_usecs;
            					output_data[key].severity = severity !== -1 ? severity : 3;
            					output_data[key].state = full_data.entities[entity].resolved ? 0 : 1;
            					output_data[key].message = full_data.entities[entity].detailed_message != '' ? full_data.entities[entity].detailed_message : message;
            					output_data[key].last_id = full_data.entities[entity].id;
            				}
            				output_data[key].count += 1;
            			} else {
            				output_data[key] = {
            					"name": title + ' - ' + message,
            					"title": title != '' ? title : message,
            					"created": full_data.entities[entity].created_time_stamp_in_usecs,
            					"severity": severity !== -1 ? severity : 3,
            					"state": full_data.entities[entity].resolved ? 0 : 1,
            					"message": full_data.entities[entity].detailed_message != '' ? full_data.entities[entity].detailed_message : message,
            					"last_id": full_data.entities[entity].id,
            					"count": 1
            				}
            			}
            		}
            
            		return output_data;
            	},
            
            	cleanUnsupported: function (full_stat) {
            		var output_stat = {};
            		for (var element in full_stat) {
            			if (full_stat[element] !== '-1') {
            				output_stat[element] = full_stat[element];
            			}
            		};
            		
            		return output_stat;
            	}
            };
            
            try {
            	const params = JSON.parse(value);
            	Nutanix.setParams(['endpoint_host', 'endpoint_port', 'username', 'password', 'auth_type', 'api_method', 'target_uuid'], params);
            
            	const url = 'https://' + Nutanix.params.endpoint_host + ':' + Nutanix.params.endpoint_port + '/PrismGateway/services/rest/v2.0/' + Nutanix.params.api_method + '?search_attribute_list=node_uuid&search_string=' + Nutanix.params.target_uuid,
            		result = Nutanix.request(url);
            
            	var output_data = {};
            	for (var entity in result.entities) {
            		output_data[result.entities[entity].id] = result.entities[entity]
            	}
            
            	return JSON.stringify(output_data);
            }
            catch (error) {
            	error += (String(error).endsWith('.')) ? '' : '.';
            	Zabbix.log(4, '[ Nutanix ] ERROR: ' + error);
            
            	return JSON.stringify({ 'error': error });
            }
          description: 'Get data about installed disks.'
          timeout: '{$NUTANIX.TIMEOUT}'
          parameters:
            - name: api_method
              value: disks
            - name: auth_type
              value: basic
            - name: endpoint_host
              value: '{$NUTANIX.PRISM.ELEMENT.IP}'
            - name: endpoint_port
              value: '{$NUTANIX.PRISM.ELEMENT.PORT}'
            - name: password
              value: '{$NUTANIX.PASSWORD}'
            - name: proxy
              value: '{$NUTANIX.PROXY}'
            - name: target_uuid
              value: '{$NUTANIX.HOST.UUID}'
            - name: username
              value: '{$NUTANIX.USER}'
          tags:
            - tag: component
              value: raw
        - uuid: 28d0f61d06f24eb39af718e213c68d87
          name: 'Get disk check'
          type: DEPENDENT
          key: nutanix.host.disk.get.check
          value_type: TEXT
          description: 'Data collection check. Check the latest values for details.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.error
              error_handler: CUSTOM_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 3h
          master_item:
            key: nutanix.host.disk.get
          tags:
            - tag: component
              value: status
          triggers:
            - uuid: a105b91b5d48438b93abc257b238e2c9
              expression: 'length(last(/Nutanix Host Prism Element by HTTP/nutanix.host.disk.get.check))>0'
              name: 'Nutanix: Failed to get disk data from the API'
              priority: HIGH
              description: 'Failed to get data from the API. Check the latest values for details.'
              tags:
                - tag: scope
                  value: availability
        - uuid: 0931721d1a3943649344315e2de7f39f
          name: 'General: Boot time'
          type: DEPENDENT
          key: nutanix.host.general.boot.time
          units: unixtime
          description: 'The last host boot time.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.boot_time_in_usecs
            - type: MULTIPLIER
              parameters:
                - '1.0E-6'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: application
        - uuid: 15b33f72661e4d5180460966d11a71d0
          name: 'General: Total CPU capacity'
          type: DEPENDENT
          key: nutanix.host.general.cpu.capacity.hz
          value_type: FLOAT
          units: Hz
          description: 'Total host CPU capacity in Hz.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.cpu_capacity_in_hz
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: cpu
        - uuid: 7d17333b18c94a37a34b5390969f2832
          name: 'General: CPU frequency'
          type: DEPENDENT
          key: nutanix.host.general.cpu.frequency
          value_type: FLOAT
          units: Hz
          description: 'The processor frequency.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.cpu_frequency_in_hz
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: cpu
        - uuid: c2c0f753b64f43aabd199fd4b3bf4182
          name: 'General: CPU model'
          type: DEPENDENT
          key: nutanix.host.general.cpu.model
          value_type: CHAR
          description: 'The processor model.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.cpu_model
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 12h
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: cpu
        - uuid: a7d620e525264ccfa790f6b4f46591f1
          name: 'General: Degrade status'
          type: DEPENDENT
          key: nutanix.host.general.degraded
          description: |
            Indicates whether the host is in a degraded state. One of the following:
            - Normal;
            - Degraded;
            - Unknown.
          valuemap:
            name: 'Nutanix: Degraded state'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.is_degraded
            - type: BOOL_TO_DECIMAL
              error_handler: CUSTOM_VALUE
              error_handler_params: '2'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: health
          triggers:
            - uuid: f10f4b560bd140cabb3beb4ee1dbbf78
              expression: 'last(/Nutanix Host Prism Element by HTTP/nutanix.host.general.degraded)=1'
              name: 'Nutanix: Host is in degraded status'
              priority: HIGH
              description: 'Host is in a degraded status. The host may soon become unavailable.'
              tags:
                - tag: scope
                  value: availability
        - uuid: 4b4eb846e4de4461a02d1d24fbcadef1
          name: 'General: IO'
          type: DEPENDENT
          key: nutanix.host.general.io
          description: 'The number of Input/Output operations from the disk.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.num_io
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '0.0001'
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: application
        - uuid: e0ab22c1d8aa49dc9625ba4876e6a7c2
          name: 'General: IO, bandwidth'
          type: DEPENDENT
          key: nutanix.host.general.io.bandwidth
          units: Bps
          description: 'Data transferred in B/sec from the disk.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.io_bandwidth_kBps
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1024'
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: application
        - uuid: 4094ad4a8d3a4e0a818fadc78f612f54
          name: 'General: IO, latency'
          type: DEPENDENT
          key: nutanix.host.general.io.latency
          value_type: FLOAT
          units: s
          description: 'Input/Output latency from the disk.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.avg_io_latency_usecs
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1.0E-6'
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: application
        - uuid: 80245fcfc1554a178d1a636c9356da77
          name: 'General: Random IO'
          type: DEPENDENT
          key: nutanix.host.general.io.random
          description: 'The number of random Input/Output operations.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.num_random_io
              error_handler: DISCARD_VALUE
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: application
        - uuid: fcbabfd55e37442b85913f7efdabab91
          name: 'General: Random IO, %'
          type: DEPENDENT
          key: nutanix.host.general.io.random.percent
          value_type: FLOAT
          units: '%'
          description: 'The percentage of random Input/Output.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.random_io_ppm
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '0.0001'
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: application
        - uuid: 9f57e588e1e94101aadfbf1cdd42f45b
          name: 'General: Read IO'
          type: DEPENDENT
          key: nutanix.host.general.io.read
          description: 'Input/Output read operations from the disk.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.num_read_io
              error_handler: DISCARD_VALUE
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: application
        - uuid: 98f8336a92cb4096b5edddf190bacab2
          name: 'General: Read IO, bandwidth'
          type: DEPENDENT
          key: nutanix.host.general.io.read.bandwidth
          units: Bps
          description: 'Read data transferred in B/sec from the disk.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.read_io_bandwidth_kBps
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1024'
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: application
        - uuid: bd84805286354e94b5f36a469c4840ae
          name: 'General: Read IO, latency'
          type: DEPENDENT
          key: nutanix.host.general.io.read.latency
          value_type: FLOAT
          units: s
          description: 'Average Input/Output read latency.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.avg_read_io_latency_usecs
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1.0E-6'
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: application
        - uuid: b3e69532f2064ffba9282f3006b2b995
          name: 'General: Read IO, %'
          type: DEPENDENT
          key: nutanix.host.general.io.read.percent
          value_type: FLOAT
          units: '%'
          description: 'The total percentage of Input/Output operations that are reads.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.read_io_ppm
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '0.0001'
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: application
        - uuid: 9ff70ba2c78145b7a34d6d1c01a0305f
          name: 'General: IO total read, bytes'
          type: DEPENDENT
          key: nutanix.host.general.io.read.total.bytes
          units: B
          description: 'Total size of Input/Output read operations.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.total_read_io_size_kbytes
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1024'
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: application
        - uuid: 68e37c5e0ecf4d32bb9d8bff4fbc860d
          name: 'General: IO total read, sec'
          type: DEPENDENT
          key: nutanix.host.general.io.read.total.sec
          value_type: FLOAT
          units: s
          description: 'Total time of Input/Output read operations.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.total_read_io_time_usecs
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1.0E-6'
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: application
        - uuid: 1685e6e8655d4b438d9a62057413360b
          name: 'General: Sequence IO'
          type: DEPENDENT
          key: nutanix.host.general.io.sequence
          description: 'The number of sequential Input/Output operations.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.num_seq_io
              error_handler: DISCARD_VALUE
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: application
        - uuid: 67c05bbcbe564fe894d4f0c630b0df36
          name: 'General: Sequence IO, %'
          type: DEPENDENT
          key: nutanix.host.general.io.sequence.percent
          value_type: FLOAT
          units: '%'
          description: 'The percentage of sequential Input/Output.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.seq_io_ppm
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '0.0001'
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: application
        - uuid: 6b2b1a101c284ccca77001c24296913b
          name: 'General: IO total, bytes'
          type: DEPENDENT
          key: nutanix.host.general.io.total.bytes
          units: B
          description: 'Total size of Input/Output operations.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.total_io_size_kbytes
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1024'
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: application
        - uuid: 31ec053fb9074612aec2f390c3297922
          name: 'General: IO total, sec'
          type: DEPENDENT
          key: nutanix.host.general.io.total.sec
          value_type: FLOAT
          units: s
          description: 'Total time of Input/Output operations.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.total_io_time_usecs
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1.0E-6'
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: application
        - uuid: 6a84248e84474c7fb5f43f002d5c8184
          name: 'General: Write IO'
          type: DEPENDENT
          key: nutanix.host.general.io.write
          description: 'Total number of Input/Output write operations.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.num_write_io
              error_handler: DISCARD_VALUE
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: application
        - uuid: 01da29a48ad844dda87220bdf51fc49b
          name: 'General: Write IO, bandwidth'
          type: DEPENDENT
          key: nutanix.host.general.io.write.bandwidth
          units: Bps
          description: 'Write data transferred in B/sec from the disk.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.write_io_bandwidth_kBps
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1024'
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: application
        - uuid: dfa5a832da96436ab36adb2ce5c427a7
          name: 'General: Write IO, latency'
          type: DEPENDENT
          key: nutanix.host.general.io.write.latency
          value_type: FLOAT
          units: s
          description: 'Average Input/Output write operation latency.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.avg_write_io_latency_usecs
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1.0E-6'
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: application
        - uuid: 1b46f733b32b401f820817ce10923f7c
          name: 'General: Write IO, %'
          type: DEPENDENT
          key: nutanix.host.general.io.write.percent
          value_type: FLOAT
          units: '%'
          description: 'Total percentage of Input/Output operations that are writes.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.write_io_ppm
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '0.0001'
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: application
        - uuid: d8760935333d464993158e756b5dc242
          name: 'General: IOPS'
          type: DEPENDENT
          key: nutanix.host.general.iops
          units: '!iops'
          description: 'Input/Output operations per second from the disk.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.num_iops
              error_handler: DISCARD_VALUE
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: application
        - uuid: fd34deb2093943c6b4f4ce5494e66b97
          name: 'General: Read IOPS'
          type: DEPENDENT
          key: nutanix.host.general.iops.read
          units: '!iops'
          description: 'Total number of Input/Output read operations per second.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.num_read_iops
              error_handler: DISCARD_VALUE
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: application
        - uuid: 2be54532725d4286b0f2f5427fa77087
          name: 'General: Write IOPS'
          type: DEPENDENT
          key: nutanix.host.general.iops.write
          value_type: FLOAT
          units: '!iops'
          description: 'Total number of Input/Output operations write per second.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.num_write_iops
              error_handler: DISCARD_VALUE
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: application
        - uuid: fa448c5009ca461baf2973f6c3c65a72
          name: 'General: Maintenance mode'
          type: DEPENDENT
          key: nutanix.host.general.maintenance
          description: |
            Indicates whether the host is in maintenance mode. One of the following:
            - Normal;
            - Maintenance;
            - Unknown.
          valuemap:
            name: 'Nutanix: Maintenance mode'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.host_in_maintenance_mode
            - type: BOOL_TO_DECIMAL
              error_handler: CUSTOM_VALUE
              error_handler_params: '2'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: application
        - uuid: 19f7001acc8e45c49b6d5734322ee05d
          name: 'General: Total memory, bytes'
          type: DEPENDENT
          key: nutanix.host.general.memory.total.bytes
          units: B
          description: 'Total host memory in bytes.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.memory_capacity_in_bytes
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: memory
        - uuid: e67d32de7523428d959c29a653a0647b
          name: 'General: Reboot pending'
          type: DEPENDENT
          key: nutanix.host.general.reboot
          description: 'Indicates whether the host is pending to reboot.'
          valuemap:
            name: 'Nutanix: Boolean'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.reboot_pending
            - type: BOOL_TO_DECIMAL
              error_handler: CUSTOM_VALUE
              error_handler_params: '2'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: application
        - uuid: eee1f5f4f68a44ea8cfbb409370b0f80
          name: 'General: Host state'
          type: DEPENDENT
          key: nutanix.host.general.state
          description: |
            Displays the host state. One of the following:
            - NEW;
            - NORMAL;
            - MARKED_FOR_REMOVAL_BUT_NOT_DETACHABLE;
            - DETACHABLE.
          valuemap:
            name: 'Nutanix: Host state'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.state
            - type: JAVASCRIPT
              parameters:
                - |
                  const idx = [
                    'NEW',
                    'NORMAL',
                    'MARKED_FOR_REMOVAL_BUT_NOT_DETACHABLE',
                    'DETACHABLE'
                  ].indexOf(value.toUpperCase());
                  return idx !== -1 ? idx : 4;
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 10m
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: application
        - uuid: 2e52146c43cd46cba3ad350528e5c277
          name: 'General: Storage capacity, bytes'
          type: DEPENDENT
          key: nutanix.host.general.storage.capacity.bytes
          units: B
          description: 'Total size of the datastores used by this system in bytes.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$.usage_stats.[''storage.capacity_bytes'']'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: storage
        - uuid: 7917e0babb4b433da73a3d8f5a872bd1
          name: 'General: Storage free, bytes'
          type: DEPENDENT
          key: nutanix.host.general.storage.free.bytes
          units: B
          description: 'Total free space of all the datastores used by this system in bytes.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$.usage_stats.[''storage.free_bytes'']'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: storage
        - uuid: 51be63c3691049a683be08546387ab7a
          name: 'General: Storage logical usage, bytes'
          type: DEPENDENT
          key: nutanix.host.general.storage.logical.usage.bytes
          units: B
          description: 'Total logical used space by the datastores of this system in bytes.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$.usage_stats.[''storage.logical_usage_bytes'']'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: storage
        - uuid: ca11026b4f3e411588eea1eab0c8c299
          name: 'General: Storage usage, bytes'
          type: DEPENDENT
          key: nutanix.host.general.storage.usage.bytes
          units: B
          description: 'Total physical datastore space used by this host and all its snapshots on the datastores.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$.usage_stats.[''storage.usage_bytes'']'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: storage
        - uuid: c603fce582d64d5abe2f5863640c9f58
          name: 'General: Timespan, sec'
          type: DEPENDENT
          key: nutanix.host.general.timespan.sec
          value_type: FLOAT
          units: s
          description: 'Host timespan.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.timespan_usecs
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1.0E-6'
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: application
        - uuid: 229e67e4300143a5b1ff1f5e0738785f
          name: 'General: Total transformed usage, bytes'
          type: DEPENDENT
          key: nutanix.host.general.transformed.usage.total.bytes
          units: B
          description: 'Actual usage of storage.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.total_transformed_usage_bytes
              error_handler: DISCARD_VALUE
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: application
        - uuid: 653f6d1b6e2d47e3a3c44406b7d6de11
          name: 'General: Host type'
          type: DEPENDENT
          key: nutanix.host.general.type
          description: |
            Displays the host type. One of the following:
            - HYPER_CONVERGED;
            - COMPUTE_ONLY.
          valuemap:
            name: 'Nutanix: Host type'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.host_type
            - type: JAVASCRIPT
              parameters:
                - |
                  const idx = [
                    'HYPER_CONVERGED',
                    'COMPUTE_ONLY'
                  ].indexOf(value.toUpperCase());
                  return idx !== -1 ? idx : 2;
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: application
        - uuid: b46931e9874342bb9071170235db1523
          name: 'General: Total untransformed usage, bytes'
          type: DEPENDENT
          key: nutanix.host.general.untransformed.usage.total.bytes
          units: B
          description: 'Logical usage of storage (physical usage divided by the replication factor).'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.total_untransformed_usage_bytes
              error_handler: DISCARD_VALUE
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: application
        - uuid: 044d58d7c3394f6fa62dd6390218f5ea
          name: 'General: Number of virtual machines'
          type: DEPENDENT
          key: nutanix.host.general.vms.num
          description: 'Number of virtual machines running on this host.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.num_vms
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: application
        - uuid: 52aa85553198433298dbbac196ebf66a
          name: 'Hypervisor: Number of CPU cores'
          type: DEPENDENT
          key: nutanix.host.hypervisor.cpu.cores.num
          description: 'The number of CPU cores.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.num_cpu_cores
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 12h
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: cpu
        - uuid: fc3b3850f7c4440cb9ff50194204e68f
          name: 'Hypervisor: Number of CPU sockets'
          type: DEPENDENT
          key: nutanix.host.hypervisor.cpu.sockets.num
          description: 'The number of CPU sockets.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.num_cpu_sockets
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 12h
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: cpu
        - uuid: 674aff8c3c764f1aa9571789f3c8d938
          name: 'Hypervisor: Number of CPU threads'
          type: DEPENDENT
          key: nutanix.host.hypervisor.cpu.threads.num
          description: 'The number of CPU threads.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.num_cpu_threads
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 12h
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: cpu
        - uuid: a7153c897dd64d0a9b523401380d5074
          name: 'Hypervisor: CPU usage, %'
          type: DEPENDENT
          key: nutanix.host.hypervisor.cpu.usage.percent
          value_type: FLOAT
          units: '%'
          description: 'Percentage of CPU used by the Hypervisor.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.hypervisor_cpu_usage_ppm
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '0.0001'
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: cpu
        - uuid: 9b943b7fbdb14ea88a755c048dbcd42d
          name: 'Hypervisor: IO'
          type: DEPENDENT
          key: nutanix.host.hypervisor.io
          value_type: FLOAT
          description: 'The number of Input/Output operations from the Hypervisor.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.hypervisor_num_io
              error_handler: DISCARD_VALUE
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: application
        - uuid: d3c5c2f3aac9497c82db53b22fef99bc
          name: 'Hypervisor: IO, bandwidth'
          type: DEPENDENT
          key: nutanix.host.hypervisor.io.bandwidth
          units: Bps
          description: 'Data transferred in B/sec from the Hypervisor.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.hypervisor_io_bandwidth_kBps
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1024'
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: application
        - uuid: fdc056be2fa34e84aa801e0dd1c27f2c
          name: 'Hypervisor: IO, latency'
          type: DEPENDENT
          key: nutanix.host.hypervisor.io.latency
          value_type: FLOAT
          units: s
          description: 'Input/Output operation latency from the Hypervisor.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.hypervisor_avg_io_latency_usecs
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1.0E-6'
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: application
        - uuid: 34b8a6a9dff44c858cff7762f8f6f129
          name: 'Hypervisor: Read IO'
          type: DEPENDENT
          key: nutanix.host.hypervisor.io.read
          description: 'Input/Output read operations per second from the Hypervisor.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.hypervisor_num_read_io
              error_handler: DISCARD_VALUE
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: application
        - uuid: 3ab152f1c0534e90b9c84ed56e8f6522
          name: 'Hypervisor: Read IO, bandwidth'
          type: DEPENDENT
          key: nutanix.host.hypervisor.io.read.bandwidth
          units: Bps
          description: 'Read data transferred in B/sec from the Hypervisor.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.hypervisor_read_io_bandwidth_kBps
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1024'
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: application
        - uuid: d8a7b7a2090a4b81947c2b0043b15460
          name: 'Hypervisor: Read IO, latency'
          type: DEPENDENT
          key: nutanix.host.hypervisor.io.read.latency
          value_type: FLOAT
          units: s
          description: 'Input/Output read latency from the Hypervisor.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.hypervisor_avg_read_io_latency_usecs
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1.0E-6'
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: application
        - uuid: 7d8e8c00ced846a4b214123a5c11b6ba
          name: 'Hypervisor: IO total read, bytes'
          type: DEPENDENT
          key: nutanix.host.hypervisor.io.read.total.bytes
          units: B
          description: 'Total size of Input/Output read operations from the Hypervisor.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.hypervisor_total_read_io_size_kbytes
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1024'
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: application
        - uuid: 7cc44b50da26404a8a95a94f9640e259
          name: 'Hypervisor: IO total read, sec'
          type: DEPENDENT
          key: nutanix.host.hypervisor.io.read.total.sec
          value_type: FLOAT
          units: s
          description: 'Total time of Input/Output read operations from the Hypervisor.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.hypervisor_total_read_io_time_usecs
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1.0E-6'
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: application
        - uuid: 4f2081e28140438d94103dd709f45d9a
          name: 'Hypervisor: IO total, bytes'
          type: DEPENDENT
          key: nutanix.host.hypervisor.io.total.bytes
          units: B
          description: 'Total Input/Output operation size from the Hypervisor.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.hypervisor_total_io_size_kbytes
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1024'
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: application
        - uuid: 08a7564943fd4d608b5b57299ca52956
          name: 'Hypervisor: IO total, sec'
          type: DEPENDENT
          key: nutanix.host.hypervisor.io.total.sec
          value_type: FLOAT
          units: s
          description: 'Total Input/Output operation time from the Hypervisor.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.hypervisor_total_io_time_usecs
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1.0E-6'
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: application
        - uuid: 6678f0f027274409b44a879e22bc2255
          name: 'Hypervisor: Write IO'
          type: DEPENDENT
          key: nutanix.host.hypervisor.io.write
          description: 'Input/Output write operations from the Hypervisor.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.hypervisor_num_write_io
              error_handler: DISCARD_VALUE
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: application
        - uuid: 80514bb25ca54a789da233349b98d4bc
          name: 'Hypervisor: Write IO, bandwidth'
          type: DEPENDENT
          key: nutanix.host.hypervisor.io.write.bandwidth
          units: Bps
          description: 'Write data transferred in B/sec from the Hypervisor.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.hypervisor_write_io_bandwidth_kBps
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1024'
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: application
        - uuid: 113e7fbd52e64d628275a2246f9b1572
          name: 'Hypervisor: Write IO, latency'
          type: DEPENDENT
          key: nutanix.host.hypervisor.io.write.latency
          value_type: FLOAT
          units: s
          description: 'Input/Output write latency from the Hypervisor.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.hypervisor_avg_write_io_latency_usecs
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1.0E-6'
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: application
        - uuid: 5bffd28af1c64bff97e923551621bc75
          name: 'Hypervisor: IOPS'
          type: DEPENDENT
          key: nutanix.host.hypervisor.iops
          units: '!iops'
          description: 'Input/Output operations per second from the Hypervisor.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.hypervisor_num_iops
              error_handler: DISCARD_VALUE
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: application
        - uuid: b60f8c87b1484087835e1157895a9230
          name: 'Hypervisor: Read IOPS'
          type: DEPENDENT
          key: nutanix.host.hypervisor.iops.read
          description: 'The number of Input/Output read operations from the Hypervisor.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.hypervisor_num_read_iops
              error_handler: DISCARD_VALUE
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: application
        - uuid: 0dc0d5c57c4044cb8a60b0f145960cde
          name: 'Hypervisor: Write IOPS'
          type: DEPENDENT
          key: nutanix.host.hypervisor.iops.write
          units: '!iops'
          description: 'Input/Output write operations per second from the Hypervisor.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.hypervisor_num_write_iops
              error_handler: DISCARD_VALUE
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: application
        - uuid: 6cea713941644a389591598d0a17ab9a
          name: 'Hypervisor: Memory usage, %'
          type: DEPENDENT
          key: nutanix.host.hypervisor.memory.usage.percent
          value_type: FLOAT
          units: '%'
          description: 'Percentage of memory used by the Hypervisor.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.hypervisor_memory_usage_ppm
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '0.0001'
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: memory
        - uuid: 3e8cb0f5766b4e8cb392ed652da8c19a
          name: 'Hypervisor: Full name'
          type: DEPENDENT
          key: nutanix.host.hypervisor.name
          value_type: CHAR
          description: 'Full name of the Hypervisor running on the host.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.hypervisor_full_name
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 12h
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: application
        - uuid: 083f7f4c56fa4e10bf90341d59cfc571
          name: 'Hypervisor: Received, bytes'
          type: DEPENDENT
          key: nutanix.host.hypervisor.received.bytes
          units: B
          description: 'Bytes received over the network reported by the Hypervisor.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.hypervisor_num_received_bytes
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: network
        - uuid: d99a423ebf124816ba85a2493500004c
          name: 'Hypervisor: Timespan, sec'
          type: DEPENDENT
          key: nutanix.host.hypervisor.timespan.sec
          value_type: FLOAT
          units: s
          description: 'Hypervisor timespan.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.hypervisor_timespan_usecs
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1.0E-6'
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: application
        - uuid: 7aeaafc3ac174692ad9b65ee1afc54f0
          name: 'Hypervisor: Transmitted, bytes'
          type: DEPENDENT
          key: nutanix.host.hypervisor.transmitted.bytes
          units: B
          description: 'Bytes transmitted over the network reported by the Hypervisor.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.hypervisor_num_transmitted_bytes
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: network
        - uuid: 30b4da75a8f54b5385310b43fa6a2a7a
          name: 'Get metric'
          type: SCRIPT
          key: nutanix.host.metric.get
          history: '0'
          value_type: TEXT
          params: |
            var Nutanix = {
            	params: {},
            
            	setParams: function (requiredParams, allParams) {
            		requiredParams.forEach(function (field) {
            			if (typeof allParams !== 'object' || typeof allParams[field] === 'undefined' || allParams[field] === '') {
            				throw 'Required param is not set: ' + field + '.';
            			}
            		});
            
            		Nutanix.params = allParams;
            	},
            
            	request: function (url) {
            
            		var request = new HttpRequest();
            
            		if (typeof Nutanix.params.proxy !== 'undefined' && Nutanix.params.proxy !== '') {
            			request.setProxy(Nutanix.params.proxy);
            		}
            
            		request.setHttpAuth(HTTPAUTH_BASIC, Nutanix.params.username, Nutanix.params.password);
            
            		Zabbix.log(4, '[ Nutanix ] Sending request: ' + url);
            
            		const response = request.get(url);
            
            		Zabbix.log(4, '[ Nutanix ] Received response with status code ' + request.getStatus() + ': ' + response);
            
            		if (request.getStatus() < 200 || request.getStatus() >= 300) {
            			throw 'Request failed with status code ' + request.getStatus() + ': ' + response;
            		}
            
            		try {
            			response = JSON.parse(response);
            		}
            		catch (error) {
            			throw 'Failed to parse response received from Nutanix PRISM API. Check debug log for more information.';
            		}
            
            		return response;
            	},
            
            	deduplicateAlerts: function (full_data) {
            		const severity_mapping = [
            			'kinfo',
            			'kwarning',
            			'kcritical'
            		]
            
            		var output_data = {};
            		for (var entity in full_data.entities) {
            	
            			if (Nutanix.params.api_method === 'clusters') {
            				if (result.entities[entity].node_uuid.split('-').length == 5) continue;
            			}
            
            			var severity = severity_mapping.indexOf(full_data.entities[entity].severity.toLowerCase()),
            				message = full_data.entities[entity].message,
            				title = full_data.entities[entity].alert_title;
            	
            			full_data.entities[entity].context_types.forEach(function(context, index) {
            				message = message.replace('{' + context + '}', full_data.entities[entity].context_values[index]);
            				title = title.replace('{' + context + '}', full_data.entities[entity].context_values[index]);
            			});
            	
            			key = md5(title + message);
            			if (key in output_data) {
            				if (full_data.entities[entity].created_time_stamp_in_usecs > output_data[key].created) {
            					output_data[key].created = full_data.entities[entity].created_time_stamp_in_usecs;
            					output_data[key].severity = severity !== -1 ? severity : 3;
            					output_data[key].state = full_data.entities[entity].resolved ? 0 : 1;
            					output_data[key].message = full_data.entities[entity].detailed_message != '' ? full_data.entities[entity].detailed_message : message;
            					output_data[key].last_id = full_data.entities[entity].id;
            				}
            				output_data[key].count += 1;
            			} else {
            				output_data[key] = {
            					"name": title + ' - ' + message,
            					"title": title != '' ? title : message,
            					"created": full_data.entities[entity].created_time_stamp_in_usecs,
            					"severity": severity !== -1 ? severity : 3,
            					"state": full_data.entities[entity].resolved ? 0 : 1,
            					"message": full_data.entities[entity].detailed_message != '' ? full_data.entities[entity].detailed_message : message,
            					"last_id": full_data.entities[entity].id,
            					"count": 1
            				}
            			}
            		}
            
            		return output_data;
            	},
            
            	cleanUnsupported: function (full_stat) {
            		var output_stat = {};
            		for (var element in full_stat) {
            			if (full_stat[element] !== '-1') {
            				output_stat[element] = full_stat[element];
            			}
            		};
            		
            		return output_stat;
            	}
            };
            
            try {
            	const params = JSON.parse(value);
            	Nutanix.setParams(['endpoint_host', 'endpoint_port', 'username', 'password', 'auth_type', 'api_method', 'target_uuid'], params);
            
            	const url = 'https://' + Nutanix.params.endpoint_host + ':' + Nutanix.params.endpoint_port + '/PrismGateway/services/rest/v2.0/' + Nutanix.params.api_method + '/' + Nutanix.params.target_uuid;
            	var result = Nutanix.request(url);
            
            	result.stats = Nutanix.cleanUnsupported(result.stats);
            
            	return JSON.stringify(result);
            }
            catch (error) {
            	error += (String(error).endsWith('.')) ? '' : '.';
            	Zabbix.log(4, '[ Nutanix ] ERROR: ' + error);
            
            	return JSON.stringify({ 'error': error });
            }
          description: 'Get data about basic metrics.'
          timeout: '{$NUTANIX.TIMEOUT}'
          parameters:
            - name: api_method
              value: hosts
            - name: auth_type
              value: basic
            - name: endpoint_host
              value: '{$NUTANIX.PRISM.ELEMENT.IP}'
            - name: endpoint_port
              value: '{$NUTANIX.PRISM.ELEMENT.PORT}'
            - name: password
              value: '{$NUTANIX.PASSWORD}'
            - name: proxy
              value: '{$NUTANIX.PROXY}'
            - name: target_uuid
              value: '{$NUTANIX.HOST.UUID}'
            - name: username
              value: '{$NUTANIX.USER}'
          tags:
            - tag: component
              value: raw
        - uuid: 762928864e674745820593499facb776
          name: 'Get metric check'
          type: DEPENDENT
          key: nutanix.host.metric.get.check
          value_type: TEXT
          description: 'Data collection check. Check the latest values for details.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.error
              error_handler: CUSTOM_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 3h
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: status
          triggers:
            - uuid: f23095d512e845ae846a2b774b97de51
              expression: 'length(last(/Nutanix Host Prism Element by HTTP/nutanix.host.metric.get.check))>0'
              name: 'Nutanix: Failed to get metric data from the API'
              priority: HIGH
              description: 'Failed to get data from the API. Check the latest values for details.'
              tags:
                - tag: scope
                  value: availability
        - uuid: 9d0f46350adc468ca4160b7a7e7e85a6
          name: 'Storage Controller: IO'
          type: DEPENDENT
          key: nutanix.host.storage.controller.io
          description: 'Input/Output operations from the Storage Controller.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.controller_num_io
              error_handler: DISCARD_VALUE
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: storage
        - uuid: f927375ff1394485922c56df0146d17b
          name: 'Storage Controller: IO, bandwidth'
          type: DEPENDENT
          key: nutanix.host.storage.controller.io.bandwidth
          units: Bps
          description: 'Data transferred in B/sec from the Storage Controller.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.controller_io_bandwidth_kBps
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1024'
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: storage
        - uuid: 1c92602ab01b4a43a554bca63bc251ed
          name: 'Storage Controller: IO, latency'
          type: DEPENDENT
          key: nutanix.host.storage.controller.io.latency
          value_type: FLOAT
          units: s
          description: 'Input/Output latency from the Storage Controller.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.controller_avg_io_latency_usecs
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1.0E-6'
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: storage
        - uuid: 2811d78caec14a3fbec0e75983399677
          name: 'Storage Controller: Read IO'
          type: DEPENDENT
          key: nutanix.host.storage.controller.io.read
          description: 'Input/Output read operations from the Storage Controller.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.controller_num_read_io
              error_handler: DISCARD_VALUE
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: storage
        - uuid: 7f10496163da4c13a638c99ced62384d
          name: 'Storage Controller: Read IO, bandwidth'
          type: DEPENDENT
          key: nutanix.host.storage.controller.io.read.bandwidth
          units: Bps
          description: 'Read data transferred in B/sec from the Storage Controller.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.controller_read_io_bandwidth_kBps
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1024'
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: storage
        - uuid: 52f5ed73efa74dc8aaa308a1120b3c1d
          name: 'Storage Controller: Read IO, bytes'
          type: DEPENDENT
          key: nutanix.host.storage.controller.io.read.bytes
          units: B
          description: 'Storage Controller average read Input/Output in bytes.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.controller_avg_read_io_size_kbytes
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1024'
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: storage
        - uuid: ed5f0d67b7814aab8233693a60432726
          name: 'Storage Controller: Read IO, latency'
          type: DEPENDENT
          key: nutanix.host.storage.controller.io.read.latency
          value_type: FLOAT
          units: s
          description: 'Input/Output read latency from the Storage Controller.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.controller_avg_read_io_latency_usecs
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1.0E-6'
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: storage
        - uuid: 1f5ddc62861f44c6bd3de302805b490d
          name: 'Storage Controller: Read IO, %'
          type: DEPENDENT
          key: nutanix.host.storage.controller.io.read.percent
          value_type: FLOAT
          units: '%'
          description: 'Percentage of Input/Output operations from the Storage Controller that are reads.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.controller_read_io_ppm
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '0.0001'
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: storage
        - uuid: 7266e0a734b94612b77da9173f247391
          name: 'Storage Controller: IO total read, bytes'
          type: DEPENDENT
          key: nutanix.host.storage.controller.io.read.total.bytes
          units: B
          description: 'Total controller read Input/Output size.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.controller_total_read_io_size_kbytes
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1024'
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: storage
        - uuid: d49ffc420dee4731bf28f9835bb8e46d
          name: 'Storage Controller: IO total read, sec'
          type: DEPENDENT
          key: nutanix.host.storage.controller.io.read.total.sec
          value_type: FLOAT
          units: s
          description: 'Total controller read Input/Output time.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.controller_total_read_io_time_usecs
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1.0E-6'
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: storage
        - uuid: c9e37cc8765d4492ae579029fddfe9a6
          name: 'Storage Controller: IO total, bytes'
          type: DEPENDENT
          key: nutanix.host.storage.controller.io.total.bytes
          units: B
          description: 'Total controller Input/Output size.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.controller_total_io_size_kbytes
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1024'
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: storage
        - uuid: df7e8de51d1e4c309ace840439dc944e
          name: 'Storage Controller: IO total, sec'
          type: DEPENDENT
          key: nutanix.host.storage.controller.io.total.sec
          units: s
          description: 'Total controller Input/Output time.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.controller_total_io_time_usecs
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1.0E-6'
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: storage
        - uuid: b7b1af82edeb4852a3febd9d29404e16
          name: 'Storage Controller: Write IO'
          type: DEPENDENT
          key: nutanix.host.storage.controller.io.write
          description: 'Input/Output write operations to the Storage Controller.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.controller_num_write_io
              error_handler: DISCARD_VALUE
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: storage
        - uuid: 9378ffd9966d4980897022b2017ab63b
          name: 'Storage Controller: Write IO, bandwidth'
          type: DEPENDENT
          key: nutanix.host.storage.controller.io.write.bandwidth
          units: Bps
          description: 'Write data transferred in B/sec to the Storage Controller.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.controller_write_io_bandwidth_kBps
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1024'
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: storage
        - uuid: 967bf0b92cf54179be5c9686fb83f7b3
          name: 'Storage Controller: Write IO, bytes'
          type: DEPENDENT
          key: nutanix.host.storage.controller.io.write.bytes
          units: B
          description: 'Storage Controller average write Input/Output in bytes.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.controller_avg_write_io_size_kbytes
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1024'
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: storage
        - uuid: 3e8f8771f1e8406eb181caa86dbed38d
          name: 'Storage Controller: Write IO, latency'
          type: DEPENDENT
          key: nutanix.host.storage.controller.io.write.latency
          value_type: FLOAT
          units: s
          description: 'Input/Output write latency to the Storage Controller.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.controller_avg_write_io_latency_usecs
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1.0E-6'
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: storage
        - uuid: 6f3462bba55c4570b1ad7a5d614f567c
          name: 'Storage Controller: Write IO, %'
          type: DEPENDENT
          key: nutanix.host.storage.controller.io.write.percent
          value_type: FLOAT
          units: '%'
          description: 'Percentage of Input/Output operations to the Storage Controller that are writes.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.controller_write_io_ppm
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '0.0001'
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: storage
        - uuid: 34174b3fb45e41af9aa75d0ba3b115ff
          name: 'Storage Controller: IOPS'
          type: DEPENDENT
          key: nutanix.host.storage.controller.iops
          units: '!iops'
          description: 'Input/Output operations per second from the Storage Controller.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.controller_num_iops
              error_handler: DISCARD_VALUE
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: storage
        - uuid: b7c2fcd576c744c4b51256dfc1f9e83d
          name: 'Storage Controller: Read IOPS'
          type: DEPENDENT
          key: nutanix.host.storage.controller.iops.read
          units: '!iops'
          description: 'Input/Output read operations per second from the Storage Controller.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.controller_num_read_iops
              error_handler: DISCARD_VALUE
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: storage
        - uuid: 7c8b93d01f0a4078837a00760de1d49c
          name: 'Storage Controller: Write IOPS'
          type: DEPENDENT
          key: nutanix.host.storage.controller.iops.write
          units: '!iops'
          description: 'Input/Output write operations per second to the Storage Controller.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.controller_num_write_iops
              error_handler: DISCARD_VALUE
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: storage
        - uuid: 476b129cba244a5b8bb96ccc78de397d
          name: 'Storage Tier: Das-sata capacity, bytes'
          type: DEPENDENT
          key: nutanix.host.storage.controller.tier.das_sata.capacity.bytes
          units: B
          description: 'The total capacity of Das-sata in bytes.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$.usage_stats.[''storage_tier.das-sata.capacity_bytes'']'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: storage
        - uuid: eb23e35b137241f5a9b7142957aec07c
          name: 'Storage Tier: Das-sata free, bytes'
          type: DEPENDENT
          key: nutanix.host.storage.controller.tier.das_sata.free.bytes
          units: B
          description: 'The free space of Das-sata in bytes.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$.usage_stats.[''storage_tier.das-sata.free_bytes'']'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: storage
        - uuid: 05273aaa28c74743b1bd57a528f575b6
          name: 'Storage Tier: Das-sata usage, bytes'
          type: DEPENDENT
          key: nutanix.host.storage.controller.tier.das_sata.usage.bytes
          units: B
          description: 'The used space of Das-sata in bytes.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$.usage_stats.[''storage_tier.das-sata.usage_bytes'']'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: storage
        - uuid: 92a3a023365848a988be29f5ad8e3bfe
          name: 'Storage Tier: SSD capacity, bytes'
          type: DEPENDENT
          key: nutanix.host.storage.controller.tier.ssd.capacity.bytes
          units: B
          description: 'The total capacity of SSD in bytes.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$.usage_stats.[''storage_tier.ssd.capacity_bytes'']'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: storage
        - uuid: f4bd200a2cae4cc898718d138a57083a
          name: 'Storage Tier: SSD free, bytes'
          type: DEPENDENT
          key: nutanix.host.storage.controller.tier.ssd.free.bytes
          units: B
          description: 'The free space of SSD in bytes.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$.usage_stats.[''storage_tier.ssd.free_bytes'']'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: storage
        - uuid: 6cb0e31dcefd4354908feba5396b3959
          name: 'Storage Tier: SSD usage, bytes'
          type: DEPENDENT
          key: nutanix.host.storage.controller.tier.ssd.usage.bytes
          units: B
          description: 'The used space of SSD in bytes.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$.usage_stats.[''storage_tier.ssd.usage_bytes'']'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: storage
        - uuid: c290ab59bfe24e00b7b54d35e039d08b
          name: 'Storage Controller: Timespan, sec'
          type: DEPENDENT
          key: nutanix.host.storage.controller.timespan.sec
          value_type: FLOAT
          units: s
          description: 'Controller timespan.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.controller_timespan_usecs
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1.0E-6'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: storage
        - uuid: 85c0a08944454f5d9d60f3124dd834e0
          name: 'Storage Controller: Total transformed usage, bytes'
          type: DEPENDENT
          key: nutanix.host.storage.controller.transformed.usage.total.bytes
          units: B
          description: 'Actual usage of the Storage Controller.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.stats.controller_total_transformed_usage_bytes
              error_handler: DISCARD_VALUE
          master_item:
            key: nutanix.host.metric.get
          tags:
            - tag: component
              value: storage
      discovery_rules:
        - uuid: 389dc85322634670a9e2048ac7d378f5
          name: 'Alert discovery'
          type: DEPENDENT
          key: nutanix.host.alert.discovery
          filter:
            evaltype: AND
            conditions:
              - macro: '{#ALERT.NAME}'
                value: '{$NUTANIX.ALERT.DISCOVERY.NAME.MATCHES}'
              - macro: '{#ALERT.NAME}'
                value: '{$NUTANIX.ALERT.DISCOVERY.NAME.NOT_MATCHES}'
                operator: NOT_MATCHES_REGEX
              - macro: '{#ALERT.SEVERITY}'
                value: '{$NUTANIX.ALERT.DISCOVERY.SEVERITY.MATCHES}'
              - macro: '{#ALERT.STATE}'
                value: '{$NUTANIX.ALERT.DISCOVERY.STATE.MATCHES}'
          description: |
            Discovery of all alerts.
            Alerts will be grouped by title. For each alert, in addition to the basic information, the number of activation and last alert ID will be available.
          item_prototypes:
            - uuid: 8fa4a777a3eb4be5a0030193743ee589
              name: 'Alert [{#ALERT.NAME}]: Count alerts'
              type: DEPENDENT
              key: 'nutanix.host.alert.count["{#ALERT.KEY}"]'
              description: 'The number of times this alert was triggered.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.{#ALERT.KEY}.count'
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: nutanix.host.alert.get
              tags:
                - tag: component
                  value: alert
            - uuid: 2bcb76c0eafd49738c0fb055ab3c9142
              name: 'Alert [{#ALERT.NAME}]: Create datetime'
              type: DEPENDENT
              key: 'nutanix.host.alert.created["{#ALERT.KEY}"]'
              units: unixtime
              description: 'The alert creation date and time.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.{#ALERT.KEY}.created'
                - type: MULTIPLIER
                  parameters:
                    - '1.0E-6'
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: nutanix.host.alert.get
              tags:
                - tag: component
                  value: alert
            - uuid: a489cfb61a3d4eb8a0faf7c8f6abd449
              name: 'Alert [{#ALERT.NAME}]: Last alert ID'
              type: DEPENDENT
              key: 'nutanix.host.alert.last_id["{#ALERT.KEY}"]'
              value_type: CHAR
              description: 'Latest ID of the alert.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.{#ALERT.KEY}.last_id'
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 12h
              master_item:
                key: nutanix.host.alert.get
              tags:
                - tag: component
                  value: alert
            - uuid: 4ea82682f355440ba35372e506a5531d
              name: 'Alert [{#ALERT.NAME}]: Detailed message'
              type: DEPENDENT
              key: 'nutanix.host.alert.message["{#ALERT.KEY}"]'
              value_type: TEXT
              description: 'Detailed information about the current alert.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.{#ALERT.KEY}.message'
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 12h
              master_item:
                key: nutanix.host.alert.get
              tags:
                - tag: component
                  value: alert
            - uuid: 4cb36a2694c04c3caae239752551a963
              name: 'Alert [{#ALERT.NAME}]: Severity'
              type: DEPENDENT
              key: 'nutanix.host.alert.severity["{#ALERT.KEY}"]'
              description: |
                Alert severity. One of the following:
                - Info;
                - Warning;
                - Critical;
                - Unknown.
              valuemap:
                name: 'Nutanix: Alert severity'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.{#ALERT.KEY}.severity'
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: nutanix.host.alert.get
              tags:
                - tag: component
                  value: alert
            - uuid: 35c0d10c39f445f0a0d0df07588495b9
              name: 'Alert [{#ALERT.NAME}]: State'
              type: DEPENDENT
              key: 'nutanix.host.alert.state["{#ALERT.KEY}"]'
              description: |
                Alert state. One of the following:
                - OK;
                - Problem.
              valuemap:
                name: 'Nutanix: Alert state'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.{#ALERT.KEY}.state'
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: nutanix.host.alert.get
              tags:
                - tag: component
                  value: alert
            - uuid: 80a264a6ce9846fba559bc43a587710e
              name: 'Alert [{#ALERT.NAME}]: Full title'
              type: DEPENDENT
              key: 'nutanix.host.alert.title["{#ALERT.KEY}"]'
              value_type: TEXT
              description: 'The full title of the alert.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.{#ALERT.KEY}.title'
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 12h
              master_item:
                key: nutanix.host.alert.get
              tags:
                - tag: component
                  value: alert
          master_item:
            key: nutanix.host.alert.get
          preprocessing:
            - type: JAVASCRIPT
              parameters:
                - |
                  const json_data = JSON.parse(value);
                  var output_data = [];
                  
                  for (var entity in json_data) {
                  	output_data.push({
                  		"{#ALERT.KEY}": entity,
                  		"{#ALERT.STATE}": json_data[entity].state,
                  		"{#ALERT.TITLE}": json_data[entity].title,
                  		"{#ALERT.SEVERITY}": json_data[entity].severity,
                  		"{#ALERT.NAME}": json_data[entity].name.length > 50 ? json_data[entity].name.substr(0, 50) + '...' : json_data[entity].name
                  	});
                  }
                  
                  return JSON.stringify(output_data);
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
        - uuid: a3255c6bd1014de0a486aa2b1bb5d047
          name: 'Disk discovery'
          type: DEPENDENT
          key: nutanix.host.disk.discovery
          description: 'Discovery of all disks.'
          item_prototypes:
            - uuid: 660ca0265176460090413cd91a29c821
              name: 'Disk [{#DISK.SERIAL}]: Space: Total, bytes'
              type: DEPENDENT
              key: 'nutanix.host.disk.capacity.bytes["{#DISK.SERIAL}"]'
              units: B
              description: 'The total disk space in bytes.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.[''{#DISK.ID}''].usage_stats.[''storage.capacity_bytes'']'
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 12h
              master_item:
                key: nutanix.host.disk.get
              tags:
                - tag: component
                  value: disk
                - tag: location
                  value: '{#DISK.LOCATION}'
                - tag: path
                  value: '{#DISK.MOUNT.PATH}'
                - tag: serial
                  value: '{#DISK.SERIAL}'
            - uuid: e7a8aadc572648f38fdcba9eaaa9ef78
              name: 'Disk [{#DISK.SERIAL}]: Space: Free, bytes'
              type: DEPENDENT
              key: 'nutanix.host.disk.free.bytes["{#DISK.SERIAL}"]'
              units: B
              description: 'The free disk space in bytes.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.[''{#DISK.ID}''].usage_stats.[''storage.free_bytes'']'
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: nutanix.host.disk.get
              tags:
                - tag: component
                  value: disk
                - tag: location
                  value: '{#DISK.LOCATION}'
                - tag: path
                  value: '{#DISK.MOUNT.PATH}'
                - tag: serial
                  value: '{#DISK.SERIAL}'
            - uuid: a28563a3464c4fef8ff05b7683495efd
              name: 'Disk [{#DISK.SERIAL}]: IO, latency'
              type: DEPENDENT
              key: 'nutanix.host.disk.io.avg.latency["{#DISK.SERIAL}"]'
              value_type: FLOAT
              units: s
              description: 'The average Input/Output operation latency.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.[''{#DISK.ID}''].stats.avg_io_latency_usecs'
                - type: MULTIPLIER
                  parameters:
                    - '1.0E-6'
              master_item:
                key: nutanix.host.disk.get
              tags:
                - tag: component
                  value: disk
                - tag: location
                  value: '{#DISK.LOCATION}'
                - tag: path
                  value: '{#DISK.MOUNT.PATH}'
                - tag: serial
                  value: '{#DISK.SERIAL}'
            - uuid: 21c81453cc8c44daaa50b1e5f45c1f4b
              name: 'Disk [{#DISK.SERIAL}]: Bandwidth'
              type: DEPENDENT
              key: 'nutanix.host.disk.io.bandwidth["{#DISK.SERIAL}"]'
              units: Bps
              description: 'Bandwidth of the disk in B/sec.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.[''{#DISK.ID}''].stats.io_bandwidth_kBps'
                - type: MULTIPLIER
                  parameters:
                    - '1024'
              master_item:
                key: nutanix.host.disk.get
              tags:
                - tag: component
                  value: disk
                - tag: location
                  value: '{#DISK.LOCATION}'
                - tag: path
                  value: '{#DISK.MOUNT.PATH}'
                - tag: serial
                  value: '{#DISK.SERIAL}'
            - uuid: 324f5d2658b34cc3ab4fcc4a6e2008fe
              name: 'Disk [{#DISK.SERIAL}]: IOPS'
              type: DEPENDENT
              key: 'nutanix.host.disk.iops["{#DISK.SERIAL}"]'
              units: '!iops'
              description: 'The number of Input/Output operations from the disk.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.[''{#DISK.ID}''].stats.num_iops'
              master_item:
                key: nutanix.host.disk.get
              tags:
                - tag: component
                  value: disk
                - tag: location
                  value: '{#DISK.LOCATION}'
                - tag: path
                  value: '{#DISK.MOUNT.PATH}'
                - tag: serial
                  value: '{#DISK.SERIAL}'
            - uuid: 2517600fc093419eab9cc822fa1454a6
              name: 'Disk [{#DISK.SERIAL}]: Space: Logical usage, bytes'
              type: DEPENDENT
              key: 'nutanix.host.disk.logical.usage.bytes["{#DISK.SERIAL}"]'
              units: B
              description: 'The logical used disk space in bytes.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.[''{#DISK.ID}''].usage_stats.[''storage.logical_usage_bytes'']'
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: nutanix.host.disk.get
              tags:
                - tag: component
                  value: disk
                - tag: location
                  value: '{#DISK.LOCATION}'
                - tag: path
                  value: '{#DISK.MOUNT.PATH}'
                - tag: serial
                  value: '{#DISK.SERIAL}'
            - uuid: 673be2469f634e4cb992550d6665f0e9
              name: 'Disk [{#DISK.SERIAL}]: Online'
              type: DEPENDENT
              key: 'nutanix.host.disk.online["{#DISK.SERIAL}"]'
              description: 'Indicates whether the disk is online.'
              valuemap:
                name: 'Nutanix: Boolean'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.[''{#DISK.ID}''].online'
                - type: BOOL_TO_DECIMAL
                  error_handler: CUSTOM_VALUE
                  error_handler_params: '2'
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: nutanix.host.disk.get
              tags:
                - tag: component
                  value: disk
                - tag: location
                  value: '{#DISK.LOCATION}'
                - tag: path
                  value: '{#DISK.MOUNT.PATH}'
                - tag: serial
                  value: '{#DISK.SERIAL}'
            - uuid: d0ecf7b9e9cd4a7687ff9fd8adc8e7e3
              name: 'Disk [{#DISK.SERIAL}]: Status'
              type: DEPENDENT
              key: 'nutanix.host.disk.status["{#DISK.SERIAL}"]'
              description: |
                Current disk status. One of the following:
                - NORMAL;
                - DATA_MIGRATION_INITIATED;
                - MARKED_FOR_REMOVAL_BUT_NOT_DETACHABLE;
                - DETACHABLE.
              valuemap:
                name: 'Nutanix: Disk status'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.[''{#DISK.ID}''].disk_status'
                - type: JAVASCRIPT
                  parameters:
                    - |
                      const idx = [
                        'NORMAL',
                        'DATA_MIGRATION_INITIATED',
                        'MARKED_FOR_REMOVAL_BUT_NOT_DETACHABLE',
                        'DETACHABLE'
                      ].indexOf(value.toUpperCase());
                      return idx !== -1 ? idx : 4;
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: nutanix.host.disk.get
              tags:
                - tag: component
                  value: disk
                - tag: location
                  value: '{#DISK.LOCATION}'
                - tag: path
                  value: '{#DISK.MOUNT.PATH}'
                - tag: serial
                  value: '{#DISK.SERIAL}'
            - uuid: 904596dcd2db4721bd923e325b8b889e
              name: 'Disk [{#DISK.SERIAL}]: Space: Used, bytes'
              type: DEPENDENT
              key: 'nutanix.host.disk.usage.bytes["{#DISK.SERIAL}"]'
              units: B
              description: 'The used disk space in bytes.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.[''{#DISK.ID}''].usage_stats.[''storage.usage_bytes'']'
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: nutanix.host.disk.get
              tags:
                - tag: component
                  value: disk
                - tag: location
                  value: '{#DISK.LOCATION}'
                - tag: path
                  value: '{#DISK.MOUNT.PATH}'
                - tag: serial
                  value: '{#DISK.SERIAL}'
          graph_prototypes:
            - uuid: a9da4fc17600434b9abecd02a9e3d9f3
              name: 'Disk [{#DISK.SERIAL}]: Space: Logical usage and Used'
              graph_items:
                - drawtype: GRADIENT_LINE
                  color: 0040FF
                  item:
                    host: 'Nutanix Host Prism Element by HTTP'
                    key: 'nutanix.host.disk.usage.bytes["{#DISK.SERIAL}"]'
                - sortorder: '1'
                  drawtype: GRADIENT_LINE
                  color: 00BFFF
                  item:
                    host: 'Nutanix Host Prism Element by HTTP'
                    key: 'nutanix.host.disk.logical.usage.bytes["{#DISK.SERIAL}"]'
            - uuid: a225393ead3e4218be09cc19ba84392e
              name: 'Disk [{#DISK.SERIAL}]: Space: Total and Used'
              graph_items:
                - drawtype: GRADIENT_LINE
                  color: 0040FF
                  item:
                    host: 'Nutanix Host Prism Element by HTTP'
                    key: 'nutanix.host.disk.usage.bytes["{#DISK.SERIAL}"]'
                - sortorder: '1'
                  drawtype: GRADIENT_LINE
                  color: 00BFFF
                  item:
                    host: 'Nutanix Host Prism Element by HTTP'
                    key: 'nutanix.host.disk.capacity.bytes["{#DISK.SERIAL}"]'
          master_item:
            key: nutanix.host.disk.get
          preprocessing:
            - type: JAVASCRIPT
              parameters:
                - |
                  const json_data = JSON.parse(value);
                  var output_data = [];
                  
                  for (var entity in json_data) {
                  	output_data.push({
                  		"{#DISK.ID}": json_data[entity].id,
                  		"{#DISK.SERIAL}": json_data[entity].mount_path.split('/').pop(),
                  		"{#DISK.MOUNT.PATH}": json_data[entity].mount_path,
                  		"{#DISK.LOCATION}": json_data[entity].location
                  	});
                  };
                  
                  return JSON.stringify(output_data);
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
      tags:
        - tag: class
          value: software
        - tag: subclass
          value: virtualization
        - tag: target
          value: host
        - tag: target
          value: nutanix
        - tag: target
          value: prism-element
      macros:
        - macro: '{$NUTANIX.ALERT.DISCOVERY.NAME.MATCHES}'
          value: '.*'
          description: 'Filter of discoverable Nutanix alerts by name.'
          config:
            type: TEXT
            priority: '8'
            section_name: Filters
            label: 'Alerts filter by name (include)'
            description: 'Filter of discoverable Nutanix alerts by name.'
        - macro: '{$NUTANIX.ALERT.DISCOVERY.NAME.NOT_MATCHES}'
          value: CHANGE_IF_NEEDED
          description: 'Filter to exclude discovered Nutanix alerts by name.'
          config:
            type: TEXT
            priority: '9'
            section_name: Filters
            label: 'Alerts filter by name (exclude)'
            description: 'Filter to exclude discovered Nutanix alerts by name.'
        - macro: '{$NUTANIX.ALERT.DISCOVERY.SEVERITY.MATCHES}'
          value: '.*'
          description: 'Filter to exclude discovered Nutanix alerts by severity. Set all possible severities for filtering in the range 0-2. "0" - Info, "1" - Warning, "2" - Critical.'
          config:
            type: TEXT
            priority: '11'
            section_name: Filters
            label: 'Alerts filter by severity (include)'
            description: 'Filter to exclude discovered Nutanix alerts by severity. Set all possible severities for filtering in the range 0-2. "0" - Info, "1" - Warning, "2" - Critical.'
        - macro: '{$NUTANIX.ALERT.DISCOVERY.STATE.MATCHES}'
          value: '.*'
          description: 'Filter to exclude discovered Nutanix alerts by state. Set "1" for filtering only problem alerts or "0" for resolved ones.'
          config:
            type: TEXT
            priority: '10'
            section_name: Filters
            label: 'Alerts filter by state (include)'
            description: 'Filter to exclude discovered Nutanix alerts by state. Set "1" for filtering only problem alerts or "0" for resolved ones.'
        - macro: '{$NUTANIX.HOST.UUID}'
          description: 'UUID of the host.'
          config:
            type: TEXT
            priority: '6'
            label: 'Host UUID'
            description: 'UUID of the host.'
            required: 'YES'
        - macro: '{$NUTANIX.PASSWORD}'
          type: SECRET_TEXT
          description: 'Nutanix API password.'
          config:
            type: TEXT
            priority: '4'
            label: 'API password'
            description: 'Nutanix API password.'
            required: 'YES'
        - macro: '{$NUTANIX.PRISM.ELEMENT.IP}'
          description: 'Set the Nutanix API IP here.'
          config:
            type: TEXT
            priority: '1'
            label: 'API IP'
            description: 'Set the Nutanix API IP here.'
            required: 'YES'
        - macro: '{$NUTANIX.PRISM.ELEMENT.PORT}'
          value: '9440'
          description: 'Set the Nutanix API port here.'
          config:
            type: TEXT
            priority: '2'
            label: 'API port'
            description: 'Set the Nutanix API port here. In the range from 1 to 65535 inclusive.'
            required: 'YES'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$NUTANIX.PROXY}'
          description: 'Sets the HTTP proxy value. If this macro is empty, then no proxy is used.'
          config:
            type: TEXT
            priority: '5'
            section_name: Other
            label: Proxy
            description: 'Sets the HTTP proxy value. If this macro is empty, then no proxy is used.'
        - macro: '{$NUTANIX.TIMEOUT}'
          value: 10s
          description: 'API response timeout.'
          config:
            type: TEXT
            priority: '7'
            section_name: Other
            label: 'API response timeout'
            description: 'API response timeout.'
        - macro: '{$NUTANIX.USER}'
          description: 'Nutanix API username.'
          config:
            type: TEXT
            priority: '3'
            label: 'API username'
            description: 'Nutanix API username.'
            required: 'YES'
      dashboards:
        - uuid: ef6430bfad434b939f1bb22848cba40e
          name: 'Nutanix Host Prism Element overview'
          pages:
            - name: Overview
              widgets:
                - type: item
                  name: 'General: Host state'
                  width: '18'
                  hide_header: 'YES'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.general.state
                    - type: INTEGER
                      name: show.0
                      value: '1'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: STRING
                      name: thresholds.0.color
                      value: 00BFFF
                    - type: STRING
                      name: thresholds.0.threshold
                      value: '0'
                    - type: STRING
                      name: thresholds.1.color
                      value: 47A76A
                    - type: STRING
                      name: thresholds.1.threshold
                      value: '1'
                    - type: STRING
                      name: thresholds.2.color
                      value: FF8F00
                    - type: STRING
                      name: thresholds.2.threshold
                      value: '2'
                    - type: STRING
                      name: thresholds.3.color
                      value: FF8F00
                    - type: STRING
                      name: thresholds.3.threshold
                      value: '3'
                    - type: STRING
                      name: thresholds.4.color
                      value: D2D2D2
                    - type: STRING
                      name: thresholds.4.threshold
                      value: '4'
                    - type: INTEGER
                      name: value_bold
                      value: '0'
                - type: svggraph
                  name: IOPS
                  'y': '2'
                  width: '54'
                  height: '6'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: ds.0.color.0
                      value: 00BFFF
                    - type: STRING
                      name: ds.0.color.1
                      value: FF0080
                    - type: STRING
                      name: ds.0.color.2
                      value: 0040FF
                    - type: INTEGER
                      name: ds.0.dataset_type
                      value: '0'
                    - type: INTEGER
                      name: ds.0.fill
                      value: '4'
                    - type: ITEM
                      name: ds.0.itemids.0
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.general.iops
                    - type: ITEM
                      name: ds.0.itemids.1
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.hypervisor.iops
                    - type: ITEM
                      name: ds.0.itemids.2
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.storage.controller.iops
                    - type: INTEGER
                      name: ds.0.missingdatafunc
                      value: '3'
                    - type: INTEGER
                      name: ds.0.transparency
                      value: '6'
                    - type: INTEGER
                      name: ds.0.width
                      value: '2'
                    - type: INTEGER
                      name: legend_columns
                      value: '1'
                    - type: INTEGER
                      name: legend_lines
                      value: '3'
                    - type: INTEGER
                      name: legend_statistic
                      value: '1'
                    - type: STRING
                      name: reference
                      value: PMVMG
                    - type: INTEGER
                      name: righty
                      value: '0'
                - type: svggraph
                  name: 'General: Storage: Total and free'
                  'y': '8'
                  width: '18'
                  height: '4'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: ds.0.color.0
                      value: 00BFFF
                    - type: STRING
                      name: ds.0.color.1
                      value: 0040FF
                    - type: INTEGER
                      name: ds.0.dataset_type
                      value: '0'
                    - type: INTEGER
                      name: ds.0.fill
                      value: '4'
                    - type: ITEM
                      name: ds.0.itemids.0
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.general.storage.capacity.bytes
                    - type: ITEM
                      name: ds.0.itemids.1
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.general.storage.free.bytes
                    - type: INTEGER
                      name: ds.0.missingdatafunc
                      value: '3'
                    - type: INTEGER
                      name: ds.0.transparency
                      value: '6'
                    - type: INTEGER
                      name: ds.0.width
                      value: '2'
                    - type: INTEGER
                      name: legend_columns
                      value: '1'
                    - type: INTEGER
                      name: legend_lines
                      value: '3'
                    - type: INTEGER
                      name: legend_statistic
                      value: '1'
                    - type: STRING
                      name: reference
                      value: PMVKF
                    - type: INTEGER
                      name: righty
                      value: '0'
                - type: item
                  name: 'General: Reboot pending'
                  x: '18'
                  width: '18'
                  hide_header: 'YES'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.general.reboot
                    - type: INTEGER
                      name: show.0
                      value: '1'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: STRING
                      name: thresholds.0.color
                      value: 47A76A
                    - type: STRING
                      name: thresholds.0.threshold
                      value: '0'
                    - type: STRING
                      name: thresholds.1.color
                      value: FF8F00
                    - type: STRING
                      name: thresholds.1.threshold
                      value: '1'
                    - type: STRING
                      name: thresholds.2.color
                      value: D2D2D2
                    - type: STRING
                      name: thresholds.2.threshold
                      value: '2'
                    - type: INTEGER
                      name: value_bold
                      value: '0'
                - type: svggraph
                  name: 'General: Storage: Usage'
                  x: '18'
                  'y': '8'
                  width: '18'
                  height: '4'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: ds.0.color.0
                      value: 00BFFF
                    - type: STRING
                      name: ds.0.color.1
                      value: 0040FF
                    - type: INTEGER
                      name: ds.0.dataset_type
                      value: '0'
                    - type: INTEGER
                      name: ds.0.fill
                      value: '4'
                    - type: ITEM
                      name: ds.0.itemids.0
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.general.storage.logical.usage.bytes
                    - type: ITEM
                      name: ds.0.itemids.1
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.general.storage.usage.bytes
                    - type: INTEGER
                      name: ds.0.missingdatafunc
                      value: '3'
                    - type: INTEGER
                      name: ds.0.transparency
                      value: '6'
                    - type: INTEGER
                      name: ds.0.width
                      value: '2'
                    - type: INTEGER
                      name: legend_columns
                      value: '1'
                    - type: INTEGER
                      name: legend_lines
                      value: '3'
                    - type: INTEGER
                      name: legend_statistic
                      value: '1'
                    - type: STRING
                      name: reference
                      value: PMVKJ
                    - type: INTEGER
                      name: righty
                      value: '0'
                - type: item
                  name: 'General: Maintenance mode'
                  x: '36'
                  width: '18'
                  hide_header: 'YES'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.general.maintenance
                    - type: INTEGER
                      name: show.0
                      value: '1'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: STRING
                      name: thresholds.0.color
                      value: 47A76A
                    - type: STRING
                      name: thresholds.0.threshold
                      value: '0'
                    - type: STRING
                      name: thresholds.1.color
                      value: FF8F00
                    - type: STRING
                      name: thresholds.1.threshold
                      value: '1'
                    - type: STRING
                      name: thresholds.2.color
                      value: D2D2D2
                    - type: STRING
                      name: thresholds.2.threshold
                      value: '2'
                    - type: INTEGER
                      name: value_bold
                      value: '0'
                - type: item
                  name: 'General: Total CPU capacity'
                  x: '36'
                  'y': '8'
                  width: '18'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.general.cpu.capacity.hz
                    - type: INTEGER
                      name: show.0
                      value: '1'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: INTEGER
                      name: units_bold
                      value: '0'
                    - type: INTEGER
                      name: value_bold
                      value: '0'
                - type: item
                  name: 'General: Total memory'
                  x: '36'
                  'y': '10'
                  width: '18'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.general.memory.total.bytes
                    - type: INTEGER
                      name: show.0
                      value: '1'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: INTEGER
                      name: units_bold
                      value: '0'
                    - type: INTEGER
                      name: value_bold
                      value: '0'
                - type: item
                  name: 'General: Degrade status'
                  x: '54'
                  width: '18'
                  hide_header: 'YES'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.general.degraded
                    - type: INTEGER
                      name: show.0
                      value: '1'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: STRING
                      name: thresholds.0.color
                      value: 47A76A
                    - type: STRING
                      name: thresholds.0.threshold
                      value: '0'
                    - type: STRING
                      name: thresholds.1.color
                      value: FF8F00
                    - type: STRING
                      name: thresholds.1.threshold
                      value: '1'
                    - type: STRING
                      name: thresholds.2.color
                      value: D2D2D2
                    - type: STRING
                      name: thresholds.2.threshold
                      value: '2'
                    - type: INTEGER
                      name: value_bold
                      value: '0'
                - type: item
                  name: 'General: Number of virtual machines'
                  x: '54'
                  'y': '2'
                  width: '18'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.general.vms.num
                    - type: INTEGER
                      name: show.0
                      value: '1'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: INTEGER
                      name: show.2
                      value: '4'
                    - type: INTEGER
                      name: value_bold
                      value: '0'
                - type: item
                  name: 'General: Host type'
                  x: '54'
                  'y': '4'
                  width: '18'
                  hide_header: 'YES'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.general.type
                    - type: INTEGER
                      name: show.0
                      value: '1'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: INTEGER
                      name: units_bold
                      value: '0'
                    - type: INTEGER
                      name: value_bold
                      value: '0'
                    - type: INTEGER
                      name: value_size
                      value: '30'
                - type: item
                  name: 'General: Boot time'
                  x: '54'
                  'y': '6'
                  width: '18'
                  hide_header: 'YES'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.general.boot.time
                    - type: INTEGER
                      name: show.0
                      value: '1'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: INTEGER
                      name: units_bold
                      value: '0'
                    - type: INTEGER
                      name: value_bold
                      value: '0'
                    - type: INTEGER
                      name: value_size
                      value: '30'
                - type: item
                  name: 'General: CPU model'
                  x: '54'
                  'y': '8'
                  width: '18'
                  hide_header: 'YES'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.general.cpu.model
                    - type: INTEGER
                      name: show.0
                      value: '1'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: INTEGER
                      name: units_bold
                      value: '0'
                    - type: INTEGER
                      name: value_bold
                      value: '0'
                    - type: INTEGER
                      name: value_size
                      value: '20'
                - type: item
                  name: 'General: Timespan'
                  x: '54'
                  'y': '10'
                  width: '18'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.general.timespan.sec
                    - type: INTEGER
                      name: show.0
                      value: '1'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: INTEGER
                      name: units_bold
                      value: '0'
                    - type: INTEGER
                      name: value_bold
                      value: '0'
            - name: Performance
              widgets:
                - type: svggraph
                  name: 'Hypervisor: CPU usage'
                  width: '48'
                  height: '5'
                  fields:
                    - type: STRING
                      name: ds.0.color.0
                      value: 0040FF
                    - type: INTEGER
                      name: ds.0.dataset_type
                      value: '0'
                    - type: INTEGER
                      name: ds.0.fill
                      value: '4'
                    - type: ITEM
                      name: ds.0.itemids.0
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.hypervisor.cpu.usage.percent
                    - type: INTEGER
                      name: ds.0.missingdatafunc
                      value: '3'
                    - type: INTEGER
                      name: ds.0.transparency
                      value: '6'
                    - type: INTEGER
                      name: ds.0.width
                      value: '2'
                    - type: STRING
                      name: lefty_max
                      value: '100'
                    - type: STRING
                      name: lefty_min
                      value: '0'
                    - type: STRING
                      name: lefty_static_units
                      value: '%'
                    - type: INTEGER
                      name: lefty_units
                      value: '1'
                    - type: INTEGER
                      name: legend_statistic
                      value: '1'
                    - type: STRING
                      name: reference
                      value: RUGEL
                    - type: INTEGER
                      name: righty
                      value: '0'
                - type: svggraph
                  name: 'Hypervisor: Memory usage'
                  'y': '5'
                  width: '48'
                  height: '5'
                  fields:
                    - type: STRING
                      name: ds.0.color.0
                      value: FF465C
                    - type: INTEGER
                      name: ds.0.dataset_type
                      value: '0'
                    - type: INTEGER
                      name: ds.0.fill
                      value: '4'
                    - type: ITEM
                      name: ds.0.itemids.0
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.hypervisor.memory.usage.percent
                    - type: INTEGER
                      name: ds.0.missingdatafunc
                      value: '3'
                    - type: INTEGER
                      name: ds.0.transparency
                      value: '6'
                    - type: INTEGER
                      name: ds.0.width
                      value: '2'
                    - type: STRING
                      name: lefty_max
                      value: '100'
                    - type: STRING
                      name: lefty_min
                      value: '0'
                    - type: STRING
                      name: lefty_static_units
                      value: '%'
                    - type: INTEGER
                      name: lefty_units
                      value: '1'
                    - type: INTEGER
                      name: legend_statistic
                      value: '1'
                    - type: STRING
                      name: reference
                      value: RUGEN
                    - type: INTEGER
                      name: righty
                      value: '0'
                - type: item
                  name: 'Number of CPU cores'
                  'y': '10'
                  width: '24'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.hypervisor.cpu.cores.num
                    - type: INTEGER
                      name: show.0
                      value: '1'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: INTEGER
                      name: show.2
                      value: '4'
                    - type: INTEGER
                      name: units_bold
                      value: '0'
                    - type: INTEGER
                      name: value_bold
                      value: '0'
                - type: item
                  name: 'Number of CPU sockets'
                  x: '24'
                  'y': '10'
                  width: '24'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.hypervisor.cpu.sockets.num
                    - type: INTEGER
                      name: show.0
                      value: '1'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: INTEGER
                      name: show.2
                      value: '4'
                    - type: INTEGER
                      name: units_bold
                      value: '0'
                    - type: INTEGER
                      name: value_bold
                      value: '0'
                - type: gauge
                  name: 'Hypervisor: CPU usage'
                  x: '48'
                  width: '24'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: empty_color
                      value: E1F5FE
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.hypervisor.cpu.usage.percent
                    - type: STRING
                      name: thresholds.0.color
                      value: 29B6F6
                    - type: STRING
                      name: thresholds.0.threshold
                      value: '0'
                    - type: STRING
                      name: thresholds.1.color
                      value: FFF176
                    - type: STRING
                      name: thresholds.1.threshold
                      value: '70'
                    - type: STRING
                      name: thresholds.2.color
                      value: F9A825
                    - type: STRING
                      name: thresholds.2.threshold
                      value: '80'
                    - type: STRING
                      name: thresholds.3.color
                      value: FF465C
                    - type: STRING
                      name: thresholds.3.threshold
                      value: '90'
                    - type: INTEGER
                      name: th_show_arc
                      value: '1'
                    - type: STRING
                      name: units
                      value: '%'
                - type: item
                  name: 'General: Total CPU capacity'
                  x: '48'
                  'y': '3'
                  width: '24'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.general.cpu.capacity.hz
                    - type: INTEGER
                      name: show.0
                      value: '1'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: INTEGER
                      name: units_bold
                      value: '0'
                    - type: INTEGER
                      name: value_bold
                      value: '0'
                - type: gauge
                  name: 'Hypervisor: Memory usage'
                  x: '48'
                  'y': '5'
                  width: '24'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: empty_color
                      value: E1F5FE
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.hypervisor.memory.usage.percent
                    - type: STRING
                      name: thresholds.0.color
                      value: 29B6F6
                    - type: STRING
                      name: thresholds.0.threshold
                      value: '0'
                    - type: STRING
                      name: thresholds.1.color
                      value: FFF176
                    - type: STRING
                      name: thresholds.1.threshold
                      value: '70'
                    - type: STRING
                      name: thresholds.2.color
                      value: F9A825
                    - type: STRING
                      name: thresholds.2.threshold
                      value: '80'
                    - type: STRING
                      name: thresholds.3.color
                      value: FF465C
                    - type: STRING
                      name: thresholds.3.threshold
                      value: '90'
                    - type: INTEGER
                      name: th_show_arc
                      value: '1'
                    - type: STRING
                      name: units
                      value: '%'
                - type: item
                  name: 'General: Total memory'
                  x: '48'
                  'y': '8'
                  width: '24'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.general.memory.total.bytes
                    - type: INTEGER
                      name: show.0
                      value: '1'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: INTEGER
                      name: units_bold
                      value: '0'
                    - type: INTEGER
                      name: value_bold
                      value: '0'
                - type: item
                  name: 'Number of CPU threads'
                  x: '48'
                  'y': '10'
                  width: '24'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.hypervisor.cpu.threads.num
                    - type: INTEGER
                      name: show.0
                      value: '1'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: INTEGER
                      name: show.2
                      value: '4'
                    - type: INTEGER
                      name: units_bold
                      value: '0'
                    - type: INTEGER
                      name: value_bold
                      value: '0'
            - name: IO
              widgets:
                - type: svggraph
                  name: 'General: IOPS'
                  width: '40'
                  height: '6'
                  fields:
                    - type: STRING
                      name: ds.0.color.0
                      value: 00BFFF
                    - type: STRING
                      name: ds.0.color.1
                      value: FF0080
                    - type: STRING
                      name: ds.0.color.2
                      value: 0040FF
                    - type: INTEGER
                      name: ds.0.dataset_type
                      value: '0'
                    - type: INTEGER
                      name: ds.0.fill
                      value: '4'
                    - type: ITEM
                      name: ds.0.itemids.0
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.general.iops
                    - type: ITEM
                      name: ds.0.itemids.1
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.general.iops.read
                    - type: ITEM
                      name: ds.0.itemids.2
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.general.iops.write
                    - type: INTEGER
                      name: ds.0.missingdatafunc
                      value: '3'
                    - type: INTEGER
                      name: ds.0.transparency
                      value: '6'
                    - type: INTEGER
                      name: ds.0.width
                      value: '2'
                    - type: INTEGER
                      name: legend_columns
                      value: '1'
                    - type: INTEGER
                      name: legend_lines
                      value: '3'
                    - type: INTEGER
                      name: legend_statistic
                      value: '1'
                    - type: STRING
                      name: reference
                      value: TQOEF
                    - type: INTEGER
                      name: righty
                      value: '0'
                - type: svggraph
                  name: 'General: Bandwidth'
                  'y': '6'
                  width: '36'
                  height: '6'
                  fields:
                    - type: STRING
                      name: ds.0.color.0
                      value: 00BFFF
                    - type: STRING
                      name: ds.0.color.1
                      value: FF0080
                    - type: STRING
                      name: ds.0.color.2
                      value: 0040FF
                    - type: INTEGER
                      name: ds.0.dataset_type
                      value: '0'
                    - type: INTEGER
                      name: ds.0.fill
                      value: '4'
                    - type: ITEM
                      name: ds.0.itemids.0
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.general.io.bandwidth
                    - type: ITEM
                      name: ds.0.itemids.1
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.general.io.read.bandwidth
                    - type: ITEM
                      name: ds.0.itemids.2
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.general.io.write.bandwidth
                    - type: INTEGER
                      name: ds.0.missingdatafunc
                      value: '3'
                    - type: INTEGER
                      name: ds.0.transparency
                      value: '6'
                    - type: INTEGER
                      name: ds.0.width
                      value: '2'
                    - type: INTEGER
                      name: legend_columns
                      value: '1'
                    - type: INTEGER
                      name: legend_lines
                      value: '3'
                    - type: INTEGER
                      name: legend_statistic
                      value: '1'
                    - type: STRING
                      name: reference
                      value: CJFZM
                    - type: INTEGER
                      name: righty
                      value: '0'
                - type: svggraph
                  name: 'General: Latency'
                  x: '36'
                  'y': '6'
                  width: '36'
                  height: '6'
                  fields:
                    - type: STRING
                      name: ds.0.color.0
                      value: 00BFFF
                    - type: STRING
                      name: ds.0.color.1
                      value: FF0080
                    - type: STRING
                      name: ds.0.color.2
                      value: 0040FF
                    - type: INTEGER
                      name: ds.0.dataset_type
                      value: '0'
                    - type: INTEGER
                      name: ds.0.fill
                      value: '4'
                    - type: ITEM
                      name: ds.0.itemids.0
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.general.io.latency
                    - type: ITEM
                      name: ds.0.itemids.1
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.general.io.read.latency
                    - type: ITEM
                      name: ds.0.itemids.2
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.general.io.write.latency
                    - type: INTEGER
                      name: ds.0.missingdatafunc
                      value: '3'
                    - type: INTEGER
                      name: ds.0.transparency
                      value: '6'
                    - type: INTEGER
                      name: ds.0.width
                      value: '2'
                    - type: INTEGER
                      name: legend_columns
                      value: '1'
                    - type: INTEGER
                      name: legend_lines
                      value: '3'
                    - type: INTEGER
                      name: legend_statistic
                      value: '1'
                    - type: STRING
                      name: reference
                      value: PDAZA
                    - type: INTEGER
                      name: righty
                      value: '0'
                - type: item
                  name: 'General: IOPS'
                  x: '40'
                  width: '18'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.general.iops
                    - type: INTEGER
                      name: show.0
                      value: '1'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: INTEGER
                      name: show.2
                      value: '4'
                    - type: INTEGER
                      name: units_bold
                      value: '0'
                    - type: INTEGER
                      name: value_bold
                      value: '0'
                - type: item
                  name: 'General: Read IOPS'
                  x: '40'
                  'y': '2'
                  width: '18'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.general.iops.read
                    - type: INTEGER
                      name: show.0
                      value: '1'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: INTEGER
                      name: show.2
                      value: '4'
                    - type: INTEGER
                      name: units_bold
                      value: '0'
                    - type: INTEGER
                      name: value_bold
                      value: '0'
                - type: item
                  name: 'General: Write IOPS'
                  x: '40'
                  'y': '4'
                  width: '18'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.general.iops.write
                    - type: INTEGER
                      name: show.0
                      value: '1'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: INTEGER
                      name: show.2
                      value: '4'
                    - type: INTEGER
                      name: units_bold
                      value: '0'
                    - type: INTEGER
                      name: value_bold
                      value: '0'
                - type: piechart
                  name: 'General: Read IO / Write IO'
                  x: '58'
                  width: '14'
                  height: '6'
                  fields:
                    - type: INTEGER
                      name: draw_type
                      value: '1'
                    - type: STRING
                      name: ds.0.color.0
                      value: 00BFFF
                    - type: STRING
                      name: ds.0.color.1
                      value: 0040FF
                    - type: INTEGER
                      name: ds.0.dataset_type
                      value: '0'
                    - type: ITEM
                      name: ds.0.itemids.0
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.general.io.read.percent
                    - type: ITEM
                      name: ds.0.itemids.1
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.general.io.write.percent
                    - type: INTEGER
                      name: ds.0.type.0
                      value: '0'
                    - type: INTEGER
                      name: ds.0.type.1
                      value: '0'
                    - type: INTEGER
                      name: legend_lines
                      value: '2'
                    - type: INTEGER
                      name: legend_value
                      value: '1'
                    - type: INTEGER
                      name: space
                      value: '7'
                    - type: INTEGER
                      name: width
                      value: '40'
            - name: 'Content Cache'
              widgets:
                - type: svggraph
                  name: 'Content Cache: Memory'
                  width: '54'
                  height: '4'
                  fields:
                    - type: STRING
                      name: ds.0.color.0
                      value: 00BFFF
                    - type: STRING
                      name: ds.0.color.1
                      value: FF0080
                    - type: STRING
                      name: ds.0.color.2
                      value: 0040FF
                    - type: INTEGER
                      name: ds.0.dataset_type
                      value: '0'
                    - type: INTEGER
                      name: ds.0.fill
                      value: '4'
                    - type: ITEM
                      name: ds.0.itemids.0
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.content.cache.logical.memory.usage.bytes
                    - type: ITEM
                      name: ds.0.itemids.1
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.content.cache.saved.memory.usage.bytes
                    - type: ITEM
                      name: ds.0.itemids.2
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.content.cache.physical.memory.usage.bytes
                    - type: INTEGER
                      name: ds.0.missingdatafunc
                      value: '3'
                    - type: INTEGER
                      name: ds.0.transparency
                      value: '6'
                    - type: INTEGER
                      name: ds.0.width
                      value: '2'
                    - type: INTEGER
                      name: legend_columns
                      value: '1'
                    - type: INTEGER
                      name: legend_lines
                      value: '3'
                    - type: INTEGER
                      name: legend_statistic
                      value: '1'
                    - type: STRING
                      name: reference
                      value: HNWKK
                    - type: INTEGER
                      name: righty
                      value: '0'
                - type: item
                  name: 'Content Cache: Logical memory usage'
                  'y': '4'
                  width: '18'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'Content Cache: Logical memory usage'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.content.cache.logical.memory.usage.bytes
                    - type: INTEGER
                      name: show.0
                      value: '1'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: INTEGER
                      name: units_bold
                      value: '0'
                    - type: INTEGER
                      name: value_bold
                      value: '0'
                - type: svggraph
                  name: 'Content Cache: SSD usage'
                  'y': '6'
                  width: '54'
                  height: '4'
                  fields:
                    - type: STRING
                      name: ds.0.color.0
                      value: 00BFFF
                    - type: STRING
                      name: ds.0.color.1
                      value: FF0080
                    - type: STRING
                      name: ds.0.color.2
                      value: 0040FF
                    - type: INTEGER
                      name: ds.0.dataset_type
                      value: '0'
                    - type: INTEGER
                      name: ds.0.fill
                      value: '4'
                    - type: ITEM
                      name: ds.0.itemids.0
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.content.cache.logical.ssd.usage.bytes
                    - type: ITEM
                      name: ds.0.itemids.1
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.content.cache.physical.ssd.usage.bytes
                    - type: ITEM
                      name: ds.0.itemids.2
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.content.cache.saved.ssd.usage.bytes
                    - type: INTEGER
                      name: ds.0.missingdatafunc
                      value: '3'
                    - type: INTEGER
                      name: ds.0.transparency
                      value: '6'
                    - type: INTEGER
                      name: ds.0.width
                      value: '2'
                    - type: INTEGER
                      name: legend_columns
                      value: '1'
                    - type: INTEGER
                      name: legend_lines
                      value: '3'
                    - type: INTEGER
                      name: legend_statistic
                      value: '1'
                    - type: STRING
                      name: reference
                      value: GCYCY
                    - type: INTEGER
                      name: righty
                      value: '0'
                - type: item
                  name: 'Content Cache: Logical SSD usage'
                  'y': '10'
                  width: '18'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'Content Cache: Logical SSD usage'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.content.cache.logical.ssd.usage.bytes
                    - type: INTEGER
                      name: show.0
                      value: '1'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: INTEGER
                      name: units_bold
                      value: '0'
                    - type: INTEGER
                      name: value_bold
                      value: '0'
                - type: item
                  name: 'Content Cache: Logical saved memory usage'
                  x: '18'
                  'y': '4'
                  width: '18'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'Content Cache: Logical saved memory usage'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.content.cache.saved.memory.usage.bytes
                    - type: INTEGER
                      name: show.0
                      value: '1'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: INTEGER
                      name: units_bold
                      value: '0'
                    - type: INTEGER
                      name: value_bold
                      value: '0'
                - type: item
                  name: 'Content Cache: Physical SSD usage'
                  x: '18'
                  'y': '10'
                  width: '18'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'Content Cache: Physical SSD usage'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.content.cache.physical.ssd.usage.bytes
                    - type: INTEGER
                      name: show.0
                      value: '1'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: INTEGER
                      name: units_bold
                      value: '0'
                    - type: INTEGER
                      name: value_bold
                      value: '0'
                - type: item
                  name: 'Content Cache: Physical memory usage'
                  x: '36'
                  'y': '4'
                  width: '18'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'Content Cache: Physical memory usage'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.content.cache.physical.memory.usage.bytes
                    - type: INTEGER
                      name: show.0
                      value: '1'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: INTEGER
                      name: units_bold
                      value: '0'
                    - type: INTEGER
                      name: value_bold
                      value: '0'
                - type: item
                  name: 'Content Cache: Saved SSD usage'
                  x: '36'
                  'y': '10'
                  width: '18'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'Content Cache: Saved SSD usage'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.content.cache.saved.ssd.usage.bytes
                    - type: INTEGER
                      name: show.0
                      value: '1'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: INTEGER
                      name: units_bold
                      value: '0'
                    - type: INTEGER
                      name: value_bold
                      value: '0'
                - type: gauge
                  name: 'Content Cache: Hit rate'
                  x: '54'
                  width: '18'
                  height: '4'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: empty_color
                      value: E1F5FE
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.content.cache.hit.percent
                    - type: STRING
                      name: units
                      value: '%'
                    - type: STRING
                      name: value_arc_color
                      value: 0040FF
                - type: svggraph
                  name: 'Content Cache: Hit rate'
                  x: '54'
                  'y': '4'
                  width: '18'
                  height: '4'
                  fields:
                    - type: STRING
                      name: ds.0.color.0
                      value: 0040FF
                    - type: INTEGER
                      name: ds.0.dataset_type
                      value: '0'
                    - type: INTEGER
                      name: ds.0.fill
                      value: '4'
                    - type: ITEM
                      name: ds.0.itemids.0
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.content.cache.hit.percent
                    - type: INTEGER
                      name: ds.0.missingdatafunc
                      value: '3'
                    - type: INTEGER
                      name: ds.0.transparency
                      value: '6'
                    - type: INTEGER
                      name: ds.0.width
                      value: '2'
                    - type: STRING
                      name: lefty_max
                      value: '100'
                    - type: STRING
                      name: lefty_min
                      value: '0'
                    - type: STRING
                      name: lefty_static_units
                      value: '%'
                    - type: INTEGER
                      name: lefty_units
                      value: '1'
                    - type: INTEGER
                      name: legend
                      value: '0'
                    - type: STRING
                      name: reference
                      value: ZBMMF
                    - type: INTEGER
                      name: righty
                      value: '0'
                - type: item
                  name: 'Content Cache: Number of lookups'
                  x: '54'
                  'y': '8'
                  width: '18'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.content.cache.lookups.num
                    - type: INTEGER
                      name: show.0
                      value: '1'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: INTEGER
                      name: units_bold
                      value: '0'
                    - type: INTEGER
                      name: value_bold
                      value: '0'
                - type: item
                  name: 'Content Cache: References'
                  x: '54'
                  'y': '10'
                  width: '18'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.content.cache.dedup.ref.num
                    - type: INTEGER
                      name: show.0
                      value: '1'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: INTEGER
                      name: units_bold
                      value: '0'
                    - type: INTEGER
                      name: value_bold
                      value: '0'
            - name: Hypervisor
              widgets:
                - type: svggraph
                  name: 'Hypervisor: IOPS'
                  width: '52'
                  height: '4'
                  fields:
                    - type: STRING
                      name: ds.0.color.0
                      value: 00BFFF
                    - type: STRING
                      name: ds.0.color.1
                      value: FF0080
                    - type: STRING
                      name: ds.0.color.2
                      value: 0040FF
                    - type: INTEGER
                      name: ds.0.dataset_type
                      value: '0'
                    - type: INTEGER
                      name: ds.0.fill
                      value: '4'
                    - type: ITEM
                      name: ds.0.itemids.0
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.hypervisor.iops
                    - type: ITEM
                      name: ds.0.itemids.1
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.hypervisor.iops.read
                    - type: ITEM
                      name: ds.0.itemids.2
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.hypervisor.iops.write
                    - type: INTEGER
                      name: ds.0.missingdatafunc
                      value: '3'
                    - type: INTEGER
                      name: ds.0.transparency
                      value: '6'
                    - type: INTEGER
                      name: ds.0.width
                      value: '2'
                    - type: INTEGER
                      name: legend_columns
                      value: '1'
                    - type: INTEGER
                      name: legend_lines
                      value: '3'
                    - type: INTEGER
                      name: legend_statistic
                      value: '1'
                    - type: STRING
                      name: reference
                      value: RUGEM
                    - type: INTEGER
                      name: righty
                      value: '0'
                - type: svggraph
                  name: 'Hypervisor: Latency'
                  'y': '4'
                  width: '52'
                  height: '4'
                  fields:
                    - type: STRING
                      name: ds.0.color.0
                      value: 00BFFF
                    - type: STRING
                      name: ds.0.color.1
                      value: FF0080
                    - type: STRING
                      name: ds.0.color.2
                      value: 0040FF
                    - type: INTEGER
                      name: ds.0.dataset_type
                      value: '0'
                    - type: INTEGER
                      name: ds.0.fill
                      value: '4'
                    - type: ITEM
                      name: ds.0.itemids.0
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.hypervisor.io.latency
                    - type: ITEM
                      name: ds.0.itemids.1
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.hypervisor.io.read.latency
                    - type: ITEM
                      name: ds.0.itemids.2
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.hypervisor.io.write.latency
                    - type: INTEGER
                      name: ds.0.missingdatafunc
                      value: '3'
                    - type: INTEGER
                      name: ds.0.transparency
                      value: '6'
                    - type: INTEGER
                      name: ds.0.width
                      value: '2'
                    - type: INTEGER
                      name: legend_columns
                      value: '1'
                    - type: INTEGER
                      name: legend_lines
                      value: '3'
                    - type: INTEGER
                      name: legend_statistic
                      value: '1'
                    - type: STRING
                      name: reference
                      value: GNBJL
                    - type: INTEGER
                      name: righty
                      value: '0'
                - type: svggraph
                  name: 'Hypervisor: Bandwidth'
                  'y': '8'
                  width: '52'
                  height: '4'
                  fields:
                    - type: STRING
                      name: ds.0.color.0
                      value: 00BFFF
                    - type: STRING
                      name: ds.0.color.1
                      value: FF0080
                    - type: STRING
                      name: ds.0.color.2
                      value: 0040FF
                    - type: INTEGER
                      name: ds.0.dataset_type
                      value: '0'
                    - type: INTEGER
                      name: ds.0.fill
                      value: '4'
                    - type: ITEM
                      name: ds.0.itemids.0
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.hypervisor.io.bandwidth
                    - type: ITEM
                      name: ds.0.itemids.1
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.hypervisor.io.read.bandwidth
                    - type: ITEM
                      name: ds.0.itemids.2
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.hypervisor.io.write.bandwidth
                    - type: INTEGER
                      name: ds.0.missingdatafunc
                      value: '3'
                    - type: INTEGER
                      name: ds.0.transparency
                      value: '6'
                    - type: INTEGER
                      name: ds.0.width
                      value: '2'
                    - type: INTEGER
                      name: legend_columns
                      value: '1'
                    - type: INTEGER
                      name: legend_lines
                      value: '3'
                    - type: INTEGER
                      name: legend_statistic
                      value: '1'
                    - type: STRING
                      name: reference
                      value: BVXJW
                    - type: INTEGER
                      name: righty
                      value: '0'
                - type: item
                  name: 'Hypervisor: Full name'
                  x: '52'
                  width: '20'
                  hide_header: 'YES'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.hypervisor.name
                    - type: INTEGER
                      name: show.0
                      value: '1'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: INTEGER
                      name: value_bold
                      value: '0'
                    - type: INTEGER
                      name: value_size
                      value: '30'
                - type: item
                  name: 'Hypervisor: Timespan'
                  x: '52'
                  'y': '2'
                  width: '20'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.hypervisor.timespan.sec
                    - type: INTEGER
                      name: show.0
                      value: '1'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: INTEGER
                      name: units_bold
                      value: '0'
                    - type: INTEGER
                      name: value_bold
                      value: '0'
                - type: svggraph
                  name: 'Hypervisor: Received'
                  x: '52'
                  'y': '4'
                  width: '20'
                  height: '4'
                  fields:
                    - type: STRING
                      name: ds.0.color.0
                      value: 0040FF
                    - type: INTEGER
                      name: ds.0.dataset_type
                      value: '0'
                    - type: INTEGER
                      name: ds.0.fill
                      value: '4'
                    - type: ITEM
                      name: ds.0.itemids.0
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.hypervisor.received.bytes
                    - type: INTEGER
                      name: ds.0.missingdatafunc
                      value: '3'
                    - type: INTEGER
                      name: ds.0.transparency
                      value: '6'
                    - type: INTEGER
                      name: ds.0.width
                      value: '2'
                    - type: INTEGER
                      name: legend
                      value: '0'
                    - type: STRING
                      name: reference
                      value: LOWCE
                    - type: INTEGER
                      name: righty
                      value: '0'
                - type: svggraph
                  name: 'Hypervisor: Transmitted'
                  x: '52'
                  'y': '8'
                  width: '20'
                  height: '4'
                  fields:
                    - type: STRING
                      name: ds.0.color.0
                      value: FF465C
                    - type: INTEGER
                      name: ds.0.dataset_type
                      value: '0'
                    - type: INTEGER
                      name: ds.0.fill
                      value: '4'
                    - type: ITEM
                      name: ds.0.itemids.0
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.hypervisor.transmitted.bytes
                    - type: INTEGER
                      name: ds.0.missingdatafunc
                      value: '3'
                    - type: INTEGER
                      name: ds.0.transparency
                      value: '6'
                    - type: INTEGER
                      name: ds.0.width
                      value: '2'
                    - type: INTEGER
                      name: legend
                      value: '0'
                    - type: STRING
                      name: reference
                      value: LOWCF
                    - type: INTEGER
                      name: righty
                      value: '0'
            - name: 'Storage controller'
              widgets:
                - type: svggraph
                  name: 'Storage controller: IOPS'
                  width: '36'
                  height: '6'
                  fields:
                    - type: STRING
                      name: ds.0.color.0
                      value: 00BFFF
                    - type: STRING
                      name: ds.0.color.1
                      value: FF0080
                    - type: STRING
                      name: ds.0.color.2
                      value: 0040FF
                    - type: INTEGER
                      name: ds.0.dataset_type
                      value: '0'
                    - type: INTEGER
                      name: ds.0.fill
                      value: '4'
                    - type: ITEM
                      name: ds.0.itemids.0
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.storage.controller.iops
                    - type: ITEM
                      name: ds.0.itemids.1
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.storage.controller.iops.read
                    - type: ITEM
                      name: ds.0.itemids.2
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.storage.controller.iops.write
                    - type: INTEGER
                      name: ds.0.missingdatafunc
                      value: '3'
                    - type: INTEGER
                      name: ds.0.transparency
                      value: '6'
                    - type: INTEGER
                      name: ds.0.width
                      value: '2'
                    - type: INTEGER
                      name: legend_columns
                      value: '1'
                    - type: INTEGER
                      name: legend_lines
                      value: '3'
                    - type: INTEGER
                      name: legend_statistic
                      value: '1'
                    - type: STRING
                      name: reference
                      value: VKETW
                    - type: INTEGER
                      name: righty
                      value: '0'
                - type: svggraph
                  name: 'Storage controller: IO'
                  'y': '6'
                  width: '36'
                  height: '6'
                  fields:
                    - type: STRING
                      name: ds.0.color.0
                      value: 00BFFF
                    - type: STRING
                      name: ds.0.color.1
                      value: FF0080
                    - type: STRING
                      name: ds.0.color.2
                      value: 0040FF
                    - type: INTEGER
                      name: ds.0.dataset_type
                      value: '0'
                    - type: INTEGER
                      name: ds.0.fill
                      value: '4'
                    - type: ITEM
                      name: ds.0.itemids.0
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.storage.controller.io
                    - type: ITEM
                      name: ds.0.itemids.1
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.storage.controller.io.read
                    - type: ITEM
                      name: ds.0.itemids.2
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.storage.controller.io.write
                    - type: INTEGER
                      name: ds.0.missingdatafunc
                      value: '3'
                    - type: INTEGER
                      name: ds.0.transparency
                      value: '6'
                    - type: INTEGER
                      name: ds.0.width
                      value: '2'
                    - type: INTEGER
                      name: legend_columns
                      value: '1'
                    - type: INTEGER
                      name: legend_lines
                      value: '3'
                    - type: INTEGER
                      name: legend_statistic
                      value: '1'
                    - type: STRING
                      name: reference
                      value: RKARF
                    - type: INTEGER
                      name: righty
                      value: '0'
                - type: piechart
                  name: 'Storage controller: Read IO / Write IO'
                  x: '36'
                  width: '12'
                  height: '6'
                  fields:
                    - type: INTEGER
                      name: draw_type
                      value: '1'
                    - type: STRING
                      name: ds.0.color.0
                      value: 00BFFF
                    - type: STRING
                      name: ds.0.color.1
                      value: 0040FF
                    - type: INTEGER
                      name: ds.0.dataset_type
                      value: '0'
                    - type: ITEM
                      name: ds.0.itemids.0
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.storage.controller.io.read.percent
                    - type: ITEM
                      name: ds.0.itemids.1
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.storage.controller.io.write.percent
                    - type: INTEGER
                      name: ds.0.type.0
                      value: '0'
                    - type: INTEGER
                      name: ds.0.type.1
                      value: '0'
                    - type: INTEGER
                      name: legend_lines
                      value: '2'
                    - type: INTEGER
                      name: legend_value
                      value: '1'
                    - type: INTEGER
                      name: space
                      value: '7'
                    - type: INTEGER
                      name: width
                      value: '40'
                - type: svggraph
                  name: 'Storage controller: Bandwidth'
                  x: '36'
                  'y': '6'
                  width: '36'
                  height: '6'
                  fields:
                    - type: STRING
                      name: ds.0.color.0
                      value: 00BFFF
                    - type: STRING
                      name: ds.0.color.1
                      value: FF0080
                    - type: STRING
                      name: ds.0.color.2
                      value: 0040FF
                    - type: INTEGER
                      name: ds.0.dataset_type
                      value: '0'
                    - type: INTEGER
                      name: ds.0.fill
                      value: '4'
                    - type: ITEM
                      name: ds.0.itemids.0
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.storage.controller.io.bandwidth
                    - type: ITEM
                      name: ds.0.itemids.1
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.storage.controller.io.read.bandwidth
                    - type: ITEM
                      name: ds.0.itemids.2
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.storage.controller.io.write.bandwidth
                    - type: INTEGER
                      name: ds.0.missingdatafunc
                      value: '3'
                    - type: INTEGER
                      name: ds.0.transparency
                      value: '6'
                    - type: INTEGER
                      name: ds.0.width
                      value: '2'
                    - type: INTEGER
                      name: legend_columns
                      value: '1'
                    - type: INTEGER
                      name: legend_lines
                      value: '3'
                    - type: INTEGER
                      name: legend_statistic
                      value: '1'
                    - type: STRING
                      name: reference
                      value: FCTEE
                    - type: INTEGER
                      name: righty
                      value: '0'
                - type: svggraph
                  name: 'Storage controller: Read IO / Write IO'
                  x: '48'
                  width: '24'
                  height: '6'
                  fields:
                    - type: STRING
                      name: ds.0.color.0
                      value: 00BFFF
                    - type: STRING
                      name: ds.0.color.1
                      value: 0040FF
                    - type: INTEGER
                      name: ds.0.dataset_type
                      value: '0'
                    - type: INTEGER
                      name: ds.0.fill
                      value: '4'
                    - type: ITEM
                      name: ds.0.itemids.0
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.storage.controller.io.read.percent
                    - type: ITEM
                      name: ds.0.itemids.1
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.storage.controller.io.write.percent
                    - type: INTEGER
                      name: ds.0.missingdatafunc
                      value: '3'
                    - type: INTEGER
                      name: ds.0.stacked
                      value: '1'
                    - type: INTEGER
                      name: ds.0.transparency
                      value: '6'
                    - type: INTEGER
                      name: ds.0.width
                      value: '2'
                    - type: INTEGER
                      name: legend_columns
                      value: '1'
                    - type: INTEGER
                      name: legend_lines
                      value: '2'
                    - type: INTEGER
                      name: legend_statistic
                      value: '1'
                    - type: STRING
                      name: reference
                      value: GVMJB
                    - type: INTEGER
                      name: righty
                      value: '0'
            - name: 'Storage Tier'
              widgets:
                - type: svggraph
                  name: 'Storage Tier: Das-sata'
                  width: '50'
                  height: '4'
                  fields:
                    - type: STRING
                      name: ds.0.color.0
                      value: 00BFFF
                    - type: STRING
                      name: ds.0.color.1
                      value: 0040FF
                    - type: INTEGER
                      name: ds.0.dataset_type
                      value: '0'
                    - type: INTEGER
                      name: ds.0.fill
                      value: '4'
                    - type: ITEM
                      name: ds.0.itemids.0
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.storage.controller.tier.das_sata.free.bytes
                    - type: ITEM
                      name: ds.0.itemids.1
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.storage.controller.tier.das_sata.usage.bytes
                    - type: INTEGER
                      name: ds.0.missingdatafunc
                      value: '3'
                    - type: INTEGER
                      name: ds.0.transparency
                      value: '6'
                    - type: INTEGER
                      name: ds.0.width
                      value: '2'
                    - type: INTEGER
                      name: legend_columns
                      value: '1'
                    - type: INTEGER
                      name: legend_lines
                      value: '2'
                    - type: INTEGER
                      name: legend_statistic
                      value: '1'
                    - type: STRING
                      name: reference
                      value: SCETD
                    - type: INTEGER
                      name: righty
                      value: '0'
                - type: item
                  name: 'Storage Tier: Das-sata free'
                  'y': '4'
                  width: '25'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'Storage Tier: Das-sata free'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.storage.controller.tier.das_sata.free.bytes
                    - type: INTEGER
                      name: show.0
                      value: '1'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: INTEGER
                      name: units_bold
                      value: '0'
                    - type: INTEGER
                      name: value_bold
                      value: '0'
                - type: svggraph
                  name: 'Storage Tier: SSD'
                  'y': '6'
                  width: '50'
                  height: '4'
                  fields:
                    - type: STRING
                      name: ds.0.color.0
                      value: 00BFFF
                    - type: STRING
                      name: ds.0.color.1
                      value: 0040FF
                    - type: INTEGER
                      name: ds.0.dataset_type
                      value: '0'
                    - type: INTEGER
                      name: ds.0.fill
                      value: '4'
                    - type: ITEM
                      name: ds.0.itemids.0
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.storage.controller.tier.ssd.free.bytes
                    - type: ITEM
                      name: ds.0.itemids.1
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.storage.controller.tier.ssd.usage.bytes
                    - type: INTEGER
                      name: ds.0.missingdatafunc
                      value: '3'
                    - type: INTEGER
                      name: ds.0.transparency
                      value: '6'
                    - type: INTEGER
                      name: ds.0.width
                      value: '2'
                    - type: INTEGER
                      name: legend_columns
                      value: '1'
                    - type: INTEGER
                      name: legend_lines
                      value: '2'
                    - type: INTEGER
                      name: legend_statistic
                      value: '1'
                    - type: STRING
                      name: reference
                      value: NEBOH
                    - type: INTEGER
                      name: righty
                      value: '0'
                - type: item
                  name: 'Storage Tier: SSD free'
                  'y': '10'
                  width: '25'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'Storage Tier: SSD free'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.storage.controller.tier.ssd.free.bytes
                    - type: INTEGER
                      name: show.0
                      value: '1'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: INTEGER
                      name: units_bold
                      value: '0'
                    - type: INTEGER
                      name: value_bold
                      value: '0'
                - type: item
                  name: 'Storage Tier: Das-sata usage'
                  x: '25'
                  'y': '4'
                  width: '25'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'Storage Tier: Das-sata usage'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.storage.controller.tier.das_sata.usage.bytes
                    - type: INTEGER
                      name: show.0
                      value: '1'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: INTEGER
                      name: units_bold
                      value: '0'
                    - type: INTEGER
                      name: value_bold
                      value: '0'
                - type: item
                  name: 'Storage Tier: SSD usage'
                  x: '25'
                  'y': '10'
                  width: '25'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'Storage Tier: SSD usage'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.storage.controller.tier.ssd.usage.bytes
                    - type: INTEGER
                      name: show.0
                      value: '1'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: INTEGER
                      name: units_bold
                      value: '0'
                    - type: INTEGER
                      name: value_bold
                      value: '0'
                - type: piechart
                  name: 'Storage Tier: Das-sata Usage / Total'
                  x: '50'
                  width: '22'
                  height: '6'
                  fields:
                    - type: INTEGER
                      name: draw_type
                      value: '1'
                    - type: STRING
                      name: ds.0.color.0
                      value: 00BFFF
                    - type: STRING
                      name: ds.0.color.1
                      value: 0040FF
                    - type: INTEGER
                      name: ds.0.dataset_type
                      value: '0'
                    - type: ITEM
                      name: ds.0.itemids.0
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.storage.controller.tier.das_sata.capacity.bytes
                    - type: ITEM
                      name: ds.0.itemids.1
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.storage.controller.tier.das_sata.usage.bytes
                    - type: INTEGER
                      name: ds.0.type.0
                      value: '1'
                    - type: INTEGER
                      name: ds.0.type.1
                      value: '0'
                    - type: INTEGER
                      name: legend_lines
                      value: '2'
                    - type: INTEGER
                      name: legend_value
                      value: '1'
                    - type: INTEGER
                      name: space
                      value: '7'
                    - type: INTEGER
                      name: width
                      value: '40'
                - type: piechart
                  name: 'Storage Tier: SSD Usage / Total'
                  x: '50'
                  'y': '6'
                  width: '22'
                  height: '6'
                  fields:
                    - type: INTEGER
                      name: draw_type
                      value: '1'
                    - type: STRING
                      name: ds.0.color.0
                      value: 00BFFF
                    - type: STRING
                      name: ds.0.color.1
                      value: 0040FF
                    - type: INTEGER
                      name: ds.0.dataset_type
                      value: '0'
                    - type: ITEM
                      name: ds.0.itemids.0
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.storage.controller.tier.ssd.capacity.bytes
                    - type: ITEM
                      name: ds.0.itemids.1
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: nutanix.host.storage.controller.tier.ssd.usage.bytes
                    - type: INTEGER
                      name: ds.0.type.0
                      value: '1'
                    - type: INTEGER
                      name: ds.0.type.1
                      value: '0'
                    - type: INTEGER
                      name: legend_lines
                      value: '2'
                    - type: INTEGER
                      name: legend_value
                      value: '1'
                    - type: INTEGER
                      name: space
                      value: '7'
                    - type: INTEGER
                      name: width
                      value: '40'
            - name: Disk
              widgets:
                - type: honeycomb
                  name: 'Disk online'
                  width: '36'
                  height: '4'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: 81D4FA
                    - type: STRING
                      name: items.0
                      value: '*Online'
                    - type: STRING
                      name: primary_label
                      value: '{{ITEM.NAME}.regsub("Disk.\[(.*)\]:\sOnline", \1)}'
                    - type: INTEGER
                      name: primary_label_size_type
                      value: '1'
                    - type: STRING
                      name: reference
                      value: LSGAM
                    - type: STRING
                      name: thresholds.0.color
                      value: FF465C
                    - type: STRING
                      name: thresholds.0.threshold
                      value: '0'
                    - type: STRING
                      name: thresholds.1.color
                      value: 47A76A
                    - type: STRING
                      name: thresholds.1.threshold
                      value: '1'
                    - type: STRING
                      name: thresholds.2.color
                      value: D2D2D2
                    - type: STRING
                      name: thresholds.2.threshold
                      value: '2'
                - type: graphprototype
                  name: 'Space: Total and Used'
                  'y': '4'
                  width: '36'
                  height: '4'
                  fields:
                    - type: INTEGER
                      name: columns
                      value: '1'
                    - type: GRAPH_PROTOTYPE
                      name: graphid.0
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        name: 'Disk [{#DISK.SERIAL}]: Space: Total and Used'
                    - type: STRING
                      name: reference
                      value: MLSDN
                - type: graphprototype
                  name: 'Space: Free'
                  'y': '8'
                  width: '72'
                  height: '4'
                  fields:
                    - type: ITEM_PROTOTYPE
                      name: itemid.0
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        key: 'nutanix.host.disk.free.bytes["{#DISK.SERIAL}"]'
                    - type: STRING
                      name: reference
                      value: MLSDA
                    - type: INTEGER
                      name: source_type
                      value: '3'
                - type: honeycomb
                  name: 'Disk status'
                  x: '36'
                  width: '36'
                  height: '4'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: 81D4FA
                    - type: STRING
                      name: items.0
                      value: 'Disk*Status'
                    - type: STRING
                      name: primary_label
                      value: '{{ITEM.NAME}.regsub("Disk.\[(.*)\]:\sStatus", \1)}'
                    - type: INTEGER
                      name: primary_label_size_type
                      value: '1'
                    - type: STRING
                      name: reference
                      value: LSGAL
                    - type: STRING
                      name: thresholds.0.color
                      value: 47A76A
                    - type: STRING
                      name: thresholds.0.threshold
                      value: '0'
                    - type: STRING
                      name: thresholds.1.color
                      value: FFB300
                    - type: STRING
                      name: thresholds.1.threshold
                      value: '1'
                    - type: STRING
                      name: thresholds.2.color
                      value: FFB300
                    - type: STRING
                      name: thresholds.2.threshold
                      value: '2'
                - type: graphprototype
                  name: 'Space: Logical usage and Used'
                  x: '36'
                  'y': '4'
                  width: '36'
                  height: '4'
                  fields:
                    - type: INTEGER
                      name: columns
                      value: '1'
                    - type: GRAPH_PROTOTYPE
                      name: graphid.0
                      value:
                        host: 'Nutanix Host Prism Element by HTTP'
                        name: 'Disk [{#DISK.SERIAL}]: Space: Logical usage and Used'
                    - type: STRING
                      name: reference
                      value: MLSDX
      valuemaps:
        - uuid: c2fbc73721564974adb6251fdb372f70
          name: 'Nutanix: Alert severity'
          mappings:
            - value: '0'
              newvalue: Info
            - value: '1'
              newvalue: Warning
            - value: '2'
              newvalue: Critical
            - value: '3'
              newvalue: Unknown
        - uuid: 7972e3d351f04d1b9cd4b7a542d8a81f
          name: 'Nutanix: Alert state'
          mappings:
            - value: '0'
              newvalue: Ok
            - value: '1'
              newvalue: Problem
        - uuid: 20773014179d419cae5306b0370d405c
          name: 'Nutanix: Boolean'
          mappings:
            - value: '0'
              newvalue: 'False'
            - value: '1'
              newvalue: 'True'
            - value: '2'
              newvalue: Unknown
        - uuid: 6e081d8e0e4e43f7914b311ce2925f82
          name: 'Nutanix: Degraded state'
          mappings:
            - value: '0'
              newvalue: 'Not degraded'
            - value: '1'
              newvalue: Degraded
            - value: '2'
              newvalue: Unknown
        - uuid: 1381c5ba61eb4cb89303b6256f81e036
          name: 'Nutanix: Disk status'
          mappings:
            - value: '0'
              newvalue: Normal
            - value: '1'
              newvalue: 'Data migration initiated'
            - value: '2'
              newvalue: 'Marked for removal but not detachable'
            - value: '3'
              newvalue: Detachable
            - value: '4'
              newvalue: Unknown
        - uuid: 513019c2559c48cfbc6c801179c4a7ce
          name: 'Nutanix: Host state'
          mappings:
            - value: '0'
              newvalue: New
            - value: '1'
              newvalue: Normal
            - value: '2'
              newvalue: 'Marked for removal but not detachable'
            - value: '3'
              newvalue: Detachable
            - value: '4'
              newvalue: Unknown
        - uuid: d934bf8ae17c4ed78a439b92cf2f7bef
          name: 'Nutanix: Host type'
          mappings:
            - value: '0'
              newvalue: 'Hyper converged'
            - value: '1'
              newvalue: 'Compute only'
            - value: '2'
              newvalue: Unknown
        - uuid: 1ee8073575c842269be02dd94211c22c
          name: 'Nutanix: Maintenance mode'
          mappings:
            - value: '0'
              newvalue: Normal
            - value: '1'
              newvalue: Maintenance
            - value: '2'
              newvalue: Unknown
    - uuid: 0bb43a48a33f48ad910441384486edb4
      template: 'Nutanix Prism Element by HTTP'
      name: 'Nutanix Prism Element by HTTP'
      description: |
        Prism Element: It is a service already built into the platform for every Nutanix cluster deployed. It provides the ability to fully configure, manage, and monitor Nutanix clusters running any hypervisors, however, it only manages the cluster it is part of.
        
        This template is designed for the effortless deployment of Nutanix Prism Element monitoring and doesn't require any external scripts.
        
        The templates "Nutanix Host Prism Element by HTTP" and "Nutanix Cluster Prism Element by HTTP" can be used in discovery, as well as manually linked to a host.
        
        More details can be found in the official documentation:
          - on the Nutanix Prism Element REST API: https://www.nutanix.dev/api_reference/apis/prism_v2.html
          - on the differences between Nutanix API versions: https://www.nutanix.dev/api-versions/
          - on the differences between Nutanix Prism Element REST API and Nutanix Prism Central REST API: https://next.nutanix.com/how-it-works-22/differences-between-prism-element-prism-central-and-prism-pro-37137
        
        Generated by official Zabbix template tool "Templator"
      wizard_ready: 'YES'
      readme: |
        ## Overview
        
        This template is designed for the effortless deployment of Nutanix Prism Element monitoring and doesn't require any external scripts.
        
        The templates "Nutanix Host Prism Element by HTTP" and "Nutanix Cluster Prism Element by HTTP" can be used in discovery, as well as manually linked to a host.
        
        More details can be found in the official documentation:
        - [on the Nutanix Prism Element REST API](https://www.nutanix.dev/api_reference/apis/prism_v2.html);
        - [on differences between Nutanix API versions](https://www.nutanix.dev/api-versions/).
        
        ## Setup
        
        1. Create a new Nutanix user and add the role "Viewer"
        2. Create a new host
        3. Link the template to host created earlier
        4. Set the host wizard configuration fields required for getting data:
        ```text
        API IP
        API port
        ```
        5. Set the host wizard configuration fields with the login and password of the Nutanix user created earlier:
        ```text
        API username
        API password
        ```
      vendor:
        name: Zabbix
        version: 8.0-1
      groups:
        - name: Templates/Applications
      items:
        - uuid: 0c073836f90a4072be7acfc5d1a96b9e
          name: 'Get cluster'
          type: SCRIPT
          key: nutanix.cluster.get
          delay: 10m
          history: '0'
          value_type: TEXT
          params: |
            var Nutanix = {
            	params: {},
            
            	setParams: function (requiredParams, allParams) {
            		requiredParams.forEach(function (field) {
            			if (typeof allParams !== 'object' || typeof allParams[field] === 'undefined' || allParams[field] === '') {
            				throw 'Required param is not set: ' + field + '.';
            			}
            		});
            
            		Nutanix.params = allParams;
            	},
            
            	request: function (url) {
            
            		var request = new HttpRequest();
            
            		if (typeof Nutanix.params.proxy !== 'undefined' && Nutanix.params.proxy !== '') {
            			request.setProxy(Nutanix.params.proxy);
            		}
            
            		request.setHttpAuth(HTTPAUTH_BASIC, Nutanix.params.username, Nutanix.params.password);
            
            		Zabbix.log(4, '[ Nutanix ] Sending request: ' + url);
            
            		const response = request.get(url);
            
            		Zabbix.log(4, '[ Nutanix ] Received response with status code ' + request.getStatus() + ': ' + response);
            
            		if (request.getStatus() < 200 || request.getStatus() >= 300) {
            			throw 'Request failed with status code ' + request.getStatus() + ': ' + response;
            		}
            
            		try {
            			response = JSON.parse(response);
            		}
            		catch (error) {
            			throw 'Failed to parse response received from Nutanix PRISM API. Check debug log for more information.';
            		}
            
            		return response;
            	},
            
            	deduplicateAlerts: function (full_data) {
            		const severity_mapping = [
            			'kinfo',
            			'kwarning',
            			'kcritical'
            		]
            
            		var output_data = {};
            		for (var entity in full_data.entities) {
            	
            			if (Nutanix.params.api_method === 'clusters') {
            				if (result.entities[entity].node_uuid.split('-').length == 5) continue;
            			}
            
            			var severity = severity_mapping.indexOf(full_data.entities[entity].severity.toLowerCase()),
            				message = full_data.entities[entity].message,
            				title = full_data.entities[entity].alert_title;
            	
            			full_data.entities[entity].context_types.forEach(function(context, index) {
            				message = message.replace('{' + context + '}', full_data.entities[entity].context_values[index]);
            				title = title.replace('{' + context + '}', full_data.entities[entity].context_values[index]);
            			});
            	
            			key = md5(title + message);
            			if (key in output_data) {
            				if (full_data.entities[entity].created_time_stamp_in_usecs > output_data[key].created) {
            					output_data[key].created = full_data.entities[entity].created_time_stamp_in_usecs;
            					output_data[key].severity = severity !== -1 ? severity : 3;
            					output_data[key].state = full_data.entities[entity].resolved ? 0 : 1;
            					output_data[key].message = full_data.entities[entity].detailed_message != '' ? full_data.entities[entity].detailed_message : message;
            					output_data[key].last_id = full_data.entities[entity].id;
            				}
            				output_data[key].count += 1;
            			} else {
            				output_data[key] = {
            					"name": title + ' - ' + message,
            					"title": title != '' ? title : message,
            					"created": full_data.entities[entity].created_time_stamp_in_usecs,
            					"severity": severity !== -1 ? severity : 3,
            					"state": full_data.entities[entity].resolved ? 0 : 1,
            					"message": full_data.entities[entity].detailed_message != '' ? full_data.entities[entity].detailed_message : message,
            					"last_id": full_data.entities[entity].id,
            					"count": 1
            				}
            			}
            		}
            
            		return output_data;
            	},
            
            	cleanUnsupported: function (full_stat) {
            		var output_stat = {};
            		for (var element in full_stat) {
            			if (full_stat[element] !== '-1') {
            				output_stat[element] = full_stat[element];
            			}
            		};
            		
            		return output_stat;
            	}
            };
            
            try {
            	const params = JSON.parse(value);
            	Nutanix.setParams(['endpoint_host', 'endpoint_port', 'username', 'password', 'auth_type', 'api_method'], params);
            
            	const url = 'https://' + Nutanix.params.endpoint_host + ':' + Nutanix.params.endpoint_port + '/PrismGateway/services/rest/v2.0/' + Nutanix.params.api_method,
            		result = Nutanix.request(url);
            
            	return JSON.stringify(result);
            }
            catch (error) {
            	error += (String(error).endsWith('.')) ? '' : '.';
            	Zabbix.log(4, '[ Nutanix ] ERROR: ' + error);
            
            	return JSON.stringify({ 'error': error });
            }
          description: 'Get the available clusters.'
          timeout: 10s
          parameters:
            - name: api_method
              value: clusters
            - name: auth_type
              value: basic
            - name: endpoint_host
              value: '{$NUTANIX.PRISM.ELEMENT.IP}'
            - name: endpoint_port
              value: '{$NUTANIX.PRISM.ELEMENT.PORT}'
            - name: password
              value: '{$NUTANIX.PASSWORD}'
            - name: proxy
              value: '{$NUTANIX.PROXY}'
            - name: username
              value: '{$NUTANIX.USER}'
          tags:
            - tag: component
              value: raw
        - uuid: 435f96fef5e44fbaae3d3281a6fd88eb
          name: 'Get cluster check'
          type: DEPENDENT
          key: nutanix.cluster.get.check
          value_type: TEXT
          description: 'Data collection check. Check the latest values for details.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.error
              error_handler: CUSTOM_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 3h
          master_item:
            key: nutanix.cluster.get
          tags:
            - tag: component
              value: status
          triggers:
            - uuid: baf3ae722bd44a09a628f9c81c541259
              expression: 'length(last(/Nutanix Prism Element by HTTP/nutanix.cluster.get.check))>0'
              name: 'Nutanix: Failed to get cluster data from the API'
              priority: HIGH
              description: 'Failed to get data from the API. Check the latest values for details.'
              tags:
                - tag: scope
                  value: availability
        - uuid: 06ce8fe78e9642cfb2064ad2aa25b50e
          name: 'Get host'
          type: SCRIPT
          key: nutanix.host.get
          delay: 10m
          history: '0'
          value_type: TEXT
          params: |
            var Nutanix = {
            	params: {},
            
            	setParams: function (requiredParams, allParams) {
            		requiredParams.forEach(function (field) {
            			if (typeof allParams !== 'object' || typeof allParams[field] === 'undefined' || allParams[field] === '') {
            				throw 'Required param is not set: ' + field + '.';
            			}
            		});
            
            		Nutanix.params = allParams;
            	},
            
            	request: function (url) {
            
            		var request = new HttpRequest();
            
            		if (typeof Nutanix.params.proxy !== 'undefined' && Nutanix.params.proxy !== '') {
            			request.setProxy(Nutanix.params.proxy);
            		}
            
            		request.setHttpAuth(HTTPAUTH_BASIC, Nutanix.params.username, Nutanix.params.password);
            
            		Zabbix.log(4, '[ Nutanix ] Sending request: ' + url);
            
            		const response = request.get(url);
            
            		Zabbix.log(4, '[ Nutanix ] Received response with status code ' + request.getStatus() + ': ' + response);
            
            		if (request.getStatus() < 200 || request.getStatus() >= 300) {
            			throw 'Request failed with status code ' + request.getStatus() + ': ' + response;
            		}
            
            		try {
            			response = JSON.parse(response);
            		}
            		catch (error) {
            			throw 'Failed to parse response received from Nutanix PRISM API. Check debug log for more information.';
            		}
            
            		return response;
            	},
            
            	deduplicateAlerts: function (full_data) {
            		const severity_mapping = [
            			'kinfo',
            			'kwarning',
            			'kcritical'
            		]
            
            		var output_data = {};
            		for (var entity in full_data.entities) {
            	
            			if (Nutanix.params.api_method === 'clusters') {
            				if (result.entities[entity].node_uuid.split('-').length == 5) continue;
            			}
            
            			var severity = severity_mapping.indexOf(full_data.entities[entity].severity.toLowerCase()),
            				message = full_data.entities[entity].message,
            				title = full_data.entities[entity].alert_title;
            	
            			full_data.entities[entity].context_types.forEach(function(context, index) {
            				message = message.replace('{' + context + '}', full_data.entities[entity].context_values[index]);
            				title = title.replace('{' + context + '}', full_data.entities[entity].context_values[index]);
            			});
            	
            			key = md5(title + message);
            			if (key in output_data) {
            				if (full_data.entities[entity].created_time_stamp_in_usecs > output_data[key].created) {
            					output_data[key].created = full_data.entities[entity].created_time_stamp_in_usecs;
            					output_data[key].severity = severity !== -1 ? severity : 3;
            					output_data[key].state = full_data.entities[entity].resolved ? 0 : 1;
            					output_data[key].message = full_data.entities[entity].detailed_message != '' ? full_data.entities[entity].detailed_message : message;
            					output_data[key].last_id = full_data.entities[entity].id;
            				}
            				output_data[key].count += 1;
            			} else {
            				output_data[key] = {
            					"name": title + ' - ' + message,
            					"title": title != '' ? title : message,
            					"created": full_data.entities[entity].created_time_stamp_in_usecs,
            					"severity": severity !== -1 ? severity : 3,
            					"state": full_data.entities[entity].resolved ? 0 : 1,
            					"message": full_data.entities[entity].detailed_message != '' ? full_data.entities[entity].detailed_message : message,
            					"last_id": full_data.entities[entity].id,
            					"count": 1
            				}
            			}
            		}
            
            		return output_data;
            	},
            
            	cleanUnsupported: function (full_stat) {
            		var output_stat = {};
            		for (var element in full_stat) {
            			if (full_stat[element] !== '-1') {
            				output_stat[element] = full_stat[element];
            			}
            		};
            		
            		return output_stat;
            	}
            };
            
            try {
            	const params = JSON.parse(value);
            	Nutanix.setParams(['endpoint_host', 'endpoint_port', 'username', 'password', 'auth_type', 'api_method'], params);
            
            	const url = 'https://' + Nutanix.params.endpoint_host + ':' + Nutanix.params.endpoint_port + '/PrismGateway/services/rest/v2.0/' + Nutanix.params.api_method,
            		result = Nutanix.request(url);
            
            	return JSON.stringify(result);
            }
            catch (error) {
            	error += (String(error).endsWith('.')) ? '' : '.';
            	Zabbix.log(4, '[ Nutanix ] ERROR: ' + error);
            
            	return JSON.stringify({ 'error': error });
            }
          description: 'Get the available hosts.'
          timeout: 10s
          parameters:
            - name: api_method
              value: hosts
            - name: auth_type
              value: basic
            - name: endpoint_host
              value: '{$NUTANIX.PRISM.ELEMENT.IP}'
            - name: endpoint_port
              value: '{$NUTANIX.PRISM.ELEMENT.PORT}'
            - name: password
              value: '{$NUTANIX.PASSWORD}'
            - name: proxy
              value: '{$NUTANIX.PROXY}'
            - name: username
              value: '{$NUTANIX.USER}'
          tags:
            - tag: component
              value: raw
        - uuid: 7fa751ec3908489391aa2403723e2ac1
          name: 'Get host check'
          type: DEPENDENT
          key: nutanix.host.get.check
          value_type: TEXT
          description: 'Data collection check. Check the latest values for details.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.error
              error_handler: CUSTOM_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 3h
          master_item:
            key: nutanix.host.get
          tags:
            - tag: component
              value: status
          triggers:
            - uuid: 56e915c86d4640c3b073cb8309bf1d6e
              expression: 'length(last(/Nutanix Prism Element by HTTP/nutanix.host.get.check))>0'
              name: 'Nutanix: Failed to get host data from the API'
              priority: HIGH
              description: 'Failed to get data from the API. Check the latest values for details.'
              tags:
                - tag: scope
                  value: availability
        - uuid: 10cd43e73f1146cf8eb4bffd33978344
          name: 'Get storage container'
          type: SCRIPT
          key: nutanix.storage.container.get
          delay: 10m
          history: '0'
          value_type: TEXT
          params: |
            var Nutanix = {
            	params: {},
            
            	setParams: function (requiredParams, allParams) {
            		requiredParams.forEach(function (field) {
            			if (typeof allParams !== 'object' || typeof allParams[field] === 'undefined' || allParams[field] === '') {
            				throw 'Required param is not set: ' + field + '.';
            			}
            		});
            
            		Nutanix.params = allParams;
            	},
            
            	request: function (url) {
            
            		var request = new HttpRequest();
            
            		if (typeof Nutanix.params.proxy !== 'undefined' && Nutanix.params.proxy !== '') {
            			request.setProxy(Nutanix.params.proxy);
            		}
            
            		request.setHttpAuth(HTTPAUTH_BASIC, Nutanix.params.username, Nutanix.params.password);
            
            		Zabbix.log(4, '[ Nutanix ] Sending request: ' + url);
            
            		const response = request.get(url);
            
            		Zabbix.log(4, '[ Nutanix ] Received response with status code ' + request.getStatus() + ': ' + response);
            
            		if (request.getStatus() < 200 || request.getStatus() >= 300) {
            			throw 'Request failed with status code ' + request.getStatus() + ': ' + response;
            		}
            
            		try {
            			response = JSON.parse(response);
            		}
            		catch (error) {
            			throw 'Failed to parse response received from Nutanix PRISM API. Check debug log for more information.';
            		}
            
            		return response;
            	},
            
            	deduplicateAlerts: function (full_data) {
            		const severity_mapping = [
            			'kinfo',
            			'kwarning',
            			'kcritical'
            		]
            
            		var output_data = {};
            		for (var entity in full_data.entities) {
            	
            			if (Nutanix.params.api_method === 'clusters') {
            				if (result.entities[entity].node_uuid.split('-').length == 5) continue;
            			}
            
            			var severity = severity_mapping.indexOf(full_data.entities[entity].severity.toLowerCase()),
            				message = full_data.entities[entity].message,
            				title = full_data.entities[entity].alert_title;
            	
            			full_data.entities[entity].context_types.forEach(function(context, index) {
            				message = message.replace('{' + context + '}', full_data.entities[entity].context_values[index]);
            				title = title.replace('{' + context + '}', full_data.entities[entity].context_values[index]);
            			});
            	
            			key = md5(title + message);
            			if (key in output_data) {
            				if (full_data.entities[entity].created_time_stamp_in_usecs > output_data[key].created) {
            					output_data[key].created = full_data.entities[entity].created_time_stamp_in_usecs;
            					output_data[key].severity = severity !== -1 ? severity : 3;
            					output_data[key].state = full_data.entities[entity].resolved ? 0 : 1;
            					output_data[key].message = full_data.entities[entity].detailed_message != '' ? full_data.entities[entity].detailed_message : message;
            					output_data[key].last_id = full_data.entities[entity].id;
            				}
            				output_data[key].count += 1;
            			} else {
            				output_data[key] = {
            					"name": title + ' - ' + message,
            					"title": title != '' ? title : message,
            					"created": full_data.entities[entity].created_time_stamp_in_usecs,
            					"severity": severity !== -1 ? severity : 3,
            					"state": full_data.entities[entity].resolved ? 0 : 1,
            					"message": full_data.entities[entity].detailed_message != '' ? full_data.entities[entity].detailed_message : message,
            					"last_id": full_data.entities[entity].id,
            					"count": 1
            				}
            			}
            		}
            
            		return output_data;
            	},
            
            	cleanUnsupported: function (full_stat) {
            		var output_stat = {};
            		for (var element in full_stat) {
            			if (full_stat[element] !== '-1') {
            				output_stat[element] = full_stat[element];
            			}
            		};
            		
            		return output_stat;
            	}
            };
            
            try {
            	const params = JSON.parse(value);
            	Nutanix.setParams(['endpoint_host', 'endpoint_port', 'username', 'password', 'auth_type', 'api_method'], params);
            
            	const url = 'https://' + Nutanix.params.endpoint_host + ':' + Nutanix.params.endpoint_port + '/PrismGateway/services/rest/v2.0/' + Nutanix.params.api_method,
            		result = Nutanix.request(url);
            
            	var output_data = {};
            	for (var entity in result.entities) {
            		output_data[result.entities[entity].storage_container_uuid] = result.entities[entity]
            	}
            
            	return JSON.stringify(output_data);
            }
            catch (error) {
            	error += (String(error).endsWith('.')) ? '' : '.';
            	Zabbix.log(4, '[ Nutanix ] ERROR: ' + error);
            
            	return JSON.stringify({ 'error': error });
            }
          description: 'Get the available storage containers.'
          timeout: 10s
          parameters:
            - name: api_method
              value: storage_containers
            - name: auth_type
              value: basic
            - name: endpoint_host
              value: '{$NUTANIX.PRISM.ELEMENT.IP}'
            - name: endpoint_port
              value: '{$NUTANIX.PRISM.ELEMENT.PORT}'
            - name: password
              value: '{$NUTANIX.PASSWORD}'
            - name: proxy
              value: '{$NUTANIX.PROXY}'
            - name: username
              value: '{$NUTANIX.USER}'
          tags:
            - tag: component
              value: raw
        - uuid: a59d77244200466384ec0b4cad7648db
          name: 'Get storage container check'
          type: DEPENDENT
          key: nutanix.storage.container.get.check
          value_type: TEXT
          description: 'Data collection check. Check the latest values for details.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.error
              error_handler: CUSTOM_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 3h
          master_item:
            key: nutanix.storage.container.get
          tags:
            - tag: component
              value: status
          triggers:
            - uuid: f46c6213084c4afe88065beb6cdcef33
              expression: 'length(last(/Nutanix Prism Element by HTTP/nutanix.storage.container.get.check))>0'
              name: 'Nutanix: Failed to get storage container data from the API'
              priority: HIGH
              description: 'Failed to get data from the API. Check the latest values for details.'
              tags:
                - tag: scope
                  value: availability
      discovery_rules:
        - uuid: 3611bdb3bf0343bc813510e11d32f273
          name: 'Cluster discovery'
          type: DEPENDENT
          key: nutanix.cluster.discovery
          filter:
            evaltype: AND
            conditions:
              - macro: '{#NUTANIX.CLUSTER.NAME}'
                value: '{$NUTANIX.CLUSTER.DISCOVERY.NAME.MATCHES}'
              - macro: '{#NUTANIX.CLUSTER.NAME}'
                value: '{$NUTANIX.CLUSTER.DISCOVERY.NAME.NOT_MATCHES}'
                operator: NOT_MATCHES_REGEX
          description: 'Discovery of all clusters.'
          host_prototypes:
            - uuid: c1f630a16e304dcda7771895344638c7
              host: '{#NUTANIX.CLUSTER.UUID}'
              name: '{#NUTANIX.CLUSTER.NAME}'
              group_links:
                - group:
                    name: Applications
              templates:
                - name: 'Nutanix Cluster Prism Element by HTTP'
              macros:
                - macro: '{$NUTANIX.CLUSTER.UUID}'
                  value: '{#NUTANIX.CLUSTER.UUID}'
                  description: 'UUID of the cluster.'
          master_item:
            key: nutanix.cluster.get
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.entities
            - type: JAVASCRIPT
              parameters:
                - |
                  const json_data = JSON.parse(value);
                  
                  const result = json_data.map(function(entity) {
                  	return {
                  		"{#NUTANIX.CLUSTER.NAME}": entity.name ? entity.name : entity.uuid,
                  		"{#NUTANIX.CLUSTER.UUID}": entity.uuid
                  	};
                  });
                  
                  return JSON.stringify(result);
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
        - uuid: 19cd9a3bc7ac4e42860f3e3b0ab20afe
          name: 'Host discovery'
          type: DEPENDENT
          key: nutanix.host.discovery
          filter:
            evaltype: AND
            conditions:
              - macro: '{#NUTANIX.HOST.NAME}'
                value: '{$NUTANIX.HOST.DISCOVERY.NAME.MATCHES}'
              - macro: '{#NUTANIX.HOST.NAME}'
                value: '{$NUTANIX.HOST.DISCOVERY.NAME.NOT_MATCHES}'
                operator: NOT_MATCHES_REGEX
          description: 'Discovery of all hosts.'
          host_prototypes:
            - uuid: 24ccbeb75dc949ccb6c094416618443b
              host: '{#NUTANIX.HOST.UUID}'
              name: '{#NUTANIX.HOST.NAME}'
              group_links:
                - group:
                    name: Applications
              templates:
                - name: 'Nutanix Host Prism Element by HTTP'
              macros:
                - macro: '{$NUTANIX.HOST.UUID}'
                  value: '{#NUTANIX.HOST.UUID}'
                  description: 'UUID of the host.'
          master_item:
            key: nutanix.host.get
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.entities
            - type: JAVASCRIPT
              parameters:
                - |
                  const json_data = JSON.parse(value);
                  
                  const result = json_data.map(function(entity) {
                  	return {
                  		"{#NUTANIX.HOST.NAME}": entity.name ? entity.name : entity.uuid,
                  		"{#NUTANIX.HOST.UUID}": entity.uuid
                  	};
                  });
                  
                  return JSON.stringify(result);
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
        - uuid: 7ece7ee4f9d0423b856b6ecd7f616026
          name: 'Storage container discovery'
          type: DEPENDENT
          key: nutanix.storage.container.discovery
          filter:
            evaltype: AND
            conditions:
              - macro: '{#STORAGE.CONTAINER.NAME}'
                value: '{$NUTANIX.STORAGE.CONTAINER.DISCOVERY.NAME.MATCHES}'
              - macro: '{#STORAGE.CONTAINER.NAME}'
                value: '{$NUTANIX.STORAGE.CONTAINER.DISCOVERY.NAME.NOT_MATCHES}'
                operator: NOT_MATCHES_REGEX
          description: 'Discovery of all storage containers.'
          item_prototypes:
            - uuid: f0a6602489f54d5c8be85bb75ebd3e6f
              name: 'Container [{#STORAGE.CONTAINER.NAME}]: Space: Total, bytes'
              type: DEPENDENT
              key: 'nutanix.storage.container.capacity.bytes["{#STORAGE.CONTAINER.UUID}"]'
              units: B
              description: 'The total space of the storage container.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.[''{#STORAGE.CONTAINER.UUID}''].usage_stats.[''storage.capacity_bytes'']'
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: nutanix.storage.container.get
              tags:
                - tag: component
                  value: storage
                - tag: container
                  value: '{#STORAGE.CONTAINER.NAME}'
            - uuid: dac6fb1aa0ee4d93ab67e1bd3374c412
              name: 'Container [{#STORAGE.CONTAINER.NAME}]: Space: Free, bytes'
              type: DEPENDENT
              key: 'nutanix.storage.container.free.bytes["{#STORAGE.CONTAINER.UUID}"]'
              units: B
              description: 'The free space of the storage container.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.[''{#STORAGE.CONTAINER.UUID}''].usage_stats.[''storage.free_bytes'']'
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: nutanix.storage.container.get
              tags:
                - tag: component
                  value: storage
                - tag: container
                  value: '{#STORAGE.CONTAINER.NAME}'
            - uuid: dc76d8405d204e90bd6213f34344dcb6
              name: 'Container [{#STORAGE.CONTAINER.NAME}]: Replication factor'
              type: DEPENDENT
              key: 'nutanix.storage.container.replication.factor["{#STORAGE.CONTAINER.UUID}"]'
              description: 'The replication factor of the storage container.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.[''{#STORAGE.CONTAINER.UUID}''].replication_factor'
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: nutanix.storage.container.get
              tags:
                - tag: component
                  value: storage
                - tag: container
                  value: '{#STORAGE.CONTAINER.NAME}'
            - uuid: 5d40812ff4f14146a5199edf271be1ec
              name: 'Container [{#STORAGE.CONTAINER.NAME}]: Space: Used, bytes'
              type: DEPENDENT
              key: 'nutanix.storage.container.usage.bytes["{#STORAGE.CONTAINER.UUID}"]'
              units: B
              description: 'The used space of the storage container.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.[''{#STORAGE.CONTAINER.UUID}''].usage_stats.[''storage.usage_bytes'']'
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: nutanix.storage.container.get
              tags:
                - tag: component
                  value: storage
                - tag: container
                  value: '{#STORAGE.CONTAINER.NAME}'
          graph_prototypes:
            - uuid: b067c9f9467b4760b43235aa453ee424
              name: 'Container [{#STORAGE.CONTAINER.NAME}]: Space: Total and Used'
              graph_items:
                - drawtype: GRADIENT_LINE
                  color: 0040FF
                  item:
                    host: 'Nutanix Prism Element by HTTP'
                    key: 'nutanix.storage.container.usage.bytes["{#STORAGE.CONTAINER.UUID}"]'
                - sortorder: '1'
                  drawtype: GRADIENT_LINE
                  color: 00BFFF
                  item:
                    host: 'Nutanix Prism Element by HTTP'
                    key: 'nutanix.storage.container.capacity.bytes["{#STORAGE.CONTAINER.UUID}"]'
          master_item:
            key: nutanix.storage.container.get
          preprocessing:
            - type: JAVASCRIPT
              parameters:
                - |
                  const json_data = JSON.parse(value);
                  var output_data = [];
                  
                  for (var entity in json_data) {
                  	output_data.push({
                  		"{#STORAGE.CONTAINER.UUID}": json_data[entity].storage_container_uuid,
                  		"{#STORAGE.CONTAINER.NAME}": json_data[entity].name
                  	});
                  }
                  
                  return JSON.stringify(output_data);
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
      tags:
        - tag: class
          value: software
        - tag: subclass
          value: virtualization
        - tag: target
          value: nutanix
        - tag: target
          value: prism-element
      macros:
        - macro: '{$NUTANIX.CLUSTER.DISCOVERY.NAME.MATCHES}'
          value: '.*'
          description: 'Filter of discoverable Nutanix clusters by name.'
          config:
            type: TEXT
            priority: '6'
            section_name: Filters
            label: 'Clusters filter (include)'
            description: 'Filter of discoverable Nutanix clusters by name.'
        - macro: '{$NUTANIX.CLUSTER.DISCOVERY.NAME.NOT_MATCHES}'
          value: CHANGE_IF_NEEDED
          description: 'Filter to exclude discovered Nutanix clusters by name.'
          config:
            type: TEXT
            priority: '7'
            section_name: Filters
            label: 'Clusters filter (exclude)'
            description: 'Filter to exclude discovered Nutanix clusters by name.'
        - macro: '{$NUTANIX.HOST.DISCOVERY.NAME.MATCHES}'
          value: '.*'
          description: 'Filter of discoverable Nutanix hosts by name.'
          config:
            type: TEXT
            priority: '8'
            section_name: Filters
            label: 'Hosts filter (include)'
            description: 'Filter of discoverable Nutanix hosts by name.'
        - macro: '{$NUTANIX.HOST.DISCOVERY.NAME.NOT_MATCHES}'
          value: CHANGE_IF_NEEDED
          description: 'Filter to exclude discovered Nutanix hosts by name.'
          config:
            type: TEXT
            priority: '9'
            section_name: Filters
            label: 'Hosts filter (exclude)'
            description: 'Filter to exclude discovered Nutanix hosts by name.'
        - macro: '{$NUTANIX.PASSWORD}'
          type: SECRET_TEXT
          description: 'Nutanix API password.'
          config:
            type: TEXT
            priority: '4'
            label: 'API password'
            description: 'Nutanix API password.'
            required: 'YES'
        - macro: '{$NUTANIX.PRISM.ELEMENT.IP}'
          description: 'Set the Nutanix API IP here.'
          config:
            type: TEXT
            priority: '1'
            label: 'API IP'
            description: 'Set the Nutanix API IP here.'
            required: 'YES'
        - macro: '{$NUTANIX.PRISM.ELEMENT.PORT}'
          value: '9440'
          description: 'Set the Nutanix API port here.'
          config:
            type: TEXT
            priority: '2'
            label: 'API port'
            description: 'Set the Nutanix API port here. In the range from 1 to 65535 inclusive.'
            required: 'YES'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$NUTANIX.PROXY}'
          description: 'Sets the HTTP proxy value. If this macro is empty, then no proxy is used.'
          config:
            type: TEXT
            priority: '5'
            section_name: Other
            label: Proxy
            description: 'Sets the HTTP proxy value. If this macro is empty, then no proxy is used.'
        - macro: '{$NUTANIX.STORAGE.CONTAINER.DISCOVERY.NAME.MATCHES}'
          value: '.*'
          description: 'Filter of discoverable storage containers by name.'
          config:
            type: TEXT
            priority: '10'
            section_name: Filters
            label: 'Storage containers filter (include)'
            description: 'Filter of discoverable storage containers by name.'
        - macro: '{$NUTANIX.STORAGE.CONTAINER.DISCOVERY.NAME.NOT_MATCHES}'
          value: CHANGE_IF_NEEDED
          description: 'Filter to exclude discovered storage containers by name.'
          config:
            type: TEXT
            priority: '11'
            section_name: Filters
            label: 'Storage containers filter (exclude)'
            description: 'Filter to exclude discovered storage containers by name.'
        - macro: '{$NUTANIX.USER}'
          description: 'Nutanix API username.'
          config:
            type: TEXT
            priority: '3'
            label: 'API username'
            description: 'Nutanix API username.'
            required: 'YES'
      dashboards:
        - uuid: 02f05b74967140859a2e86d0d14b0545
          name: 'Nutanix Prism Element overview'
          pages:
            - name: 'Nutanix: Overview'
              widgets:
                - type: graphprototype
                  name: Capacity
                  width: '36'
                  height: '6'
                  fields:
                    - type: INTEGER
                      name: columns
                      value: '1'
                    - type: ITEM_PROTOTYPE
                      name: itemid.0
                      value:
                        host: 'Nutanix Prism Element by HTTP'
                        key: 'nutanix.storage.container.capacity.bytes["{#STORAGE.CONTAINER.UUID}"]'
                    - type: STRING
                      name: reference
                      value: MLSDY
                    - type: INTEGER
                      name: source_type
                      value: '3'
                - type: graphprototype
                  name: 'Free space'
                  'y': '6'
                  width: '72'
                  height: '6'
                  fields:
                    - type: GRAPH_PROTOTYPE
                      name: graphid.0
                      value:
                        host: 'Nutanix Prism Element by HTTP'
                        name: 'Container [{#STORAGE.CONTAINER.NAME}]: Space: Total and Used'
                    - type: STRING
                      name: reference
                      value: MLSDW
                - type: honeycomb
                  name: 'Replication factor'
                  x: '36'
                  width: '36'
                  height: '6'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: 81D4FA
                    - type: STRING
                      name: items.0
                      value: '*Replication factor'
                    - type: STRING
                      name: primary_label
                      value: '{{ITEM.NAME}.regsub("Container.\[(.*)\]:\sReplication factor", \1)}'
                    - type: INTEGER
                      name: primary_label_size_type
                      value: '1'
                    - type: STRING
                      name: reference
                      value: LSGAA
                    - type: INTEGER
                      name: secondary_label_bold
                      value: '0'
                    - type: INTEGER
                      name: secondary_label_decimal_places
                      value: '0'
    - uuid: 178645e229484bcf9cb030dc1edccebb
      template: 'Oracle Cloud Autonomous Database by HTTP'
      name: 'Oracle Cloud Autonomous Database by HTTP'
      description: |
        This template monitors Oracle Cloud Infrastructure (OCI) autonomous database (serverless) resources.
        
        This template is not meant to be used independently, but together with Oracle Cloud by HTTP as a template for
        LLD host prototypes.
        
        Read the template documentation prior to using this template.
        
        You can discuss this template or leave feedback on our forum https://www.zabbix.com/forum/zabbix-suggestions-and-feedback
        
        Generated by official Zabbix template tool "Templator"
      wizard_ready: 'YES'
      readme: |
        ## Setup
        
        This template is used in low-level discovery and will be auto-assigned to host prototypes. Additional configuration is not required.
      vendor:
        name: Zabbix
        version: 8.0-2
      groups:
        - name: Templates/Cloud
      items:
        - uuid: 8520813edccc4fb9ba975c27914c5633
          name: 'Database availability'
          type: DEPENDENT
          key: oci.aut.db.availability
          value_type: FLOAT
          description: 'The database is available for connections in the given minute.'
          valuemap:
            name: 'Database availability'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.DatabaseAvailability
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 5h
          master_item:
            key: oci.aut.db.metrics.stats
          tags:
            - tag: component
              value: environment
          triggers:
            - uuid: 21b1a5c7d7754eb6be30098b2df99a22
              expression: 'last(/Oracle Cloud Autonomous Database by HTTP/oci.aut.db.availability) = 0'
              name: 'OCI Autonomous DB: Database is not available'
              priority: HIGH
              description: 'Autonomous database is not available.'
              dependencies:
                - name: 'OCI Autonomous DB: Database is not available or accessible'
                  expression: 'last(/Oracle Cloud Autonomous Database by HTTP/oci.aut.db.state) = 19 or last(/Oracle Cloud Autonomous Database by HTTP/oci.aut.db.state) = 20'
              tags:
                - tag: scope
                  value: availability
        - uuid: 038c4b2c000747799b60cb074aebbce5
          name: 'DB block changes'
          type: DEPENDENT
          key: oci.aut.db.block.changes
          description: |
            The number of changes that were part of an update or delete operation that were made to all blocks in the SGA.
            
            Such changes generate redo log entries and thus become permanent changes to the database if
            the transaction is committed.
            
            This statistic approximates total database work and indicates the rate at which buffers are being dirtied
            during the selected time interval.
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.DBBlockChanges
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: oci.aut.db.metrics.frequent.get
          tags:
            - tag: component
              value: environment
        - uuid: a471a74943b24a4a81347404e37b7359
          name: 'Failed connections'
          type: DEPENDENT
          key: oci.aut.db.conn.failed
          description: 'The number of failed database connections.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.FailedConnections
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: oci.aut.db.metrics.frequent.get
          tags:
            - tag: component
              value: environment
        - uuid: cc1244e911314e9aaa6a995636848809
          name: 'CPU time'
          type: DEPENDENT
          key: oci.aut.db.cpu.time
          value_type: FLOAT
          description: 'Average rate of accumulation of CPU time by foreground sessions in the database over the selected time interval.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.CpuTime
            - type: JAVASCRIPT
              parameters:
                - 'return Math.round(value * 100) / 100;'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: oci.aut.db.metrics.frequent.get
          tags:
            - tag: component
              value: cpu
        - uuid: da165d0adf324b9e98390d122925fd67
          name: 'CPU utilization, in %'
          type: DEPENDENT
          key: oci.aut.db.cpu.util
          value_type: FLOAT
          units: '%'
          description: |
            The CPU usage expressed as a percentage, aggregated across all consumer groups.
            The utilization percentage is reported with respect to the number of CPUs the database is allowed to use.
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.CpuUtilization
            - type: JAVASCRIPT
              parameters:
                - 'return Math.round(value * 100) / 100;'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: oci.aut.db.metrics.frequent.get
          tags:
            - tag: component
              value: cpu
          triggers:
            - uuid: 59fd2d0eff9f4f5493cd0de94ba57572
              expression: 'min(/Oracle Cloud Autonomous Database by HTTP/oci.aut.db.cpu.util,5m) >= {$OCI.AUTONOMOUS.DB.CPU.UTIL.WARN}'
              name: 'OCI Autonomous DB: Current CPU utilization is high'
              event_name: 'OCI Autonomous DB: Current CPU utilization is high (util >= {$OCI.AUTONOMOUS.DB.CPU.UTIL.WARN}%)'
              opdata: 'Current: {ITEM.LASTVALUE1}'
              priority: WARNING
              description: 'Current CPU utilization has exceeded `{$OCI.AUTONOMOUS.DB.CPU.UTIL.WARN}`% of the max available value.'
              dependencies:
                - name: 'OCI Autonomous DB: Current CPU utilization is too high'
                  expression: 'min(/Oracle Cloud Autonomous Database by HTTP/oci.aut.db.cpu.util,5m) >= {$OCI.AUTONOMOUS.DB.CPU.UTIL.HIGH}'
              tags:
                - tag: scope
                  value: capacity
            - uuid: f8a53ef11d2140649bc701660183c33d
              expression: 'min(/Oracle Cloud Autonomous Database by HTTP/oci.aut.db.cpu.util,5m) >= {$OCI.AUTONOMOUS.DB.CPU.UTIL.HIGH}'
              name: 'OCI Autonomous DB: Current CPU utilization is too high'
              event_name: 'OCI Autonomous DB: Current CPU utilization is too high (util >= {$OCI.AUTONOMOUS.DB.CPU.UTIL.HIGH}%)'
              opdata: 'Current: {ITEM.LASTVALUE1}'
              priority: HIGH
              description: 'Current CPU utilization has exceeded `{$OCI.AUTONOMOUS.DB.CPU.UTIL.HIGH}`% of the max available value.'
              tags:
                - tag: scope
                  value: capacity
        - uuid: 47708f3446644bbc9afd11bd0e98d1f5
          name: 'Execute count'
          type: DEPENDENT
          key: oci.aut.db.exec.count
          description: 'The number of user and recursive calls that executed SQL statements during the selected time interval.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.ExecuteCount
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: oci.aut.db.metrics.frequent.get
          tags:
            - tag: component
              value: environment
        - uuid: 4a1af0cbea8645cc897d64e3c1ac802e
          name: 'Connection latency'
          type: DEPENDENT
          key: oci.aut.db.latency.conn
          value_type: FLOAT
          units: s
          description: |
            The time taken to connect to an Oracle Autonomous Database Serverless instance in each region
            from a Compute service virtual machine in the same region.
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.ConnectionLatency
            - type: MULTIPLIER
              parameters:
                - '0.001'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 5h
          master_item:
            key: oci.aut.db.metrics.stats
          tags:
            - tag: component
              value: environment
        - uuid: e233b1ab82384297b9ee88556969da31
          name: 'Query latency'
          type: DEPENDENT
          key: oci.aut.db.latency.query
          value_type: FLOAT
          units: s
          description: 'The time taken to display the results of a simple query on the user''s screen.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.QueryLatency
            - type: MULTIPLIER
              parameters:
                - '0.001'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 5h
          master_item:
            key: oci.aut.db.metrics.stats
          tags:
            - tag: component
              value: environment
        - uuid: b39b36b4a72b4cbf80584614c3d996ed
          name: 'Session logical reads'
          type: DEPENDENT
          key: oci.aut.db.logical.reads.session
          description: |
            The sum of `db block gets` and `consistent gets` during the selected time interval.
            This includes logical reads of database blocks from either the buffer cache or process private memory.
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.LogicalReads
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: oci.aut.db.metrics.frequent.get
          tags:
            - tag: component
              value: environment
        - uuid: 27b77344e5fc473693e48eb676ceb746
          name: 'Current logons'
          type: DEPENDENT
          key: oci.aut.db.logons
          description: 'The number of successful logons during the selected time interval.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.CurrentLogons
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: oci.aut.db.metrics.frequent.get
          tags:
            - tag: component
              value: environment
        - uuid: f4c0af10cea04decbb049c02f06795e4
          name: 'Failed logons'
          type: DEPENDENT
          key: oci.aut.db.logons.failed
          value_type: FLOAT
          description: |
            The number of logons that failed because of an invalid user name and/or password
            during the selected time interval.
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.FailedLogons
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: oci.aut.db.metrics.frequent.get
          tags:
            - tag: component
              value: environment
        - uuid: 6104537179324cb48d82e05d64f3a19f
          name: 'Get frequent metrics'
          type: SCRIPT
          key: oci.aut.db.metrics.frequent.get
          history: '0'
          value_type: TEXT
          params: |
            function validateZabbixParams(requiredParams, allParams) {
            	requiredParams.forEach(function (field) {
            		if (typeof allParams !== 'object' || typeof allParams[field] === 'undefined' || allParams[field] === '') {
            			throw 'Required param is not set: ' + field + '.';
            		}
            	});
            }
            
            function OCI(service, action, params) {
            	this.zabbixLogPrefix = '[ OCI ] [ ' + service + ' ] [ ' + action + ' ]';
            	this.request = new HttpRequest();
            
            	this.hash = function (string) {
            		return sha256(string);
            	};
            
            	this.sign = function (string) {
            		return sign('sha256', params['private_key'], string);
            	};
            
            	this.encode = function (hash) {
            		const hexArr = hash.match(/.{1,2}/g);
            		var uInt8Array = new Uint8Array(hexArr.length);
            		hexArr.forEach(function (hex, idx) {
            			uInt8Array[idx] = parseInt(hex, 16);
            		});
            		return btoa(uInt8Array);
            	};
            
            	this.getDate = function () {
            		const weekdayShortList = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
            		const monthShortList = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'];
            		const today = new Date();
            		return weekdayShortList[today.getUTCDay()] + ', ' + today.getUTCDate() + ' ' + monthShortList[today.getUTCMonth()] + ' ' + today.getUTCFullYear() + ' ' + today.getUTCHours() + ':' + today.getUTCMinutes() + ':' + today.getUTCSeconds() + ' GMT';
            	};
            
            	this.executeRequest = function (httpMethod, apiPath, apiParams, mql, namespace) {
            		var headers = '(request-target) date host';
            		const contentTypeHeader = 'content-type: application/json';
            		const dateHeader = 'date: ' + this.getDate();
            		const hostHeader = 'host: ' + params['api_host'];
            		const requestTarget = '(request-target): ' + httpMethod + ' ' + apiPath + apiParams;
            		var signingString = requestTarget + '\n' + dateHeader + '\n' + hostHeader;
            		var reqHeaders = [contentTypeHeader, dateHeader];
            
            		if (httpMethod === 'post') {
            			var body = JSON.stringify({
            				'namespace': namespace,
            				'query': mql
            			});
            			headers = headers + ' x-content-sha256 content-type content-length';
            			const bodyHeader = 'x-content-sha256: ' + this.encode(this.hash(body));
            			const bodyLengthHeader = 'content-length: ' + body.length;
            			signingString = signingString + '\n' + bodyHeader + '\n' + contentTypeHeader + '\n' + bodyLengthHeader;
            			reqHeaders.push(bodyHeader, bodyLengthHeader);
            		}
            
            		const signature = this.encode(this.sign(signingString));
            
            		reqHeaders.push('Authorization: Signature version="1",keyId="' + params['tenancy_ocid'] + '/' + params['user_ocid'] + '/' + params['fingerprint'] + '",algorithm="rsa-sha256",headers="' + headers + '",signature="' + signature + '"');
            		for (var header = 0, headerLength = reqHeaders.length; header < headerLength; header++) {
            			this.request.addHeader(reqHeaders[header]);
            		}
            
            		if (params['http_proxy']) {
            			this.request.setProxy(params['http_proxy']);
            			Zabbix.log(4, this.zabbixLogPrefix + ' Using http proxy: ' + params['http_proxy']);
            		}
            
            		if (httpMethod === 'post') {
            			var apiRateLimitExceeded = false;
            			do {
            				const response = this.request.post('https://' + params['api_host'] + apiPath + apiParams, body);
            
            				try {
            					if (JSON.parse(response)['code'] === 'TooManyRequests') {
            
            						apiRateLimitExceeded = true;
            						Zabbix.sleep(1000);
            					} else {
            						apiRateLimitExceeded = false;
            					}
            				} catch (error) {
            					Zabbix.log(3, this.zabbixLogPrefix + ' Could not parse the response: ' + JSON.stringify(response));
            					throw 'Could not parse the response. See logs for more information.';
            				}
            			} while (apiRateLimitExceeded);
            		} else {
            			const response = this.request.get('https://' + params['api_host'] + apiPath + apiParams);
            		}
            
            		this.request.clearHeader();
            
            		if (this.request.getStatus() === parseInt(params['http_status_code'])) {
            			return response;
            		} else {
            			Zabbix.log(3, this.zabbixLogPrefix + ' Unexpected HTTP response code: ' + this.request.getStatus());
            			throw 'Unexpected HTTP response code: ' + this.request.getStatus();
            		}
            	};
            
            	this.extractData = function (httpMethod, data, keys, compartment) {
            		try {
            			data = JSON.parse(data);
            		} catch (error) {
            			Zabbix.log(3, this.zabbixLogPrefix + ' Could not parse the received JSON object: ' + data);
            			throw 'Could not parse received JSON object. See logs for more information.';
            		}
            
            		if (typeof keys == 'object') {
            			var returnBuffer = [];
            			for (var dataObj = 0, dataLength = data.length; dataObj < dataLength; dataObj++) {
            
            				var objectBuffer = {};
            				for (var key = 0, keysLength = keys.length; key < keysLength; key++) {
            					if (data[dataObj][keys[key]] || data[dataObj][keys[key]] == null) {
            						objectBuffer[keys[key].match(/^[a-z]+$|[A-Z][a-z]+$/)[0].toLowerCase()] = data[dataObj][keys[key]];
            					} else {
            						Zabbix.log(3, this.zabbixLogPrefix + ' Received an unexpected JSON object. Could not get value for key "' + keys[key] + '" in JSON: ' + JSON.stringify(data[dataObj]));
            						throw 'Received an unexpected JSON object. See logs for more information.';
            					}
            				}
            				if (typeof compartment != 'undefined' && compartment != '') objectBuffer['compartment'] = compartment;
            				returnBuffer.push(objectBuffer);
            			}
            			return returnBuffer;
            		}
            
            		try {
            			if (httpMethod === 'get') {
            				return data[keys];
            			} else {
            				if (data.length === 0) {
            					return 0;
            				}
            				data = data[0][keys];
            				return data[data.length - 1]['value'];
            			}
            		} catch (error) {
            			Zabbix.log(3, this.zabbixLogPrefix + ' Could not find key "' + keys + '" in JSON: ' + JSON.stringify(data));
            			throw 'Could not find required key in JSON object. See logs for more information.';
            		}
            	};
            }
            
            function buildMql(id, metrics, defaultStatistic, resourceType) {
            	resourceType = resourceType === '' || resourceType === undefined ? 'resourceId' : resourceType;
            	this.query = '[' + params['req_interval'] + 'm]{' + resourceType + '=' + id + '}.';
            
            	for (var i = 0, metricsLength = metrics.length; i < metricsLength; i++) {
            		const metric = ((Array.isArray(metrics[i]) ? metrics[i] : [metrics[i], defaultStatistic]));
            		metrics[i] = [metric[0], this.query + metric[1]];
            	}
            }
            
            
            const params = JSON.parse(value);
            validateZabbixParams(['tenancy_ocid', 'user_ocid', 'private_key', 'fingerprint', 'api_host', 'db_id', 'http_status_code', 'req_interval', 'compartment_id'], params);
            var oci = new OCI('Autonomous DB', 'Get metrics ' + params['req_interval'] + 'm', params);
            
            const metrics = [
            	['CpuTime', 'mean'],
            	['CpuUtilization', 'mean'],
            	['CurrentLogons', 'count'],
            	'DBBlockChanges',
            	['DBTime', 'mean'],
            	'ExecuteCount',
            	'FailedConnections',
            	['FailedLogons', 'mean'],
            	'HardParseCount',
            	'LogicalReads',
            	'ParseCount',
            	'ParseFailureCount',
            	'PhysicalReads',
            	'PhysicalReadTotalBytes',
            	'PhysicalWrites',
            	'PhysicalWriteTotalBytes',
            	'QueuedStatements',
            	'RedoGenerated',
            	['RunningStatements', 'mean'],
            	'Sessions',
            	'SQLNetBytesFromClient',
            	'SQLNetBytesFromDBLink',
            	'SQLNetBytesToClient',
            	'SQLNetBytesToDBLink',
            	'TransactionCount',
            	'UserCalls',
            	'UserCommits',
            	'UserRollbacks',
            	['WaitTime', 'mean']
            ];
            buildMql(params['db_id'], metrics, 'sum');
            
            var result = {};
            for (var i = 0, metricsLength = metrics.length; i < metricsLength; i++) {
            	result[metrics[i][0]] = oci.extractData('post', oci.executeRequest('post', '/20180401/metrics/actions/summarizeMetricsData', '?compartmentId=' + encodeURIComponent(params['compartment_id']), metrics[i][0] + metrics[i][1] + '()', 'oci_autonomous_database'), 'aggregatedDatapoints');
            }
            return JSON.stringify(result);
          description: 'Gets all metrics related to the database that have a collection frequency of 1 minute.'
          timeout: 30s
          parameters:
            - name: api_host
              value: '{$OCI.API.TELEMETRY.HOST}'
            - name: compartment_id
              value: '{$OCI.AUTONOMOUS.DB.COMPARTMENT.ID}'
            - name: db_id
              value: '{$OCI.AUTONOMOUS.DB.ID}'
            - name: fingerprint
              value: '{$OCI.API.FINGERPRINT}'
            - name: http_proxy
              value: '{$OCI.HTTP.PROXY}'
            - name: http_status_code
              value: '{$OCI.HTTP.RETURN.CODE.OK}'
            - name: private_key
              value: '{$OCI.API.PRIVATE.KEY}'
            - name: req_interval
              value: '1'
            - name: tenancy_ocid
              value: '{$OCI.API.TENANCY}'
            - name: user_ocid
              value: '{$OCI.API.USER}'
          tags:
            - tag: component
              value: raw
        - uuid: 87a25240776a4b8a9a17ac053b69fd99
          name: 'Get database stats'
          type: SCRIPT
          key: oci.aut.db.metrics.stats
          delay: 5m
          history: '0'
          value_type: TEXT
          params: |
            function validateZabbixParams(requiredParams, allParams) {
            	requiredParams.forEach(function (field) {
            		if (typeof allParams !== 'object' || typeof allParams[field] === 'undefined' || allParams[field] === '') {
            			throw 'Required param is not set: ' + field + '.';
            		}
            	});
            }
            
            function OCI(service, action, params) {
            	this.zabbixLogPrefix = '[ OCI ] [ ' + service + ' ] [ ' + action + ' ]';
            	this.request = new HttpRequest();
            
            	this.hash = function (string) {
            		return sha256(string);
            	};
            
            	this.sign = function (string) {
            		return sign('sha256', params['private_key'], string);
            	};
            
            	this.encode = function (hash) {
            		const hexArr = hash.match(/.{1,2}/g);
            		var uInt8Array = new Uint8Array(hexArr.length);
            		hexArr.forEach(function (hex, idx) {
            			uInt8Array[idx] = parseInt(hex, 16);
            		});
            		return btoa(uInt8Array);
            	};
            
            	this.getDate = function () {
            		const weekdayShortList = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
            		const monthShortList = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'];
            		const today = new Date();
            		return weekdayShortList[today.getUTCDay()] + ', ' + today.getUTCDate() + ' ' + monthShortList[today.getUTCMonth()] + ' ' + today.getUTCFullYear() + ' ' + today.getUTCHours() + ':' + today.getUTCMinutes() + ':' + today.getUTCSeconds() + ' GMT';
            	};
            
            	this.executeRequest = function (httpMethod, apiPath, apiParams, mql, namespace) {
            		var headers = '(request-target) date host';
            		const contentTypeHeader = 'content-type: application/json';
            		const dateHeader = 'date: ' + this.getDate();
            		const hostHeader = 'host: ' + params['api_host'];
            		const requestTarget = '(request-target): ' + httpMethod + ' ' + apiPath + apiParams;
            		var signingString = requestTarget + '\n' + dateHeader + '\n' + hostHeader;
            		var reqHeaders = [contentTypeHeader, dateHeader];
            
            		if (httpMethod === 'post') {
            			var body = JSON.stringify({
            				'namespace': namespace,
            				'query': mql
            			});
            			headers = headers + ' x-content-sha256 content-type content-length';
            			const bodyHeader = 'x-content-sha256: ' + this.encode(this.hash(body));
            			const bodyLengthHeader = 'content-length: ' + body.length;
            			signingString = signingString + '\n' + bodyHeader + '\n' + contentTypeHeader + '\n' + bodyLengthHeader;
            			reqHeaders.push(bodyHeader, bodyLengthHeader);
            		}
            
            		const signature = this.encode(this.sign(signingString));
            
            		reqHeaders.push('Authorization: Signature version="1",keyId="' + params['tenancy_ocid'] + '/' + params['user_ocid'] + '/' + params['fingerprint'] + '",algorithm="rsa-sha256",headers="' + headers + '",signature="' + signature + '"');
            		for (var header = 0, headerLength = reqHeaders.length; header < headerLength; header++) {
            			this.request.addHeader(reqHeaders[header]);
            		}
            
            		if (params['http_proxy']) {
            			this.request.setProxy(params['http_proxy']);
            			Zabbix.log(4, this.zabbixLogPrefix + ' Using http proxy: ' + params['http_proxy']);
            		}
            
            		if (httpMethod === 'post') {
            			var apiRateLimitExceeded = false;
            			do {
            				const response = this.request.post('https://' + params['api_host'] + apiPath + apiParams, body);
            
            				try {
            					if (JSON.parse(response)['code'] === 'TooManyRequests') {
            
            						apiRateLimitExceeded = true;
            						Zabbix.sleep(1000);
            					} else {
            						apiRateLimitExceeded = false;
            					}
            				} catch (error) {
            					Zabbix.log(3, this.zabbixLogPrefix + ' Could not parse the response: ' + JSON.stringify(response));
            					throw 'Could not parse the response. See logs for more information.';
            				}
            			} while (apiRateLimitExceeded);
            		} else {
            			const response = this.request.get('https://' + params['api_host'] + apiPath + apiParams);
            		}
            
            		this.request.clearHeader();
            
            		if (this.request.getStatus() === parseInt(params['http_status_code'])) {
            			return response;
            		} else {
            			Zabbix.log(3, this.zabbixLogPrefix + ' Unexpected HTTP response code: ' + this.request.getStatus());
            			throw 'Unexpected HTTP response code: ' + this.request.getStatus();
            		}
            	};
            
            	this.extractData = function (httpMethod, data, keys, compartment) {
            		try {
            			data = JSON.parse(data);
            		} catch (error) {
            			Zabbix.log(3, this.zabbixLogPrefix + ' Could not parse the received JSON object: ' + data);
            			throw 'Could not parse received JSON object. See logs for more information.';
            		}
            
            		if (typeof keys == 'object') {
            			var returnBuffer = [];
            			for (var dataObj = 0, dataLength = data.length; dataObj < dataLength; dataObj++) {
            
            				var objectBuffer = {};
            				for (var key = 0, keysLength = keys.length; key < keysLength; key++) {
            					if (data[dataObj][keys[key]] || data[dataObj][keys[key]] == null) {
            						objectBuffer[keys[key].match(/^[a-z]+$|[A-Z][a-z]+$/)[0].toLowerCase()] = data[dataObj][keys[key]];
            					} else {
            						Zabbix.log(3, this.zabbixLogPrefix + ' Received an unexpected JSON object. Could not get value for key "' + keys[key] + '" in JSON: ' + JSON.stringify(data[dataObj]));
            						throw 'Received an unexpected JSON object. See logs for more information.';
            					}
            				}
            				if (typeof compartment != 'undefined' && compartment != '') objectBuffer['compartment'] = compartment;
            				returnBuffer.push(objectBuffer);
            			}
            			return returnBuffer;
            		}
            
            		try {
            			if (httpMethod === 'get') {
            				return data[keys];
            			} else {
            				if (data.length === 0) {
            					return 0;
            				}
            				data = data[0][keys];
            				return data[data.length - 1]['value'];
            			}
            		} catch (error) {
            			Zabbix.log(3, this.zabbixLogPrefix + ' Could not find key "' + keys + '" in JSON: ' + JSON.stringify(data));
            			throw 'Could not find required key in JSON object. See logs for more information.';
            		}
            	};
            }
            
            function buildMql(id, metrics, defaultStatistic, resourceType) {
            	resourceType = resourceType === '' || resourceType === undefined ? 'resourceId' : resourceType;
            	this.query = '[' + params['req_interval'] + 'm]{' + resourceType + '=' + id + '}.';
            
            	for (var i = 0, metricsLength = metrics.length; i < metricsLength; i++) {
            		const metric = ((Array.isArray(metrics[i]) ? metrics[i] : [metrics[i], defaultStatistic]));
            		metrics[i] = [metric[0], this.query + metric[1]];
            	}
            }
            
            
            const params = JSON.parse(value);
            validateZabbixParams(['tenancy_ocid', 'user_ocid', 'private_key', 'fingerprint', 'api_host', 'db_id', 'http_status_code', 'req_interval', 'compartment_id'], params);
            var oci = new OCI('Autonomous DB', 'Get metrics ' + params['req_interval'] + 'm', params);
            
            const metrics = [
            	['DatabaseAvailability', 'last'],
            	'ConnectionLatency',
            	'QueryLatency'
            ];
            buildMql(params['db_id'], metrics, 'max');
            
            var result = {};
            for (var i = 0, metricsLength = metrics.length; i < metricsLength; i++) {
            	result[metrics[i][0]] = oci.extractData('post', oci.executeRequest('post', '/20180401/metrics/actions/summarizeMetricsData', '?compartmentId=' + encodeURIComponent(params['compartment_id']), metrics[i][0] + metrics[i][1] + '()', 'oci_autonomous_database'), 'aggregatedDatapoints');
            }
            return JSON.stringify(result);
          description: 'Gets all metrics related to specific database that have a collection frequency of 5 minutes.'
          timeout: 30s
          parameters:
            - name: api_host
              value: '{$OCI.API.TELEMETRY.HOST}'
            - name: compartment_id
              value: '{$OCI.AUTONOMOUS.DB.COMPARTMENT.ID}'
            - name: db_id
              value: '{$OCI.AUTONOMOUS.DB.ID}'
            - name: fingerprint
              value: '{$OCI.API.FINGERPRINT}'
            - name: http_proxy
              value: '{$OCI.HTTP.PROXY}'
            - name: http_status_code
              value: '{$OCI.HTTP.RETURN.CODE.OK}'
            - name: private_key
              value: '{$OCI.API.PRIVATE.KEY}'
            - name: req_interval
              value: '5'
            - name: tenancy_ocid
              value: '{$OCI.API.TENANCY}'
            - name: user_ocid
              value: '{$OCI.API.USER}'
          tags:
            - tag: component
              value: raw
        - uuid: cb2936c594e4450096559b3023f6aa4f
          name: 'Get storage stats'
          type: SCRIPT
          key: oci.aut.db.metrics.storage.stats
          delay: 60m
          history: '0'
          value_type: TEXT
          params: |
            function validateZabbixParams(requiredParams, allParams) {
            	requiredParams.forEach(function (field) {
            		if (typeof allParams !== 'object' || typeof allParams[field] === 'undefined' || allParams[field] === '') {
            			throw 'Required param is not set: ' + field + '.';
            		}
            	});
            }
            
            function OCI(service, action, params) {
            	this.zabbixLogPrefix = '[ OCI ] [ ' + service + ' ] [ ' + action + ' ]';
            	this.request = new HttpRequest();
            
            	this.hash = function (string) {
            		return sha256(string);
            	};
            
            	this.sign = function (string) {
            		return sign('sha256', params['private_key'], string);
            	};
            
            	this.encode = function (hash) {
            		const hexArr = hash.match(/.{1,2}/g);
            		var uInt8Array = new Uint8Array(hexArr.length);
            		hexArr.forEach(function (hex, idx) {
            			uInt8Array[idx] = parseInt(hex, 16);
            		});
            		return btoa(uInt8Array);
            	};
            
            	this.getDate = function () {
            		const weekdayShortList = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
            		const monthShortList = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'];
            		const today = new Date();
            		return weekdayShortList[today.getUTCDay()] + ', ' + today.getUTCDate() + ' ' + monthShortList[today.getUTCMonth()] + ' ' + today.getUTCFullYear() + ' ' + today.getUTCHours() + ':' + today.getUTCMinutes() + ':' + today.getUTCSeconds() + ' GMT';
            	};
            
            	this.executeRequest = function (httpMethod, apiPath, apiParams, mql, namespace) {
            		var headers = '(request-target) date host';
            		const contentTypeHeader = 'content-type: application/json';
            		const dateHeader = 'date: ' + this.getDate();
            		const hostHeader = 'host: ' + params['api_host'];
            		const requestTarget = '(request-target): ' + httpMethod + ' ' + apiPath + apiParams;
            		var signingString = requestTarget + '\n' + dateHeader + '\n' + hostHeader;
            		var reqHeaders = [contentTypeHeader, dateHeader];
            
            		if (httpMethod === 'post') {
            			var body = JSON.stringify({
            				'namespace': namespace,
            				'query': mql
            			});
            			headers = headers + ' x-content-sha256 content-type content-length';
            			const bodyHeader = 'x-content-sha256: ' + this.encode(this.hash(body));
            			const bodyLengthHeader = 'content-length: ' + body.length;
            			signingString = signingString + '\n' + bodyHeader + '\n' + contentTypeHeader + '\n' + bodyLengthHeader;
            			reqHeaders.push(bodyHeader, bodyLengthHeader);
            		}
            
            		const signature = this.encode(this.sign(signingString));
            
            		reqHeaders.push('Authorization: Signature version="1",keyId="' + params['tenancy_ocid'] + '/' + params['user_ocid'] + '/' + params['fingerprint'] + '",algorithm="rsa-sha256",headers="' + headers + '",signature="' + signature + '"');
            		for (var header = 0, headerLength = reqHeaders.length; header < headerLength; header++) {
            			this.request.addHeader(reqHeaders[header]);
            		}
            
            		if (params['http_proxy']) {
            			this.request.setProxy(params['http_proxy']);
            			Zabbix.log(4, this.zabbixLogPrefix + ' Using http proxy: ' + params['http_proxy']);
            		}
            
            		if (httpMethod === 'post') {
            			var apiRateLimitExceeded = false;
            			do {
            				const response = this.request.post('https://' + params['api_host'] + apiPath + apiParams, body);
            
            				try {
            					if (JSON.parse(response)['code'] === 'TooManyRequests') {
            
            						apiRateLimitExceeded = true;
            						Zabbix.sleep(1000);
            					} else {
            						apiRateLimitExceeded = false;
            					}
            				} catch (error) {
            					Zabbix.log(3, this.zabbixLogPrefix + ' Could not parse the response: ' + JSON.stringify(response));
            					throw 'Could not parse the response. See logs for more information.';
            				}
            			} while (apiRateLimitExceeded);
            		} else {
            			const response = this.request.get('https://' + params['api_host'] + apiPath + apiParams);
            		}
            
            		this.request.clearHeader();
            
            		if (this.request.getStatus() === parseInt(params['http_status_code'])) {
            			return response;
            		} else {
            			Zabbix.log(3, this.zabbixLogPrefix + ' Unexpected HTTP response code: ' + this.request.getStatus());
            			throw 'Unexpected HTTP response code: ' + this.request.getStatus();
            		}
            	};
            
            	this.extractData = function (httpMethod, data, keys, compartment) {
            		try {
            			data = JSON.parse(data);
            		} catch (error) {
            			Zabbix.log(3, this.zabbixLogPrefix + ' Could not parse the received JSON object: ' + data);
            			throw 'Could not parse received JSON object. See logs for more information.';
            		}
            
            		if (typeof keys == 'object') {
            			var returnBuffer = [];
            			for (var dataObj = 0, dataLength = data.length; dataObj < dataLength; dataObj++) {
            
            				var objectBuffer = {};
            				for (var key = 0, keysLength = keys.length; key < keysLength; key++) {
            					if (data[dataObj][keys[key]] || data[dataObj][keys[key]] == null) {
            						objectBuffer[keys[key].match(/^[a-z]+$|[A-Z][a-z]+$/)[0].toLowerCase()] = data[dataObj][keys[key]];
            					} else {
            						Zabbix.log(3, this.zabbixLogPrefix + ' Received an unexpected JSON object. Could not get value for key "' + keys[key] + '" in JSON: ' + JSON.stringify(data[dataObj]));
            						throw 'Received an unexpected JSON object. See logs for more information.';
            					}
            				}
            				if (typeof compartment != 'undefined' && compartment != '') objectBuffer['compartment'] = compartment;
            				returnBuffer.push(objectBuffer);
            			}
            			return returnBuffer;
            		}
            
            		try {
            			if (httpMethod === 'get') {
            				return data[keys];
            			} else {
            				if (data.length === 0) {
            					return 0;
            				}
            				data = data[0][keys];
            				return data[data.length - 1]['value'];
            			}
            		} catch (error) {
            			Zabbix.log(3, this.zabbixLogPrefix + ' Could not find key "' + keys + '" in JSON: ' + JSON.stringify(data));
            			throw 'Could not find required key in JSON object. See logs for more information.';
            		}
            	};
            }
            
            function buildMql(id, metrics, defaultStatistic, resourceType) {
            	resourceType = resourceType === '' || resourceType === undefined ? 'resourceId' : resourceType;
            	this.query = '[' + params['req_interval'] + 'm]{' + resourceType + '=' + id + '}.';
            
            	for (var i = 0, metricsLength = metrics.length; i < metricsLength; i++) {
            		const metric = ((Array.isArray(metrics[i]) ? metrics[i] : [metrics[i], defaultStatistic]));
            		metrics[i] = [metric[0], this.query + metric[1]];
            	}
            }
            
            
            const params = JSON.parse(value);
            validateZabbixParams(['tenancy_ocid', 'user_ocid', 'private_key', 'fingerprint', 'api_host', 'db_id', 'http_status_code', 'req_interval', 'compartment_id'], params);
            var oci = new OCI('Autonomous DB', 'Get metrics ' + params['req_interval'] + 'm', params);
            
            const metrics = [
            	'StorageAllocated',
            	'StorageMax',
            	'StorageUsed',
            	['StorageUtilization', 'mean']
            ];
            buildMql(params['db_id'], metrics, 'max');
            
            var result = {};
            for (var i = 0, metricsLength = metrics.length; i < metricsLength; i++) {
            	result[metrics[i][0]] = oci.extractData('post', oci.executeRequest('post', '/20180401/metrics/actions/summarizeMetricsData', '?compartmentId=' + encodeURIComponent(params['compartment_id']), metrics[i][0] + metrics[i][1] + '()', 'oci_autonomous_database'), 'aggregatedDatapoints');
            }
            return JSON.stringify(result);
          description: 'Gets all storage metrics related to a specific database that have a collection frequency of 60 minutes.'
          timeout: 30s
          parameters:
            - name: api_host
              value: '{$OCI.API.TELEMETRY.HOST}'
            - name: compartment_id
              value: '{$OCI.AUTONOMOUS.DB.COMPARTMENT.ID}'
            - name: db_id
              value: '{$OCI.AUTONOMOUS.DB.ID}'
            - name: fingerprint
              value: '{$OCI.API.FINGERPRINT}'
            - name: http_proxy
              value: '{$OCI.HTTP.PROXY}'
            - name: http_status_code
              value: '{$OCI.HTTP.RETURN.CODE.OK}'
            - name: private_key
              value: '{$OCI.API.PRIVATE.KEY}'
            - name: req_interval
              value: '60'
            - name: tenancy_ocid
              value: '{$OCI.API.TENANCY}'
            - name: user_ocid
              value: '{$OCI.API.USER}'
          tags:
            - tag: component
              value: raw
        - uuid: 8ca09dafd8a744489ac122d995367a76
          name: 'Parse count (failures)'
          type: DEPENDENT
          key: oci.aut.db.parse.count.failed
          description: 'The number of parse failures during the selected time interval.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.ParseFailureCount
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: oci.aut.db.metrics.frequent.get
          tags:
            - tag: component
              value: environment
        - uuid: 0f052e0dd75d4ae190c3b87581e29136
          name: 'Parse count (hard)'
          type: DEPENDENT
          key: oci.aut.db.parse.count.hard
          description: |
            The number of parse calls (real parses) during the selected time interval.
            A hard parse is an expensive operation in terms of memory use as it requires Oracle to allocate a
            workheap and other memory structures and then build a parse tree.
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.HardParseCount
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: oci.aut.db.metrics.frequent.get
          tags:
            - tag: component
              value: environment
        - uuid: d5097f4c85ee40608ca8096f1d5f81c1
          name: 'Parse count (total)'
          type: DEPENDENT
          key: oci.aut.db.parse.count.total
          description: 'The number of hard and soft parses during the selected time interval.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.ParseCount
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: oci.aut.db.metrics.frequent.get
          tags:
            - tag: component
              value: environment
        - uuid: db1b10f32442428b89a0437176b94906
          name: 'Physical read total bytes'
          type: DEPENDENT
          key: oci.aut.db.physical.read.bytes
          units: B
          description: |
            The size in bytes of disk reads by all database instance activity including
            application reads, backup and recovery, and other utilities during the selected time interval.
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.PhysicalReadTotalBytes
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: oci.aut.db.metrics.frequent.get
          tags:
            - tag: component
              value: environment
        - uuid: a0e9f2b67c364a8baecc611ff1637399
          name: 'Physical reads'
          type: DEPENDENT
          key: oci.aut.db.physical.reads
          description: 'The number of data blocks read from disk during the selected time interval.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.PhysicalReads
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: oci.aut.db.metrics.frequent.get
          tags:
            - tag: component
              value: environment
        - uuid: 81f85ed2baa44bb3a0b05255cc866c3e
          name: 'Physical write total bytes'
          type: DEPENDENT
          key: oci.aut.db.physical.write.bytes
          units: B
          description: |
            The size in bytes of all disk writes for the database instance including
            application activity, backup and recovery, and other utilities during the selected time interval.
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.PhysicalWriteTotalBytes
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: oci.aut.db.metrics.frequent.get
          tags:
            - tag: component
              value: environment
        - uuid: 2b9998f8dd7d493496146d10fff0a5ee
          name: 'Physical writes'
          type: DEPENDENT
          key: oci.aut.db.physical.writes
          description: 'The number of data blocks written to disk during the selected time interval.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.PhysicalWrites
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: oci.aut.db.metrics.frequent.get
          tags:
            - tag: component
              value: environment
        - uuid: 2acac07f1c30472a84b8864a6cfa7985
          name: 'Queued statements'
          type: DEPENDENT
          key: oci.aut.db.queued.statements
          description: 'The number of queued SQL statements aggregated across all consumer groups during the selected time interval.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.QueuedStatements
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: oci.aut.db.metrics.frequent.get
          tags:
            - tag: component
              value: environment
        - uuid: 0f79764cca3f45688d79bb79c762ef99
          name: 'Redo generated'
          type: DEPENDENT
          key: oci.aut.db.redo.gen
          description: 'Amount of redo generated in bytes during the selected time interval.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.RedoGenerated
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: oci.aut.db.metrics.frequent.get
          tags:
            - tag: component
              value: environment
        - uuid: 11ca43167a374fe99eab91817957a3fb
          name: Sessions
          type: DEPENDENT
          key: oci.aut.db.sessions
          description: 'The number of sessions in the database.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.Sessions
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: oci.aut.db.metrics.frequent.get
          tags:
            - tag: component
              value: environment
        - uuid: a71a6114736f4ce89425ed8de504140d
          name: 'Bytes received via SQL*Net from client'
          type: DEPENDENT
          key: oci.aut.db.sqlnet.bytes.recv.client
          units: B
          description: 'The number of bytes received from the client over Oracle Net Services during the selected time interval.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.SQLNetBytesFromClient
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: oci.aut.db.metrics.frequent.get
          tags:
            - tag: component
              value: environment
        - uuid: a1555ae851e1432c94169e430a782c7d
          name: 'Bytes received via SQL*Net from DBLink'
          type: DEPENDENT
          key: oci.aut.db.sqlnet.bytes.recv.dblink
          units: B
          description: 'The number of bytes received from a database link over Oracle Net Services during the selected time interval.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.SQLNetBytesFromDBLink
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: oci.aut.db.metrics.frequent.get
          tags:
            - tag: component
              value: environment
        - uuid: 35cdcf2b736745708910f2389a64670d
          name: 'Bytes sent via SQL*Net to client'
          type: DEPENDENT
          key: oci.aut.db.sqlnet.bytes.sent.client
          units: B
          description: 'The number of bytes sent to the client from the foreground processes during the selected time interval.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.SQLNetBytesToClient
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: oci.aut.db.metrics.frequent.get
          tags:
            - tag: component
              value: environment
        - uuid: 5cc3975e76a842b89a7c6d2ac5108b8c
          name: 'Bytes sent via SQL*Net to DBLink'
          type: DEPENDENT
          key: oci.aut.db.sqlnet.bytes.sent.dblink
          units: B
          description: 'The number of bytes sent over a database link during the selected time interval.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.SQLNetBytesToDBLink
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: oci.aut.db.metrics.frequent.get
          tags:
            - tag: component
              value: environment
        - uuid: 48d69be6970c41fcb110f18e18ff6387
          name: State
          type: SCRIPT
          key: oci.aut.db.state
          params: |
            function validateZabbixParams(requiredParams, allParams) {
            	requiredParams.forEach(function (field) {
            		if (typeof allParams !== 'object' || typeof allParams[field] === 'undefined' || allParams[field] === '') {
            			throw 'Required param is not set: ' + field + '.';
            		}
            	});
            }
            
            function OCI(service, action, params) {
            	this.zabbixLogPrefix = '[ OCI ] [ ' + service + ' ] [ ' + action + ' ]';
            	this.request = new HttpRequest();
            
            	this.hash = function (string) {
            		return sha256(string);
            	};
            
            	this.sign = function (string) {
            		return sign('sha256', params['private_key'], string);
            	};
            
            	this.encode = function (hash) {
            		const hexArr = hash.match(/.{1,2}/g);
            		var uInt8Array = new Uint8Array(hexArr.length);
            		hexArr.forEach(function (hex, idx) {
            			uInt8Array[idx] = parseInt(hex, 16);
            		});
            		return btoa(uInt8Array);
            	};
            
            	this.getDate = function () {
            		const weekdayShortList = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
            		const monthShortList = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'];
            		const today = new Date();
            		return weekdayShortList[today.getUTCDay()] + ', ' + today.getUTCDate() + ' ' + monthShortList[today.getUTCMonth()] + ' ' + today.getUTCFullYear() + ' ' + today.getUTCHours() + ':' + today.getUTCMinutes() + ':' + today.getUTCSeconds() + ' GMT';
            	};
            
            	this.executeRequest = function (httpMethod, apiPath, apiParams, mql, namespace) {
            		var headers = '(request-target) date host';
            		const contentTypeHeader = 'content-type: application/json';
            		const dateHeader = 'date: ' + this.getDate();
            		const hostHeader = 'host: ' + params['api_host'];
            		const requestTarget = '(request-target): ' + httpMethod + ' ' + apiPath + apiParams;
            		var signingString = requestTarget + '\n' + dateHeader + '\n' + hostHeader;
            		var reqHeaders = [contentTypeHeader, dateHeader];
            
            		if (httpMethod === 'post') {
            			var body = JSON.stringify({
            				'namespace': namespace,
            				'query': mql
            			});
            			headers = headers + ' x-content-sha256 content-type content-length';
            			const bodyHeader = 'x-content-sha256: ' + this.encode(this.hash(body));
            			const bodyLengthHeader = 'content-length: ' + body.length;
            			signingString = signingString + '\n' + bodyHeader + '\n' + contentTypeHeader + '\n' + bodyLengthHeader;
            			reqHeaders.push(bodyHeader, bodyLengthHeader);
            		}
            
            		const signature = this.encode(this.sign(signingString));
            
            		reqHeaders.push('Authorization: Signature version="1",keyId="' + params['tenancy_ocid'] + '/' + params['user_ocid'] + '/' + params['fingerprint'] + '",algorithm="rsa-sha256",headers="' + headers + '",signature="' + signature + '"');
            		for (var header = 0, headerLength = reqHeaders.length; header < headerLength; header++) {
            			this.request.addHeader(reqHeaders[header]);
            		}
            
            		if (params['http_proxy']) {
            			this.request.setProxy(params['http_proxy']);
            			Zabbix.log(4, this.zabbixLogPrefix + ' Using http proxy: ' + params['http_proxy']);
            		}
            
            		if (httpMethod === 'post') {
            			var apiRateLimitExceeded = false;
            			do {
            				const response = this.request.post('https://' + params['api_host'] + apiPath + apiParams, body);
            
            				try {
            					if (JSON.parse(response)['code'] === 'TooManyRequests') {
            
            						apiRateLimitExceeded = true;
            						Zabbix.sleep(1000);
            					} else {
            						apiRateLimitExceeded = false;
            					}
            				} catch (error) {
            					Zabbix.log(3, this.zabbixLogPrefix + ' Could not parse the response: ' + JSON.stringify(response));
            					throw 'Could not parse the response. See logs for more information.';
            				}
            			} while (apiRateLimitExceeded);
            		} else {
            			const response = this.request.get('https://' + params['api_host'] + apiPath + apiParams);
            		}
            
            		this.request.clearHeader();
            
            		if (this.request.getStatus() === parseInt(params['http_status_code'])) {
            			return response;
            		} else {
            			Zabbix.log(3, this.zabbixLogPrefix + ' Unexpected HTTP response code: ' + this.request.getStatus());
            			throw 'Unexpected HTTP response code: ' + this.request.getStatus();
            		}
            	};
            
            	this.extractData = function (httpMethod, data, keys, compartment) {
            		try {
            			data = JSON.parse(data);
            		} catch (error) {
            			Zabbix.log(3, this.zabbixLogPrefix + ' Could not parse the received JSON object: ' + data);
            			throw 'Could not parse received JSON object. See logs for more information.';
            		}
            
            		if (typeof keys == 'object') {
            			var returnBuffer = [];
            			for (var dataObj = 0, dataLength = data.length; dataObj < dataLength; dataObj++) {
            
            				var objectBuffer = {};
            				for (var key = 0, keysLength = keys.length; key < keysLength; key++) {
            					if (data[dataObj][keys[key]] || data[dataObj][keys[key]] == null) {
            						objectBuffer[keys[key].match(/^[a-z]+$|[A-Z][a-z]+$/)[0].toLowerCase()] = data[dataObj][keys[key]];
            					} else {
            						Zabbix.log(3, this.zabbixLogPrefix + ' Received an unexpected JSON object. Could not get value for key "' + keys[key] + '" in JSON: ' + JSON.stringify(data[dataObj]));
            						throw 'Received an unexpected JSON object. See logs for more information.';
            					}
            				}
            				if (typeof compartment != 'undefined' && compartment != '') objectBuffer['compartment'] = compartment;
            				returnBuffer.push(objectBuffer);
            			}
            			return returnBuffer;
            		}
            
            		try {
            			if (httpMethod === 'get') {
            				return data[keys];
            			} else {
            				if (data.length === 0) {
            					return 0;
            				}
            				data = data[0][keys];
            				return data[data.length - 1]['value'];
            			}
            		} catch (error) {
            			Zabbix.log(3, this.zabbixLogPrefix + ' Could not find key "' + keys + '" in JSON: ' + JSON.stringify(data));
            			throw 'Could not find required key in JSON object. See logs for more information.';
            		}
            	};
            }
            
            
            const params = JSON.parse(value);
            validateZabbixParams(['tenancy_ocid', 'user_ocid', 'private_key', 'fingerprint', 'api_host', 'db_id', 'http_status_code'], params);
            var oci = new OCI('Autonomous DB', 'Get state', params);
            
            return oci.extractData('get', oci.executeRequest('get', '/20160918/autonomousDatabases/' + encodeURIComponent(params['db_id']), ''), 'lifecycleState');
          description: 'Gets the autonomous database state.'
          valuemap:
            name: 'Autonomous database state'
          preprocessing:
            - type: JAVASCRIPT
              parameters:
                - |
                  const idx = {
                  	'PROVISIONING': 1,
                  	'AVAILABLE': 2,
                  	'STOPPING': 3,
                  	'STOPPED': 4,
                  	'STARTING': 5,
                  	'TERMINATING': 6,
                  	'TERMINATED': 7,
                  	'RESTORE_IN_PROGRESS': 8,
                  	'RESTORE_FAILED': 9,
                  	'BACKUP_IN_PROGRESS': 10,
                  	'SCALE_IN_PROGRESS': 11,
                  	'AVAILABLE_NEEDS_ATTENTION': 12,
                  	'UPDATING': 13,
                  	'MAINTENANCE_IN_PROGRESS': 14,
                  	'RESTARTING': 15,
                  	'RECREATING': 16,
                  	'ROLE_CHANGE_IN_PROGRESS': 17,
                  	'UPGRADING': 18,
                  	'UNAVAILABLE': 19,
                  	'INACCESSIBLE': 20,
                  	'STANDBY': 21
                  };
                  
                  return typeof idx[value] === 'undefined' ? 0 : idx[value];
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          timeout: 10s
          parameters:
            - name: api_host
              value: '{$OCI.API.AUTONOMOUS.DB.HOST}'
            - name: db_id
              value: '{$OCI.AUTONOMOUS.DB.ID}'
            - name: fingerprint
              value: '{$OCI.API.FINGERPRINT}'
            - name: http_proxy
              value: '{$OCI.HTTP.PROXY}'
            - name: http_status_code
              value: '{$OCI.HTTP.RETURN.CODE.OK}'
            - name: private_key
              value: '{$OCI.API.PRIVATE.KEY}'
            - name: tenancy_ocid
              value: '{$OCI.API.TENANCY}'
            - name: user_ocid
              value: '{$OCI.API.USER}'
          tags:
            - tag: component
              value: environment
          triggers:
            - uuid: bb790262359f4e35af895b1a69ad511c
              expression: 'last(/Oracle Cloud Autonomous Database by HTTP/oci.aut.db.state) = 12'
              name: 'OCI Autonomous DB: Available, needs attention'
              priority: WARNING
              description: 'Autonomous database is available, but needs attention.'
              tags:
                - tag: scope
                  value: availability
            - uuid: 18594a88549843c498d0e037f51afc59
              expression: 'last(/Oracle Cloud Autonomous Database by HTTP/oci.aut.db.state) = 19 or last(/Oracle Cloud Autonomous Database by HTTP/oci.aut.db.state) = 20'
              name: 'OCI Autonomous DB: Database is not available or accessible'
              priority: HIGH
              description: 'Autonomous database is not available or accessible.'
              tags:
                - tag: scope
                  value: availability
            - uuid: 4ee1a96f29ef461c8830667e19637911
              expression: 'last(/Oracle Cloud Autonomous Database by HTTP/oci.aut.db.state) = 9'
              name: 'OCI Autonomous DB: Restore has failed'
              priority: WARNING
              description: 'Autonomous database restore has failed.'
              tags:
                - tag: scope
                  value: notice
            - uuid: 783550ed705944259190fb10dae3f5a8
              expression: 'last(/Oracle Cloud Autonomous Database by HTTP/oci.aut.db.state,#1)<>last(/Oracle Cloud Autonomous Database by HTTP/oci.aut.db.state,#2)'
              name: 'OCI Autonomous DB: State has changed'
              event_name: 'OCI Autonomous DB: State has changed (new state: {ITEM.VALUE})'
              opdata: 'Current state: {ITEM.LASTVALUE}'
              priority: INFO
              description: 'Autonomous database state has changed.'
              manual_close: 'YES'
              dependencies:
                - name: 'OCI Autonomous DB: Available, needs attention'
                  expression: 'last(/Oracle Cloud Autonomous Database by HTTP/oci.aut.db.state) = 12'
                - name: 'OCI Autonomous DB: Database is not available or accessible'
                  expression: 'last(/Oracle Cloud Autonomous Database by HTTP/oci.aut.db.state) = 19 or last(/Oracle Cloud Autonomous Database by HTTP/oci.aut.db.state) = 20'
                - name: 'OCI Autonomous DB: Restore has failed'
                  expression: 'last(/Oracle Cloud Autonomous Database by HTTP/oci.aut.db.state) = 9'
                - name: 'OCI Autonomous DB: State unknown'
                  expression: 'last(/Oracle Cloud Autonomous Database by HTTP/oci.aut.db.state) = 0'
              tags:
                - tag: scope
                  value: notice
            - uuid: 2bc79a5a19a544d39c6de861b94564af
              expression: 'last(/Oracle Cloud Autonomous Database by HTTP/oci.aut.db.state) = 0'
              name: 'OCI Autonomous DB: State unknown'
              priority: WARNING
              description: 'Autonomous database state is unknown.'
              tags:
                - tag: scope
                  value: availability
        - uuid: 6111b1843fe94fefbf1ca1d530832d39
          name: 'Running statements'
          type: DEPENDENT
          key: oci.aut.db.statements.running
          value_type: FLOAT
          description: 'The number of running SQL statements aggregated across all consumer groups during the selected time interval.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.RunningStatements
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: oci.aut.db.metrics.frequent.get
          tags:
            - tag: component
              value: environment
        - uuid: 7901279fcb2a4f6285874680ed5f55f5
          name: 'Storage space allocated'
          type: DEPENDENT
          key: oci.aut.db.storage.space.alloc
          value_type: FLOAT
          units: B
          description: 'Amount of space allocated to the database for all tablespaces during the selected time interval.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.StorageAllocated
            - type: MULTIPLIER
              parameters:
                - '1073741824'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 12h
          master_item:
            key: oci.aut.db.metrics.storage.stats
          tags:
            - tag: component
              value: storage
        - uuid: 9dd27df012b24019ad2562822b471a25
          name: 'Maximum storage space'
          type: DEPENDENT
          key: oci.aut.db.storage.space.max
          value_type: FLOAT
          units: B
          description: 'Maximum amount of storage reserved for the database during the selected time interval.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.StorageMax
            - type: MULTIPLIER
              parameters:
                - '1073741824'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 12h
          master_item:
            key: oci.aut.db.metrics.storage.stats
          tags:
            - tag: component
              value: storage
        - uuid: e5378b6a3d33462eb4f3ed6228532d10
          name: 'Storage space used'
          type: DEPENDENT
          key: oci.aut.db.storage.space.used
          value_type: FLOAT
          units: B
          description: 'Maximum amount of space used during the selected time interval.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.StorageUsed
            - type: MULTIPLIER
              parameters:
                - '1073741824'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 12h
          master_item:
            key: oci.aut.db.metrics.storage.stats
          tags:
            - tag: component
              value: storage
        - uuid: 5cad114ed74341199a4d3ef17c9acd8e
          name: 'Storage utilization, in %'
          type: DEPENDENT
          key: oci.aut.db.storage.space.util
          value_type: FLOAT
          units: '%'
          description: |
            The percentage of the reserved maximum storage currently allocated for all database tablespaces.
            Represents the total reserved space for all tablespaces.
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.StorageUtilization
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 12h
          master_item:
            key: oci.aut.db.metrics.storage.stats
          tags:
            - tag: component
              value: storage
          triggers:
            - uuid: 37bb41d830424ba2871e768957225add
              expression: 'min(/Oracle Cloud Autonomous Database by HTTP/oci.aut.db.storage.space.util,5m) >= {$OCI.AUTONOMOUS.DB.STORAGE.UTIL.WARN}'
              name: 'OCI Autonomous DB: Current storage utilization is high'
              event_name: 'OCI Autonomous DB: Current storage utilization is high (util >= {$OCI.AUTONOMOUS.DB.STORAGE.UTIL.WARN}%)'
              opdata: 'Current: {ITEM.LASTVALUE1}'
              priority: WARNING
              description: 'Current storage utilization has exceeded `{$OCI.AUTONOMOUS.DB.STORAGE.UTIL.WARN}`% of the max available value.'
              dependencies:
                - name: 'OCI Autonomous DB: Current storage utilization is too high'
                  expression: 'min(/Oracle Cloud Autonomous Database by HTTP/oci.aut.db.storage.space.util,5m) >= {$OCI.AUTONOMOUS.DB.STORAGE.UTIL.HIGH}'
              tags:
                - tag: scope
                  value: capacity
            - uuid: 8e16451106094713abaa624967026dc3
              expression: 'min(/Oracle Cloud Autonomous Database by HTTP/oci.aut.db.storage.space.util,5m) >= {$OCI.AUTONOMOUS.DB.STORAGE.UTIL.HIGH}'
              name: 'OCI Autonomous DB: Current storage utilization is too high'
              event_name: 'OCI Autonomous DB: Current storage utilization is too high (util >= {$OCI.AUTONOMOUS.DB.STORAGE.UTIL.HIGH}%)'
              opdata: 'Current: {ITEM.LASTVALUE1}'
              priority: HIGH
              description: 'Current storage utilization has exceeded `{$OCI.AUTONOMOUS.DB.STORAGE.UTIL.HIGH}`% of the max available value.'
              tags:
                - tag: scope
                  value: capacity
        - uuid: 3455978b6e2a4291984bf1e7c95551e1
          name: 'DB time'
          type: DEPENDENT
          key: oci.aut.db.time
          value_type: FLOAT
          description: |
            The amount of time database user sessions spend executing database code (CPU time + wait time).
            Database time is used to infer database call latency as it increases in direct proportion
            to both database call latency (response time) and call volume.
            
            It is calculated as the average rate of accumulation of database time by foreground sessions in
            the database over the selected time interval.
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.DBTime
            - type: JAVASCRIPT
              parameters:
                - 'return Math.round(value * 100) / 100;'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: oci.aut.db.metrics.frequent.get
          tags:
            - tag: component
              value: environment
        - uuid: 35995e92de8e45b0a8493bc285ccd0c8
          name: 'Transaction count'
          type: DEPENDENT
          key: oci.aut.db.transaction.count
          description: 'The combined number of user commits and user rollbacks during the selected time interval.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.TransactionCount
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: oci.aut.db.metrics.frequent.get
          tags:
            - tag: component
              value: environment
        - uuid: 3e1cd8b4c829451499d605512e1a1bf0
          name: 'User calls'
          type: DEPENDENT
          key: oci.aut.db.user.calls
          description: 'The combined number of logons, parses, and execute calls during the selected time interval.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.UserCalls
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: oci.aut.db.metrics.frequent.get
          tags:
            - tag: component
              value: environment
        - uuid: 0cda6a956ca1476da28083cfc6de8bcc
          name: 'User commits'
          type: DEPENDENT
          key: oci.aut.db.user.commits
          description: |
            The number of user commits during the selected time interval.
            When a user commits a transaction, the generated redo that reflects the changes made to database
            blocks must be written to disk. Commits often represent the closest thing to a user transaction rate.
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.UserCommits
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: oci.aut.db.metrics.frequent.get
          tags:
            - tag: component
              value: environment
        - uuid: 99292418f1764484b1cda27b70af84cc
          name: 'User rollbacks'
          type: DEPENDENT
          key: oci.aut.db.user.rollbacks
          description: |
            Number of times users manually issue the `ROLLBACK` statement or an error occurs during a user's
            transactions during the selected time interval.
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.UserRollbacks
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: oci.aut.db.metrics.frequent.get
          tags:
            - tag: component
              value: environment
        - uuid: 8f627c48a0a94e41ad1b66d7a4817898
          name: 'Wait time'
          type: DEPENDENT
          key: oci.aut.db.wait.time
          value_type: FLOAT
          description: |
            Average rate of accumulation of non-idle wait time by foreground sessions in the database over the selected
            time interval.
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.WaitTime
            - type: JAVASCRIPT
              parameters:
                - 'return Math.round(value * 100) / 100;'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: oci.aut.db.metrics.frequent.get
          tags:
            - tag: component
              value: environment
      tags:
        - tag: class
          value: cloud
        - tag: class
          value: database
        - tag: subclass
          value: automation
        - tag: subclass
          value: bigdata
        - tag: subclass
          value: deploy
        - tag: target
          value: oci
        - tag: target
          value: oracle-cloud-infrastructure
      macros:
        - macro: '{$OCI.AUTONOMOUS.DB.CPU.UTIL.HIGH}'
          value: '90'
          description: 'Sets the percentage threshold for creating a "high" severity event about CPU resource utilization.'
        - macro: '{$OCI.AUTONOMOUS.DB.CPU.UTIL.WARN}'
          value: '75'
          description: 'Sets the percentage threshold for creating a "warning" severity event about CPU resource utilization.'
        - macro: '{$OCI.AUTONOMOUS.DB.STORAGE.UTIL.HIGH}'
          value: '90'
          description: 'Sets the percentage threshold for creating a "high" severity event about storage resource utilization.'
        - macro: '{$OCI.AUTONOMOUS.DB.STORAGE.UTIL.WARN}'
          value: '75'
          description: 'Sets the percentage threshold for creating a "warning" severity event about storage resource utilization.'
        - macro: '{$OCI.HTTP.PROXY}'
          description: 'Set an HTTP proxy for OCI API requests if needed.'
        - macro: '{$OCI.HTTP.RETURN.CODE.OK}'
          value: '200'
          description: 'Set the HTTP return code that represents an OK response from the API. The default is "200",  but can vary, for example, if a proxy is used.'
      dashboards:
        - uuid: 26fb1668002c42e2b311eaef5850f2ad
          name: 'OCI Autonomous DB: Overview'
          pages:
            - name: Main
              display_period: '30'
              widgets:
                - type: item
                  name: State
                  width: '27'
                  height: '4'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: 6C00D9
                    - type: STRING
                      name: description
                      value: 'Current State'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Autonomous Database by HTTP'
                        key: oci.aut.db.state
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: INTEGER
                      name: units_show
                      value: '0'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                    - type: INTEGER
                      name: value_size
                      value: '35'
                - type: graph
                  name: 'CPU utilization'
                  'y': '4'
                  width: '21'
                  height: '7'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Oracle Cloud Autonomous Database by HTTP'
                        name: 'OCI Autonomous DB: CPU utilization'
                    - type: STRING
                      name: reference
                      value: AAAAA
                - type: graph
                  name: 'Storage stats'
                  x: '21'
                  'y': '4'
                  width: '21'
                  height: '7'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Oracle Cloud Autonomous Database by HTTP'
                        name: 'OCI Autonomous DB: Storage stats'
                    - type: STRING
                      name: reference
                      value: AAAAB
                - type: item
                  name: Availability
                  x: '27'
                  width: '15'
                  height: '4'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: 6C00D9
                    - type: STRING
                      name: description
                      value: Availability
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Autonomous Database by HTTP'
                        key: oci.aut.db.availability
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: INTEGER
                      name: units_show
                      value: '0'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                    - type: INTEGER
                      name: value_size
                      value: '20'
                - type: item
                  name: 'Connection latency'
                  x: '42'
                  width: '30'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: 6C00D9
                    - type: INTEGER
                      name: decimal_size
                      value: '60'
                    - type: STRING
                      name: description
                      value: 'Connection latency'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_size
                      value: '30'
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Autonomous Database by HTTP'
                        key: oci.aut.db.latency.conn
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '40'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                    - type: INTEGER
                      name: value_size
                      value: '60'
                - type: gauge
                  name: 'CPU utilization'
                  x: '42'
                  'y': '2'
                  width: '15'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: 2196F3
                    - type: STRING
                      name: description
                      value: CPU
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: STRING
                      name: empty_color
                      value: 145C96
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Autonomous Database by HTTP'
                        key: oci.aut.db.cpu.util
                    - type: INTEGER
                      name: rf_rate
                      value: '30'
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: INTEGER
                      name: show.2
                      value: '5'
                    - type: STRING
                      name: units
                      value: '%'
                    - type: INTEGER
                      name: units_bold
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: STRING
                      name: value_arc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: value_arc_size
                      value: '35'
                    - type: INTEGER
                      name: value_bold
                      value: '1'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: item
                  name: Sessions
                  x: '42'
                  'y': '5'
                  width: '15'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: FBC02D
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: Sessions
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Autonomous Database by HTTP'
                        key: oci.aut.db.sessions
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: item
                  name: 'Running statements'
                  x: '42'
                  'y': '8'
                  width: '15'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: FBC02D
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'Running Statements'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Autonomous Database by HTTP'
                        key: oci.aut.db.statements.running
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: gauge
                  name: 'Storage utilization'
                  x: '57'
                  'y': '2'
                  width: '15'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: 00D936
                    - type: STRING
                      name: description
                      value: 'Storage Utilization'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: STRING
                      name: empty_color
                      value: 00701c
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Autonomous Database by HTTP'
                        key: oci.aut.db.storage.space.util
                    - type: INTEGER
                      name: rf_rate
                      value: '30'
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: INTEGER
                      name: show.2
                      value: '5'
                    - type: STRING
                      name: units
                      value: '%'
                    - type: INTEGER
                      name: units_bold
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: STRING
                      name: value_arc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: value_arc_size
                      value: '35'
                    - type: INTEGER
                      name: value_bold
                      value: '1'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: item
                  name: 'Execute count'
                  x: '57'
                  'y': '5'
                  width: '15'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: FBC02D
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'Execute Count'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Autonomous Database by HTTP'
                        key: oci.aut.db.exec.count
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: item
                  name: 'Queued statements'
                  x: '57'
                  'y': '8'
                  width: '15'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: FBC02D
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'Queued Statements'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Autonomous Database by HTTP'
                        key: oci.aut.db.queued.statements
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
            - name: CPU
              display_period: '30'
              widgets:
                - type: gauge
                  name: 'CPU utilization'
                  width: '36'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: 2196F3
                    - type: STRING
                      name: description
                      value: CPU
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: STRING
                      name: empty_color
                      value: 145C96
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Autonomous Database by HTTP'
                        key: oci.aut.db.cpu.util
                    - type: INTEGER
                      name: rf_rate
                      value: '30'
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: INTEGER
                      name: show.2
                      value: '5'
                    - type: STRING
                      name: units
                      value: '%'
                    - type: INTEGER
                      name: units_bold
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: STRING
                      name: value_arc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: value_arc_size
                      value: '35'
                    - type: INTEGER
                      name: value_bold
                      value: '1'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: graph
                  name: 'CPU utilization'
                  'y': '3'
                  width: '36'
                  height: '8'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Oracle Cloud Autonomous Database by HTTP'
                        name: 'OCI Autonomous DB: CPU utilization'
                    - type: STRING
                      name: reference
                      value: ABAAA
                - type: gauge
                  name: 'CPU time'
                  x: '36'
                  width: '36'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: 2196F3
                    - type: STRING
                      name: description
                      value: 'CPU Time'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: STRING
                      name: empty_color
                      value: 145C96
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Autonomous Database by HTTP'
                        key: oci.aut.db.cpu.util
                    - type: INTEGER
                      name: rf_rate
                      value: '30'
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: INTEGER
                      name: show.2
                      value: '5'
                    - type: STRING
                      name: units
                      value: '%'
                    - type: INTEGER
                      name: units_bold
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: STRING
                      name: value_arc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: value_arc_size
                      value: '35'
                    - type: INTEGER
                      name: value_bold
                      value: '1'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: graph
                  name: 'CPU time'
                  x: '36'
                  'y': '3'
                  width: '36'
                  height: '8'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Oracle Cloud Autonomous Database by HTTP'
                        name: 'OCI Autonomous DB: CPU time'
                    - type: STRING
                      name: reference
                      value: ABAAB
            - name: Storage
              display_period: '30'
              widgets:
                - type: gauge
                  name: 'Storage utilization'
                  width: '18'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: 00D936
                    - type: STRING
                      name: description
                      value: 'Storage Utilization'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: STRING
                      name: empty_color
                      value: 00701c
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Autonomous Database by HTTP'
                        key: oci.aut.db.storage.space.util
                    - type: INTEGER
                      name: rf_rate
                      value: '30'
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: INTEGER
                      name: show.2
                      value: '5'
                    - type: STRING
                      name: units
                      value: '%'
                    - type: INTEGER
                      name: units_bold
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: STRING
                      name: value_arc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: value_arc_size
                      value: '35'
                    - type: INTEGER
                      name: value_bold
                      value: '1'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: graph
                  name: 'Storage utilization'
                  'y': '3'
                  width: '18'
                  height: '8'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Oracle Cloud Autonomous Database by HTTP'
                        name: 'OCI Autonomous DB: Storage utilization'
                    - type: STRING
                      name: reference
                      value: ACAAA
                - type: item
                  name: 'Max storage space'
                  x: '18'
                  width: '18'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: 00D936
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'Max storage space'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Autonomous Database by HTTP'
                        key: oci.aut.db.storage.space.max
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: graph
                  name: 'Storage stats'
                  x: '18'
                  'y': '3'
                  width: '54'
                  height: '8'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Oracle Cloud Autonomous Database by HTTP'
                        name: 'OCI Autonomous DB: Storage stats'
                    - type: STRING
                      name: reference
                      value: ACAAB
                - type: item
                  name: 'Allocated Storage Space'
                  x: '36'
                  width: '18'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: 00D936
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'Allocated Storage Space'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Autonomous Database by HTTP'
                        key: oci.aut.db.storage.space.alloc
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: item
                  name: 'Used storage space'
                  x: '54'
                  width: '18'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: 00D936
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'Used Storage Space'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Autonomous Database by HTTP'
                        key: oci.aut.db.storage.space.used
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
            - name: Read/Writes
              display_period: '30'
              widgets:
                - type: item
                  name: 'Physical reads'
                  width: '15'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: 00D936
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'Physical Reads'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Autonomous Database by HTTP'
                        key: oci.aut.db.physical.reads
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: graph
                  name: Read/writes
                  'y': '3'
                  width: '27'
                  height: '8'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Oracle Cloud Autonomous Database by HTTP'
                        name: 'OCI Autonomous DB: Physical reads/writes'
                    - type: STRING
                      name: reference
                      value: ADAAA
                - type: item
                  name: 'Physical writes'
                  x: '15'
                  width: '12'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: 00D936
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'Physical Writes'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Autonomous Database by HTTP'
                        key: oci.aut.db.physical.writes
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: item
                  name: 'Physical read total bytes'
                  x: '27'
                  width: '15'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: 00D936
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'Physical Read Total Bytes'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Autonomous Database by HTTP'
                        key: oci.aut.db.physical.read.bytes
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: graph
                  name: 'Physical total read/write bytes'
                  x: '27'
                  'y': '3'
                  width: '27'
                  height: '8'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Oracle Cloud Autonomous Database by HTTP'
                        name: 'OCI Autonomous DB: Physical read/write total bytes'
                    - type: STRING
                      name: reference
                      value: ADAAB
                - type: item
                  name: 'Physical write total bytes'
                  x: '42'
                  width: '12'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: 00D936
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'Physical Write Total Bytes'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Autonomous Database by HTTP'
                        key: oci.aut.db.physical.write.bytes
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: item
                  name: 'Logical reads session'
                  x: '54'
                  width: '18'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: 00D936
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'Logical Reads Session'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Autonomous Database by HTTP'
                        key: oci.aut.db.logical.reads.session
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: graph
                  name: 'Logical reads session'
                  x: '54'
                  'y': '3'
                  width: '18'
                  height: '8'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Oracle Cloud Autonomous Database by HTTP'
                        name: 'OCI Autonomous DB: Session logical reads'
                    - type: STRING
                      name: reference
                      value: ADAAC
                    - type: INTEGER
                      name: show_legend
                      value: '0'
            - name: Sessions
              display_period: '30'
              widgets:
                - type: item
                  name: Sessions
                  width: '15'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: FBC02D
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: STRING
                      name: description
                      value: Sessions
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Autonomous Database by HTTP'
                        key: oci.aut.db.sessions
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: item
                  name: 'Failed connections'
                  'y': '3'
                  width: '15'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: FF0000
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: STRING
                      name: description
                      value: 'Failed Connections'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Autonomous Database by HTTP'
                        key: oci.aut.db.conn.failed
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: graph
                  name: 'Session stats'
                  'y': '6'
                  width: '30'
                  height: '5'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Oracle Cloud Autonomous Database by HTTP'
                        name: 'OCI Autonomous DB: Session stats'
                    - type: STRING
                      name: reference
                      value: AEAAA
                - type: item
                  name: Logons
                  x: '15'
                  width: '15'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: FBC02D
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: STRING
                      name: description
                      value: Logons
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Autonomous Database by HTTP'
                        key: oci.aut.db.logons
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: item
                  name: 'Failed logons'
                  x: '15'
                  'y': '3'
                  width: '15'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: FF0000
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: STRING
                      name: description
                      value: 'Failed Logons'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Autonomous Database by HTTP'
                        key: oci.aut.db.logons.failed
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: item
                  name: 'Wait time'
                  x: '30'
                  width: '15'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: FBC02D
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'Wait Time'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Autonomous Database by HTTP'
                        key: oci.aut.db.wait.time
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: graph
                  name: 'Wait time'
                  x: '30'
                  'y': '3'
                  width: '15'
                  height: '8'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Oracle Cloud Autonomous Database by HTTP'
                        name: 'OCI Autonomous DB: Wait time'
                    - type: STRING
                      name: reference
                      value: AEAAB
                    - type: INTEGER
                      name: show_legend
                      value: '0'
                - type: item
                  name: 'DB time'
                  x: '45'
                  width: '15'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: FBC02D
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'DB Time'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Autonomous Database by HTTP'
                        key: oci.aut.db.time
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: graph
                  name: 'DB time'
                  x: '45'
                  'y': '3'
                  width: '15'
                  height: '8'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Oracle Cloud Autonomous Database by HTTP'
                        name: 'OCI Autonomous DB: DB time'
                    - type: STRING
                      name: reference
                      value: AEAAC
                    - type: INTEGER
                      name: show_legend
                      value: '0'
                - type: item
                  name: 'Connection latency'
                  x: '60'
                  width: '12'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: FBC02D
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'Connection Latency'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Autonomous Database by HTTP'
                        key: oci.aut.db.latency.conn
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: graph
                  name: 'Connection latency'
                  x: '60'
                  'y': '3'
                  width: '12'
                  height: '8'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Oracle Cloud Autonomous Database by HTTP'
                        name: 'OCI Autonomous DB: Connection latency'
                    - type: STRING
                      name: reference
                      value: AEAAD
                    - type: INTEGER
                      name: show_legend
                      value: '0'
            - name: Users
              display_period: '30'
              widgets:
                - type: item
                  name: 'User calls'
                  width: '18'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: FBC02D
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: STRING
                      name: description
                      value: 'User Calls'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Autonomous Database by HTTP'
                        key: oci.aut.db.user.calls
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: graph
                  name: 'User calls'
                  'y': '3'
                  width: '18'
                  height: '8'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Oracle Cloud Autonomous Database by HTTP'
                        name: 'OCI Autonomous DB: User calls'
                    - type: STRING
                      name: reference
                      value: AFAAA
                - type: item
                  name: 'User commits'
                  x: '18'
                  width: '18'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: FBC02D
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: STRING
                      name: description
                      value: 'User Commits'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Autonomous Database by HTTP'
                        key: oci.aut.db.user.commits
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: graph
                  name: 'User commits'
                  x: '18'
                  'y': '3'
                  width: '18'
                  height: '8'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Oracle Cloud Autonomous Database by HTTP'
                        name: 'OCI Autonomous DB: User commits'
                    - type: STRING
                      name: reference
                      value: AFAAB
                - type: item
                  name: 'User rollbacks'
                  x: '36'
                  width: '18'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: FBC02D
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: STRING
                      name: description
                      value: 'User Rollbacks'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Autonomous Database by HTTP'
                        key: oci.aut.db.user.rollbacks
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: graph
                  name: 'User rollbacks'
                  x: '36'
                  'y': '3'
                  width: '18'
                  height: '8'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Oracle Cloud Autonomous Database by HTTP'
                        name: 'OCI Autonomous DB: User rollbacks'
                    - type: STRING
                      name: reference
                      value: AFAAC
                - type: item
                  name: 'Execute count'
                  x: '54'
                  width: '18'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: FBC02D
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: STRING
                      name: description
                      value: 'Execute Count'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Autonomous Database by HTTP'
                        key: oci.aut.db.exec.count
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: graph
                  name: 'Execute count'
                  x: '54'
                  'y': '3'
                  width: '18'
                  height: '8'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Oracle Cloud Autonomous Database by HTTP'
                        name: 'OCI Autonomous DB: Execute count'
                    - type: STRING
                      name: reference
                      value: AFAAD
            - name: Parses
              display_period: '30'
              widgets:
                - type: item
                  name: 'Parse count (hard)'
                  width: '24'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: 2196F3
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: STRING
                      name: description
                      value: 'Parse Count (Hard)'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Autonomous Database by HTTP'
                        key: oci.aut.db.parse.count.hard
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: graph
                  name: 'Parse count (hard)'
                  'y': '3'
                  width: '24'
                  height: '8'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Oracle Cloud Autonomous Database by HTTP'
                        name: 'OCI Autonomous DB: Parse count hard'
                    - type: STRING
                      name: reference
                      value: AGAAA
                - type: item
                  name: 'Parse count (failures)'
                  x: '24'
                  width: '24'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: 2196F3
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: STRING
                      name: description
                      value: 'Parse Count (Failures)'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Autonomous Database by HTTP'
                        key: oci.aut.db.parse.count.failed
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: graph
                  name: 'Parse count (failures)'
                  x: '24'
                  'y': '3'
                  width: '24'
                  height: '8'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Oracle Cloud Autonomous Database by HTTP'
                        name: 'OCI Autonomous DB: Parse count failures'
                    - type: STRING
                      name: reference
                      value: AGAAB
                - type: item
                  name: 'Parse count (total)'
                  x: '48'
                  width: '24'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: 2196F3
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: STRING
                      name: description
                      value: 'Parse Count (Total)'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Autonomous Database by HTTP'
                        key: oci.aut.db.parse.count.total
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: graph
                  name: 'Parse count (total)'
                  x: '48'
                  'y': '3'
                  width: '24'
                  height: '8'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Oracle Cloud Autonomous Database by HTTP'
                        name: 'OCI Autonomous DB: Parse count total'
                    - type: STRING
                      name: reference
                      value: AGAAC
            - name: 'SQL*Net'
              display_period: '30'
              widgets:
                - type: item
                  name: 'Bytes received from client'
                  width: '18'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: 2196F3
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: STRING
                      name: description
                      value: 'Bytes Received From Client'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Autonomous Database by HTTP'
                        key: oci.aut.db.sqlnet.bytes.recv.client
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: graph
                  name: 'SQL*Net client bytes'
                  'y': '3'
                  width: '36'
                  height: '8'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Oracle Cloud Autonomous Database by HTTP'
                        name: 'OCI Autonomous DB: SQL*Net client bytes'
                    - type: STRING
                      name: reference
                      value: AHAAA
                - type: item
                  name: 'Bytes sent to client'
                  x: '18'
                  width: '18'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: 2196F3
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: STRING
                      name: description
                      value: 'Bytes Sent To Client'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Autonomous Database by HTTP'
                        key: oci.aut.db.sqlnet.bytes.sent.client
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: item
                  name: 'Bytes received from DBLink'
                  x: '36'
                  width: '18'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: 2196F3
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: STRING
                      name: description
                      value: 'Bytes Received From DBLink'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Autonomous Database by HTTP'
                        key: oci.aut.db.sqlnet.bytes.recv.dblink
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: graph
                  name: 'SQL*Net DBLink bytes'
                  x: '36'
                  'y': '3'
                  width: '36'
                  height: '8'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Oracle Cloud Autonomous Database by HTTP'
                        name: 'OCI Autonomous DB: SQL*Net DBLink bytes'
                    - type: STRING
                      name: reference
                      value: AHAAB
                - type: item
                  name: 'Bytes sent to DBLink'
                  x: '54'
                  width: '18'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: 2196F3
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: STRING
                      name: description
                      value: 'Bytes Sent To DBLink'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Autonomous Database by HTTP'
                        key: oci.aut.db.sqlnet.bytes.sent.dblink
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
            - name: 'DB Calls'
              display_period: '30'
              widgets:
                - type: item
                  name: 'Query latency'
                  width: '21'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: 6C00D9
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: STRING
                      name: description
                      value: 'Query Latency'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Autonomous Database by HTTP'
                        key: oci.aut.db.latency.query
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: graph
                  name: 'Query latency'
                  'y': '3'
                  width: '21'
                  height: '8'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Oracle Cloud Autonomous Database by HTTP'
                        name: 'OCI Autonomous DB: Query latency'
                    - type: STRING
                      name: reference
                      value: AIAAA
                - type: item
                  name: 'Running statements'
                  x: '21'
                  width: '12'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: FBC02D
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: STRING
                      name: description
                      value: 'Running Statements'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Autonomous Database by HTTP'
                        key: oci.aut.db.statements.running
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: graph
                  name: Statements
                  x: '21'
                  'y': '3'
                  width: '36'
                  height: '8'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Oracle Cloud Autonomous Database by HTTP'
                        name: 'OCI Autonomous DB: Statements'
                    - type: STRING
                      name: reference
                      value: AIAAB
                - type: item
                  name: 'Queued statements'
                  x: '33'
                  width: '12'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: FBC02D
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: STRING
                      name: description
                      value: 'Queued Statements'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Autonomous Database by HTTP'
                        key: oci.aut.db.queued.statements
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: item
                  name: 'Transaction count'
                  x: '45'
                  width: '12'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: FBC02D
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: STRING
                      name: description
                      value: 'Transaction Count'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Autonomous Database by HTTP'
                        key: oci.aut.db.transaction.count
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: item
                  name: 'DB block changes'
                  x: '57'
                  width: '15'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: FBC02D
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: STRING
                      name: description
                      value: 'DB Block Changes'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Autonomous Database by HTTP'
                        key: oci.aut.db.block.changes
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: item
                  name: 'Redo generated'
                  x: '57'
                  'y': '3'
                  width: '15'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: FBC02D
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: STRING
                      name: description
                      value: 'Redo Generated'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Autonomous Database by HTTP'
                        key: oci.aut.db.redo.gen
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
      valuemaps:
        - uuid: e336c0d4e22f4f9f9c42d6de65fed068
          name: 'Autonomous database state'
          mappings:
            - value: '0'
              newvalue: Unknown
            - value: '1'
              newvalue: Provisioning
            - value: '2'
              newvalue: Available
            - value: '3'
              newvalue: Stopping
            - value: '4'
              newvalue: Stopped
            - value: '5'
              newvalue: Starting
            - value: '6'
              newvalue: Terminating
            - value: '7'
              newvalue: Terminated
            - value: '8'
              newvalue: 'Restore in progress'
            - value: '9'
              newvalue: 'Restore failed'
            - value: '10'
              newvalue: 'Backup in progress'
            - value: '11'
              newvalue: 'Scale in progress'
            - value: '12'
              newvalue: 'Available needs attention'
            - value: '13'
              newvalue: Updating
            - value: '14'
              newvalue: 'Maintenance in progress'
            - value: '15'
              newvalue: Restarting
            - value: '16'
              newvalue: Recreating
            - value: '17'
              newvalue: 'Role change in progress'
            - value: '18'
              newvalue: Upgrading
            - value: '19'
              newvalue: Unavailable
            - value: '20'
              newvalue: Inaccessible
            - value: '21'
              newvalue: Standby
        - uuid: 3b30e8a71ef342e78f9f29243aafd992
          name: 'Database availability'
          mappings:
            - value: '0'
              newvalue: Unavailable
            - value: '1'
              newvalue: Available
    - uuid: 8afa1796d280425b99c7ea36900dac24
      template: 'Oracle Cloud Block Volume by HTTP'
      name: 'Oracle Cloud Block Volume by HTTP'
      description: |
        This template monitors Oracle Cloud Infrastructure (OCI) block volume resources.
        
        This template is not meant to be used independently, but together with Oracle Cloud by HTTP as a template for
        LLD host prototypes.
        
        Read the template documentation prior to using this template.
        
        You can discuss this template or leave feedback on our forum https://www.zabbix.com/forum/zabbix-suggestions-and-feedback
        
        Generated by official Zabbix template tool "Templator"
      wizard_ready: 'YES'
      readme: |
        ## Setup
        
        This template is used in low-level discovery and will be auto-assigned to host prototypes. Additional configuration is not required.
      vendor:
        name: Zabbix
        version: 8.0-1
      groups:
        - name: Templates/Cloud
      items:
        - uuid: dc2887a2b954406db8588c0ead37411f
          name: 'Volume guaranteed IOPS'
          type: DEPENDENT
          key: oci.block.volume.iops
          value_type: FLOAT
          units: '!IOPS'
          description: |
            Rate of change for guaranteed IOPS per SLA.
            Expressed as the average of guaranteed IOPS during a given time interval.
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.VolumeGuaranteedIOPS
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: oci.block.volume.metrics.get
          tags:
            - tag: component
              value: storage
        - uuid: 5c1d0fd1686e4c74b33dbe12956d7b7c
          name: 'Get metrics'
          type: SCRIPT
          key: oci.block.volume.metrics.get
          history: '0'
          value_type: TEXT
          params: |
            function validateZabbixParams(requiredParams, allParams) {
            	requiredParams.forEach(function (field) {
            		if (typeof allParams !== 'object' || typeof allParams[field] === 'undefined' || allParams[field] === '') {
            			throw 'Required param is not set: ' + field + '.';
            		}
            	});
            }
            
            function OCI(service, action, params) {
            	this.zabbixLogPrefix = '[ OCI ] [ ' + service + ' ] [ ' + action + ' ]';
            	this.request = new HttpRequest();
            
            	this.hash = function (string) {
            		return sha256(string);
            	};
            
            	this.sign = function (string) {
            		return sign('sha256', params['private_key'], string);
            	};
            
            	this.encode = function (hash) {
            		const hexArr = hash.match(/.{1,2}/g);
            		var uInt8Array = new Uint8Array(hexArr.length);
            		hexArr.forEach(function (hex, idx) {
            			uInt8Array[idx] = parseInt(hex, 16);
            		});
            		return btoa(uInt8Array);
            	};
            
            	this.getDate = function () {
            		const weekdayShortList = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
            		const monthShortList = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'];
            		const today = new Date();
            		return weekdayShortList[today.getUTCDay()] + ', ' + today.getUTCDate() + ' ' + monthShortList[today.getUTCMonth()] + ' ' + today.getUTCFullYear() + ' ' + today.getUTCHours() + ':' + today.getUTCMinutes() + ':' + today.getUTCSeconds() + ' GMT';
            	};
            
            	this.executeRequest = function (httpMethod, apiPath, apiParams, mql, namespace) {
            		var headers = '(request-target) date host';
            		const contentTypeHeader = 'content-type: application/json';
            		const dateHeader = 'date: ' + this.getDate();
            		const hostHeader = 'host: ' + params['api_host'];
            		const requestTarget = '(request-target): ' + httpMethod + ' ' + apiPath + apiParams;
            		var signingString = requestTarget + '\n' + dateHeader + '\n' + hostHeader;
            		var reqHeaders = [contentTypeHeader, dateHeader];
            
            		if (httpMethod === 'post') {
            			var body = JSON.stringify({
            				'namespace': namespace,
            				'query': mql
            			});
            			headers = headers + ' x-content-sha256 content-type content-length';
            			const bodyHeader = 'x-content-sha256: ' + this.encode(this.hash(body));
            			const bodyLengthHeader = 'content-length: ' + body.length;
            			signingString = signingString + '\n' + bodyHeader + '\n' + contentTypeHeader + '\n' + bodyLengthHeader;
            			reqHeaders.push(bodyHeader, bodyLengthHeader);
            		}
            
            		const signature = this.encode(this.sign(signingString));
            
            		reqHeaders.push('Authorization: Signature version="1",keyId="' + params['tenancy_ocid'] + '/' + params['user_ocid'] + '/' + params['fingerprint'] + '",algorithm="rsa-sha256",headers="' + headers + '",signature="' + signature + '"');
            		for (var header = 0, headerLength = reqHeaders.length; header < headerLength; header++) {
            			this.request.addHeader(reqHeaders[header]);
            		}
            
            		if (params['http_proxy']) {
            			this.request.setProxy(params['http_proxy']);
            			Zabbix.log(4, this.zabbixLogPrefix + ' Using http proxy: ' + params['http_proxy']);
            		}
            
            		if (httpMethod === 'post') {
            			var apiRateLimitExceeded = false;
            			do {
            				const response = this.request.post('https://' + params['api_host'] + apiPath + apiParams, body);
            
            				try {
            					if (JSON.parse(response)['code'] === 'TooManyRequests') {
            
            						apiRateLimitExceeded = true;
            						Zabbix.sleep(1000);
            					} else {
            						apiRateLimitExceeded = false;
            					}
            				} catch (error) {
            					Zabbix.log(3, this.zabbixLogPrefix + ' Could not parse the response: ' + JSON.stringify(response));
            					throw 'Could not parse the response. See logs for more information.';
            				}
            			} while (apiRateLimitExceeded);
            		} else {
            			const response = this.request.get('https://' + params['api_host'] + apiPath + apiParams);
            		}
            
            		this.request.clearHeader();
            
            		if (this.request.getStatus() === parseInt(params['http_status_code'])) {
            			return response;
            		} else {
            			Zabbix.log(3, this.zabbixLogPrefix + ' Unexpected HTTP response code: ' + this.request.getStatus());
            			throw 'Unexpected HTTP response code: ' + this.request.getStatus();
            		}
            	};
            
            	this.extractData = function (httpMethod, data, keys, compartment) {
            		try {
            			data = JSON.parse(data);
            		} catch (error) {
            			Zabbix.log(3, this.zabbixLogPrefix + ' Could not parse the received JSON object: ' + data);
            			throw 'Could not parse received JSON object. See logs for more information.';
            		}
            
            		if (typeof keys == 'object') {
            			var returnBuffer = [];
            			for (var dataObj = 0, dataLength = data.length; dataObj < dataLength; dataObj++) {
            
            				var objectBuffer = {};
            				for (var key = 0, keysLength = keys.length; key < keysLength; key++) {
            					if (data[dataObj][keys[key]] || data[dataObj][keys[key]] == null) {
            						objectBuffer[keys[key].match(/^[a-z]+$|[A-Z][a-z]+$/)[0].toLowerCase()] = data[dataObj][keys[key]];
            					} else {
            						Zabbix.log(3, this.zabbixLogPrefix + ' Received an unexpected JSON object. Could not get value for key "' + keys[key] + '" in JSON: ' + JSON.stringify(data[dataObj]));
            						throw 'Received an unexpected JSON object. See logs for more information.';
            					}
            				}
            				if (typeof compartment != 'undefined' && compartment != '') objectBuffer['compartment'] = compartment;
            				returnBuffer.push(objectBuffer);
            			}
            			return returnBuffer;
            		}
            
            		try {
            			if (httpMethod === 'get') {
            				return data[keys];
            			} else {
            				if (data.length === 0) {
            					return 0;
            				}
            				data = data[0][keys];
            				return data[data.length - 1]['value'];
            			}
            		} catch (error) {
            			Zabbix.log(3, this.zabbixLogPrefix + ' Could not find key "' + keys + '" in JSON: ' + JSON.stringify(data));
            			throw 'Could not find required key in JSON object. See logs for more information.';
            		}
            	};
            }
            
            function buildMql(id, metrics, defaultStatistic, resourceType) {
            	resourceType = resourceType === '' || resourceType === undefined ? 'resourceId' : resourceType;
            	this.query = '[' + params['req_interval'] + 'm]{' + resourceType + '=' + id + '}.';
            
            	for (var i = 0, metricsLength = metrics.length; i < metricsLength; i++) {
            		const metric = ((Array.isArray(metrics[i]) ? metrics[i] : [metrics[i], defaultStatistic]));
            		metrics[i] = [metric[0], this.query + metric[1]];
            	}
            }
            
            
            const params = JSON.parse(value);
            validateZabbixParams(['tenancy_ocid', 'user_ocid', 'private_key', 'fingerprint', 'api_host', 'volume_id', 'http_status_code', 'req_interval', 'compartment_id'], params);
            var oci = new OCI('Block volume', 'Get metrics', params);
            
            const metrics = [
            	'VolumeReadThroughput',
            	'VolumeWriteThroughput',
            	'VolumeReadOps',
            	'VolumeWriteOps',
            	['VolumeThrottledIOs', 'sum'],
            	'VolumeGuaranteedVPUsPerGB',
            	'VolumeGuaranteedIOPS',
            	'VolumeGuaranteedThroughput'
            ];
            buildMql(params['volume_id'], metrics, 'mean');
            
            var result = {};
            for (var i = 0, metricsLength = metrics.length; i < metricsLength; i++) {
            	result[metrics[i][0]] = oci.extractData('post', oci.executeRequest('post', '/20180401/metrics/actions/summarizeMetricsData', '?compartmentId=' + encodeURIComponent(params['compartment_id']), metrics[i][0] + metrics[i][1] + '()', 'oci_blockstore'), 'aggregatedDatapoints');
            }
            return JSON.stringify(result);
          description: 'Gets block volume metrics.'
          timeout: 30s
          parameters:
            - name: api_host
              value: '{$OCI.API.TELEMETRY.HOST}'
            - name: compartment_id
              value: '{$OCI.VOLUME.BLOCK.COMPARTMENT.ID}'
            - name: fingerprint
              value: '{$OCI.API.FINGERPRINT}'
            - name: http_proxy
              value: '{$OCI.HTTP.PROXY}'
            - name: http_status_code
              value: '{$OCI.HTTP.RETURN.CODE.OK}'
            - name: private_key
              value: '{$OCI.API.PRIVATE.KEY}'
            - name: req_interval
              value: '1'
            - name: tenancy_ocid
              value: '{$OCI.API.TENANCY}'
            - name: user_ocid
              value: '{$OCI.API.USER}'
            - name: volume_id
              value: '{$OCI.VOLUME.BLOCK.ID}'
          tags:
            - tag: component
              value: raw
        - uuid: 680f9e8c96d34c099533adc99c33a48f
          name: 'Volume read throughput'
          type: DEPENDENT
          key: oci.block.volume.read
          value_type: FLOAT
          units: Bps
          description: 'Read throughput. Expressed as bytes read per interval.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.VolumeReadThroughput
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: oci.block.volume.metrics.get
          tags:
            - tag: component
              value: storage
        - uuid: 6b8060ce122142968e73da9a3e0813a1
          name: 'Volume read operations'
          type: DEPENDENT
          key: oci.block.volume.read.ops
          value_type: FLOAT
          units: '!reads'
          description: 'Activity level from I/O reads. Expressed as reads per interval.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.VolumeReadOps
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: oci.block.volume.metrics.get
          tags:
            - tag: component
              value: storage
        - uuid: 4fdab3067ada41219c8208862e7c8b14
          name: State
          type: SCRIPT
          key: oci.block.volume.state
          params: |
            function validateZabbixParams(requiredParams, allParams) {
            	requiredParams.forEach(function (field) {
            		if (typeof allParams !== 'object' || typeof allParams[field] === 'undefined' || allParams[field] === '') {
            			throw 'Required param is not set: ' + field + '.';
            		}
            	});
            }
            
            function OCI(service, action, params) {
            	this.zabbixLogPrefix = '[ OCI ] [ ' + service + ' ] [ ' + action + ' ]';
            	this.request = new HttpRequest();
            
            	this.hash = function (string) {
            		return sha256(string);
            	};
            
            	this.sign = function (string) {
            		return sign('sha256', params['private_key'], string);
            	};
            
            	this.encode = function (hash) {
            		const hexArr = hash.match(/.{1,2}/g);
            		var uInt8Array = new Uint8Array(hexArr.length);
            		hexArr.forEach(function (hex, idx) {
            			uInt8Array[idx] = parseInt(hex, 16);
            		});
            		return btoa(uInt8Array);
            	};
            
            	this.getDate = function () {
            		const weekdayShortList = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
            		const monthShortList = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'];
            		const today = new Date();
            		return weekdayShortList[today.getUTCDay()] + ', ' + today.getUTCDate() + ' ' + monthShortList[today.getUTCMonth()] + ' ' + today.getUTCFullYear() + ' ' + today.getUTCHours() + ':' + today.getUTCMinutes() + ':' + today.getUTCSeconds() + ' GMT';
            	};
            
            	this.executeRequest = function (httpMethod, apiPath, apiParams, mql, namespace) {
            		var headers = '(request-target) date host';
            		const contentTypeHeader = 'content-type: application/json';
            		const dateHeader = 'date: ' + this.getDate();
            		const hostHeader = 'host: ' + params['api_host'];
            		const requestTarget = '(request-target): ' + httpMethod + ' ' + apiPath + apiParams;
            		var signingString = requestTarget + '\n' + dateHeader + '\n' + hostHeader;
            		var reqHeaders = [contentTypeHeader, dateHeader];
            
            		if (httpMethod === 'post') {
            			var body = JSON.stringify({
            				'namespace': namespace,
            				'query': mql
            			});
            			headers = headers + ' x-content-sha256 content-type content-length';
            			const bodyHeader = 'x-content-sha256: ' + this.encode(this.hash(body));
            			const bodyLengthHeader = 'content-length: ' + body.length;
            			signingString = signingString + '\n' + bodyHeader + '\n' + contentTypeHeader + '\n' + bodyLengthHeader;
            			reqHeaders.push(bodyHeader, bodyLengthHeader);
            		}
            
            		const signature = this.encode(this.sign(signingString));
            
            		reqHeaders.push('Authorization: Signature version="1",keyId="' + params['tenancy_ocid'] + '/' + params['user_ocid'] + '/' + params['fingerprint'] + '",algorithm="rsa-sha256",headers="' + headers + '",signature="' + signature + '"');
            		for (var header = 0, headerLength = reqHeaders.length; header < headerLength; header++) {
            			this.request.addHeader(reqHeaders[header]);
            		}
            
            		if (params['http_proxy']) {
            			this.request.setProxy(params['http_proxy']);
            			Zabbix.log(4, this.zabbixLogPrefix + ' Using http proxy: ' + params['http_proxy']);
            		}
            
            		if (httpMethod === 'post') {
            			var apiRateLimitExceeded = false;
            			do {
            				const response = this.request.post('https://' + params['api_host'] + apiPath + apiParams, body);
            
            				try {
            					if (JSON.parse(response)['code'] === 'TooManyRequests') {
            
            						apiRateLimitExceeded = true;
            						Zabbix.sleep(1000);
            					} else {
            						apiRateLimitExceeded = false;
            					}
            				} catch (error) {
            					Zabbix.log(3, this.zabbixLogPrefix + ' Could not parse the response: ' + JSON.stringify(response));
            					throw 'Could not parse the response. See logs for more information.';
            				}
            			} while (apiRateLimitExceeded);
            		} else {
            			const response = this.request.get('https://' + params['api_host'] + apiPath + apiParams);
            		}
            
            		this.request.clearHeader();
            
            		if (this.request.getStatus() === parseInt(params['http_status_code'])) {
            			return response;
            		} else {
            			Zabbix.log(3, this.zabbixLogPrefix + ' Unexpected HTTP response code: ' + this.request.getStatus());
            			throw 'Unexpected HTTP response code: ' + this.request.getStatus();
            		}
            	};
            
            	this.extractData = function (httpMethod, data, keys, compartment) {
            		try {
            			data = JSON.parse(data);
            		} catch (error) {
            			Zabbix.log(3, this.zabbixLogPrefix + ' Could not parse the received JSON object: ' + data);
            			throw 'Could not parse received JSON object. See logs for more information.';
            		}
            
            		if (typeof keys == 'object') {
            			var returnBuffer = [];
            			for (var dataObj = 0, dataLength = data.length; dataObj < dataLength; dataObj++) {
            
            				var objectBuffer = {};
            				for (var key = 0, keysLength = keys.length; key < keysLength; key++) {
            					if (data[dataObj][keys[key]] || data[dataObj][keys[key]] == null) {
            						objectBuffer[keys[key].match(/^[a-z]+$|[A-Z][a-z]+$/)[0].toLowerCase()] = data[dataObj][keys[key]];
            					} else {
            						Zabbix.log(3, this.zabbixLogPrefix + ' Received an unexpected JSON object. Could not get value for key "' + keys[key] + '" in JSON: ' + JSON.stringify(data[dataObj]));
            						throw 'Received an unexpected JSON object. See logs for more information.';
            					}
            				}
            				if (typeof compartment != 'undefined' && compartment != '') objectBuffer['compartment'] = compartment;
            				returnBuffer.push(objectBuffer);
            			}
            			return returnBuffer;
            		}
            
            		try {
            			if (httpMethod === 'get') {
            				return data[keys];
            			} else {
            				if (data.length === 0) {
            					return 0;
            				}
            				data = data[0][keys];
            				return data[data.length - 1]['value'];
            			}
            		} catch (error) {
            			Zabbix.log(3, this.zabbixLogPrefix + ' Could not find key "' + keys + '" in JSON: ' + JSON.stringify(data));
            			throw 'Could not find required key in JSON object. See logs for more information.';
            		}
            	};
            }
            
            
            const params = JSON.parse(value);
            validateZabbixParams(['tenancy_ocid', 'user_ocid', 'private_key', 'fingerprint', 'api_host', 'volume_id', 'http_status_code'], params);
            var oci = new OCI('Block volume', 'Get volume state', params);
            
            return oci.extractData('get', oci.executeRequest('get', '/20160918/volumes/' + encodeURIComponent(params['volume_id']), ''), 'lifecycleState');
          description: 'Gets the block volume state.'
          valuemap:
            name: 'Block volume state'
          preprocessing:
            - type: JAVASCRIPT
              parameters:
                - |
                  const idx = {
                  	'PROVISIONING': 1,
                  	'RESTORING': 2,
                  	'AVAILABLE': 3,
                  	'TERMINATING': 4,
                  	'TERMINATED': 5,
                  	'FAULTY': 6
                  };
                  
                  return typeof idx[value] === 'undefined' ? 0 : idx[value];
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          timeout: 10s
          parameters:
            - name: api_host
              value: '{$OCI.API.CORE.HOST}'
            - name: fingerprint
              value: '{$OCI.API.FINGERPRINT}'
            - name: http_proxy
              value: '{$OCI.HTTP.PROXY}'
            - name: http_status_code
              value: '{$OCI.HTTP.RETURN.CODE.OK}'
            - name: private_key
              value: '{$OCI.API.PRIVATE.KEY}'
            - name: tenancy_ocid
              value: '{$OCI.API.TENANCY}'
            - name: user_ocid
              value: '{$OCI.API.USER}'
            - name: volume_id
              value: '{$OCI.VOLUME.BLOCK.ID}'
          tags:
            - tag: component
              value: storage
          triggers:
            - uuid: 4ea859d86e29455aa4bdd2f3667894f6
              expression: 'min(/Oracle Cloud Block Volume by HTTP/oci.block.volume.state,5m) = 0'
              name: 'OCI Block Volume: Block volume state unknown'
              priority: WARNING
              description: 'Block volume state is unknown.'
              dependencies:
                - name: 'OCI Block Volume: Block volume terminated or faulty'
                  expression: 'min(/Oracle Cloud Block Volume by HTTP/oci.block.volume.state,5m) >= 4'
              tags:
                - tag: scope
                  value: availability
            - uuid: b8d9491d762f40c58fb1094fa0468d9e
              expression: 'min(/Oracle Cloud Block Volume by HTTP/oci.block.volume.state,5m) >= 4'
              name: 'OCI Block Volume: Block volume terminated or faulty'
              priority: HIGH
              description: 'Block volume state is "terminated"/"terminating" or "faulty".'
              tags:
                - tag: scope
                  value: availability
        - uuid: cc9ef37437b04a40a4b48a9f21e36ff1
          name: 'Volume throttled operations'
          type: DEPENDENT
          key: oci.block.volume.throttled.ops
          description: 'Total sum of all the I/O operations that were throttled during a given time interval.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.VolumeThrottledIOs
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: oci.block.volume.metrics.get
          tags:
            - tag: component
              value: storage
        - uuid: d1b199adc996404db814ba7568b054df
          name: 'Volume guaranteed throughput'
          type: DEPENDENT
          key: oci.block.volume.throughput
          value_type: FLOAT
          units: Bps
          description: 'Rate of change for guaranteed throughput per SLA. Expressed as megabytes per interval.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.VolumeGuaranteedThroughput
            - type: MULTIPLIER
              parameters:
                - '1048576'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: oci.block.volume.metrics.get
          tags:
            - tag: component
              value: storage
        - uuid: 607f3c4a8197473bb1872e4ed45edd26
          name: 'Volume guaranteed VPUs/GB'
          type: DEPENDENT
          key: oci.block.volume.vpu
          value_type: FLOAT
          units: '!VPUs'
          description: |
            Rate of change for currently active VPUs/GB.
            Expressed as the average of active VPUs/GB during a given time interval.
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.VolumeGuaranteedVPUsPerGB
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: oci.block.volume.metrics.get
          tags:
            - tag: component
              value: storage
        - uuid: 9ec2ce2d21154028a5623b5d0ac9c082
          name: 'Volume write throughput'
          type: DEPENDENT
          key: oci.block.volume.write
          value_type: FLOAT
          units: Bps
          description: 'Write throughput. Expressed as bytes read per interval.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.VolumeWriteThroughput
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: oci.block.volume.metrics.get
          tags:
            - tag: component
              value: storage
        - uuid: e55fee2db439493992a80e39ca647e9a
          name: 'Volume write operations'
          type: DEPENDENT
          key: oci.block.volume.write.ops
          value_type: FLOAT
          units: '!writes'
          description: 'Activity level from I/O writes. Expressed as writes per interval.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.VolumeWriteOps
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: oci.block.volume.metrics.get
          tags:
            - tag: component
              value: storage
      tags:
        - tag: class
          value: cloud
        - tag: class
          value: database
        - tag: subclass
          value: automation
        - tag: subclass
          value: bigdata
        - tag: subclass
          value: deploy
        - tag: target
          value: oci
        - tag: target
          value: oracle-cloud-infrastructure
      macros:
        - macro: '{$OCI.HTTP.PROXY}'
          description: 'Set an HTTP proxy for OCI API requests if needed.'
        - macro: '{$OCI.HTTP.RETURN.CODE.OK}'
          value: '200'
          description: 'Set the HTTP return code that represents an OK response from the API. The default is "200",  but can vary, for example, if a proxy is used.'
      dashboards:
        - uuid: f87041e2902c4286a648b0f53daee03f
          name: 'OCI Block Volume: Overview'
          pages:
            - name: Overview
              display_period: '30'
              widgets:
                - type: item
                  name: Availability
                  width: '27'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: 6C00D9
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Block Volume by HTTP'
                        key: oci.block.volume.state
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: units_show
                      value: '0'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: item
                  name: 'Volume read operations'
                  'y': '3'
                  width: '18'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: 2196F3
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'Volume Read Operations'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Block Volume by HTTP'
                        key: oci.block.volume.read.ops
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: graph
                  name: Operations
                  'y': '6'
                  width: '36'
                  height: '5'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Oracle Cloud Block Volume by HTTP'
                        name: 'OCI Block Volume: Operations'
                    - type: STRING
                      name: reference
                      value: AAAAA
                - type: item
                  name: 'Volume write operations'
                  x: '18'
                  'y': '3'
                  width: '18'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: 2196F3
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'Volume Write Operations'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Block Volume by HTTP'
                        key: oci.block.volume.write.ops
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: item
                  name: 'Guaranteed IOPS'
                  x: '27'
                  width: '15'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: 00D936
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: STRING
                      name: description
                      value: 'Guaranteed IOPS'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Block Volume by HTTP'
                        key: oci.block.volume.iops
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: item
                  name: 'Volume read throughput'
                  x: '36'
                  'y': '3'
                  width: '18'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: 2196F3
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'Volume Read Throughput'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Block Volume by HTTP'
                        key: oci.block.volume.read
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: graph
                  name: Throughput
                  x: '36'
                  'y': '6'
                  width: '36'
                  height: '5'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Oracle Cloud Block Volume by HTTP'
                        name: 'OCI Block Volume: Throughput'
                    - type: STRING
                      name: reference
                      value: AAAAB
                - type: item
                  name: 'Guaranteed throughput'
                  x: '42'
                  width: '15'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: 00D936
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'Guaranteed Throughput'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Block Volume by HTTP'
                        key: oci.block.volume.throughput
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: item
                  name: 'Volume write throughput'
                  x: '54'
                  'y': '3'
                  width: '18'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: 2196F3
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'Volume Write Throughput'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Block Volume by HTTP'
                        key: oci.block.volume.write
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: item
                  name: 'Guaranteed VPUs/GB'
                  x: '57'
                  width: '15'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: 00D936
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'Guaranteed VPUs/GB'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Block Volume by HTTP'
                        key: oci.block.volume.vpu
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
      valuemaps:
        - uuid: 780a56fd95474839943cbd2f8be2fc18
          name: 'Block volume state'
          mappings:
            - value: '0'
              newvalue: Unknown
            - value: '1'
              newvalue: Provisioning
            - value: '2'
              newvalue: Restoring
            - value: '3'
              newvalue: Available
            - value: '4'
              newvalue: Terminating
            - value: '5'
              newvalue: Terminated
            - value: '6'
              newvalue: Faulty
    - uuid: e5486d98ff414c1391de1bd369a7f9db
      template: 'Oracle Cloud Boot Volume by HTTP'
      name: 'Oracle Cloud Boot Volume by HTTP'
      description: |
        Monitor Oracle Cloud Infrastructure (OCI) boot volume.
        
        This template is not meant to be used independently, but instead with Oracle Cloud by HTTP as a template for
        LLD host prototypes.
        
        Read the template documentation prior to using this template.
        
        You can discuss this template or leave feedback on our forum https://www.zabbix.com/forum/zabbix-suggestions-and-feedback
        
        Generated by official Zabbix template tool "Templator"
      wizard_ready: 'YES'
      readme: |
        ## Setup
        
        This template is used in low-level discovery and will be auto-assigned to host prototypes. Additional configuration is not required.
      vendor:
        name: Zabbix
        version: 8.0-1
      groups:
        - name: Templates/Cloud
      items:
        - uuid: c629f4e4424b48288b7e7058eef2ca92
          name: 'Volume guaranteed IOPS'
          type: DEPENDENT
          key: oci.boot.volume.iops
          value_type: FLOAT
          units: '!IOPS'
          description: |
            Rate of change for guaranteed IOPS per SLA.
            Expressed as the average of guaranteed IOPS during a given time interval.
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.VolumeGuaranteedIOPS
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: oci.boot.volume.metrics.get
          tags:
            - tag: component
              value: storage
        - uuid: 388e89b8e68149438d714237e785ccde
          name: 'Get metrics'
          type: SCRIPT
          key: oci.boot.volume.metrics.get
          history: '0'
          value_type: TEXT
          params: |
            function validateZabbixParams(requiredParams, allParams) {
            	requiredParams.forEach(function (field) {
            		if (typeof allParams !== 'object' || typeof allParams[field] === 'undefined' || allParams[field] === '') {
            			throw 'Required param is not set: ' + field + '.';
            		}
            	});
            }
            
            function OCI(service, action, params) {
            	this.zabbixLogPrefix = '[ OCI ] [ ' + service + ' ] [ ' + action + ' ]';
            	this.request = new HttpRequest();
            
            	this.hash = function (string) {
            		return sha256(string);
            	};
            
            	this.sign = function (string) {
            		return sign('sha256', params['private_key'], string);
            	};
            
            	this.encode = function (hash) {
            		const hexArr = hash.match(/.{1,2}/g);
            		var uInt8Array = new Uint8Array(hexArr.length);
            		hexArr.forEach(function (hex, idx) {
            			uInt8Array[idx] = parseInt(hex, 16);
            		});
            		return btoa(uInt8Array);
            	};
            
            	this.getDate = function () {
            		const weekdayShortList = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
            		const monthShortList = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'];
            		const today = new Date();
            		return weekdayShortList[today.getUTCDay()] + ', ' + today.getUTCDate() + ' ' + monthShortList[today.getUTCMonth()] + ' ' + today.getUTCFullYear() + ' ' + today.getUTCHours() + ':' + today.getUTCMinutes() + ':' + today.getUTCSeconds() + ' GMT';
            	};
            
            	this.executeRequest = function (httpMethod, apiPath, apiParams, mql, namespace) {
            		var headers = '(request-target) date host';
            		const contentTypeHeader = 'content-type: application/json';
            		const dateHeader = 'date: ' + this.getDate();
            		const hostHeader = 'host: ' + params['api_host'];
            		const requestTarget = '(request-target): ' + httpMethod + ' ' + apiPath + apiParams;
            		var signingString = requestTarget + '\n' + dateHeader + '\n' + hostHeader;
            		var reqHeaders = [contentTypeHeader, dateHeader];
            
            		if (httpMethod === 'post') {
            			var body = JSON.stringify({
            				'namespace': namespace,
            				'query': mql
            			});
            			headers = headers + ' x-content-sha256 content-type content-length';
            			const bodyHeader = 'x-content-sha256: ' + this.encode(this.hash(body));
            			const bodyLengthHeader = 'content-length: ' + body.length;
            			signingString = signingString + '\n' + bodyHeader + '\n' + contentTypeHeader + '\n' + bodyLengthHeader;
            			reqHeaders.push(bodyHeader, bodyLengthHeader);
            		}
            
            		const signature = this.encode(this.sign(signingString));
            
            		reqHeaders.push('Authorization: Signature version="1",keyId="' + params['tenancy_ocid'] + '/' + params['user_ocid'] + '/' + params['fingerprint'] + '",algorithm="rsa-sha256",headers="' + headers + '",signature="' + signature + '"');
            		for (var header = 0, headerLength = reqHeaders.length; header < headerLength; header++) {
            			this.request.addHeader(reqHeaders[header]);
            		}
            
            		if (params['http_proxy']) {
            			this.request.setProxy(params['http_proxy']);
            			Zabbix.log(4, this.zabbixLogPrefix + ' Using http proxy: ' + params['http_proxy']);
            		}
            
            		if (httpMethod === 'post') {
            			var apiRateLimitExceeded = false;
            			do {
            				const response = this.request.post('https://' + params['api_host'] + apiPath + apiParams, body);
            
            				try {
            					if (JSON.parse(response)['code'] === 'TooManyRequests') {
            
            						apiRateLimitExceeded = true;
            						Zabbix.sleep(1000);
            					} else {
            						apiRateLimitExceeded = false;
            					}
            				} catch (error) {
            					Zabbix.log(3, this.zabbixLogPrefix + ' Could not parse the response: ' + JSON.stringify(response));
            					throw 'Could not parse the response. See logs for more information.';
            				}
            			} while (apiRateLimitExceeded);
            		} else {
            			const response = this.request.get('https://' + params['api_host'] + apiPath + apiParams);
            		}
            
            		this.request.clearHeader();
            
            		if (this.request.getStatus() === parseInt(params['http_status_code'])) {
            			return response;
            		} else {
            			Zabbix.log(3, this.zabbixLogPrefix + ' Unexpected HTTP response code: ' + this.request.getStatus());
            			throw 'Unexpected HTTP response code: ' + this.request.getStatus();
            		}
            	};
            
            	this.extractData = function (httpMethod, data, keys, compartment) {
            		try {
            			data = JSON.parse(data);
            		} catch (error) {
            			Zabbix.log(3, this.zabbixLogPrefix + ' Could not parse the received JSON object: ' + data);
            			throw 'Could not parse received JSON object. See logs for more information.';
            		}
            
            		if (typeof keys == 'object') {
            			var returnBuffer = [];
            			for (var dataObj = 0, dataLength = data.length; dataObj < dataLength; dataObj++) {
            
            				var objectBuffer = {};
            				for (var key = 0, keysLength = keys.length; key < keysLength; key++) {
            					if (data[dataObj][keys[key]] || data[dataObj][keys[key]] == null) {
            						objectBuffer[keys[key].match(/^[a-z]+$|[A-Z][a-z]+$/)[0].toLowerCase()] = data[dataObj][keys[key]];
            					} else {
            						Zabbix.log(3, this.zabbixLogPrefix + ' Received an unexpected JSON object. Could not get value for key "' + keys[key] + '" in JSON: ' + JSON.stringify(data[dataObj]));
            						throw 'Received an unexpected JSON object. See logs for more information.';
            					}
            				}
            				if (typeof compartment != 'undefined' && compartment != '') objectBuffer['compartment'] = compartment;
            				returnBuffer.push(objectBuffer);
            			}
            			return returnBuffer;
            		}
            
            		try {
            			if (httpMethod === 'get') {
            				return data[keys];
            			} else {
            				if (data.length === 0) {
            					return 0;
            				}
            				data = data[0][keys];
            				return data[data.length - 1]['value'];
            			}
            		} catch (error) {
            			Zabbix.log(3, this.zabbixLogPrefix + ' Could not find key "' + keys + '" in JSON: ' + JSON.stringify(data));
            			throw 'Could not find required key in JSON object. See logs for more information.';
            		}
            	};
            }
            
            function buildMql(id, metrics, defaultStatistic, resourceType) {
            	resourceType = resourceType === '' || resourceType === undefined ? 'resourceId' : resourceType;
            	this.query = '[' + params['req_interval'] + 'm]{' + resourceType + '=' + id + '}.';
            
            	for (var i = 0, metricsLength = metrics.length; i < metricsLength; i++) {
            		const metric = ((Array.isArray(metrics[i]) ? metrics[i] : [metrics[i], defaultStatistic]));
            		metrics[i] = [metric[0], this.query + metric[1]];
            	}
            }
            
            
            const params = JSON.parse(value);
            validateZabbixParams(['tenancy_ocid', 'user_ocid', 'private_key', 'fingerprint', 'api_host', 'volume_id', 'http_status_code', 'req_interval', 'compartment_id'], params);
            var oci = new OCI('Boot volume', 'Get metrics', params);
            
            const metrics = [
            	'VolumeReadThroughput',
            	'VolumeWriteThroughput',
            	'VolumeReadOps',
            	'VolumeWriteOps',
            	['VolumeThrottledIOs', 'sum'],
            	'VolumeGuaranteedVPUsPerGB',
            	'VolumeGuaranteedIOPS',
            	'VolumeGuaranteedThroughput'
            ];
            buildMql(params['volume_id'], metrics, 'mean');
            
            var result = {};
            for (var i = 0, metricsLength = metrics.length; i < metricsLength; i++) {
            	result[metrics[i][0]] = oci.extractData('post', oci.executeRequest('post', '/20180401/metrics/actions/summarizeMetricsData', '?compartmentId=' + encodeURIComponent(params['compartment_id']), metrics[i][0] + metrics[i][1] + '()', 'oci_blockstore'), 'aggregatedDatapoints');
            }
            return JSON.stringify(result);
          description: 'Gets boot volume metrics.'
          timeout: 30s
          parameters:
            - name: api_host
              value: '{$OCI.API.TELEMETRY.HOST}'
            - name: compartment_id
              value: '{$OCI.VOLUME.BOOT.COMPARTMENT.ID}'
            - name: fingerprint
              value: '{$OCI.API.FINGERPRINT}'
            - name: http_proxy
              value: '{$OCI.HTTP.PROXY}'
            - name: http_status_code
              value: '{$OCI.HTTP.RETURN.CODE.OK}'
            - name: private_key
              value: '{$OCI.API.PRIVATE.KEY}'
            - name: req_interval
              value: '1'
            - name: tenancy_ocid
              value: '{$OCI.API.TENANCY}'
            - name: user_ocid
              value: '{$OCI.API.USER}'
            - name: volume_id
              value: '{$OCI.VOLUME.BOOT.ID}'
          tags:
            - tag: component
              value: raw
        - uuid: 01700702f306414892828674c0046e5c
          name: 'Volume read throughput'
          type: DEPENDENT
          key: oci.boot.volume.read
          value_type: FLOAT
          units: Bps
          description: 'Read throughput. Expressed as bytes read per interval.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.VolumeReadThroughput
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: oci.boot.volume.metrics.get
          tags:
            - tag: component
              value: storage
        - uuid: b004ee7931dd4eccbfc89d3a8c363209
          name: 'Volume read operations'
          type: DEPENDENT
          key: oci.boot.volume.read.ops
          value_type: FLOAT
          units: '!reads'
          description: 'Activity level from I/O reads. Expressed as reads per interval.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.VolumeReadOps
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: oci.boot.volume.metrics.get
          tags:
            - tag: component
              value: storage
        - uuid: 3f0e4bed1fd14293b40b23595f01ebb1
          name: State
          type: SCRIPT
          key: oci.boot.volume.state
          params: |
            function validateZabbixParams(requiredParams, allParams) {
            	requiredParams.forEach(function (field) {
            		if (typeof allParams !== 'object' || typeof allParams[field] === 'undefined' || allParams[field] === '') {
            			throw 'Required param is not set: ' + field + '.';
            		}
            	});
            }
            
            function OCI(service, action, params) {
            	this.zabbixLogPrefix = '[ OCI ] [ ' + service + ' ] [ ' + action + ' ]';
            	this.request = new HttpRequest();
            
            	this.hash = function (string) {
            		return sha256(string);
            	};
            
            	this.sign = function (string) {
            		return sign('sha256', params['private_key'], string);
            	};
            
            	this.encode = function (hash) {
            		const hexArr = hash.match(/.{1,2}/g);
            		var uInt8Array = new Uint8Array(hexArr.length);
            		hexArr.forEach(function (hex, idx) {
            			uInt8Array[idx] = parseInt(hex, 16);
            		});
            		return btoa(uInt8Array);
            	};
            
            	this.getDate = function () {
            		const weekdayShortList = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
            		const monthShortList = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'];
            		const today = new Date();
            		return weekdayShortList[today.getUTCDay()] + ', ' + today.getUTCDate() + ' ' + monthShortList[today.getUTCMonth()] + ' ' + today.getUTCFullYear() + ' ' + today.getUTCHours() + ':' + today.getUTCMinutes() + ':' + today.getUTCSeconds() + ' GMT';
            	};
            
            	this.executeRequest = function (httpMethod, apiPath, apiParams, mql, namespace) {
            		var headers = '(request-target) date host';
            		const contentTypeHeader = 'content-type: application/json';
            		const dateHeader = 'date: ' + this.getDate();
            		const hostHeader = 'host: ' + params['api_host'];
            		const requestTarget = '(request-target): ' + httpMethod + ' ' + apiPath + apiParams;
            		var signingString = requestTarget + '\n' + dateHeader + '\n' + hostHeader;
            		var reqHeaders = [contentTypeHeader, dateHeader];
            
            		if (httpMethod === 'post') {
            			var body = JSON.stringify({
            				'namespace': namespace,
            				'query': mql
            			});
            			headers = headers + ' x-content-sha256 content-type content-length';
            			const bodyHeader = 'x-content-sha256: ' + this.encode(this.hash(body));
            			const bodyLengthHeader = 'content-length: ' + body.length;
            			signingString = signingString + '\n' + bodyHeader + '\n' + contentTypeHeader + '\n' + bodyLengthHeader;
            			reqHeaders.push(bodyHeader, bodyLengthHeader);
            		}
            
            		const signature = this.encode(this.sign(signingString));
            
            		reqHeaders.push('Authorization: Signature version="1",keyId="' + params['tenancy_ocid'] + '/' + params['user_ocid'] + '/' + params['fingerprint'] + '",algorithm="rsa-sha256",headers="' + headers + '",signature="' + signature + '"');
            		for (var header = 0, headerLength = reqHeaders.length; header < headerLength; header++) {
            			this.request.addHeader(reqHeaders[header]);
            		}
            
            		if (params['http_proxy']) {
            			this.request.setProxy(params['http_proxy']);
            			Zabbix.log(4, this.zabbixLogPrefix + ' Using http proxy: ' + params['http_proxy']);
            		}
            
            		if (httpMethod === 'post') {
            			var apiRateLimitExceeded = false;
            			do {
            				const response = this.request.post('https://' + params['api_host'] + apiPath + apiParams, body);
            
            				try {
            					if (JSON.parse(response)['code'] === 'TooManyRequests') {
            
            						apiRateLimitExceeded = true;
            						Zabbix.sleep(1000);
            					} else {
            						apiRateLimitExceeded = false;
            					}
            				} catch (error) {
            					Zabbix.log(3, this.zabbixLogPrefix + ' Could not parse the response: ' + JSON.stringify(response));
            					throw 'Could not parse the response. See logs for more information.';
            				}
            			} while (apiRateLimitExceeded);
            		} else {
            			const response = this.request.get('https://' + params['api_host'] + apiPath + apiParams);
            		}
            
            		this.request.clearHeader();
            
            		if (this.request.getStatus() === parseInt(params['http_status_code'])) {
            			return response;
            		} else {
            			Zabbix.log(3, this.zabbixLogPrefix + ' Unexpected HTTP response code: ' + this.request.getStatus());
            			throw 'Unexpected HTTP response code: ' + this.request.getStatus();
            		}
            	};
            
            	this.extractData = function (httpMethod, data, keys, compartment) {
            		try {
            			data = JSON.parse(data);
            		} catch (error) {
            			Zabbix.log(3, this.zabbixLogPrefix + ' Could not parse the received JSON object: ' + data);
            			throw 'Could not parse received JSON object. See logs for more information.';
            		}
            
            		if (typeof keys == 'object') {
            			var returnBuffer = [];
            			for (var dataObj = 0, dataLength = data.length; dataObj < dataLength; dataObj++) {
            
            				var objectBuffer = {};
            				for (var key = 0, keysLength = keys.length; key < keysLength; key++) {
            					if (data[dataObj][keys[key]] || data[dataObj][keys[key]] == null) {
            						objectBuffer[keys[key].match(/^[a-z]+$|[A-Z][a-z]+$/)[0].toLowerCase()] = data[dataObj][keys[key]];
            					} else {
            						Zabbix.log(3, this.zabbixLogPrefix + ' Received an unexpected JSON object. Could not get value for key "' + keys[key] + '" in JSON: ' + JSON.stringify(data[dataObj]));
            						throw 'Received an unexpected JSON object. See logs for more information.';
            					}
            				}
            				if (typeof compartment != 'undefined' && compartment != '') objectBuffer['compartment'] = compartment;
            				returnBuffer.push(objectBuffer);
            			}
            			return returnBuffer;
            		}
            
            		try {
            			if (httpMethod === 'get') {
            				return data[keys];
            			} else {
            				if (data.length === 0) {
            					return 0;
            				}
            				data = data[0][keys];
            				return data[data.length - 1]['value'];
            			}
            		} catch (error) {
            			Zabbix.log(3, this.zabbixLogPrefix + ' Could not find key "' + keys + '" in JSON: ' + JSON.stringify(data));
            			throw 'Could not find required key in JSON object. See logs for more information.';
            		}
            	};
            }
            
            
            const params = JSON.parse(value);
            validateZabbixParams(['tenancy_ocid', 'user_ocid', 'private_key', 'fingerprint', 'api_host', 'volume_id', 'http_status_code'], params);
            var oci = new OCI('Boot volume', 'Get volume state', params);
            
            return oci.extractData('get', oci.executeRequest('get', '/20160918/bootVolumes/' + encodeURIComponent(params['volume_id']), ''), 'lifecycleState');
          description: 'Gets the boot volume state.'
          valuemap:
            name: 'Boot volume state'
          preprocessing:
            - type: JAVASCRIPT
              parameters:
                - |
                  const idx = {
                  	'PROVISIONING': 1,
                  	'RESTORING': 2,
                  	'AVAILABLE': 3,
                  	'TERMINATING': 4,
                  	'TERMINATED': 5,
                  	'FAULTY': 6
                  };
                  
                  return typeof idx[value] === 'undefined' ? 0 : idx[value];
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          timeout: 10s
          parameters:
            - name: api_host
              value: '{$OCI.API.CORE.HOST}'
            - name: fingerprint
              value: '{$OCI.API.FINGERPRINT}'
            - name: http_proxy
              value: '{$OCI.HTTP.PROXY}'
            - name: http_status_code
              value: '{$OCI.HTTP.RETURN.CODE.OK}'
            - name: private_key
              value: '{$OCI.API.PRIVATE.KEY}'
            - name: tenancy_ocid
              value: '{$OCI.API.TENANCY}'
            - name: user_ocid
              value: '{$OCI.API.USER}'
            - name: volume_id
              value: '{$OCI.VOLUME.BOOT.ID}'
          tags:
            - tag: component
              value: storage
          triggers:
            - uuid: b31f698c5b164afc85a14acc813f463d
              expression: 'min(/Oracle Cloud Boot Volume by HTTP/oci.boot.volume.state,5m) = 0'
              name: 'OCI Boot Volume: Boot volume state unknown'
              priority: WARNING
              description: 'Boot volume state is unknown.'
              dependencies:
                - name: 'OCI Boot Volume: Boot volume terminated or faulty'
                  expression: 'min(/Oracle Cloud Boot Volume by HTTP/oci.boot.volume.state,5m) >= 4'
              tags:
                - tag: scope
                  value: availability
            - uuid: 6525eef6dd6c4cb0a22a6442773c3cfa
              expression: 'min(/Oracle Cloud Boot Volume by HTTP/oci.boot.volume.state,5m) >= 4'
              name: 'OCI Boot Volume: Boot volume terminated or faulty'
              priority: HIGH
              description: 'Boot volume state is "terminated"/"terminating" or "faulty".'
              tags:
                - tag: scope
                  value: availability
        - uuid: cfdc208b621b46508f9addc7ddb0808c
          name: 'Volume throttled operations'
          type: DEPENDENT
          key: oci.boot.volume.throttled.ops
          value_type: FLOAT
          description: 'Total sum of all the I/O operations that were throttled during a given time interval.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.VolumeThrottledIOs
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: oci.boot.volume.metrics.get
          tags:
            - tag: component
              value: storage
        - uuid: 09bc5d7c95fe4b41bed9d786b78eba88
          name: 'Volume guaranteed throughput'
          type: DEPENDENT
          key: oci.boot.volume.throughput
          value_type: FLOAT
          units: Bps
          description: 'Rate of change for guaranteed throughput per SLA. Expressed as megabytes per interval.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.VolumeGuaranteedThroughput
            - type: MULTIPLIER
              parameters:
                - '1048576'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: oci.boot.volume.metrics.get
          tags:
            - tag: component
              value: storage
        - uuid: a3e5f888d2c84d7eb105f1061b9fadd1
          name: 'Volume guaranteed VPUs/GB'
          type: DEPENDENT
          key: oci.boot.volume.vpu
          value_type: FLOAT
          units: '!VPUs'
          description: |
            Rate of change for currently active VPUs/GB.
            Expressed as the average of active VPUs/GB during a given time interval.
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.VolumeGuaranteedVPUsPerGB
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: oci.boot.volume.metrics.get
          tags:
            - tag: component
              value: storage
        - uuid: a92206102a7a45d7b5c46096486465b6
          name: 'Volume write throughput'
          type: DEPENDENT
          key: oci.boot.volume.write
          value_type: FLOAT
          units: Bps
          description: 'Write throughput. Expressed as bytes read per interval.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.VolumeWriteThroughput
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: oci.boot.volume.metrics.get
          tags:
            - tag: component
              value: storage
        - uuid: 724197c8dcfe4c3ea52bc25d99de727c
          name: 'Volume write operations'
          type: DEPENDENT
          key: oci.boot.volume.write.ops
          value_type: FLOAT
          units: '!writes'
          description: 'Activity level from I/O writes. Expressed as writes per interval.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.VolumeWriteOps
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: oci.boot.volume.metrics.get
          tags:
            - tag: component
              value: storage
      tags:
        - tag: class
          value: cloud
        - tag: class
          value: database
        - tag: subclass
          value: automation
        - tag: subclass
          value: bigdata
        - tag: subclass
          value: deploy
        - tag: target
          value: oci
        - tag: target
          value: oracle-cloud-infrastructure
      macros:
        - macro: '{$OCI.HTTP.PROXY}'
          description: 'Set an HTTP proxy for OCI API requests if needed.'
        - macro: '{$OCI.HTTP.RETURN.CODE.OK}'
          value: '200'
          description: 'Set the HTTP return code that represents an OK response from the API. The default is "200",  but can vary, for example, if a proxy is used.'
      dashboards:
        - uuid: 67db0d25f18a45b4913a15ab2618608c
          name: 'OCI Boot Volume: Overview'
          pages:
            - name: Overview
              display_period: '30'
              widgets:
                - type: item
                  name: Availability
                  width: '27'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: 6C00D9
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Boot Volume by HTTP'
                        key: oci.boot.volume.state
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: units_show
                      value: '0'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: item
                  name: 'Volume read operations'
                  'y': '3'
                  width: '18'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: 2196F3
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'Volume Read Operations'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Boot Volume by HTTP'
                        key: oci.boot.volume.read.ops
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: graph
                  name: Operations
                  'y': '6'
                  width: '36'
                  height: '5'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Oracle Cloud Boot Volume by HTTP'
                        name: 'OCI Boot Volume: Operations'
                    - type: STRING
                      name: reference
                      value: AAAAA
                - type: item
                  name: 'Volume write operations'
                  x: '18'
                  'y': '3'
                  width: '18'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: 2196F3
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'Volume Write Operations'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Boot Volume by HTTP'
                        key: oci.boot.volume.write.ops
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: item
                  name: 'Guaranteed IOPS'
                  x: '27'
                  width: '15'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: 00D936
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: STRING
                      name: description
                      value: 'Guaranteed IOPS'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Boot Volume by HTTP'
                        key: oci.boot.volume.iops
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: item
                  name: 'Volume read throughput'
                  x: '36'
                  'y': '3'
                  width: '18'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: 2196F3
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'Volume Read Throughput'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Boot Volume by HTTP'
                        key: oci.boot.volume.read
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: graph
                  name: Throughput
                  x: '36'
                  'y': '6'
                  width: '36'
                  height: '5'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Oracle Cloud Boot Volume by HTTP'
                        name: 'OCI Boot Volume: Throughput'
                    - type: STRING
                      name: reference
                      value: AAAAB
                - type: item
                  name: 'Guaranteed throughput'
                  x: '42'
                  width: '15'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: 00D936
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'Guaranteed Throughput'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Boot Volume by HTTP'
                        key: oci.boot.volume.throughput
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: item
                  name: 'Volume write throughput'
                  x: '54'
                  'y': '3'
                  width: '18'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: 2196F3
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'Volume Write Throughput'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Boot Volume by HTTP'
                        key: oci.boot.volume.write
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: item
                  name: 'Guaranteed VPUs/GB'
                  x: '57'
                  width: '15'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: 00D936
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'Guaranteed VPUs/GB'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Boot Volume by HTTP'
                        key: oci.boot.volume.vpu
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
      valuemaps:
        - uuid: d881a2a2bedc4556a36f3d676ece0456
          name: 'Boot volume state'
          mappings:
            - value: '0'
              newvalue: Unknown
            - value: '1'
              newvalue: Provisioning
            - value: '2'
              newvalue: Restoring
            - value: '3'
              newvalue: Available
            - value: '4'
              newvalue: Terminating
            - value: '5'
              newvalue: Terminated
            - value: '6'
              newvalue: Faulty
    - uuid: 057558a26d934b4683d73a7058499d62
      template: 'Oracle Cloud by HTTP'
      name: 'Oracle Cloud by HTTP'
      description: |
        Monitor resources of Oracle Cloud Infrastructure (OCI) services.
        
        This template handles discovery of various OCI services.
        
        Read the template documentation prior to using this template.
        
        You can discuss this template or leave feedback on our forum https://www.zabbix.com/forum/zabbix-suggestions-and-feedback
        
        Generated by official Zabbix template tool "Templator"
      wizard_ready: 'YES'
      readme: |
        ## Overview
        
        This template is designed as a master template that discovers various Oracle Cloud Infrastructure (OCI) services
        and resources, such as:
        
        * OCI Compute;
        
        * OCI Autonomous Database (serverless);
        
        * OCI Object Storage;
        
        * OCI Virtual Cloud Networks (VCNs);
        
        * OCI Block Volumes;
        
        * OCI Boot Volumes.
        
        For communication with OCI, this template utilizes script items which execute HTTP `GET` and `POST` requests. 
        `POST` requests are required for OCI Monitoring API as it utilizes Monitoring Query Language (MQL) which uses an
        HTTP request body for queries.
        
        
        ## Setup
        
        ## Required setup
        
        For this template to work, it needs authentication details to use in requests. To acquire this information, see
        the following steps:
        
        1. Log into your administrator account in Oracle Cloud Console.
        
        2. Create a new user that will be used by Zabbix for monitoring.
        
        3. Create a new security policy and assign a previously created user to it.
        
        4. This policy will contain a set of rules that will give monitoring user access to specific resources in your
        OCI. Make sure to add the following rules to the policy:
          
            ```
            Allow group 'zabbix_api' to read metrics in tenancy
            Allow group 'zabbix_api' to read instances in tenancy
            Allow group 'zabbix_api' to read subnets in tenancy
            Allow group 'zabbix_api' to read vcns in tenancy
            Allow group 'zabbix_api' to read vnic-attachments in tenancy
            Allow group 'zabbix_api' to read volumes in tenancy
            Allow group 'zabbix_api' to read objectstorage-namespaces in tenancy
            Allow group 'zabbix_api' to read buckets in tenancy
            Allow group 'zabbix_api' to read autonomous-databases in tenancy
            ```
          
            In this example, `zabbix_api` is the name of the previously created monitoring user. Rename it to your
        monitoring user's name.
        
        5. Generate an API key pair for your monitoring user - open your monitoring user profile and on the left side,
        press `API keys` and then, `Add API key` (if generating a new key pair, do not forget to save the private key).
          
        6. After this, Oracle Cloud Console will provide additional information that is required for access, such as:
        
            * Tenancy OCID;
              
            * User OCID;
              
            * Fingerprint;
              
            * Region.
        
            > Save this information somewhere or keep this window open. This information will be required in later steps.
        
        7. In Zabbix, create a new host and assign this template to it (Oracle Cloud by HTTP).
        
        8. In host wizard configuration fields please set next values (from step #6):
        
            * `OCID tenancy` - set the tenancy OCID value;
              
            * `OCID user` - set the user OCID value;
              
            * `Fingerprint` - set the fingerprint value;
              
            * `Private key` - copy and paste the contents of private key file here.
        
        9. After the authentication credentials are entered, you need to identify the OCI API endpoints that match your
        region (as provided by Oracle Cloud Console in step #6).
        To do so, you can use the OCI [API Reference and Endpoints](https://docs.public.oneportal.content.oci.oraclecloud.com/en-us/iaas/api/#/) list, where each API service has a dedicated page with the respective API endpoints.
        
           The required API service endpoints are:
          
           * [Core Services API](https://docs.public.oneportal.content.oci.oraclecloud.com/en-us/iaas/api/#/en/iaas/20160918/);
          
           * [Database Service API](https://docs.public.oneportal.content.oci.oraclecloud.com/en-us/iaas/api/#/en/database/20160918/);
          
           * [Object Storage Service API](https://docs.public.oneportal.content.oci.oraclecloud.com/en-us/iaas/api/#/en/objectstorage/20160918/);
          
           * [Monitoring API](https://docs.public.oneportal.content.oci.oraclecloud.com/en-us/iaas/api/#/en/monitoring/20180401/).
                
        10. When the API endpoints are identified, you need to set them in host wizard configuration fields (similarly to step #8):
        
            * `Core Services host` - Core Services API endpoint, for example, `iaas.eu-stockholm-1.oraclecloud.com`;
        
            * `Database Service host` - Database Service API endpoint, for example, `database.eu-stockholm-1.oraclecloud.com`;
        
            * `Object Storage host` - Object Storage Service API endpoint, for example, `objectstorage.eu-stockholm-1.oraclecloud.com`;
        
            * `Monitoring host` - Monitoring API endpoint, for example, `telemetry.eu-stockholm-1.oraclecloud.com`;
                                    
            > IMPORTANT! API Endpoint URLs need to be entered without the HTTP scheme (`https://`).
                                    
        11. Once you've completed adding the host to Zabbix, and it will automatically discover services and monitor them.
        
        ## Optional setup
        
        #### Example
        
        1. In Oracle Cloud Console, add a free-form tag to a resource, for example, a compute instance.
        The tag key will be `location_group` and the tag value will be `eu-north-1`.
        
        2. Open the Oracle Cloud by HTTP template in Zabbix and go to "Discovery rules".
        Find "Compute instances discovery" and open it.
        
        3. Under "LLD macros", add a new macro that will represent this location group tag, for example:
        `{#LOCATION_GROUP}` `$.tags.location_group`.
                                                                                                    
        4. Under the "Filters" tab, there will already be filters regarding the compute instance name and state.
        Click "Add" to add a new filter and define the previously created LLD macro and add a matching pattern and
        value, for example, `{#LOCATION_GROUP}` `matches` `eu-north-*`.
        
        5. The next time `Compute instances discovery` is executed, it will only discover OCI compute instances that
        have the free-form tag `location_group` that matches the regex of `eu-north-*`. You can also experiment with
        the LLD filter pattern matching value to receive different matching results for a specified value.
      vendor:
        name: Zabbix
        version: 8.0-0
      groups:
        - name: Templates/Cloud
      discovery_rules:
        - uuid: 72fa6dfedfd8497298c5930f48594e72
          name: 'Block volumes discovery'
          type: SCRIPT
          key: oci.block.volumes.discovery
          delay: 1h
          params: |
            function validateZabbixParams(requiredParams, allParams) {
            	requiredParams.forEach(function (field) {
            		if (typeof allParams !== 'object' || typeof allParams[field] === 'undefined' || allParams[field] === '') {
            			throw 'Required param is not set: ' + field + '.';
            		}
            	});
            }
            
            function prepareCompartments(compartments, tenancy) {
            	if (typeof compartments === 'undefined' || compartments === '') {
            		return [tenancy];
            	} else {
            		return compartments.split(',')
            	}
            }
            
            function OCI(service, action, params) {
            	this.zabbixLogPrefix = '[ OCI ] [ ' + service + ' ] [ ' + action + ' ]';
            	this.request = new HttpRequest();
            
            	this.hash = function (string) {
            		return sha256(string);
            	};
            
            	this.sign = function (string) {
            		return sign('sha256', params['private_key'], string);
            	};
            
            	this.encode = function (hash) {
            		const hexArr = hash.match(/.{1,2}/g);
            		var uInt8Array = new Uint8Array(hexArr.length);
            		hexArr.forEach(function (hex, idx) {
            			uInt8Array[idx] = parseInt(hex, 16);
            		});
            		return btoa(uInt8Array);
            	};
            
            	this.getDate = function () {
            		const weekdayShortList = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
            		const monthShortList = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'];
            		const today = new Date();
            		return weekdayShortList[today.getUTCDay()] + ', ' + today.getUTCDate() + ' ' + monthShortList[today.getUTCMonth()] + ' ' + today.getUTCFullYear() + ' ' + today.getUTCHours() + ':' + today.getUTCMinutes() + ':' + today.getUTCSeconds() + ' GMT';
            	};
            
            	this.executeRequest = function (httpMethod, apiPath, apiParams, mql, namespace) {
            		var headers = '(request-target) date host';
            		const contentTypeHeader = 'content-type: application/json';
            		const dateHeader = 'date: ' + this.getDate();
            		const hostHeader = 'host: ' + params['api_host'];
            		const requestTarget = '(request-target): ' + httpMethod + ' ' + apiPath + apiParams;
            		var signingString = requestTarget + '\n' + dateHeader + '\n' + hostHeader;
            		var reqHeaders = [contentTypeHeader, dateHeader];
            
            		if (httpMethod === 'post') {
            			var body = JSON.stringify({
            				'namespace': namespace,
            				'query': mql
            			});
            			headers = headers + ' x-content-sha256 content-type content-length';
            			const bodyHeader = 'x-content-sha256: ' + this.encode(this.hash(body));
            			const bodyLengthHeader = 'content-length: ' + body.length;
            			signingString = signingString + '\n' + bodyHeader + '\n' + contentTypeHeader + '\n' + bodyLengthHeader;
            			reqHeaders.push(bodyHeader, bodyLengthHeader);
            		}
            
            		const signature = this.encode(this.sign(signingString));
            
            		reqHeaders.push('Authorization: Signature version="1",keyId="' + params['tenancy_ocid'] + '/' + params['user_ocid'] + '/' + params['fingerprint'] + '",algorithm="rsa-sha256",headers="' + headers + '",signature="' + signature + '"');
            		for (var header = 0, headerLength = reqHeaders.length; header < headerLength; header++) {
            			this.request.addHeader(reqHeaders[header]);
            		}
            
            		if (params['http_proxy']) {
            			this.request.setProxy(params['http_proxy']);
            			Zabbix.log(4, this.zabbixLogPrefix + ' Using http proxy: ' + params['http_proxy']);
            		}
            
            		if (httpMethod === 'post') {
            			var apiRateLimitExceeded = false;
            			do {
            				const response = this.request.post('https://' + params['api_host'] + apiPath + apiParams, body);
            
            				try {
            					if (JSON.parse(response)['code'] === 'TooManyRequests') {
            
            						apiRateLimitExceeded = true;
            						Zabbix.sleep(1000);
            					} else {
            						apiRateLimitExceeded = false;
            					}
            				} catch (error) {
            					Zabbix.log(3, this.zabbixLogPrefix + ' Could not parse the response: ' + JSON.stringify(response));
            					throw 'Could not parse the response. See logs for more information.';
            				}
            			} while (apiRateLimitExceeded);
            		} else {
            			const response = this.request.get('https://' + params['api_host'] + apiPath + apiParams);
            		}
            
            		this.request.clearHeader();
            
            		if (this.request.getStatus() === parseInt(params['http_status_code'])) {
            			return response;
            		} else {
            			Zabbix.log(3, this.zabbixLogPrefix + ' Unexpected HTTP response code: ' + this.request.getStatus());
            			throw 'Unexpected HTTP response code: ' + this.request.getStatus();
            		}
            	};
            
            	this.extractData = function (httpMethod, data, keys, compartment) {
            		try {
            			data = JSON.parse(data);
            		} catch (error) {
            			Zabbix.log(3, this.zabbixLogPrefix + ' Could not parse the received JSON object: ' + data);
            			throw 'Could not parse received JSON object. See logs for more information.';
            		}
            
            		if (typeof keys == 'object') {
            			var returnBuffer = [];
            			for (var dataObj = 0, dataLength = data.length; dataObj < dataLength; dataObj++) {
            
            				var objectBuffer = {};
            				for (var key = 0, keysLength = keys.length; key < keysLength; key++) {
            					if (data[dataObj][keys[key]] || data[dataObj][keys[key]] == null) {
            						objectBuffer[keys[key].match(/^[a-z]+$|[A-Z][a-z]+$/)[0].toLowerCase()] = data[dataObj][keys[key]];
            					} else {
            						Zabbix.log(3, this.zabbixLogPrefix + ' Received an unexpected JSON object. Could not get value for key "' + keys[key] + '" in JSON: ' + JSON.stringify(data[dataObj]));
            						throw 'Received an unexpected JSON object. See logs for more information.';
            					}
            				}
            				if (typeof compartment != 'undefined' && compartment != '') objectBuffer['compartment'] = compartment;
            				returnBuffer.push(objectBuffer);
            			}
            			return returnBuffer;
            		}
            
            		try {
            			if (httpMethod === 'get') {
            				return data[keys];
            			} else {
            				if (data.length === 0) {
            					return 0;
            				}
            				data = data[0][keys];
            				return data[data.length - 1]['value'];
            			}
            		} catch (error) {
            			Zabbix.log(3, this.zabbixLogPrefix + ' Could not find key "' + keys + '" in JSON: ' + JSON.stringify(data));
            			throw 'Could not find required key in JSON object. See logs for more information.';
            		}
            	};
            }
            
            
            const params = JSON.parse(value);
            validateZabbixParams(['tenancy_ocid', 'user_ocid', 'private_key', 'fingerprint', 'api_host', 'http_status_code'], params);
            var oci = new OCI('Block volume', 'Get volumes', params);
            var compartments = prepareCompartments(params['compartment_ocid'], params['tenancy_ocid']);
            
            var buffer = [];
            compartments.forEach(function (compartment) {
            	Array.prototype.push.apply(buffer, oci.extractData('get', oci.executeRequest('get', '/20160918/volumes', '?compartmentId=' + encodeURIComponent(compartment)), ['id', 'displayName', 'lifecycleState', 'freeformTags'], compartment));
            })
            return JSON.stringify(buffer);
          filter:
            evaltype: AND
            conditions:
              - macro: '{#NAME}'
                value: '{$OCI.VOLUME.BLOCK.DISCOVERY.NAME.MATCHES}'
              - macro: '{#NAME}'
                value: '{$OCI.VOLUME.BLOCK.DISCOVERY.NAME.NOT_MATCHES}'
                operator: NOT_MATCHES_REGEX
              - macro: '{#STATE}'
                value: '{$OCI.VOLUME.BLOCK.DISCOVERY.STATE.MATCHES}'
              - macro: '{#STATE}'
                value: '{$OCI.VOLUME.BLOCK.DISCOVERY.STATE.NOT_MATCHES}'
                operator: NOT_MATCHES_REGEX
          description: 'Discover block volumes.'
          host_prototypes:
            - uuid: 5030f7dadd5b40558e07a4545d7346bd
              host: 'OCI Block Volume - {#ID}'
              name: 'OCI Block Volume - {#ID}'
              group_links:
                - group:
                    name: Applications
              templates:
                - name: 'Oracle Cloud Block Volume by HTTP'
              macros:
                - macro: '{$OCI.VOLUME.BLOCK.COMPARTMENT.ID}'
                  value: '{#COMPARTMENT}'
                  description: 'Block volume compartment ID.'
                - macro: '{$OCI.VOLUME.BLOCK.ID}'
                  value: '{#ID}'
                  description: 'Block volume ID.'
              tags:
                - tag: oci-block-vol-name
                  value: '{#NAME}'
                - tag: oci-compartment-id
                  value: '{#COMPARTMENT}'
          timeout: 10s
          parameters:
            - name: api_host
              value: '{$OCI.API.CORE.HOST}'
            - name: compartment_ocid
              value: '{$OCI.API.COMPARTMENT.VOLUME.BLOCK}'
            - name: fingerprint
              value: '{$OCI.API.FINGERPRINT}'
            - name: http_proxy
              value: '{$OCI.HTTP.PROXY}'
            - name: http_status_code
              value: '{$OCI.HTTP.RETURN.CODE.OK}'
            - name: private_key
              value: '{$OCI.API.PRIVATE.KEY}'
            - name: tenancy_ocid
              value: '{$OCI.API.TENANCY}'
            - name: user_ocid
              value: '{$OCI.API.USER}'
          lld_macro_paths:
            - lld_macro: '{#COMPARTMENT}'
              path: $.compartment
            - lld_macro: '{#ID}'
              path: $.id
            - lld_macro: '{#NAME}'
              path: $.name
            - lld_macro: '{#STATE}'
              path: $.state
        - uuid: 90982afdf2f9430bb1c5a3755d8e6c6d
          name: 'Boot volumes discovery'
          type: SCRIPT
          key: oci.boot.volumes.discovery
          delay: 1h
          params: |
            function validateZabbixParams(requiredParams, allParams) {
            	requiredParams.forEach(function (field) {
            		if (typeof allParams !== 'object' || typeof allParams[field] === 'undefined' || allParams[field] === '') {
            			throw 'Required param is not set: ' + field + '.';
            		}
            	});
            }
            
            function prepareCompartments(compartments, tenancy) {
            	if (typeof compartments === 'undefined' || compartments === '') {
            		return [tenancy];
            	} else {
            		return compartments.split(',')
            	}
            }
            
            function OCI(service, action, params) {
            	this.zabbixLogPrefix = '[ OCI ] [ ' + service + ' ] [ ' + action + ' ]';
            	this.request = new HttpRequest();
            
            	this.hash = function (string) {
            		return sha256(string);
            	};
            
            	this.sign = function (string) {
            		return sign('sha256', params['private_key'], string);
            	};
            
            	this.encode = function (hash) {
            		const hexArr = hash.match(/.{1,2}/g);
            		var uInt8Array = new Uint8Array(hexArr.length);
            		hexArr.forEach(function (hex, idx) {
            			uInt8Array[idx] = parseInt(hex, 16);
            		});
            		return btoa(uInt8Array);
            	};
            
            	this.getDate = function () {
            		const weekdayShortList = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
            		const monthShortList = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'];
            		const today = new Date();
            		return weekdayShortList[today.getUTCDay()] + ', ' + today.getUTCDate() + ' ' + monthShortList[today.getUTCMonth()] + ' ' + today.getUTCFullYear() + ' ' + today.getUTCHours() + ':' + today.getUTCMinutes() + ':' + today.getUTCSeconds() + ' GMT';
            	};
            
            	this.executeRequest = function (httpMethod, apiPath, apiParams, mql, namespace) {
            		var headers = '(request-target) date host';
            		const contentTypeHeader = 'content-type: application/json';
            		const dateHeader = 'date: ' + this.getDate();
            		const hostHeader = 'host: ' + params['api_host'];
            		const requestTarget = '(request-target): ' + httpMethod + ' ' + apiPath + apiParams;
            		var signingString = requestTarget + '\n' + dateHeader + '\n' + hostHeader;
            		var reqHeaders = [contentTypeHeader, dateHeader];
            
            		if (httpMethod === 'post') {
            			var body = JSON.stringify({
            				'namespace': namespace,
            				'query': mql
            			});
            			headers = headers + ' x-content-sha256 content-type content-length';
            			const bodyHeader = 'x-content-sha256: ' + this.encode(this.hash(body));
            			const bodyLengthHeader = 'content-length: ' + body.length;
            			signingString = signingString + '\n' + bodyHeader + '\n' + contentTypeHeader + '\n' + bodyLengthHeader;
            			reqHeaders.push(bodyHeader, bodyLengthHeader);
            		}
            
            		const signature = this.encode(this.sign(signingString));
            
            		reqHeaders.push('Authorization: Signature version="1",keyId="' + params['tenancy_ocid'] + '/' + params['user_ocid'] + '/' + params['fingerprint'] + '",algorithm="rsa-sha256",headers="' + headers + '",signature="' + signature + '"');
            		for (var header = 0, headerLength = reqHeaders.length; header < headerLength; header++) {
            			this.request.addHeader(reqHeaders[header]);
            		}
            
            		if (params['http_proxy']) {
            			this.request.setProxy(params['http_proxy']);
            			Zabbix.log(4, this.zabbixLogPrefix + ' Using http proxy: ' + params['http_proxy']);
            		}
            
            		if (httpMethod === 'post') {
            			var apiRateLimitExceeded = false;
            			do {
            				const response = this.request.post('https://' + params['api_host'] + apiPath + apiParams, body);
            
            				try {
            					if (JSON.parse(response)['code'] === 'TooManyRequests') {
            
            						apiRateLimitExceeded = true;
            						Zabbix.sleep(1000);
            					} else {
            						apiRateLimitExceeded = false;
            					}
            				} catch (error) {
            					Zabbix.log(3, this.zabbixLogPrefix + ' Could not parse the response: ' + JSON.stringify(response));
            					throw 'Could not parse the response. See logs for more information.';
            				}
            			} while (apiRateLimitExceeded);
            		} else {
            			const response = this.request.get('https://' + params['api_host'] + apiPath + apiParams);
            		}
            
            		this.request.clearHeader();
            
            		if (this.request.getStatus() === parseInt(params['http_status_code'])) {
            			return response;
            		} else {
            			Zabbix.log(3, this.zabbixLogPrefix + ' Unexpected HTTP response code: ' + this.request.getStatus());
            			throw 'Unexpected HTTP response code: ' + this.request.getStatus();
            		}
            	};
            
            	this.extractData = function (httpMethod, data, keys, compartment) {
            		try {
            			data = JSON.parse(data);
            		} catch (error) {
            			Zabbix.log(3, this.zabbixLogPrefix + ' Could not parse the received JSON object: ' + data);
            			throw 'Could not parse received JSON object. See logs for more information.';
            		}
            
            		if (typeof keys == 'object') {
            			var returnBuffer = [];
            			for (var dataObj = 0, dataLength = data.length; dataObj < dataLength; dataObj++) {
            
            				var objectBuffer = {};
            				for (var key = 0, keysLength = keys.length; key < keysLength; key++) {
            					if (data[dataObj][keys[key]] || data[dataObj][keys[key]] == null) {
            						objectBuffer[keys[key].match(/^[a-z]+$|[A-Z][a-z]+$/)[0].toLowerCase()] = data[dataObj][keys[key]];
            					} else {
            						Zabbix.log(3, this.zabbixLogPrefix + ' Received an unexpected JSON object. Could not get value for key "' + keys[key] + '" in JSON: ' + JSON.stringify(data[dataObj]));
            						throw 'Received an unexpected JSON object. See logs for more information.';
            					}
            				}
            				if (typeof compartment != 'undefined' && compartment != '') objectBuffer['compartment'] = compartment;
            				returnBuffer.push(objectBuffer);
            			}
            			return returnBuffer;
            		}
            
            		try {
            			if (httpMethod === 'get') {
            				return data[keys];
            			} else {
            				if (data.length === 0) {
            					return 0;
            				}
            				data = data[0][keys];
            				return data[data.length - 1]['value'];
            			}
            		} catch (error) {
            			Zabbix.log(3, this.zabbixLogPrefix + ' Could not find key "' + keys + '" in JSON: ' + JSON.stringify(data));
            			throw 'Could not find required key in JSON object. See logs for more information.';
            		}
            	};
            }
            
            
            const params = JSON.parse(value);
            validateZabbixParams(['tenancy_ocid', 'user_ocid', 'private_key', 'fingerprint', 'api_host', 'http_status_code'], params);
            var oci = new OCI('Boot volume', 'Get volumes', params);
            var compartments = prepareCompartments(params['compartment_ocid'], params['tenancy_ocid']);
            
            var buffer = [];
            compartments.forEach(function (compartment) {
            	Array.prototype.push.apply(buffer, oci.extractData('get', oci.executeRequest('get', '/20160918/bootVolumes', '?compartmentId=' + encodeURIComponent(compartment)), ['id', 'displayName', 'lifecycleState', 'freeformTags'], compartment));
            })
            return JSON.stringify(buffer);
          filter:
            evaltype: AND
            conditions:
              - macro: '{#NAME}'
                value: '{$OCI.VOLUME.BOOT.DISCOVERY.NAME.MATCHES}'
              - macro: '{#NAME}'
                value: '{$OCI.VOLUME.BOOT.DISCOVERY.NAME.NOT_MATCHES}'
                operator: NOT_MATCHES_REGEX
              - macro: '{#STATE}'
                value: '{$OCI.VOLUME.BOOT.DISCOVERY.STATE.MATCHES}'
              - macro: '{#STATE}'
                value: '{$OCI.VOLUME.BOOT.DISCOVERY.STATE.NOT_MATCHES}'
                operator: NOT_MATCHES_REGEX
          description: 'Discover boot volumes.'
          host_prototypes:
            - uuid: 914b808a4a014f6e824a3b9c53f1b492
              host: 'OCI Boot Volume - {#ID}'
              name: 'OCI Boot Volume - {#ID}'
              group_links:
                - group:
                    name: Applications
              templates:
                - name: 'Oracle Cloud Boot Volume by HTTP'
              macros:
                - macro: '{$OCI.VOLUME.BOOT.COMPARTMENT.ID}'
                  value: '{#COMPARTMENT}'
                  description: 'Boot volume compartment ID.'
                - macro: '{$OCI.VOLUME.BOOT.ID}'
                  value: '{#ID}'
                  description: 'Boot volume ID.'
              tags:
                - tag: oci-boot-vol-name
                  value: '{#NAME}'
                - tag: oci-compartment-id
                  value: '{#COMPARTMENT}'
          timeout: 10s
          parameters:
            - name: api_host
              value: '{$OCI.API.CORE.HOST}'
            - name: compartment_ocid
              value: '{$OCI.API.COMPARTMENT.VOLUME.BOOT}'
            - name: fingerprint
              value: '{$OCI.API.FINGERPRINT}'
            - name: http_proxy
              value: '{$OCI.HTTP.PROXY}'
            - name: http_status_code
              value: '{$OCI.HTTP.RETURN.CODE.OK}'
            - name: private_key
              value: '{$OCI.API.PRIVATE.KEY}'
            - name: tenancy_ocid
              value: '{$OCI.API.TENANCY}'
            - name: user_ocid
              value: '{$OCI.API.USER}'
          lld_macro_paths:
            - lld_macro: '{#COMPARTMENT}'
              path: $.compartment
            - lld_macro: '{#ID}'
              path: $.id
            - lld_macro: '{#NAME}'
              path: $.name
            - lld_macro: '{#STATE}'
              path: $.state
        - uuid: ea4bbd0e9737406693aa0051cf861115
          name: 'Compute instances discovery'
          type: SCRIPT
          key: oci.compute.discovery
          delay: 1h
          params: |
            function validateZabbixParams(requiredParams, allParams) {
            	requiredParams.forEach(function (field) {
            		if (typeof allParams !== 'object' || typeof allParams[field] === 'undefined' || allParams[field] === '') {
            			throw 'Required param is not set: ' + field + '.';
            		}
            	});
            }
            
            function prepareCompartments(compartments, tenancy) {
            	if (typeof compartments === 'undefined' || compartments === '') {
            		return [tenancy];
            	} else {
            		return compartments.split(',')
            	}
            }
            
            function OCI(service, action, params) {
            	this.zabbixLogPrefix = '[ OCI ] [ ' + service + ' ] [ ' + action + ' ]';
            	this.request = new HttpRequest();
            
            	this.hash = function (string) {
            		return sha256(string);
            	};
            
            	this.sign = function (string) {
            		return sign('sha256', params['private_key'], string);
            	};
            
            	this.encode = function (hash) {
            		const hexArr = hash.match(/.{1,2}/g);
            		var uInt8Array = new Uint8Array(hexArr.length);
            		hexArr.forEach(function (hex, idx) {
            			uInt8Array[idx] = parseInt(hex, 16);
            		});
            		return btoa(uInt8Array);
            	};
            
            	this.getDate = function () {
            		const weekdayShortList = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
            		const monthShortList = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'];
            		const today = new Date();
            		return weekdayShortList[today.getUTCDay()] + ', ' + today.getUTCDate() + ' ' + monthShortList[today.getUTCMonth()] + ' ' + today.getUTCFullYear() + ' ' + today.getUTCHours() + ':' + today.getUTCMinutes() + ':' + today.getUTCSeconds() + ' GMT';
            	};
            
            	this.executeRequest = function (httpMethod, apiPath, apiParams, mql, namespace) {
            		var headers = '(request-target) date host';
            		const contentTypeHeader = 'content-type: application/json';
            		const dateHeader = 'date: ' + this.getDate();
            		const hostHeader = 'host: ' + params['api_host'];
            		const requestTarget = '(request-target): ' + httpMethod + ' ' + apiPath + apiParams;
            		var signingString = requestTarget + '\n' + dateHeader + '\n' + hostHeader;
            		var reqHeaders = [contentTypeHeader, dateHeader];
            
            		if (httpMethod === 'post') {
            			var body = JSON.stringify({
            				'namespace': namespace,
            				'query': mql
            			});
            			headers = headers + ' x-content-sha256 content-type content-length';
            			const bodyHeader = 'x-content-sha256: ' + this.encode(this.hash(body));
            			const bodyLengthHeader = 'content-length: ' + body.length;
            			signingString = signingString + '\n' + bodyHeader + '\n' + contentTypeHeader + '\n' + bodyLengthHeader;
            			reqHeaders.push(bodyHeader, bodyLengthHeader);
            		}
            
            		const signature = this.encode(this.sign(signingString));
            
            		reqHeaders.push('Authorization: Signature version="1",keyId="' + params['tenancy_ocid'] + '/' + params['user_ocid'] + '/' + params['fingerprint'] + '",algorithm="rsa-sha256",headers="' + headers + '",signature="' + signature + '"');
            		for (var header = 0, headerLength = reqHeaders.length; header < headerLength; header++) {
            			this.request.addHeader(reqHeaders[header]);
            		}
            
            		if (params['http_proxy']) {
            			this.request.setProxy(params['http_proxy']);
            			Zabbix.log(4, this.zabbixLogPrefix + ' Using http proxy: ' + params['http_proxy']);
            		}
            
            		if (httpMethod === 'post') {
            			var apiRateLimitExceeded = false;
            			do {
            				const response = this.request.post('https://' + params['api_host'] + apiPath + apiParams, body);
            
            				try {
            					if (JSON.parse(response)['code'] === 'TooManyRequests') {
            
            						apiRateLimitExceeded = true;
            						Zabbix.sleep(1000);
            					} else {
            						apiRateLimitExceeded = false;
            					}
            				} catch (error) {
            					Zabbix.log(3, this.zabbixLogPrefix + ' Could not parse the response: ' + JSON.stringify(response));
            					throw 'Could not parse the response. See logs for more information.';
            				}
            			} while (apiRateLimitExceeded);
            		} else {
            			const response = this.request.get('https://' + params['api_host'] + apiPath + apiParams);
            		}
            
            		this.request.clearHeader();
            
            		if (this.request.getStatus() === parseInt(params['http_status_code'])) {
            			return response;
            		} else {
            			Zabbix.log(3, this.zabbixLogPrefix + ' Unexpected HTTP response code: ' + this.request.getStatus());
            			throw 'Unexpected HTTP response code: ' + this.request.getStatus();
            		}
            	};
            
            	this.extractData = function (httpMethod, data, keys, compartment) {
            		try {
            			data = JSON.parse(data);
            		} catch (error) {
            			Zabbix.log(3, this.zabbixLogPrefix + ' Could not parse the received JSON object: ' + data);
            			throw 'Could not parse received JSON object. See logs for more information.';
            		}
            
            		if (typeof keys == 'object') {
            			var returnBuffer = [];
            			for (var dataObj = 0, dataLength = data.length; dataObj < dataLength; dataObj++) {
            
            				var objectBuffer = {};
            				for (var key = 0, keysLength = keys.length; key < keysLength; key++) {
            					if (data[dataObj][keys[key]] || data[dataObj][keys[key]] == null) {
            						objectBuffer[keys[key].match(/^[a-z]+$|[A-Z][a-z]+$/)[0].toLowerCase()] = data[dataObj][keys[key]];
            					} else {
            						Zabbix.log(3, this.zabbixLogPrefix + ' Received an unexpected JSON object. Could not get value for key "' + keys[key] + '" in JSON: ' + JSON.stringify(data[dataObj]));
            						throw 'Received an unexpected JSON object. See logs for more information.';
            					}
            				}
            				if (typeof compartment != 'undefined' && compartment != '') objectBuffer['compartment'] = compartment;
            				returnBuffer.push(objectBuffer);
            			}
            			return returnBuffer;
            		}
            
            		try {
            			if (httpMethod === 'get') {
            				return data[keys];
            			} else {
            				if (data.length === 0) {
            					return 0;
            				}
            				data = data[0][keys];
            				return data[data.length - 1]['value'];
            			}
            		} catch (error) {
            			Zabbix.log(3, this.zabbixLogPrefix + ' Could not find key "' + keys + '" in JSON: ' + JSON.stringify(data));
            			throw 'Could not find required key in JSON object. See logs for more information.';
            		}
            	};
            }
            
            
            const params = JSON.parse(value);
            validateZabbixParams(['tenancy_ocid', 'user_ocid', 'private_key', 'fingerprint', 'api_host', 'http_status_code'], params);
            var oci = new OCI('Compute', 'Get instances', params);
            var compartments = prepareCompartments(params['compartment_ocid'], params['tenancy_ocid']);
            
            var buffer = [];
            compartments.forEach(function (compartment) {
            	Array.prototype.push.apply(buffer, oci.extractData('get', oci.executeRequest('get', '/20160918/instances', '?compartmentId=' + encodeURIComponent(compartment)), ['id', 'displayName', 'lifecycleState', 'freeformTags', 'availabilityDomain'], compartment));
            })
            return JSON.stringify(buffer);
          filter:
            evaltype: AND
            conditions:
              - macro: '{#NAME}'
                value: '{$OCI.COMPUTE.DISCOVERY.NAME.MATCHES}'
              - macro: '{#NAME}'
                value: '{$OCI.COMPUTE.DISCOVERY.NAME.NOT_MATCHES}'
                operator: NOT_MATCHES_REGEX
              - macro: '{#STATE}'
                value: '{$OCI.COMPUTE.DISCOVERY.STATE.MATCHES}'
              - macro: '{#STATE}'
                value: '{$OCI.COMPUTE.DISCOVERY.STATE.NOT_MATCHES}'
                operator: NOT_MATCHES_REGEX
          description: 'Discover compute instances.'
          host_prototypes:
            - uuid: 9337374066e04291b2f94f8ad5470f54
              host: 'OCI Compute - {#ID}'
              name: 'OCI Compute - {#ID}'
              group_links:
                - group:
                    name: 'Virtual machines'
              templates:
                - name: 'Oracle Cloud Compute by HTTP'
              macros:
                - macro: '{$OCI.COMPUTE.AVAILABILITY.DOMAIN}'
                  value: '{#DOMAIN}'
                  description: 'Availability domain for instance.'
                - macro: '{$OCI.COMPUTE.COMPARTMENT.ID}'
                  value: '{#COMPARTMENT}'
                  description: 'Compartment ID of OCI compute instance.'
                - macro: '{$OCI.COMPUTE.INSTANCE.ID}'
                  value: '{#ID}'
                  description: 'ID of OCI compute instance.'
              tags:
                - tag: oci-compartment-id
                  value: '{#COMPARTMENT}'
                - tag: oci-compute-name
                  value: '{#NAME}'
          timeout: 10s
          parameters:
            - name: api_host
              value: '{$OCI.API.CORE.HOST}'
            - name: compartment_ocid
              value: '{$OCI.API.COMPARTMENT.COMPUTE}'
            - name: fingerprint
              value: '{$OCI.API.FINGERPRINT}'
            - name: http_proxy
              value: '{$OCI.HTTP.PROXY}'
            - name: http_status_code
              value: '{$OCI.HTTP.RETURN.CODE.OK}'
            - name: private_key
              value: '{$OCI.API.PRIVATE.KEY}'
            - name: tenancy_ocid
              value: '{$OCI.API.TENANCY}'
            - name: user_ocid
              value: '{$OCI.API.USER}'
          lld_macro_paths:
            - lld_macro: '{#COMPARTMENT}'
              path: $.compartment
            - lld_macro: '{#DOMAIN}'
              path: $.domain
            - lld_macro: '{#ID}'
              path: $.id
            - lld_macro: '{#NAME}'
              path: $.name
            - lld_macro: '{#STATE}'
              path: $.state
        - uuid: c69611c5b86043b28c8ce2bc0627b377
          name: 'Autonomous database discovery'
          type: SCRIPT
          key: oci.object.autonomous.db.discovery
          delay: 1h
          params: |
            function validateZabbixParams(requiredParams, allParams) {
            	requiredParams.forEach(function (field) {
            		if (typeof allParams !== 'object' || typeof allParams[field] === 'undefined' || allParams[field] === '') {
            			throw 'Required param is not set: ' + field + '.';
            		}
            	});
            }
            
            function prepareCompartments(compartments, tenancy) {
            	if (typeof compartments === 'undefined' || compartments === '') {
            		return [tenancy];
            	} else {
            		return compartments.split(',')
            	}
            }
            
            function OCI(service, action, params) {
            	this.zabbixLogPrefix = '[ OCI ] [ ' + service + ' ] [ ' + action + ' ]';
            	this.request = new HttpRequest();
            
            	this.hash = function (string) {
            		return sha256(string);
            	};
            
            	this.sign = function (string) {
            		return sign('sha256', params['private_key'], string);
            	};
            
            	this.encode = function (hash) {
            		const hexArr = hash.match(/.{1,2}/g);
            		var uInt8Array = new Uint8Array(hexArr.length);
            		hexArr.forEach(function (hex, idx) {
            			uInt8Array[idx] = parseInt(hex, 16);
            		});
            		return btoa(uInt8Array);
            	};
            
            	this.getDate = function () {
            		const weekdayShortList = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
            		const monthShortList = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'];
            		const today = new Date();
            		return weekdayShortList[today.getUTCDay()] + ', ' + today.getUTCDate() + ' ' + monthShortList[today.getUTCMonth()] + ' ' + today.getUTCFullYear() + ' ' + today.getUTCHours() + ':' + today.getUTCMinutes() + ':' + today.getUTCSeconds() + ' GMT';
            	};
            
            	this.executeRequest = function (httpMethod, apiPath, apiParams, mql, namespace) {
            		var headers = '(request-target) date host';
            		const contentTypeHeader = 'content-type: application/json';
            		const dateHeader = 'date: ' + this.getDate();
            		const hostHeader = 'host: ' + params['api_host'];
            		const requestTarget = '(request-target): ' + httpMethod + ' ' + apiPath + apiParams;
            		var signingString = requestTarget + '\n' + dateHeader + '\n' + hostHeader;
            		var reqHeaders = [contentTypeHeader, dateHeader];
            
            		if (httpMethod === 'post') {
            			var body = JSON.stringify({
            				'namespace': namespace,
            				'query': mql
            			});
            			headers = headers + ' x-content-sha256 content-type content-length';
            			const bodyHeader = 'x-content-sha256: ' + this.encode(this.hash(body));
            			const bodyLengthHeader = 'content-length: ' + body.length;
            			signingString = signingString + '\n' + bodyHeader + '\n' + contentTypeHeader + '\n' + bodyLengthHeader;
            			reqHeaders.push(bodyHeader, bodyLengthHeader);
            		}
            
            		const signature = this.encode(this.sign(signingString));
            
            		reqHeaders.push('Authorization: Signature version="1",keyId="' + params['tenancy_ocid'] + '/' + params['user_ocid'] + '/' + params['fingerprint'] + '",algorithm="rsa-sha256",headers="' + headers + '",signature="' + signature + '"');
            		for (var header = 0, headerLength = reqHeaders.length; header < headerLength; header++) {
            			this.request.addHeader(reqHeaders[header]);
            		}
            
            		if (params['http_proxy']) {
            			this.request.setProxy(params['http_proxy']);
            			Zabbix.log(4, this.zabbixLogPrefix + ' Using http proxy: ' + params['http_proxy']);
            		}
            
            		if (httpMethod === 'post') {
            			var apiRateLimitExceeded = false;
            			do {
            				const response = this.request.post('https://' + params['api_host'] + apiPath + apiParams, body);
            
            				try {
            					if (JSON.parse(response)['code'] === 'TooManyRequests') {
            
            						apiRateLimitExceeded = true;
            						Zabbix.sleep(1000);
            					} else {
            						apiRateLimitExceeded = false;
            					}
            				} catch (error) {
            					Zabbix.log(3, this.zabbixLogPrefix + ' Could not parse the response: ' + JSON.stringify(response));
            					throw 'Could not parse the response. See logs for more information.';
            				}
            			} while (apiRateLimitExceeded);
            		} else {
            			const response = this.request.get('https://' + params['api_host'] + apiPath + apiParams);
            		}
            
            		this.request.clearHeader();
            
            		if (this.request.getStatus() === parseInt(params['http_status_code'])) {
            			return response;
            		} else {
            			Zabbix.log(3, this.zabbixLogPrefix + ' Unexpected HTTP response code: ' + this.request.getStatus());
            			throw 'Unexpected HTTP response code: ' + this.request.getStatus();
            		}
            	};
            
            	this.extractData = function (httpMethod, data, keys, compartment) {
            		try {
            			data = JSON.parse(data);
            		} catch (error) {
            			Zabbix.log(3, this.zabbixLogPrefix + ' Could not parse the received JSON object: ' + data);
            			throw 'Could not parse received JSON object. See logs for more information.';
            		}
            
            		if (typeof keys == 'object') {
            			var returnBuffer = [];
            			for (var dataObj = 0, dataLength = data.length; dataObj < dataLength; dataObj++) {
            
            				var objectBuffer = {};
            				for (var key = 0, keysLength = keys.length; key < keysLength; key++) {
            					if (data[dataObj][keys[key]] || data[dataObj][keys[key]] == null) {
            						objectBuffer[keys[key].match(/^[a-z]+$|[A-Z][a-z]+$/)[0].toLowerCase()] = data[dataObj][keys[key]];
            					} else {
            						Zabbix.log(3, this.zabbixLogPrefix + ' Received an unexpected JSON object. Could not get value for key "' + keys[key] + '" in JSON: ' + JSON.stringify(data[dataObj]));
            						throw 'Received an unexpected JSON object. See logs for more information.';
            					}
            				}
            				if (typeof compartment != 'undefined' && compartment != '') objectBuffer['compartment'] = compartment;
            				returnBuffer.push(objectBuffer);
            			}
            			return returnBuffer;
            		}
            
            		try {
            			if (httpMethod === 'get') {
            				return data[keys];
            			} else {
            				if (data.length === 0) {
            					return 0;
            				}
            				data = data[0][keys];
            				return data[data.length - 1]['value'];
            			}
            		} catch (error) {
            			Zabbix.log(3, this.zabbixLogPrefix + ' Could not find key "' + keys + '" in JSON: ' + JSON.stringify(data));
            			throw 'Could not find required key in JSON object. See logs for more information.';
            		}
            	};
            }
            
            
            const params = JSON.parse(value);
            validateZabbixParams(['tenancy_ocid', 'user_ocid', 'private_key', 'fingerprint', 'api_host', 'http_status_code'], params);
            var oci = new OCI('Autonomous DB', 'Get DBs', params);
            var compartments = prepareCompartments(params['compartment_ocid'], params['tenancy_ocid']);
            
            var buffer = [];
            compartments.forEach(function (compartment) {
            	Array.prototype.push.apply(buffer, oci.extractData('get', oci.executeRequest('get', '/20160918/autonomousDatabases', '?compartmentId=' + encodeURIComponent(compartment)), ['id', 'dbName', 'lifecycleState', 'freeformTags'], compartment));
            })
            return JSON.stringify(buffer);
          filter:
            evaltype: AND
            conditions:
              - macro: '{#NAME}'
                value: '{$OCI.AUTONOMOUS.DB.DISCOVERY.NAME.MATCHES}'
              - macro: '{#NAME}'
                value: '{$OCI.AUTONOMOUS.DB.DISCOVERY.NAME.NOT_MATCHES}'
                operator: NOT_MATCHES_REGEX
              - macro: '{#STATE}'
                value: '{$OCI.AUTONOMOUS.DB.DISCOVERY.STATE.MATCHES}'
              - macro: '{#STATE}'
                value: '{$OCI.AUTONOMOUS.DB.DISCOVERY.STATE.NOT_MATCHES}'
                operator: NOT_MATCHES_REGEX
          description: 'Discover autonomous databases.'
          host_prototypes:
            - uuid: 88d0076a057c441ab5a531cfcb650e84
              host: 'OCI Autonomous DB - {#NAME}'
              name: 'OCI Autonomous DB - {#NAME}'
              group_links:
                - group:
                    name: Databases
              templates:
                - name: 'Oracle Cloud Autonomous Database by HTTP'
              macros:
                - macro: '{$OCI.AUTONOMOUS.DB.COMPARTMENT.ID}'
                  value: '{#COMPARTMENT}'
                  description: 'Autonomous database compartment ID.'
                - macro: '{$OCI.AUTONOMOUS.DB.ID}'
                  value: '{#ID}'
                  description: 'ID of OCI autonomous database.'
              tags:
                - tag: oci-aut-db-name
                  value: '{#NAME}'
                - tag: oci-compartment-id
                  value: '{#COMPARTMENT}'
          timeout: 10s
          parameters:
            - name: api_host
              value: '{$OCI.API.AUTONOMOUS.DB.HOST}'
            - name: compartment_ocid
              value: '{$OCI.API.COMPARTMENT.AUTONOMOUS.DB}'
            - name: fingerprint
              value: '{$OCI.API.FINGERPRINT}'
            - name: http_proxy
              value: '{$OCI.HTTP.PROXY}'
            - name: http_status_code
              value: '{$OCI.HTTP.RETURN.CODE.OK}'
            - name: private_key
              value: '{$OCI.API.PRIVATE.KEY}'
            - name: tenancy_ocid
              value: '{$OCI.API.TENANCY}'
            - name: user_ocid
              value: '{$OCI.API.USER}'
          lld_macro_paths:
            - lld_macro: '{#COMPARTMENT}'
              path: $.compartment
            - lld_macro: '{#ID}'
              path: $.id
            - lld_macro: '{#NAME}'
              path: $.name
            - lld_macro: '{#STATE}'
              path: $.state
        - uuid: e1949f127af04efeb8c192f23e45b58a
          name: 'Object storage discovery'
          type: SCRIPT
          key: oci.object.storage.discovery
          delay: 1h
          params: |
            function validateZabbixParams(requiredParams, allParams) {
            	requiredParams.forEach(function (field) {
            		if (typeof allParams !== 'object' || typeof allParams[field] === 'undefined' || allParams[field] === '') {
            			throw 'Required param is not set: ' + field + '.';
            		}
            	});
            }
            
            function prepareCompartments(compartments, tenancy) {
            	if (typeof compartments === 'undefined' || compartments === '') {
            		return [tenancy];
            	} else {
            		return compartments.split(',')
            	}
            }
            
            function OCI(service, action, params) {
            	this.zabbixLogPrefix = '[ OCI ] [ ' + service + ' ] [ ' + action + ' ]';
            	this.request = new HttpRequest();
            
            	this.hash = function (string) {
            		return sha256(string);
            	};
            
            	this.sign = function (string) {
            		return sign('sha256', params['private_key'], string);
            	};
            
            	this.encode = function (hash) {
            		const hexArr = hash.match(/.{1,2}/g);
            		var uInt8Array = new Uint8Array(hexArr.length);
            		hexArr.forEach(function (hex, idx) {
            			uInt8Array[idx] = parseInt(hex, 16);
            		});
            		return btoa(uInt8Array);
            	};
            
            	this.getDate = function () {
            		const weekdayShortList = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
            		const monthShortList = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'];
            		const today = new Date();
            		return weekdayShortList[today.getUTCDay()] + ', ' + today.getUTCDate() + ' ' + monthShortList[today.getUTCMonth()] + ' ' + today.getUTCFullYear() + ' ' + today.getUTCHours() + ':' + today.getUTCMinutes() + ':' + today.getUTCSeconds() + ' GMT';
            	};
            
            	this.executeRequest = function (httpMethod, apiPath, apiParams, mql, namespace) {
            		var headers = '(request-target) date host';
            		const contentTypeHeader = 'content-type: application/json';
            		const dateHeader = 'date: ' + this.getDate();
            		const hostHeader = 'host: ' + params['api_host'];
            		const requestTarget = '(request-target): ' + httpMethod + ' ' + apiPath + apiParams;
            		var signingString = requestTarget + '\n' + dateHeader + '\n' + hostHeader;
            		var reqHeaders = [contentTypeHeader, dateHeader];
            
            		if (httpMethod === 'post') {
            			var body = JSON.stringify({
            				'namespace': namespace,
            				'query': mql
            			});
            			headers = headers + ' x-content-sha256 content-type content-length';
            			const bodyHeader = 'x-content-sha256: ' + this.encode(this.hash(body));
            			const bodyLengthHeader = 'content-length: ' + body.length;
            			signingString = signingString + '\n' + bodyHeader + '\n' + contentTypeHeader + '\n' + bodyLengthHeader;
            			reqHeaders.push(bodyHeader, bodyLengthHeader);
            		}
            
            		const signature = this.encode(this.sign(signingString));
            
            		reqHeaders.push('Authorization: Signature version="1",keyId="' + params['tenancy_ocid'] + '/' + params['user_ocid'] + '/' + params['fingerprint'] + '",algorithm="rsa-sha256",headers="' + headers + '",signature="' + signature + '"');
            		for (var header = 0, headerLength = reqHeaders.length; header < headerLength; header++) {
            			this.request.addHeader(reqHeaders[header]);
            		}
            
            		if (params['http_proxy']) {
            			this.request.setProxy(params['http_proxy']);
            			Zabbix.log(4, this.zabbixLogPrefix + ' Using http proxy: ' + params['http_proxy']);
            		}
            
            		if (httpMethod === 'post') {
            			var apiRateLimitExceeded = false;
            			do {
            				const response = this.request.post('https://' + params['api_host'] + apiPath + apiParams, body);
            
            				try {
            					if (JSON.parse(response)['code'] === 'TooManyRequests') {
            
            						apiRateLimitExceeded = true;
            						Zabbix.sleep(1000);
            					} else {
            						apiRateLimitExceeded = false;
            					}
            				} catch (error) {
            					Zabbix.log(3, this.zabbixLogPrefix + ' Could not parse the response: ' + JSON.stringify(response));
            					throw 'Could not parse the response. See logs for more information.';
            				}
            			} while (apiRateLimitExceeded);
            		} else {
            			const response = this.request.get('https://' + params['api_host'] + apiPath + apiParams);
            		}
            
            		this.request.clearHeader();
            
            		if (this.request.getStatus() === parseInt(params['http_status_code'])) {
            			return response;
            		} else {
            			Zabbix.log(3, this.zabbixLogPrefix + ' Unexpected HTTP response code: ' + this.request.getStatus());
            			throw 'Unexpected HTTP response code: ' + this.request.getStatus();
            		}
            	};
            
            	this.extractData = function (httpMethod, data, keys, compartment) {
            		try {
            			data = JSON.parse(data);
            		} catch (error) {
            			Zabbix.log(3, this.zabbixLogPrefix + ' Could not parse the received JSON object: ' + data);
            			throw 'Could not parse received JSON object. See logs for more information.';
            		}
            
            		if (typeof keys == 'object') {
            			var returnBuffer = [];
            			for (var dataObj = 0, dataLength = data.length; dataObj < dataLength; dataObj++) {
            
            				var objectBuffer = {};
            				for (var key = 0, keysLength = keys.length; key < keysLength; key++) {
            					if (data[dataObj][keys[key]] || data[dataObj][keys[key]] == null) {
            						objectBuffer[keys[key].match(/^[a-z]+$|[A-Z][a-z]+$/)[0].toLowerCase()] = data[dataObj][keys[key]];
            					} else {
            						Zabbix.log(3, this.zabbixLogPrefix + ' Received an unexpected JSON object. Could not get value for key "' + keys[key] + '" in JSON: ' + JSON.stringify(data[dataObj]));
            						throw 'Received an unexpected JSON object. See logs for more information.';
            					}
            				}
            				if (typeof compartment != 'undefined' && compartment != '') objectBuffer['compartment'] = compartment;
            				returnBuffer.push(objectBuffer);
            			}
            			return returnBuffer;
            		}
            
            		try {
            			if (httpMethod === 'get') {
            				return data[keys];
            			} else {
            				if (data.length === 0) {
            					return 0;
            				}
            				data = data[0][keys];
            				return data[data.length - 1]['value'];
            			}
            		} catch (error) {
            			Zabbix.log(3, this.zabbixLogPrefix + ' Could not find key "' + keys + '" in JSON: ' + JSON.stringify(data));
            			throw 'Could not find required key in JSON object. See logs for more information.';
            		}
            	};
            }
            
            
            const params = JSON.parse(value);
            validateZabbixParams(['tenancy_ocid', 'user_ocid', 'private_key', 'fingerprint', 'api_host', 'http_status_code'], params);
            var oci = new OCI('Object storage', 'Get buckets', params);
            var compartments = prepareCompartments(params['compartment_ocid'], params['tenancy_ocid']);
            const namespace = JSON.parse(oci.executeRequest('get', '/n', ''));
            
            var buffer = [];
            compartments.forEach(function (compartment) {
            	Array.prototype.push.apply(buffer, oci.extractData('get', oci.executeRequest('get', '/n/' + encodeURIComponent(namespace) + '/b/', '?compartmentId=' + encodeURIComponent(compartment) + '&fields=tags'), ['name', 'freeformTags'], compartment));
            })
            return JSON.stringify(buffer);
          filter:
            evaltype: AND
            conditions:
              - macro: '{#NAME}'
                value: '{$OCI.OBJECT.STORAGE.DISCOVERY.NAME.MATCHES}'
              - macro: '{#NAME}'
                value: '{$OCI.OBJECT.STORAGE.DISCOVERY.NAME.NOT_MATCHES}'
                operator: NOT_MATCHES_REGEX
          description: 'Discover object storage.'
          host_prototypes:
            - uuid: f71e979727ce42daa80a34da5ffb296f
              host: 'OCI Bucket - {#NAME}'
              name: 'OCI Bucket - {#NAME}'
              group_links:
                - group:
                    name: Applications
              templates:
                - name: 'Oracle Cloud Object Storage by HTTP'
              macros:
                - macro: '{$OCI.OBJECT.STORAGE.BUCKET}'
                  value: '{#NAME}'
                  description: 'Object storage bucket name.'
                - macro: '{$OCI.OBJECT.STORAGE.COMPARTMENT.ID}'
                  value: '{#COMPARTMENT}'
                  description: 'Object storage bucket compartment ID.'
              tags:
                - tag: oci-compartment-id
                  value: '{#COMPARTMENT}'
                - tag: oci-obj-store-name
                  value: '{#NAME}'
          timeout: 10s
          parameters:
            - name: api_host
              value: '{$OCI.API.OBJECT.STORAGE.HOST}'
            - name: compartment_ocid
              value: '{$OCI.API.COMPARTMENT.OBJECT.STORAGE}'
            - name: fingerprint
              value: '{$OCI.API.FINGERPRINT}'
            - name: http_proxy
              value: '{$OCI.HTTP.PROXY}'
            - name: http_status_code
              value: '{$OCI.HTTP.RETURN.CODE.OK}'
            - name: private_key
              value: '{$OCI.API.PRIVATE.KEY}'
            - name: tenancy_ocid
              value: '{$OCI.API.TENANCY}'
            - name: user_ocid
              value: '{$OCI.API.USER}'
          lld_macro_paths:
            - lld_macro: '{#COMPARTMENT}'
              path: $.compartment
            - lld_macro: '{#NAME}'
              path: $.name
        - uuid: 378d760173924bf48fbc25c74a520a8b
          name: 'Virtual cloud networks discovery'
          type: SCRIPT
          key: oci.vcn.discovery
          delay: 1h
          params: |
            function validateZabbixParams(requiredParams, allParams) {
            	requiredParams.forEach(function (field) {
            		if (typeof allParams !== 'object' || typeof allParams[field] === 'undefined' || allParams[field] === '') {
            			throw 'Required param is not set: ' + field + '.';
            		}
            	});
            }
            
            function prepareCompartments(compartments, tenancy) {
            	if (typeof compartments === 'undefined' || compartments === '') {
            		return [tenancy];
            	} else {
            		return compartments.split(',')
            	}
            }
            
            function OCI(service, action, params) {
            	this.zabbixLogPrefix = '[ OCI ] [ ' + service + ' ] [ ' + action + ' ]';
            	this.request = new HttpRequest();
            
            	this.hash = function (string) {
            		return sha256(string);
            	};
            
            	this.sign = function (string) {
            		return sign('sha256', params['private_key'], string);
            	};
            
            	this.encode = function (hash) {
            		const hexArr = hash.match(/.{1,2}/g);
            		var uInt8Array = new Uint8Array(hexArr.length);
            		hexArr.forEach(function (hex, idx) {
            			uInt8Array[idx] = parseInt(hex, 16);
            		});
            		return btoa(uInt8Array);
            	};
            
            	this.getDate = function () {
            		const weekdayShortList = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
            		const monthShortList = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'];
            		const today = new Date();
            		return weekdayShortList[today.getUTCDay()] + ', ' + today.getUTCDate() + ' ' + monthShortList[today.getUTCMonth()] + ' ' + today.getUTCFullYear() + ' ' + today.getUTCHours() + ':' + today.getUTCMinutes() + ':' + today.getUTCSeconds() + ' GMT';
            	};
            
            	this.executeRequest = function (httpMethod, apiPath, apiParams, mql, namespace) {
            		var headers = '(request-target) date host';
            		const contentTypeHeader = 'content-type: application/json';
            		const dateHeader = 'date: ' + this.getDate();
            		const hostHeader = 'host: ' + params['api_host'];
            		const requestTarget = '(request-target): ' + httpMethod + ' ' + apiPath + apiParams;
            		var signingString = requestTarget + '\n' + dateHeader + '\n' + hostHeader;
            		var reqHeaders = [contentTypeHeader, dateHeader];
            
            		if (httpMethod === 'post') {
            			var body = JSON.stringify({
            				'namespace': namespace,
            				'query': mql
            			});
            			headers = headers + ' x-content-sha256 content-type content-length';
            			const bodyHeader = 'x-content-sha256: ' + this.encode(this.hash(body));
            			const bodyLengthHeader = 'content-length: ' + body.length;
            			signingString = signingString + '\n' + bodyHeader + '\n' + contentTypeHeader + '\n' + bodyLengthHeader;
            			reqHeaders.push(bodyHeader, bodyLengthHeader);
            		}
            
            		const signature = this.encode(this.sign(signingString));
            
            		reqHeaders.push('Authorization: Signature version="1",keyId="' + params['tenancy_ocid'] + '/' + params['user_ocid'] + '/' + params['fingerprint'] + '",algorithm="rsa-sha256",headers="' + headers + '",signature="' + signature + '"');
            		for (var header = 0, headerLength = reqHeaders.length; header < headerLength; header++) {
            			this.request.addHeader(reqHeaders[header]);
            		}
            
            		if (params['http_proxy']) {
            			this.request.setProxy(params['http_proxy']);
            			Zabbix.log(4, this.zabbixLogPrefix + ' Using http proxy: ' + params['http_proxy']);
            		}
            
            		if (httpMethod === 'post') {
            			var apiRateLimitExceeded = false;
            			do {
            				const response = this.request.post('https://' + params['api_host'] + apiPath + apiParams, body);
            
            				try {
            					if (JSON.parse(response)['code'] === 'TooManyRequests') {
            
            						apiRateLimitExceeded = true;
            						Zabbix.sleep(1000);
            					} else {
            						apiRateLimitExceeded = false;
            					}
            				} catch (error) {
            					Zabbix.log(3, this.zabbixLogPrefix + ' Could not parse the response: ' + JSON.stringify(response));
            					throw 'Could not parse the response. See logs for more information.';
            				}
            			} while (apiRateLimitExceeded);
            		} else {
            			const response = this.request.get('https://' + params['api_host'] + apiPath + apiParams);
            		}
            
            		this.request.clearHeader();
            
            		if (this.request.getStatus() === parseInt(params['http_status_code'])) {
            			return response;
            		} else {
            			Zabbix.log(3, this.zabbixLogPrefix + ' Unexpected HTTP response code: ' + this.request.getStatus());
            			throw 'Unexpected HTTP response code: ' + this.request.getStatus();
            		}
            	};
            
            	this.extractData = function (httpMethod, data, keys, compartment) {
            		try {
            			data = JSON.parse(data);
            		} catch (error) {
            			Zabbix.log(3, this.zabbixLogPrefix + ' Could not parse the received JSON object: ' + data);
            			throw 'Could not parse received JSON object. See logs for more information.';
            		}
            
            		if (typeof keys == 'object') {
            			var returnBuffer = [];
            			for (var dataObj = 0, dataLength = data.length; dataObj < dataLength; dataObj++) {
            
            				var objectBuffer = {};
            				for (var key = 0, keysLength = keys.length; key < keysLength; key++) {
            					if (data[dataObj][keys[key]] || data[dataObj][keys[key]] == null) {
            						objectBuffer[keys[key].match(/^[a-z]+$|[A-Z][a-z]+$/)[0].toLowerCase()] = data[dataObj][keys[key]];
            					} else {
            						Zabbix.log(3, this.zabbixLogPrefix + ' Received an unexpected JSON object. Could not get value for key "' + keys[key] + '" in JSON: ' + JSON.stringify(data[dataObj]));
            						throw 'Received an unexpected JSON object. See logs for more information.';
            					}
            				}
            				if (typeof compartment != 'undefined' && compartment != '') objectBuffer['compartment'] = compartment;
            				returnBuffer.push(objectBuffer);
            			}
            			return returnBuffer;
            		}
            
            		try {
            			if (httpMethod === 'get') {
            				return data[keys];
            			} else {
            				if (data.length === 0) {
            					return 0;
            				}
            				data = data[0][keys];
            				return data[data.length - 1]['value'];
            			}
            		} catch (error) {
            			Zabbix.log(3, this.zabbixLogPrefix + ' Could not find key "' + keys + '" in JSON: ' + JSON.stringify(data));
            			throw 'Could not find required key in JSON object. See logs for more information.';
            		}
            	};
            }
            
            
            const params = JSON.parse(value);
            validateZabbixParams(['tenancy_ocid', 'user_ocid', 'private_key', 'fingerprint', 'api_host', 'http_status_code'], params);
            var oci = new OCI('VCN', 'Get VCNs', params);
            var compartments = prepareCompartments(params['compartment_ocid'], params['tenancy_ocid']);
            
            var buffer = [];
            compartments.forEach(function (compartment) {
            	Array.prototype.push.apply(buffer, oci.extractData('get', oci.executeRequest('get', '/20160918/vcns', '?compartmentId=' + encodeURIComponent(compartment)), ['id', 'displayName', 'lifecycleState', 'freeformTags'], compartment));
            })
            return JSON.stringify(buffer);
          filter:
            evaltype: AND
            conditions:
              - macro: '{#NAME}'
                value: '{$OCI.VCN.DISCOVERY.NAME.MATCHES}'
              - macro: '{#NAME}'
                value: '{$OCI.VCN.DISCOVERY.NAME.NOT_MATCHES}'
                operator: NOT_MATCHES_REGEX
              - macro: '{#STATE}'
                value: '{$OCI.VCN.DISCOVERY.STATE.MATCHES}'
              - macro: '{#STATE}'
                value: '{$OCI.VCN.DISCOVERY.STATE.NOT_MATCHES}'
                operator: NOT_MATCHES_REGEX
          description: 'Discover virtual cloud networks (VCNs).'
          host_prototypes:
            - uuid: 5329fee3dbc643ebbb99472c67a0a207
              host: 'OCI VCN - {#ID}'
              name: 'OCI VCN - {#ID}'
              group_links:
                - group:
                    name: Applications
              templates:
                - name: 'Oracle Cloud Networking by HTTP'
              macros:
                - macro: '{$OCI.VCN.COMPARTMENT.ID}'
                  value: '{#COMPARTMENT}'
                  description: 'Compartment ID of OCI VCN (virtual cloud network).'
                - macro: '{$OCI.VCN.ID}'
                  value: '{#ID}'
                  description: 'ID of the OCI VCN (virtual cloud network).'
              tags:
                - tag: oci-compartment-id
                  value: '{#COMPARTMENT}'
                - tag: oci-vcn-name
                  value: '{#NAME}'
          timeout: 10s
          parameters:
            - name: api_host
              value: '{$OCI.API.CORE.HOST}'
            - name: compartment_ocid
              value: '{$OCI.API.COMPARTMENT.VCN}'
            - name: fingerprint
              value: '{$OCI.API.FINGERPRINT}'
            - name: http_proxy
              value: '{$OCI.HTTP.PROXY}'
            - name: http_status_code
              value: '{$OCI.HTTP.RETURN.CODE.OK}'
            - name: private_key
              value: '{$OCI.API.PRIVATE.KEY}'
            - name: tenancy_ocid
              value: '{$OCI.API.TENANCY}'
            - name: user_ocid
              value: '{$OCI.API.USER}'
          lld_macro_paths:
            - lld_macro: '{#COMPARTMENT}'
              path: $.compartment
            - lld_macro: '{#ID}'
              path: $.id
            - lld_macro: '{#NAME}'
              path: $.name
            - lld_macro: '{#STATE}'
              path: $.state
      tags:
        - tag: class
          value: cloud
        - tag: class
          value: database
        - tag: subclass
          value: automation
        - tag: subclass
          value: bigdata
        - tag: subclass
          value: deploy
        - tag: target
          value: oci
        - tag: target
          value: oracle-cloud-infrastructure
      macros:
        - macro: '{$OCI.API.AUTONOMOUS.DB.HOST}'
          description: 'Host for OCI Autonomous Database API endpoint.'
          config:
            type: TEXT
            priority: '4'
            label: 'Database Service host'
            description: 'Host for Database Service API endpoint.'
            required: 'YES'
        - macro: '{$OCI.API.COMPARTMENT.AUTONOMOUS.DB}'
          description: 'Compartment OCIDs for autonomous databases. Can be a single value or a comma separated list of values.'
          config:
            type: TEXT
            priority: '10'
            label: 'Compartment  for autonomous databases'
            description: 'Compartment OCIDs for autonomous databases.'
            required: 'YES'
        - macro: '{$OCI.API.COMPARTMENT.COMPUTE}'
          description: 'Compartment OCIDs for compute instances. Can be a single value or a comma separated list of values.'
          config:
            type: TEXT
            priority: '5'
            label: 'Compartment for compute'
            description: 'Compartment OCIDs for compute instances.'
            required: 'YES'
        - macro: '{$OCI.API.COMPARTMENT.OBJECT.STORAGE}'
          description: 'Compartment OCIDs for object storage buckets. Can be a single value or a comma separated list of values.'
          config:
            type: TEXT
            priority: '9'
            label: 'Compartment for object storage buckets'
            description: 'Compartment OCIDs for object storage buckets.'
            required: 'YES'
        - macro: '{$OCI.API.COMPARTMENT.VCN}'
          description: 'Compartment OCIDs for virtual cloud networks. Can be a single value or a comma separated list of values.'
          config:
            type: TEXT
            priority: '6'
            label: 'Compartment for virtual cloud networks'
            description: 'Compartment OCIDs for virtual cloud networks.'
            required: 'YES'
        - macro: '{$OCI.API.COMPARTMENT.VOLUME.BLOCK}'
          description: 'Compartment OCIDs for block volumes. Can be a single value or a comma separated list of values.'
          config:
            type: TEXT
            priority: '7'
            label: 'Compartment for block volumes'
            description: 'Compartment OCIDs for block volumes.'
            required: 'YES'
        - macro: '{$OCI.API.COMPARTMENT.VOLUME.BOOT}'
          description: 'Compartment OCIDs for boot volumes. Can be a single value or a comma separated list of values.'
          config:
            type: TEXT
            priority: '8'
            label: 'Compartment for boot volumes'
            description: 'Compartment OCIDs for boot volumes.'
            required: 'YES'
        - macro: '{$OCI.API.CORE.HOST}'
          description: 'Host for OCI Core Services API endpoint.'
          config:
            type: TEXT
            priority: '1'
            label: 'Core Services host'
            description: 'Host for Core Services API endpoint.'
            required: 'YES'
        - macro: '{$OCI.API.FINGERPRINT}'
          type: SECRET_TEXT
          description: 'Fingerprint of private key.'
          config:
            type: TEXT
            priority: '14'
            label: Fingerprint
            description: 'Fingerprint value here.'
            required: 'YES'
        - macro: '{$OCI.API.OBJECT.STORAGE.HOST}'
          description: 'Host for OCI Object Storage API endpoint.'
          config:
            type: TEXT
            priority: '3'
            label: 'Object Storage host'
            description: 'Host for Object Storage Service API endpoint.'
            required: 'YES'
        - macro: '{$OCI.API.PRIVATE.KEY}'
          type: SECRET_TEXT
          description: 'Entire private key for API access.'
          config:
            type: TEXT
            priority: '13'
            label: 'Private key'
            description: 'Contents of private key file.'
            required: 'YES'
        - macro: '{$OCI.API.TELEMETRY.HOST}'
          description: 'Host for OCI Monitoring API endpoint.'
          config:
            type: TEXT
            priority: '2'
            label: 'Monitoring host'
            description: 'Host for Monitoring API endpoint.'
            required: 'YES'
        - macro: '{$OCI.API.TENANCY}'
          description: 'OCID of tenancy.'
          config:
            type: TEXT
            priority: '11'
            label: 'OCID tenancy'
            description: 'Tenancy OCID value.'
            required: 'YES'
        - macro: '{$OCI.API.USER}'
          description: 'OCID of user.'
          config:
            type: TEXT
            priority: '12'
            label: 'OCID user'
            description: 'User OCID value.'
            required: 'YES'
        - macro: '{$OCI.AUTONOMOUS.DB.DISCOVERY.NAME.MATCHES}'
          value: '.*'
          description: 'Sets the regex string of autonomous database names to allow in discovery.'
          config:
            type: TEXT
            priority: '35'
            section_name: Filters
            label: 'Include autonomous database names filter'
            description: 'Regex string of autonomous database names to allow in discovery.'
        - macro: '{$OCI.AUTONOMOUS.DB.DISCOVERY.NAME.NOT_MATCHES}'
          value: CHANGE_IF_NEEDED
          description: 'Sets the regex string of autonomous database names to ignore in discovery.'
          config:
            type: TEXT
            priority: '36'
            section_name: Filters
            label: 'Exclude autonomous database names filter'
            description: 'Regex string of autonomous database names to ignore in discovery.'
        - macro: '{$OCI.AUTONOMOUS.DB.DISCOVERY.STATE.MATCHES}'
          value: '.*'
          description: 'Sets the regex string of autonomous database states to allow in discovery.'
          config:
            type: TEXT
            priority: '33'
            section_name: Filters
            label: 'Include autonomous database states filter'
            description: 'Regex string of autonomous database states to allow in discovery.'
        - macro: '{$OCI.AUTONOMOUS.DB.DISCOVERY.STATE.NOT_MATCHES}'
          value: CHANGE_IF_NEEDED
          description: 'Sets the regex string of autonomous database states to ignore in discovery.'
          config:
            type: TEXT
            priority: '34'
            section_name: Filters
            label: 'Exclude autonomous database states filter'
            description: 'Regex string of autonomous database states to ignore in discovery.'
        - macro: '{$OCI.COMPUTE.DISCOVERY.NAME.MATCHES}'
          value: '.*'
          description: 'Sets the regex string of compute instance names to allow in discovery.'
          config:
            type: TEXT
            priority: '17'
            section_name: Filters
            label: 'Include compute instance names filter'
            description: 'Regex string of compute instance names to allow in discovery.'
        - macro: '{$OCI.COMPUTE.DISCOVERY.NAME.NOT_MATCHES}'
          value: CHANGE_IF_NEEDED
          description: 'Sets the regex string of compute instance names to ignore in discovery.'
          config:
            type: TEXT
            priority: '18'
            section_name: Filters
            label: 'Exclude compute instance names filter'
            description: 'Regex string of compute instance names to ignore in discovery.'
        - macro: '{$OCI.COMPUTE.DISCOVERY.STATE.MATCHES}'
          value: '.*'
          description: 'Sets the regex string of compute instance states to allow in discovery.'
          config:
            type: TEXT
            priority: '15'
            section_name: Filters
            label: 'Include compute instance states filter'
            description: 'Regex string of compute instance states to allow in discovery.'
        - macro: '{$OCI.COMPUTE.DISCOVERY.STATE.NOT_MATCHES}'
          value: TERMINATED
          description: 'Sets the regex string of compute instance states to ignore in discovery.'
          config:
            type: TEXT
            priority: '16'
            section_name: Filters
            label: 'Exclude compute instance states filter'
            description: 'Regex string of compute instance states to ignore in discovery.'
        - macro: '{$OCI.HTTP.PROXY}'
          description: 'Set an HTTP proxy for OCI API requests if needed.'
          config:
            type: TEXT
            priority: '37'
            section_name: Other
            label: 'HTTP proxy'
            description: 'HTTP proxy to use for requests.'
        - macro: '{$OCI.HTTP.RETURN.CODE.OK}'
          value: '200'
          description: 'Set the HTTP return code that represents an OK response from the API. The default is "200",  but can vary, for example, if a proxy is used.'
          config:
            type: TEXT
            priority: '38'
            section_name: Other
            label: 'HTTP return code'
            description: 'HTTP return code that represents an OK response from the API.'
        - macro: '{$OCI.OBJECT.STORAGE.DISCOVERY.NAME.MATCHES}'
          value: '.*'
          description: 'Sets the regex string of storage names to allow in discovery.'
          config:
            type: TEXT
            priority: '31'
            section_name: Filters
            label: 'Include storage names filter'
            description: 'Regex string of storage names to allow in discovery.'
        - macro: '{$OCI.OBJECT.STORAGE.DISCOVERY.NAME.NOT_MATCHES}'
          value: CHANGE_IF_NEEDED
          description: 'Sets the regex string of storage names to ignore in discovery.'
          config:
            type: TEXT
            priority: '32'
            section_name: Filters
            label: 'Exclude storage names filter'
            description: 'Regex string of storage names to ignore in discovery.'
        - macro: '{$OCI.VCN.DISCOVERY.NAME.MATCHES}'
          value: '.*'
          description: 'Sets the regex string of virtual cloud network names to allow in discovery.'
          config:
            type: TEXT
            priority: '21'
            section_name: Filters
            label: 'Include virtual cloud network names filter'
            description: 'Regex string of virtual cloud network names to allow in discovery.'
        - macro: '{$OCI.VCN.DISCOVERY.NAME.NOT_MATCHES}'
          value: CHANGE_IF_NEEDED
          description: 'Sets the regex string of virtual cloud network names to ignore in discovery.'
          config:
            type: TEXT
            priority: '22'
            section_name: Filters
            label: 'Exclude virtual cloud network names filter'
            description: 'Regex string of virtual cloud network names to ignore in discovery.'
        - macro: '{$OCI.VCN.DISCOVERY.STATE.MATCHES}'
          value: '.*'
          description: 'Sets the regex string of virtual cloud network states to allow in discovery.'
          config:
            type: TEXT
            priority: '19'
            section_name: Filters
            label: 'Include virtual cloud network states filter'
            description: 'Regex string of virtual cloud network states to allow in discovery.'
        - macro: '{$OCI.VCN.DISCOVERY.STATE.NOT_MATCHES}'
          value: CHANGE_IF_NEEDED
          description: 'Sets the regex string of virtual cloud network states to ignore in discovery.'
          config:
            type: TEXT
            priority: '20'
            section_name: Filters
            label: 'Exclude virtual cloud network states filter'
            description: 'Regex string of virtual cloud network states to ignore in discovery.'
        - macro: '{$OCI.VOLUME.BLOCK.DISCOVERY.NAME.MATCHES}'
          value: '.*'
          description: 'Sets the regex string of block volume names to allow in discovery.'
          config:
            type: TEXT
            priority: '25'
            section_name: Filters
            label: 'Include block volume names filter'
            description: 'Regex string of block volume names to allow in discovery.'
        - macro: '{$OCI.VOLUME.BLOCK.DISCOVERY.NAME.NOT_MATCHES}'
          value: CHANGE_IF_NEEDED
          description: 'Sets the regex string of block volume names to ignore in discovery.'
          config:
            type: TEXT
            priority: '26'
            section_name: Filters
            label: 'Exclude block volume names filter'
            description: 'Regex string of block volume names to ignore in discovery.'
        - macro: '{$OCI.VOLUME.BLOCK.DISCOVERY.STATE.MATCHES}'
          value: '.*'
          description: 'Sets the regex string of block volume states to allow in discovery.'
          config:
            type: TEXT
            priority: '23'
            section_name: Filters
            label: 'Include block volume states filter'
            description: 'Regex string of block volume states to allow in discovery.'
        - macro: '{$OCI.VOLUME.BLOCK.DISCOVERY.STATE.NOT_MATCHES}'
          value: CHANGE_IF_NEEDED
          description: 'Sets the regex string of block volume states to ignore in discovery.'
          config:
            type: TEXT
            priority: '24'
            section_name: Filters
            label: 'Exclude block volume states filter'
            description: 'Regex string of block volume states to ignore in discovery.'
        - macro: '{$OCI.VOLUME.BOOT.DISCOVERY.NAME.MATCHES}'
          value: '.*'
          description: 'Sets the regex string of boot volume names to allow in discovery.'
          config:
            type: TEXT
            priority: '29'
            section_name: Filters
            label: 'Include boot volume names filter'
            description: 'Regex string of boot volume names to allow in discovery.'
        - macro: '{$OCI.VOLUME.BOOT.DISCOVERY.NAME.NOT_MATCHES}'
          value: CHANGE_IF_NEEDED
          description: 'Sets the regex string of boot volume names to ignore in discovery.'
          config:
            type: TEXT
            priority: '30'
            section_name: Filters
            label: 'Exclude boot volume names filter'
            description: 'Regex string of boot volume names to ignore in discovery.'
        - macro: '{$OCI.VOLUME.BOOT.DISCOVERY.STATE.MATCHES}'
          value: '.*'
          description: 'Sets the regex string of boot volume states to allow in discovery.'
          config:
            type: TEXT
            priority: '27'
            section_name: Filters
            label: 'Include boot volume states filter'
            description: 'Regex string of boot volume states to allow in discovery.'
        - macro: '{$OCI.VOLUME.BOOT.DISCOVERY.STATE.NOT_MATCHES}'
          value: CHANGE_IF_NEEDED
          description: 'Sets the regex string of boot volume states to ignore in discovery.'
          config:
            type: TEXT
            priority: '28'
            section_name: Filters
            label: 'Exclude boot volume states filter'
            description: 'Regex string of boot volume states to ignore in discovery.'
    - uuid: e6b0aada359944d09ee4bd46c1a55587
      template: 'Oracle Cloud Compute by HTTP'
      name: 'Oracle Cloud Compute by HTTP'
      description: |
        This template monitors Oracle Cloud Infrastructure (OCI) single compute instance resources and discovers attached
        virtual network interface cards (VNICs) and monitors their resources.
        
        This template is not meant to be used independently, but together with Oracle Cloud by HTTP as a template for
        LLD host prototypes.
        
        Read the template documentation prior to using this template.
        
        You can discuss this template or leave feedback on our forum https://www.zabbix.com/forum/zabbix-suggestions-and-feedback
        
        Generated by official Zabbix template tool "Templator"
      wizard_ready: 'YES'
      readme: |
        ## Setup
        
        This template is used in low-level discovery and will be auto-assigned to host prototypes. Additional configuration is not required.
      vendor:
        name: Zabbix
        version: 8.0-2
      groups:
        - name: Templates/Cloud
      items:
        - uuid: 657ad1d54de4454696573418f5f17f11
          name: 'Get instance availability'
          type: SCRIPT
          key: oci.compute.availability.get
          delay: 5m
          params: |
            function validateZabbixParams(requiredParams, allParams) {
            	requiredParams.forEach(function (field) {
            		if (typeof allParams !== 'object' || typeof allParams[field] === 'undefined' || allParams[field] === '') {
            			throw 'Required param is not set: ' + field + '.';
            		}
            	});
            }
            
            function OCI(service, action, params) {
            	this.zabbixLogPrefix = '[ OCI ] [ ' + service + ' ] [ ' + action + ' ]';
            	this.request = new HttpRequest();
            
            	this.hash = function (string) {
            		return sha256(string);
            	};
            
            	this.sign = function (string) {
            		return sign('sha256', params['private_key'], string);
            	};
            
            	this.encode = function (hash) {
            		const hexArr = hash.match(/.{1,2}/g);
            		var uInt8Array = new Uint8Array(hexArr.length);
            		hexArr.forEach(function (hex, idx) {
            			uInt8Array[idx] = parseInt(hex, 16);
            		});
            		return btoa(uInt8Array);
            	};
            
            	this.getDate = function () {
            		const weekdayShortList = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
            		const monthShortList = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'];
            		const today = new Date();
            		return weekdayShortList[today.getUTCDay()] + ', ' + today.getUTCDate() + ' ' + monthShortList[today.getUTCMonth()] + ' ' + today.getUTCFullYear() + ' ' + today.getUTCHours() + ':' + today.getUTCMinutes() + ':' + today.getUTCSeconds() + ' GMT';
            	};
            
            	this.executeRequest = function (httpMethod, apiPath, apiParams, mql, namespace) {
            		var headers = '(request-target) date host';
            		const contentTypeHeader = 'content-type: application/json';
            		const dateHeader = 'date: ' + this.getDate();
            		const hostHeader = 'host: ' + params['api_host'];
            		const requestTarget = '(request-target): ' + httpMethod + ' ' + apiPath + apiParams;
            		var signingString = requestTarget + '\n' + dateHeader + '\n' + hostHeader;
            		var reqHeaders = [contentTypeHeader, dateHeader];
            
            		if (httpMethod === 'post') {
            			var body = JSON.stringify({
            				'namespace': namespace,
            				'query': mql
            			});
            			headers = headers + ' x-content-sha256 content-type content-length';
            			const bodyHeader = 'x-content-sha256: ' + this.encode(this.hash(body));
            			const bodyLengthHeader = 'content-length: ' + body.length;
            			signingString = signingString + '\n' + bodyHeader + '\n' + contentTypeHeader + '\n' + bodyLengthHeader;
            			reqHeaders.push(bodyHeader, bodyLengthHeader);
            		}
            
            		const signature = this.encode(this.sign(signingString));
            
            		reqHeaders.push('Authorization: Signature version="1",keyId="' + params['tenancy_ocid'] + '/' + params['user_ocid'] + '/' + params['fingerprint'] + '",algorithm="rsa-sha256",headers="' + headers + '",signature="' + signature + '"');
            		for (var header = 0, headerLength = reqHeaders.length; header < headerLength; header++) {
            			this.request.addHeader(reqHeaders[header]);
            		}
            
            		if (params['http_proxy']) {
            			this.request.setProxy(params['http_proxy']);
            			Zabbix.log(4, this.zabbixLogPrefix + ' Using http proxy: ' + params['http_proxy']);
            		}
            
            		if (httpMethod === 'post') {
            			var apiRateLimitExceeded = false;
            			do {
            				const response = this.request.post('https://' + params['api_host'] + apiPath + apiParams, body);
            
            				try {
            					if (JSON.parse(response)['code'] === 'TooManyRequests') {
            
            						apiRateLimitExceeded = true;
            						Zabbix.sleep(1000);
            					} else {
            						apiRateLimitExceeded = false;
            					}
            				} catch (error) {
            					Zabbix.log(3, this.zabbixLogPrefix + ' Could not parse the response: ' + JSON.stringify(response));
            					throw 'Could not parse the response. See logs for more information.';
            				}
            			} while (apiRateLimitExceeded);
            		} else {
            			const response = this.request.get('https://' + params['api_host'] + apiPath + apiParams);
            		}
            
            		this.request.clearHeader();
            
            		if (this.request.getStatus() === parseInt(params['http_status_code'])) {
            			return response;
            		} else {
            			Zabbix.log(3, this.zabbixLogPrefix + ' Unexpected HTTP response code: ' + this.request.getStatus());
            			throw 'Unexpected HTTP response code: ' + this.request.getStatus();
            		}
            	};
            
            	this.extractData = function (httpMethod, data, keys, compartment) {
            		try {
            			data = JSON.parse(data);
            		} catch (error) {
            			Zabbix.log(3, this.zabbixLogPrefix + ' Could not parse the received JSON object: ' + data);
            			throw 'Could not parse received JSON object. See logs for more information.';
            		}
            
            		if (typeof keys == 'object') {
            			var returnBuffer = [];
            			for (var dataObj = 0, dataLength = data.length; dataObj < dataLength; dataObj++) {
            
            				var objectBuffer = {};
            				for (var key = 0, keysLength = keys.length; key < keysLength; key++) {
            					if (data[dataObj][keys[key]] || data[dataObj][keys[key]] == null) {
            						objectBuffer[keys[key].match(/^[a-z]+$|[A-Z][a-z]+$/)[0].toLowerCase()] = data[dataObj][keys[key]];
            					} else {
            						Zabbix.log(3, this.zabbixLogPrefix + ' Received an unexpected JSON object. Could not get value for key "' + keys[key] + '" in JSON: ' + JSON.stringify(data[dataObj]));
            						throw 'Received an unexpected JSON object. See logs for more information.';
            					}
            				}
            				if (typeof compartment != 'undefined' && compartment != '') objectBuffer['compartment'] = compartment;
            				returnBuffer.push(objectBuffer);
            			}
            			return returnBuffer;
            		}
            
            		try {
            			if (httpMethod === 'get') {
            				return data[keys];
            			} else {
            				if (data.length === 0) {
            					return 0;
            				}
            				data = data[0][keys];
            				return data[data.length - 1]['value'];
            			}
            		} catch (error) {
            			Zabbix.log(3, this.zabbixLogPrefix + ' Could not find key "' + keys + '" in JSON: ' + JSON.stringify(data));
            			throw 'Could not find required key in JSON object. See logs for more information.';
            		}
            	};
            }
            
            
            const params = JSON.parse(value);
            validateZabbixParams(['tenancy_ocid', 'user_ocid', 'private_key', 'fingerprint', 'api_host', 'instance_id', 'http_status_code', 'req_interval', 'compartment_id'], params);
            var oci = new OCI('Compute', 'Get health', params);
            const mql = 'InstanceAccessibilityStatus[' + params['req_interval'] + 'm]{resourceId=' + params['instance_id'] + '}.max()';
            
            return JSON.stringify(oci.extractData('post', oci.executeRequest('post', '/20180401/metrics/actions/summarizeMetricsData', '?compartmentId=' + encodeURIComponent(params['compartment_id']), mql, 'oci_compute_instance_health'), 'aggregatedDatapoints'));
          description: |
            The accessibility status of a virtual machine instance.
            A value of "1" indicates that the instance is unresponsive due to an issue with
            the infrastructure or the instance itself.
            A value of "0" indicates that an accessibility issue has not been detected.
            If the instance is stopped, then the metric does not have a value.
          valuemap:
            name: 'Compute instance availability'
          timeout: 10s
          parameters:
            - name: api_host
              value: '{$OCI.API.TELEMETRY.HOST}'
            - name: compartment_id
              value: '{$OCI.COMPUTE.COMPARTMENT.ID}'
            - name: fingerprint
              value: '{$OCI.API.FINGERPRINT}'
            - name: http_proxy
              value: '{$OCI.HTTP.PROXY}'
            - name: http_status_code
              value: '{$OCI.HTTP.RETURN.CODE.OK}'
            - name: instance_id
              value: '{$OCI.COMPUTE.INSTANCE.ID}'
            - name: private_key
              value: '{$OCI.API.PRIVATE.KEY}'
            - name: req_interval
              value: '5'
            - name: tenancy_ocid
              value: '{$OCI.API.TENANCY}'
            - name: user_ocid
              value: '{$OCI.API.USER}'
          tags:
            - tag: component
              value: environment
          triggers:
            - uuid: dbaee26c1de544d08fa6dd76ddc4c06a
              expression: 'last(/Oracle Cloud Compute by HTTP/oci.compute.availability.get) = 1'
              name: 'OCI Compute: Compute instance is not available'
              priority: HIGH
              description: 'Current instance availability.'
              tags:
                - tag: scope
                  value: availability
        - uuid: 04a1f534ae844021be0935abf1214951
          name: 'CPU utilization, in %'
          type: DEPENDENT
          key: oci.compute.cpu.util
          value_type: FLOAT
          units: '%'
          description: 'Activity level from the CPU. Expressed as a percentage of the total time.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.CpuUtilization
            - type: JAVASCRIPT
              parameters:
                - 'return Math.round(value * 100) / 100;'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: oci.compute.metrics.get
          tags:
            - tag: component
              value: cpu
          triggers:
            - uuid: 38987527713b404f842e26ad12ce3015
              expression: 'min(/Oracle Cloud Compute by HTTP/oci.compute.cpu.util,5m) >= {$OCI.COMPUTE.CPU.UTIL.WARN}'
              name: 'OCI Compute: Current CPU utilization is high'
              event_name: 'OCI Compute: Current CPU utilization is high (util >= {$OCI.COMPUTE.CPU.UTIL.WARN}%)'
              opdata: 'Current: {ITEM.LASTVALUE1}'
              priority: WARNING
              description: 'Current CPU utilization has exceeded `{$OCI.COMPUTE.CPU.UTIL.WARN}`% of the max available value.'
              dependencies:
                - name: 'OCI Compute: Current CPU utilization is too high'
                  expression: 'min(/Oracle Cloud Compute by HTTP/oci.compute.cpu.util,5m) >= {$OCI.COMPUTE.CPU.UTIL.HIGH}'
              tags:
                - tag: scope
                  value: capacity
            - uuid: 082ba105bf614996a68054ad8c7d7101
              expression: 'min(/Oracle Cloud Compute by HTTP/oci.compute.cpu.util,5m) >= {$OCI.COMPUTE.CPU.UTIL.HIGH}'
              name: 'OCI Compute: Current CPU utilization is too high'
              event_name: 'OCI Compute: Current CPU utilization is too high (util >= {$OCI.COMPUTE.CPU.UTIL.HIGH}%)'
              opdata: 'Current: {ITEM.LASTVALUE1}'
              priority: HIGH
              description: 'Current CPU utilization has exceeded `{$OCI.COMPUTE.CPU.UTIL.HIGH}`% of the max available value.'
              tags:
                - tag: scope
                  value: capacity
        - uuid: 670783a729a647db9349d78ac61f1d94
          name: 'Disk read I/O'
          type: DEPENDENT
          key: oci.compute.disk.io.read
          value_type: FLOAT
          units: '!reads/s'
          description: 'Activity level from I/O reads. Expressed as reads per interval.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.DiskIopsRead
            - type: JAVASCRIPT
              parameters:
                - 'return Math.round(value * 100) / 100;'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: oci.compute.metrics.get
          tags:
            - tag: component
              value: storage
        - uuid: cbd32ebd403c48b2b2f9815f13407afe
          name: 'Disk write I/O'
          type: DEPENDENT
          key: oci.compute.disk.io.write
          value_type: FLOAT
          units: '!writes/s'
          description: 'Activity level from I/O writes. Expressed as writes per interval.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.DiskIopsWritten
            - type: JAVASCRIPT
              parameters:
                - 'return Math.round(value * 100) / 100;'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: oci.compute.metrics.get
          tags:
            - tag: component
              value: storage
        - uuid: 15d234ef381747bfb76e7ccf9169046d
          name: 'Disk bytes read'
          type: DEPENDENT
          key: oci.compute.disk.read
          value_type: FLOAT
          units: Bps
          description: 'Read throughput. Expressed as bytes read per interval.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.DiskBytesRead
            - type: JAVASCRIPT
              parameters:
                - 'return Math.round(value * 100) / 100;'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: oci.compute.metrics.get
          tags:
            - tag: component
              value: storage
        - uuid: c7e061599b474ac49082d28572ab74c6
          name: 'Disk bytes written'
          type: DEPENDENT
          key: oci.compute.disk.written
          value_type: FLOAT
          units: Bps
          description: 'Write throughput. Expressed as bytes written per interval.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.DiskBytesWritten
            - type: JAVASCRIPT
              parameters:
                - 'return Math.round(value * 100) / 100;'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: oci.compute.metrics.get
          tags:
            - tag: component
              value: storage
        - uuid: 75308c4fb9bd4bad8fbb80aa9b62b099
          name: 'Load average'
          type: DEPENDENT
          key: oci.compute.load.avg
          value_type: FLOAT
          units: '!processes'
          description: 'Average system load calculated over a 1-minute period. Expressed as a number of processes.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.LoadAverage
            - type: JAVASCRIPT
              parameters:
                - 'return Math.round(value * 100) / 100;'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: oci.compute.metrics.get
          tags:
            - tag: component
              value: environment
        - uuid: 610796958f694aa99f3e9ea1082972bf
          name: 'Memory allocation stalls'
          type: DEPENDENT
          key: oci.compute.mem.stalls
          value_type: FLOAT
          units: '!stalls'
          description: 'Number of times page reclaim was called directly.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.MemoryAllocationStalls
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: oci.compute.metrics.get
          tags:
            - tag: component
              value: memory
        - uuid: ef284ac17689442e835b686126161bc5
          name: 'Memory utilization, in %'
          type: DEPENDENT
          key: oci.compute.mem.util
          value_type: FLOAT
          units: '%'
          description: 'Space currently in use, measured in pages. Expressed as a percentage of used pages.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.MemoryUtilization
            - type: JAVASCRIPT
              parameters:
                - 'return Math.round(value * 100) / 100;'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: oci.compute.metrics.get
          tags:
            - tag: component
              value: memory
          triggers:
            - uuid: 9baaacf70a4446a7ae816afdc4db0ae8
              expression: 'min(/Oracle Cloud Compute by HTTP/oci.compute.mem.util,5m) >= {$OCI.COMPUTE.MEM.UTIL.WARN}'
              name: 'OCI Compute: Current memory utilization is high'
              event_name: 'OCI Compute: Current memory utilization is high (util >= {$OCI.COMPUTE.MEM.UTIL.WARN}%)'
              opdata: 'Current: {ITEM.LASTVALUE1}'
              priority: WARNING
              description: 'Current memory utilization has exceeded `{$OCI.COMPUTE.MEM.UTIL.WARN}`% of the max available value.'
              dependencies:
                - name: 'OCI Compute: Current memory utilization is too high'
                  expression: 'min(/Oracle Cloud Compute by HTTP/oci.compute.mem.util,5m) >= {$OCI.COMPUTE.MEM.UTIL.HIGH}'
              tags:
                - tag: scope
                  value: capacity
            - uuid: 3b894aa250f04ebdb63fb8a914fbd72a
              expression: 'min(/Oracle Cloud Compute by HTTP/oci.compute.mem.util,5m) >= {$OCI.COMPUTE.MEM.UTIL.HIGH}'
              name: 'OCI Compute: Current memory utilization is too high'
              event_name: 'OCI Compute: Current memory utilization is too high (util >= {$OCI.COMPUTE.MEM.UTIL.HIGH}%)'
              opdata: 'Current: {ITEM.LASTVALUE1}'
              priority: HIGH
              description: 'Current memory utilization has exceeded `{$OCI.COMPUTE.MEM.UTIL.HIGH}`% of the max available value.'
              tags:
                - tag: scope
                  value: capacity
        - uuid: 65ff665a67374bb082f260ca473dfb1b
          name: 'Get compute metrics'
          type: SCRIPT
          key: oci.compute.metrics.get
          history: '0'
          value_type: TEXT
          params: |
            function validateZabbixParams(requiredParams, allParams) {
            	requiredParams.forEach(function (field) {
            		if (typeof allParams !== 'object' || typeof allParams[field] === 'undefined' || allParams[field] === '') {
            			throw 'Required param is not set: ' + field + '.';
            		}
            	});
            }
            
            function OCI(service, action, params) {
            	this.zabbixLogPrefix = '[ OCI ] [ ' + service + ' ] [ ' + action + ' ]';
            	this.request = new HttpRequest();
            
            	this.hash = function (string) {
            		return sha256(string);
            	};
            
            	this.sign = function (string) {
            		return sign('sha256', params['private_key'], string);
            	};
            
            	this.encode = function (hash) {
            		const hexArr = hash.match(/.{1,2}/g);
            		var uInt8Array = new Uint8Array(hexArr.length);
            		hexArr.forEach(function (hex, idx) {
            			uInt8Array[idx] = parseInt(hex, 16);
            		});
            		return btoa(uInt8Array);
            	};
            
            	this.getDate = function () {
            		const weekdayShortList = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
            		const monthShortList = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'];
            		const today = new Date();
            		return weekdayShortList[today.getUTCDay()] + ', ' + today.getUTCDate() + ' ' + monthShortList[today.getUTCMonth()] + ' ' + today.getUTCFullYear() + ' ' + today.getUTCHours() + ':' + today.getUTCMinutes() + ':' + today.getUTCSeconds() + ' GMT';
            	};
            
            	this.executeRequest = function (httpMethod, apiPath, apiParams, mql, namespace) {
            		var headers = '(request-target) date host';
            		const contentTypeHeader = 'content-type: application/json';
            		const dateHeader = 'date: ' + this.getDate();
            		const hostHeader = 'host: ' + params['api_host'];
            		const requestTarget = '(request-target): ' + httpMethod + ' ' + apiPath + apiParams;
            		var signingString = requestTarget + '\n' + dateHeader + '\n' + hostHeader;
            		var reqHeaders = [contentTypeHeader, dateHeader];
            
            		if (httpMethod === 'post') {
            			var body = JSON.stringify({
            				'namespace': namespace,
            				'query': mql
            			});
            			headers = headers + ' x-content-sha256 content-type content-length';
            			const bodyHeader = 'x-content-sha256: ' + this.encode(this.hash(body));
            			const bodyLengthHeader = 'content-length: ' + body.length;
            			signingString = signingString + '\n' + bodyHeader + '\n' + contentTypeHeader + '\n' + bodyLengthHeader;
            			reqHeaders.push(bodyHeader, bodyLengthHeader);
            		}
            
            		const signature = this.encode(this.sign(signingString));
            
            		reqHeaders.push('Authorization: Signature version="1",keyId="' + params['tenancy_ocid'] + '/' + params['user_ocid'] + '/' + params['fingerprint'] + '",algorithm="rsa-sha256",headers="' + headers + '",signature="' + signature + '"');
            		for (var header = 0, headerLength = reqHeaders.length; header < headerLength; header++) {
            			this.request.addHeader(reqHeaders[header]);
            		}
            
            		if (params['http_proxy']) {
            			this.request.setProxy(params['http_proxy']);
            			Zabbix.log(4, this.zabbixLogPrefix + ' Using http proxy: ' + params['http_proxy']);
            		}
            
            		if (httpMethod === 'post') {
            			var apiRateLimitExceeded = false;
            			do {
            				const response = this.request.post('https://' + params['api_host'] + apiPath + apiParams, body);
            
            				try {
            					if (JSON.parse(response)['code'] === 'TooManyRequests') {
            
            						apiRateLimitExceeded = true;
            						Zabbix.sleep(1000);
            					} else {
            						apiRateLimitExceeded = false;
            					}
            				} catch (error) {
            					Zabbix.log(3, this.zabbixLogPrefix + ' Could not parse the response: ' + JSON.stringify(response));
            					throw 'Could not parse the response. See logs for more information.';
            				}
            			} while (apiRateLimitExceeded);
            		} else {
            			const response = this.request.get('https://' + params['api_host'] + apiPath + apiParams);
            		}
            
            		this.request.clearHeader();
            
            		if (this.request.getStatus() === parseInt(params['http_status_code'])) {
            			return response;
            		} else {
            			Zabbix.log(3, this.zabbixLogPrefix + ' Unexpected HTTP response code: ' + this.request.getStatus());
            			throw 'Unexpected HTTP response code: ' + this.request.getStatus();
            		}
            	};
            
            	this.extractData = function (httpMethod, data, keys, compartment) {
            		try {
            			data = JSON.parse(data);
            		} catch (error) {
            			Zabbix.log(3, this.zabbixLogPrefix + ' Could not parse the received JSON object: ' + data);
            			throw 'Could not parse received JSON object. See logs for more information.';
            		}
            
            		if (typeof keys == 'object') {
            			var returnBuffer = [];
            			for (var dataObj = 0, dataLength = data.length; dataObj < dataLength; dataObj++) {
            
            				var objectBuffer = {};
            				for (var key = 0, keysLength = keys.length; key < keysLength; key++) {
            					if (data[dataObj][keys[key]] || data[dataObj][keys[key]] == null) {
            						objectBuffer[keys[key].match(/^[a-z]+$|[A-Z][a-z]+$/)[0].toLowerCase()] = data[dataObj][keys[key]];
            					} else {
            						Zabbix.log(3, this.zabbixLogPrefix + ' Received an unexpected JSON object. Could not get value for key "' + keys[key] + '" in JSON: ' + JSON.stringify(data[dataObj]));
            						throw 'Received an unexpected JSON object. See logs for more information.';
            					}
            				}
            				if (typeof compartment != 'undefined' && compartment != '') objectBuffer['compartment'] = compartment;
            				returnBuffer.push(objectBuffer);
            			}
            			return returnBuffer;
            		}
            
            		try {
            			if (httpMethod === 'get') {
            				return data[keys];
            			} else {
            				if (data.length === 0) {
            					return 0;
            				}
            				data = data[0][keys];
            				return data[data.length - 1]['value'];
            			}
            		} catch (error) {
            			Zabbix.log(3, this.zabbixLogPrefix + ' Could not find key "' + keys + '" in JSON: ' + JSON.stringify(data));
            			throw 'Could not find required key in JSON object. See logs for more information.';
            		}
            	};
            }
            
            function buildMql(id, metrics, defaultStatistic, resourceType) {
            	resourceType = resourceType === '' || resourceType === undefined ? 'resourceId' : resourceType;
            	this.query = '[' + params['req_interval'] + 'm]{' + resourceType + '=' + id + '}.';
            
            	for (var i = 0, metricsLength = metrics.length; i < metricsLength; i++) {
            		const metric = ((Array.isArray(metrics[i]) ? metrics[i] : [metrics[i], defaultStatistic]));
            		metrics[i] = [metric[0], this.query + metric[1]];
            	}
            }
            
            
            const params = JSON.parse(value);
            validateZabbixParams(['tenancy_ocid', 'user_ocid', 'private_key', 'fingerprint', 'api_host', 'instance_id', 'http_status_code', 'req_interval', 'compartment_id'], params);
            var oci = new OCI('Compute', 'Get metrics', params);
            
            const metrics = [
            	['CpuUtilization', 'mean'],
            	['MemoryUtilization', 'mean'],
            	['LoadAverage', 'mean'],
            	['MemoryAllocationStalls', 'mean'],
            	'DiskBytesRead',
            	'DiskBytesWritten',
            	'DiskIopsRead',
            	'DiskIopsWritten',
            	'NetworksBytesIn',
            	'NetworksBytesOut'
            ];
            buildMql(params['instance_id'], metrics, 'rate');
            
            var result = {};
            for (var i = 0, metricsLength = metrics.length; i < metricsLength; i++) {
            	result[metrics[i][0]] = oci.extractData('post', oci.executeRequest('post', '/20180401/metrics/actions/summarizeMetricsData', '?compartmentId=' + encodeURIComponent(params['compartment_id']), metrics[i][0] + metrics[i][1] + '()', 'oci_computeagent'), 'aggregatedDatapoints');
            }
            return JSON.stringify(result);
          description: 'Gets compute instance metrics.'
          timeout: 30s
          parameters:
            - name: api_host
              value: '{$OCI.API.TELEMETRY.HOST}'
            - name: compartment_id
              value: '{$OCI.COMPUTE.COMPARTMENT.ID}'
            - name: fingerprint
              value: '{$OCI.API.FINGERPRINT}'
            - name: http_proxy
              value: '{$OCI.HTTP.PROXY}'
            - name: http_status_code
              value: '{$OCI.HTTP.RETURN.CODE.OK}'
            - name: instance_id
              value: '{$OCI.COMPUTE.INSTANCE.ID}'
            - name: private_key
              value: '{$OCI.API.PRIVATE.KEY}'
            - name: req_interval
              value: '1'
            - name: tenancy_ocid
              value: '{$OCI.API.TENANCY}'
            - name: user_ocid
              value: '{$OCI.API.USER}'
          tags:
            - tag: component
              value: raw
        - uuid: 0c910a86a99b47f08dee930f07422f45
          name: 'Network bytes in'
          type: DEPENDENT
          key: oci.compute.network.in
          value_type: FLOAT
          units: Bps
          description: 'Network bytes in for the compute instance.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.NetworksBytesIn
            - type: JAVASCRIPT
              parameters:
                - 'return Math.round(value * 100) / 100;'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: oci.compute.metrics.get
          tags:
            - tag: component
              value: network
        - uuid: a7a027ae583740e19e5f6288b3f15d10
          name: 'Network bytes out'
          type: DEPENDENT
          key: oci.compute.network.out
          value_type: FLOAT
          units: Bps
          description: 'Network bytes out for the compute instance.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.NetworksBytesOut
            - type: JAVASCRIPT
              parameters:
                - 'return Math.round(value * 100) / 100;'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: oci.compute.metrics.get
          tags:
            - tag: component
              value: network
        - uuid: 3c4a11c3c8fe40fca36635e2a6882816
          name: State
          type: SCRIPT
          key: oci.compute.state.get
          params: |
            function validateZabbixParams(requiredParams, allParams) {
            	requiredParams.forEach(function (field) {
            		if (typeof allParams !== 'object' || typeof allParams[field] === 'undefined' || allParams[field] === '') {
            			throw 'Required param is not set: ' + field + '.';
            		}
            	});
            }
            
            function OCI(service, action, params) {
            	this.zabbixLogPrefix = '[ OCI ] [ ' + service + ' ] [ ' + action + ' ]';
            	this.request = new HttpRequest();
            
            	this.hash = function (string) {
            		return sha256(string);
            	};
            
            	this.sign = function (string) {
            		return sign('sha256', params['private_key'], string);
            	};
            
            	this.encode = function (hash) {
            		const hexArr = hash.match(/.{1,2}/g);
            		var uInt8Array = new Uint8Array(hexArr.length);
            		hexArr.forEach(function (hex, idx) {
            			uInt8Array[idx] = parseInt(hex, 16);
            		});
            		return btoa(uInt8Array);
            	};
            
            	this.getDate = function () {
            		const weekdayShortList = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
            		const monthShortList = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'];
            		const today = new Date();
            		return weekdayShortList[today.getUTCDay()] + ', ' + today.getUTCDate() + ' ' + monthShortList[today.getUTCMonth()] + ' ' + today.getUTCFullYear() + ' ' + today.getUTCHours() + ':' + today.getUTCMinutes() + ':' + today.getUTCSeconds() + ' GMT';
            	};
            
            	this.executeRequest = function (httpMethod, apiPath, apiParams, mql, namespace) {
            		var headers = '(request-target) date host';
            		const contentTypeHeader = 'content-type: application/json';
            		const dateHeader = 'date: ' + this.getDate();
            		const hostHeader = 'host: ' + params['api_host'];
            		const requestTarget = '(request-target): ' + httpMethod + ' ' + apiPath + apiParams;
            		var signingString = requestTarget + '\n' + dateHeader + '\n' + hostHeader;
            		var reqHeaders = [contentTypeHeader, dateHeader];
            
            		if (httpMethod === 'post') {
            			var body = JSON.stringify({
            				'namespace': namespace,
            				'query': mql
            			});
            			headers = headers + ' x-content-sha256 content-type content-length';
            			const bodyHeader = 'x-content-sha256: ' + this.encode(this.hash(body));
            			const bodyLengthHeader = 'content-length: ' + body.length;
            			signingString = signingString + '\n' + bodyHeader + '\n' + contentTypeHeader + '\n' + bodyLengthHeader;
            			reqHeaders.push(bodyHeader, bodyLengthHeader);
            		}
            
            		const signature = this.encode(this.sign(signingString));
            
            		reqHeaders.push('Authorization: Signature version="1",keyId="' + params['tenancy_ocid'] + '/' + params['user_ocid'] + '/' + params['fingerprint'] + '",algorithm="rsa-sha256",headers="' + headers + '",signature="' + signature + '"');
            		for (var header = 0, headerLength = reqHeaders.length; header < headerLength; header++) {
            			this.request.addHeader(reqHeaders[header]);
            		}
            
            		if (params['http_proxy']) {
            			this.request.setProxy(params['http_proxy']);
            			Zabbix.log(4, this.zabbixLogPrefix + ' Using http proxy: ' + params['http_proxy']);
            		}
            
            		if (httpMethod === 'post') {
            			var apiRateLimitExceeded = false;
            			do {
            				const response = this.request.post('https://' + params['api_host'] + apiPath + apiParams, body);
            
            				try {
            					if (JSON.parse(response)['code'] === 'TooManyRequests') {
            
            						apiRateLimitExceeded = true;
            						Zabbix.sleep(1000);
            					} else {
            						apiRateLimitExceeded = false;
            					}
            				} catch (error) {
            					Zabbix.log(3, this.zabbixLogPrefix + ' Could not parse the response: ' + JSON.stringify(response));
            					throw 'Could not parse the response. See logs for more information.';
            				}
            			} while (apiRateLimitExceeded);
            		} else {
            			const response = this.request.get('https://' + params['api_host'] + apiPath + apiParams);
            		}
            
            		this.request.clearHeader();
            
            		if (this.request.getStatus() === parseInt(params['http_status_code'])) {
            			return response;
            		} else {
            			Zabbix.log(3, this.zabbixLogPrefix + ' Unexpected HTTP response code: ' + this.request.getStatus());
            			throw 'Unexpected HTTP response code: ' + this.request.getStatus();
            		}
            	};
            
            	this.extractData = function (httpMethod, data, keys, compartment) {
            		try {
            			data = JSON.parse(data);
            		} catch (error) {
            			Zabbix.log(3, this.zabbixLogPrefix + ' Could not parse the received JSON object: ' + data);
            			throw 'Could not parse received JSON object. See logs for more information.';
            		}
            
            		if (typeof keys == 'object') {
            			var returnBuffer = [];
            			for (var dataObj = 0, dataLength = data.length; dataObj < dataLength; dataObj++) {
            
            				var objectBuffer = {};
            				for (var key = 0, keysLength = keys.length; key < keysLength; key++) {
            					if (data[dataObj][keys[key]] || data[dataObj][keys[key]] == null) {
            						objectBuffer[keys[key].match(/^[a-z]+$|[A-Z][a-z]+$/)[0].toLowerCase()] = data[dataObj][keys[key]];
            					} else {
            						Zabbix.log(3, this.zabbixLogPrefix + ' Received an unexpected JSON object. Could not get value for key "' + keys[key] + '" in JSON: ' + JSON.stringify(data[dataObj]));
            						throw 'Received an unexpected JSON object. See logs for more information.';
            					}
            				}
            				if (typeof compartment != 'undefined' && compartment != '') objectBuffer['compartment'] = compartment;
            				returnBuffer.push(objectBuffer);
            			}
            			return returnBuffer;
            		}
            
            		try {
            			if (httpMethod === 'get') {
            				return data[keys];
            			} else {
            				if (data.length === 0) {
            					return 0;
            				}
            				data = data[0][keys];
            				return data[data.length - 1]['value'];
            			}
            		} catch (error) {
            			Zabbix.log(3, this.zabbixLogPrefix + ' Could not find key "' + keys + '" in JSON: ' + JSON.stringify(data));
            			throw 'Could not find required key in JSON object. See logs for more information.';
            		}
            	};
            }
            
            
            const params = JSON.parse(value);
            validateZabbixParams(['tenancy_ocid', 'user_ocid', 'private_key', 'fingerprint', 'api_host', 'instance_id', 'http_status_code'], params);
            var oci = new OCI('Compute', 'Get state', params);
            
            return oci.extractData('get', oci.executeRequest('get', '/20160918/instances/' + encodeURIComponent(params['instance_id']), ''), 'lifecycleState');
          description: 'The current state of the instance.'
          valuemap:
            name: 'Compute instance state'
          preprocessing:
            - type: JAVASCRIPT
              parameters:
                - |
                  const idx = {
                  	'MOVING': 1,
                  	'PROVISIONING': 2,
                  	'RUNNING': 3,
                  	'STARTING': 4,
                  	'STOPPING': 5,
                  	'STOPPED': 6,
                  	'CREATING_IMAGE': 7,
                  	'TERMINATING': 8,
                  	'TERMINATED': 9
                  };
                  
                  return typeof idx[value] === 'undefined' ? 0 : idx[value];
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          timeout: 10s
          parameters:
            - name: api_host
              value: '{$OCI.API.CORE.HOST}'
            - name: fingerprint
              value: '{$OCI.API.FINGERPRINT}'
            - name: http_proxy
              value: '{$OCI.HTTP.PROXY}'
            - name: http_status_code
              value: '{$OCI.HTTP.RETURN.CODE.OK}'
            - name: instance_id
              value: '{$OCI.COMPUTE.INSTANCE.ID}'
            - name: private_key
              value: '{$OCI.API.PRIVATE.KEY}'
            - name: tenancy_ocid
              value: '{$OCI.API.TENANCY}'
            - name: user_ocid
              value: '{$OCI.API.USER}'
          tags:
            - tag: component
              value: environment
          triggers:
            - uuid: 2bce7c23998f4331a5eca3507fc671d9
              expression: 'last(/Oracle Cloud Compute by HTTP/oci.compute.state.get,#1)<>last(/Oracle Cloud Compute by HTTP/oci.compute.state.get,#2)'
              name: 'OCI Compute: State has changed'
              event_name: 'OCI Compute: State has changed (new state: {ITEM.VALUE})'
              opdata: 'Current state: {ITEM.LASTVALUE}'
              priority: INFO
              description: 'Compute instance state has changed.'
              manual_close: 'YES'
              tags:
                - tag: scope
                  value: notice
        - uuid: c0e74098afb14984af6355ac0711662e
          name: 'Get VNICs'
          type: SCRIPT
          key: oci.compute.vnic.get
          history: '0'
          value_type: TEXT
          params: |
            function validateZabbixParams(requiredParams, allParams) {
            	requiredParams.forEach(function (field) {
            		if (typeof allParams !== 'object' || typeof allParams[field] === 'undefined' || allParams[field] === '') {
            			throw 'Required param is not set: ' + field + '.';
            		}
            	});
            }
            
            function OCI(service, action, params) {
            	this.zabbixLogPrefix = '[ OCI ] [ ' + service + ' ] [ ' + action + ' ]';
            	this.request = new HttpRequest();
            
            	this.hash = function (string) {
            		return sha256(string);
            	};
            
            	this.sign = function (string) {
            		return sign('sha256', params['private_key'], string);
            	};
            
            	this.encode = function (hash) {
            		const hexArr = hash.match(/.{1,2}/g);
            		var uInt8Array = new Uint8Array(hexArr.length);
            		hexArr.forEach(function (hex, idx) {
            			uInt8Array[idx] = parseInt(hex, 16);
            		});
            		return btoa(uInt8Array);
            	};
            
            	this.getDate = function () {
            		const weekdayShortList = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
            		const monthShortList = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'];
            		const today = new Date();
            		return weekdayShortList[today.getUTCDay()] + ', ' + today.getUTCDate() + ' ' + monthShortList[today.getUTCMonth()] + ' ' + today.getUTCFullYear() + ' ' + today.getUTCHours() + ':' + today.getUTCMinutes() + ':' + today.getUTCSeconds() + ' GMT';
            	};
            
            	this.executeRequest = function (httpMethod, apiPath, apiParams, mql, namespace) {
            		var headers = '(request-target) date host';
            		const contentTypeHeader = 'content-type: application/json';
            		const dateHeader = 'date: ' + this.getDate();
            		const hostHeader = 'host: ' + params['api_host'];
            		const requestTarget = '(request-target): ' + httpMethod + ' ' + apiPath + apiParams;
            		var signingString = requestTarget + '\n' + dateHeader + '\n' + hostHeader;
            		var reqHeaders = [contentTypeHeader, dateHeader];
            
            		if (httpMethod === 'post') {
            			var body = JSON.stringify({
            				'namespace': namespace,
            				'query': mql
            			});
            			headers = headers + ' x-content-sha256 content-type content-length';
            			const bodyHeader = 'x-content-sha256: ' + this.encode(this.hash(body));
            			const bodyLengthHeader = 'content-length: ' + body.length;
            			signingString = signingString + '\n' + bodyHeader + '\n' + contentTypeHeader + '\n' + bodyLengthHeader;
            			reqHeaders.push(bodyHeader, bodyLengthHeader);
            		}
            
            		const signature = this.encode(this.sign(signingString));
            
            		reqHeaders.push('Authorization: Signature version="1",keyId="' + params['tenancy_ocid'] + '/' + params['user_ocid'] + '/' + params['fingerprint'] + '",algorithm="rsa-sha256",headers="' + headers + '",signature="' + signature + '"');
            		for (var header = 0, headerLength = reqHeaders.length; header < headerLength; header++) {
            			this.request.addHeader(reqHeaders[header]);
            		}
            
            		if (params['http_proxy']) {
            			this.request.setProxy(params['http_proxy']);
            			Zabbix.log(4, this.zabbixLogPrefix + ' Using http proxy: ' + params['http_proxy']);
            		}
            
            		if (httpMethod === 'post') {
            			var apiRateLimitExceeded = false;
            			do {
            				const response = this.request.post('https://' + params['api_host'] + apiPath + apiParams, body);
            
            				try {
            					if (JSON.parse(response)['code'] === 'TooManyRequests') {
            
            						apiRateLimitExceeded = true;
            						Zabbix.sleep(1000);
            					} else {
            						apiRateLimitExceeded = false;
            					}
            				} catch (error) {
            					Zabbix.log(3, this.zabbixLogPrefix + ' Could not parse the response: ' + JSON.stringify(response));
            					throw 'Could not parse the response. See logs for more information.';
            				}
            			} while (apiRateLimitExceeded);
            		} else {
            			const response = this.request.get('https://' + params['api_host'] + apiPath + apiParams);
            		}
            
            		this.request.clearHeader();
            
            		if (this.request.getStatus() === parseInt(params['http_status_code'])) {
            			return response;
            		} else {
            			Zabbix.log(3, this.zabbixLogPrefix + ' Unexpected HTTP response code: ' + this.request.getStatus());
            			throw 'Unexpected HTTP response code: ' + this.request.getStatus();
            		}
            	};
            
            	this.extractData = function (httpMethod, data, keys, compartment) {
            		try {
            			data = JSON.parse(data);
            		} catch (error) {
            			Zabbix.log(3, this.zabbixLogPrefix + ' Could not parse the received JSON object: ' + data);
            			throw 'Could not parse received JSON object. See logs for more information.';
            		}
            
            		if (typeof keys == 'object') {
            			var returnBuffer = [];
            			for (var dataObj = 0, dataLength = data.length; dataObj < dataLength; dataObj++) {
            
            				var objectBuffer = {};
            				for (var key = 0, keysLength = keys.length; key < keysLength; key++) {
            					if (data[dataObj][keys[key]] || data[dataObj][keys[key]] == null) {
            						objectBuffer[keys[key].match(/^[a-z]+$|[A-Z][a-z]+$/)[0].toLowerCase()] = data[dataObj][keys[key]];
            					} else {
            						Zabbix.log(3, this.zabbixLogPrefix + ' Received an unexpected JSON object. Could not get value for key "' + keys[key] + '" in JSON: ' + JSON.stringify(data[dataObj]));
            						throw 'Received an unexpected JSON object. See logs for more information.';
            					}
            				}
            				if (typeof compartment != 'undefined' && compartment != '') objectBuffer['compartment'] = compartment;
            				returnBuffer.push(objectBuffer);
            			}
            			return returnBuffer;
            		}
            
            		try {
            			if (httpMethod === 'get') {
            				return data[keys];
            			} else {
            				if (data.length === 0) {
            					return 0;
            				}
            				data = data[0][keys];
            				return data[data.length - 1]['value'];
            			}
            		} catch (error) {
            			Zabbix.log(3, this.zabbixLogPrefix + ' Could not find key "' + keys + '" in JSON: ' + JSON.stringify(data));
            			throw 'Could not find required key in JSON object. See logs for more information.';
            		}
            	};
            }
            
            
            const params = JSON.parse(value);
            validateZabbixParams(['tenancy_ocid', 'user_ocid', 'private_key', 'fingerprint', 'api_host', 'instance_id', 'availability_domain', 'http_status_code', 'compartment_id'], params);
            var oci = new OCI('Compute', 'Get VNICs', params);
            
            return JSON.stringify(oci.extractData('get', oci.executeRequest('get', '/20160918/vnicAttachments', '?compartmentId=' + encodeURIComponent(params['compartment_id']) + '&availabilityDomain=' + encodeURIComponent(params['availability_domain']) + '&instanceId=' + encodeURIComponent(params['instance_id'])), ['vnicId', 'displayName', 'lifecycleState']));
          description: 'Gets information about all virtual network interface cards attached to the instance.'
          timeout: 30s
          parameters:
            - name: api_host
              value: '{$OCI.API.CORE.HOST}'
            - name: availability_domain
              value: '{$OCI.COMPUTE.AVAILABILITY.DOMAIN}'
            - name: compartment_id
              value: '{$OCI.COMPUTE.COMPARTMENT.ID}'
            - name: fingerprint
              value: '{$OCI.API.FINGERPRINT}'
            - name: http_proxy
              value: '{$OCI.HTTP.PROXY}'
            - name: http_status_code
              value: '{$OCI.HTTP.RETURN.CODE.OK}'
            - name: instance_id
              value: '{$OCI.COMPUTE.INSTANCE.ID}'
            - name: private_key
              value: '{$OCI.API.PRIVATE.KEY}'
            - name: tenancy_ocid
              value: '{$OCI.API.TENANCY}'
            - name: user_ocid
              value: '{$OCI.API.USER}'
          tags:
            - tag: component
              value: raw
      discovery_rules:
        - uuid: 4f4a058b2a0b4bddb4ddbdb7613934af
          name: 'VNIC discovery'
          type: DEPENDENT
          key: oci.compute.vnic.discovery
          filter:
            evaltype: AND
            conditions:
              - macro: '{#NAME}'
                value: '{$OCI.COMPUTE.VNIC.DISCOVERY.NAME.MATCHES}'
              - macro: '{#NAME}'
                value: '{$OCI.COMPUTE.VNIC.DISCOVERY.NAME.NOT_MATCHES}'
                operator: NOT_MATCHES_REGEX
              - macro: '{#STATE}'
                value: '{$OCI.COMPUTE.VNIC.DISCOVERY.STATE.MATCHES}'
              - macro: '{#STATE}'
                value: '{$OCI.COMPUTE.VNIC.DISCOVERY.STATE.NOT_MATCHES}'
                operator: NOT_MATCHES_REGEX
          description: 'Discover compute instance VNICs.'
          item_prototypes:
            - uuid: 45fc4a9241f147c88e45352ac0f5018d
              name: 'VNIC [{#NAME}]: Attachment state'
              type: DEPENDENT
              key: 'oci.compute.vnic.attachment[{#ID}]'
              description: 'Current attachment state of the VNIC.'
              valuemap:
                name: 'VNIC attachment state'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$[?(@.id == ''{#ID}'')].state.first()'
                - type: JAVASCRIPT
                  parameters:
                    - |
                      const idx = {
                      	'ATTACHING': 1,
                      	'ATTACHED': 2,
                      	'DETACHING': 3,
                      	'DETACHED': 4
                      };
                      
                      return typeof idx[value] === 'undefined' ? 0 : idx[value];
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: oci.compute.vnic.get
              tags:
                - tag: component
                  value: network
                - tag: vnic
                  value: '{#ID}'
              trigger_prototypes:
                - uuid: 7176da6364464cfcacadfcfe7e81fdb3
                  expression: 'min(/Oracle Cloud Compute by HTTP/oci.compute.vnic.attachment[{#ID}],5m) >= 3'
                  name: 'OCI Compute: VNIC [{#NAME}]: VNIC is not attached'
                  priority: HIGH
                  description: 'Virtual network interface card attachment status.'
                  tags:
                    - tag: scope
                      value: availability
            - uuid: a9f4e55f3dd848b8bf0c861c81c2690a
              name: 'VNIC [{#NAME}]: Egress packets dropped by security list'
              type: DEPENDENT
              key: 'oci.compute.vnic.egress.packets.dropped[{#ID}]'
              units: '!packets'
              description: 'Packets sent by the VNIC, destined for the network, dropped due to security rule violations.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.VnicEgressDropsSecurityList
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: 'oci.compute.vnic.metrics.get[{#ID}]'
              tags:
                - tag: component
                  value: network
                - tag: vnic
                  value: '{#ID}'
            - uuid: 0ac50b3b570a470ca301185489c4d2a4
              name: 'VNIC [{#NAME}]: Smartnic buffer drops from host'
              type: DEPENDENT
              key: 'oci.compute.vnic.host.smartnic.drops[{#ID}]'
              units: '!packets'
              description: |
                Number of packets dropped in SmartNIC from the host due to buffer exhaustion.
                This metric is available only for Bare Metal Instances. For virtual machines, these metric values are zero.
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.SmartnicBufferDropsFromHost
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: 'oci.compute.vnic.metrics.get[{#ID}]'
              tags:
                - tag: component
                  value: network
                - tag: vnic
                  value: '{#ID}'
            - uuid: 86258bd1db6a46c9862f175acac2daf2
              name: 'VNIC [{#NAME}]: Ingress packets dropped by security list'
              type: DEPENDENT
              key: 'oci.compute.vnic.ingress.packets.dropped[{#ID}]'
              units: '!packets'
              description: 'Packets received from the network, destined for the VNIC, dropped due to security rule violations.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.VnicIngressDropsSecurityList
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: 'oci.compute.vnic.metrics.get[{#ID}]'
              tags:
                - tag: component
                  value: network
                - tag: vnic
                  value: '{#ID}'
            - uuid: eb79782153524452ba4ba8506fb207a5
              name: 'VNIC [{#NAME}]: Get metrics'
              type: SCRIPT
              key: 'oci.compute.vnic.metrics.get[{#ID}]'
              history: '0'
              value_type: TEXT
              params: |
                function validateZabbixParams(requiredParams, allParams) {
                	requiredParams.forEach(function (field) {
                		if (typeof allParams !== 'object' || typeof allParams[field] === 'undefined' || allParams[field] === '') {
                			throw 'Required param is not set: ' + field + '.';
                		}
                	});
                }
                
                function OCI(service, action, params) {
                	this.zabbixLogPrefix = '[ OCI ] [ ' + service + ' ] [ ' + action + ' ]';
                	this.request = new HttpRequest();
                
                	this.hash = function (string) {
                		return sha256(string);
                	};
                
                	this.sign = function (string) {
                		return sign('sha256', params['private_key'], string);
                	};
                
                	this.encode = function (hash) {
                		const hexArr = hash.match(/.{1,2}/g);
                		var uInt8Array = new Uint8Array(hexArr.length);
                		hexArr.forEach(function (hex, idx) {
                			uInt8Array[idx] = parseInt(hex, 16);
                		});
                		return btoa(uInt8Array);
                	};
                
                	this.getDate = function () {
                		const weekdayShortList = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
                		const monthShortList = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'];
                		const today = new Date();
                		return weekdayShortList[today.getUTCDay()] + ', ' + today.getUTCDate() + ' ' + monthShortList[today.getUTCMonth()] + ' ' + today.getUTCFullYear() + ' ' + today.getUTCHours() + ':' + today.getUTCMinutes() + ':' + today.getUTCSeconds() + ' GMT';
                	};
                
                	this.executeRequest = function (httpMethod, apiPath, apiParams, mql, namespace) {
                		var headers = '(request-target) date host';
                		const contentTypeHeader = 'content-type: application/json';
                		const dateHeader = 'date: ' + this.getDate();
                		const hostHeader = 'host: ' + params['api_host'];
                		const requestTarget = '(request-target): ' + httpMethod + ' ' + apiPath + apiParams;
                		var signingString = requestTarget + '\n' + dateHeader + '\n' + hostHeader;
                		var reqHeaders = [contentTypeHeader, dateHeader];
                
                		if (httpMethod === 'post') {
                			var body = JSON.stringify({
                				'namespace': namespace,
                				'query': mql
                			});
                			headers = headers + ' x-content-sha256 content-type content-length';
                			const bodyHeader = 'x-content-sha256: ' + this.encode(this.hash(body));
                			const bodyLengthHeader = 'content-length: ' + body.length;
                			signingString = signingString + '\n' + bodyHeader + '\n' + contentTypeHeader + '\n' + bodyLengthHeader;
                			reqHeaders.push(bodyHeader, bodyLengthHeader);
                		}
                
                		const signature = this.encode(this.sign(signingString));
                
                		reqHeaders.push('Authorization: Signature version="1",keyId="' + params['tenancy_ocid'] + '/' + params['user_ocid'] + '/' + params['fingerprint'] + '",algorithm="rsa-sha256",headers="' + headers + '",signature="' + signature + '"');
                		for (var header = 0, headerLength = reqHeaders.length; header < headerLength; header++) {
                			this.request.addHeader(reqHeaders[header]);
                		}
                
                		if (params['http_proxy']) {
                			this.request.setProxy(params['http_proxy']);
                			Zabbix.log(4, this.zabbixLogPrefix + ' Using http proxy: ' + params['http_proxy']);
                		}
                
                		if (httpMethod === 'post') {
                			var apiRateLimitExceeded = false;
                			do {
                				const response = this.request.post('https://' + params['api_host'] + apiPath + apiParams, body);
                
                				try {
                					if (JSON.parse(response)['code'] === 'TooManyRequests') {
                
                						apiRateLimitExceeded = true;
                						Zabbix.sleep(1000);
                					} else {
                						apiRateLimitExceeded = false;
                					}
                				} catch (error) {
                					Zabbix.log(3, this.zabbixLogPrefix + ' Could not parse the response: ' + JSON.stringify(response));
                					throw 'Could not parse the response. See logs for more information.';
                				}
                			} while (apiRateLimitExceeded);
                		} else {
                			const response = this.request.get('https://' + params['api_host'] + apiPath + apiParams);
                		}
                
                		this.request.clearHeader();
                
                		if (this.request.getStatus() === parseInt(params['http_status_code'])) {
                			return response;
                		} else {
                			Zabbix.log(3, this.zabbixLogPrefix + ' Unexpected HTTP response code: ' + this.request.getStatus());
                			throw 'Unexpected HTTP response code: ' + this.request.getStatus();
                		}
                	};
                
                	this.extractData = function (httpMethod, data, keys, compartment) {
                		try {
                			data = JSON.parse(data);
                		} catch (error) {
                			Zabbix.log(3, this.zabbixLogPrefix + ' Could not parse the received JSON object: ' + data);
                			throw 'Could not parse received JSON object. See logs for more information.';
                		}
                
                		if (typeof keys == 'object') {
                			var returnBuffer = [];
                			for (var dataObj = 0, dataLength = data.length; dataObj < dataLength; dataObj++) {
                
                				var objectBuffer = {};
                				for (var key = 0, keysLength = keys.length; key < keysLength; key++) {
                					if (data[dataObj][keys[key]] || data[dataObj][keys[key]] == null) {
                						objectBuffer[keys[key].match(/^[a-z]+$|[A-Z][a-z]+$/)[0].toLowerCase()] = data[dataObj][keys[key]];
                					} else {
                						Zabbix.log(3, this.zabbixLogPrefix + ' Received an unexpected JSON object. Could not get value for key "' + keys[key] + '" in JSON: ' + JSON.stringify(data[dataObj]));
                						throw 'Received an unexpected JSON object. See logs for more information.';
                					}
                				}
                				if (typeof compartment != 'undefined' && compartment != '') objectBuffer['compartment'] = compartment;
                				returnBuffer.push(objectBuffer);
                			}
                			return returnBuffer;
                		}
                
                		try {
                			if (httpMethod === 'get') {
                				return data[keys];
                			} else {
                				if (data.length === 0) {
                					return 0;
                				}
                				data = data[0][keys];
                				return data[data.length - 1]['value'];
                			}
                		} catch (error) {
                			Zabbix.log(3, this.zabbixLogPrefix + ' Could not find key "' + keys + '" in JSON: ' + JSON.stringify(data));
                			throw 'Could not find required key in JSON object. See logs for more information.';
                		}
                	};
                }
                
                function buildMql(id, metrics, defaultStatistic, resourceType) {
                	resourceType = resourceType === '' || resourceType === undefined ? 'resourceId' : resourceType;
                	this.query = '[' + params['req_interval'] + 'm]{' + resourceType + '=' + id + '}.';
                
                	for (var i = 0, metricsLength = metrics.length; i < metricsLength; i++) {
                		const metric = ((Array.isArray(metrics[i]) ? metrics[i] : [metrics[i], defaultStatistic]));
                		metrics[i] = [metric[0], this.query + metric[1]];
                	}
                }
                
                
                const params = JSON.parse(value);
                validateZabbixParams(['tenancy_ocid', 'user_ocid', 'private_key', 'fingerprint', 'api_host', 'vnic_id', 'http_status_code', 'req_interval', 'compartment_id'], params);
                var oci = new OCI('Compute - VNIC', 'Get metrics', params);
                
                const metrics = [
                	'VnicEgressDropsSecurityList',
                	'VnicIngressDropsSecurityList',
                	'VnicFromNetworkBytes',
                	'VnicFromNetworkPackets',
                	'VnicToNetworkBytes',
                	'VnicToNetworkPackets',
                	'VnicIngressDropsThrottle',
                	'VnicEgressDropsThrottle',
                	'VnicIngressDropsConntrackFull',
                	'VnicEgressDropsConntrackFull',
                	'VnicConntrackUtilPercent',
                	['VnicConntrackIsFull', 'last'],
                	'SmartnicBufferDropsFromNetwork',
                	'SmartnicBufferDropsFromHost'
                ];
                buildMql(params['vnic_id'], metrics, 'sum');
                
                var result = {};
                for (var i = 0, metricsLength = metrics.length; i < metricsLength; i++) {
                	result[metrics[i][0]] = oci.extractData('post', oci.executeRequest('post', '/20180401/metrics/actions/summarizeMetricsData', '?compartmentId=' + encodeURIComponent(params['compartment_id']), metrics[i][0] + metrics[i][1] + '()', 'oci_vcn'), 'aggregatedDatapoints');
                }
                return JSON.stringify(result);
              description: 'Gets virtual network interface card metrics.'
              timeout: 30s
              parameters:
                - name: api_host
                  value: '{$OCI.API.TELEMETRY.HOST}'
                - name: compartment_id
                  value: '{$OCI.COMPUTE.COMPARTMENT.ID}'
                - name: fingerprint
                  value: '{$OCI.API.FINGERPRINT}'
                - name: http_proxy
                  value: '{$OCI.HTTP.PROXY}'
                - name: http_status_code
                  value: '{$OCI.HTTP.RETURN.CODE.OK}'
                - name: private_key
                  value: '{$OCI.API.PRIVATE.KEY}'
                - name: req_interval
                  value: '1'
                - name: tenancy_ocid
                  value: '{$OCI.API.TENANCY}'
                - name: user_ocid
                  value: '{$OCI.API.USER}'
                - name: vnic_id
                  value: '{#ID}'
              tags:
                - tag: component
                  value: raw
            - uuid: e083fab486984a1d8c0947924e2e6c60
              name: 'VNIC [{#NAME}]: Bytes to network'
              type: DEPENDENT
              key: 'oci.compute.vnic.net.bytes.egr[{#ID}]'
              units: B
              description: 'Bytes sent from the VNIC to the network, before drops.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.VnicToNetworkBytes
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: 'oci.compute.vnic.metrics.get[{#ID}]'
              tags:
                - tag: component
                  value: network
                - tag: vnic
                  value: '{#ID}'
            - uuid: 09b608c006b34276b34356802f755ce7
              name: 'VNIC [{#NAME}]: Bytes from network'
              type: DEPENDENT
              key: 'oci.compute.vnic.net.bytes.ingr[{#ID}]'
              units: B
              description: 'Bytes received at the VNIC from the network, after drops.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.VnicFromNetworkBytes
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: 'oci.compute.vnic.metrics.get[{#ID}]'
              tags:
                - tag: component
                  value: network
                - tag: vnic
                  value: '{#ID}'
            - uuid: 9e4d0babdaad4f7291974881d88fa991
              name: 'VNIC [{#NAME}]: Connection tracking table full'
              type: DEPENDENT
              key: 'oci.compute.vnic.net.conntrack.full[{#ID}]'
              description: 'Boolean (0/false, 1/true) that indicates the connection tracking table is full.'
              valuemap:
                name: 'Generic Bool'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.VnicConntrackIsFull
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: 'oci.compute.vnic.metrics.get[{#ID}]'
              tags:
                - tag: component
                  value: network
                - tag: vnic
                  value: '{#ID}'
              trigger_prototypes:
                - uuid: 4faafcd1719745749ae1e3b2c58a09d0
                  expression: 'min(/Oracle Cloud Compute by HTTP/oci.compute.vnic.net.conntrack.full[{#ID}],5m) = 1'
                  name: 'OCI Compute: VNIC [{#NAME}]: Conntrack table full'
                  priority: HIGH
                  description: 'Virtual network interface card connection tracking table is full.'
                  tags:
                    - tag: scope
                      value: availability
            - uuid: 088fc9f8d317402099ed0cda9dffb525
              name: 'VNIC [{#NAME}]: Connection tracking table utilization, in %'
              type: DEPENDENT
              key: 'oci.compute.vnic.net.conntrack.util[{#ID}]'
              units: '%'
              description: 'Total utilization percentage (0-100%) of the connection tracking table.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.VnicConntrackUtilPercent
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: 'oci.compute.vnic.metrics.get[{#ID}]'
              tags:
                - tag: component
                  value: network
                - tag: vnic
                  value: '{#ID}'
              trigger_prototypes:
                - uuid: c2fd382491624a74b2956be3dad187ea
                  expression: 'min(/Oracle Cloud Compute by HTTP/oci.compute.vnic.net.conntrack.util[{#ID}],5m) >= {$OCI.COMPUTE.VNIC.CONNTRACK.UTIL.WARN}'
                  name: 'OCI Compute: VNIC [{#NAME}]: Current conntrack table utilization is high'
                  event_name: 'OCI Compute: VNIC [{#NAME}]: Current conntrack table utilization is high (util >= {$OCI.COMPUTE.VNIC.CONNTRACK.UTIL.WARN}%)'
                  opdata: 'Current: {ITEM.LASTVALUE1}'
                  priority: WARNING
                  description: 'Current conntrack table utilization has exceeded `{$OCI.COMPUTE.VNIC.CONNTRACK.UTIL.WARN}`% of the max available value.'
                  dependencies:
                    - name: 'OCI Compute: VNIC [{#NAME}]: Current conntrack table utilization is too high'
                      expression: 'min(/Oracle Cloud Compute by HTTP/oci.compute.vnic.net.conntrack.util[{#ID}],5m) >= {$OCI.COMPUTE.VNIC.CONNTRACK.UTIL.HIGH}'
                  tags:
                    - tag: scope
                      value: capacity
                - uuid: cf98ffe12a2b413c9b1384e9ec167cbd
                  expression: 'min(/Oracle Cloud Compute by HTTP/oci.compute.vnic.net.conntrack.util[{#ID}],5m) >= {$OCI.COMPUTE.VNIC.CONNTRACK.UTIL.HIGH}'
                  name: 'OCI Compute: VNIC [{#NAME}]: Current conntrack table utilization is too high'
                  event_name: 'OCI Compute: VNIC [{#NAME}]: Current conntrack table utilization is too high (util >= {$OCI.COMPUTE.VNIC.CONNTRACK.UTIL.HIGH}%)'
                  opdata: 'Current: {ITEM.LASTVALUE1}'
                  priority: HIGH
                  description: 'Current conntrack table utilization has exceeded `{$OCI.COMPUTE.VNIC.CONNTRACK.UTIL.HIGH}`% of the max available value.'
                  tags:
                    - tag: scope
                      value: capacity
            - uuid: 23be348ca25948468df11644a5f51d0d
              name: 'VNIC [{#NAME}]: Egress packets dropped by full connection tracking table'
              type: DEPENDENT
              key: 'oci.compute.vnic.net.packets.egr.drop[{#ID}]'
              units: '!packets'
              description: 'Packets sent from the VNIC, destined for the network, dropped due to the full connection tracking table.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.VnicEgressDropsConntrackFull
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: 'oci.compute.vnic.metrics.get[{#ID}]'
              tags:
                - tag: component
                  value: network
                - tag: vnic
                  value: '{#ID}'
            - uuid: bfa72f1cfc294d2b819cea22dbe7ddd8
              name: 'VNIC [{#NAME}]: Throttled egress packets'
              type: DEPENDENT
              key: 'oci.compute.vnic.net.packets.egr.throttled[{#ID}]'
              units: '!packets'
              description: 'Packets sent from the VNIC, destined for the network, dropped due to throttling.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.VnicEgressDropsThrottle
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: 'oci.compute.vnic.metrics.get[{#ID}]'
              tags:
                - tag: component
                  value: network
                - tag: vnic
                  value: '{#ID}'
            - uuid: 06cee1bacd744926ac61f72cd8ba3ae5
              name: 'VNIC [{#NAME}]: Packets to network'
              type: DEPENDENT
              key: 'oci.compute.vnic.net.packets.egr[{#ID}]'
              units: '!packets'
              description: 'Packets sent from the VNIC to the network, before drops.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.VnicToNetworkPackets
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: 'oci.compute.vnic.metrics.get[{#ID}]'
              tags:
                - tag: component
                  value: network
                - tag: vnic
                  value: '{#ID}'
            - uuid: 2564ee2fa8bd4d5f9859506c1486f45f
              name: 'VNIC [{#NAME}]: Ingress packets dropped by full connection tracking table'
              type: DEPENDENT
              key: 'oci.compute.vnic.net.packets.ingr.drop[{#ID}]'
              units: '!packets'
              description: 'Packets received from the network, destined for the VNIC, dropped due to the full connection tracking table.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.VnicIngressDropsConntrackFull
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: 'oci.compute.vnic.metrics.get[{#ID}]'
              tags:
                - tag: component
                  value: network
                - tag: vnic
                  value: '{#ID}'
            - uuid: 595654f8255f454fba44abfcfeeb8c14
              name: 'VNIC [{#NAME}]: Throttled ingress packets'
              type: DEPENDENT
              key: 'oci.compute.vnic.net.packets.ingr.throttled[{#ID}]'
              units: '!packets'
              description: 'Packets received from the network, destined for the VNIC, dropped due to throttling.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.VnicIngressDropsThrottle
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: 'oci.compute.vnic.metrics.get[{#ID}]'
              tags:
                - tag: component
                  value: network
                - tag: vnic
                  value: '{#ID}'
            - uuid: 9c37d782e3594e199f0c77010853d893
              name: 'VNIC [{#NAME}]: Packets from network'
              type: DEPENDENT
              key: 'oci.compute.vnic.net.packets.ingr[{#ID}]'
              units: '!packets'
              description: 'Packets received at the VNIC from the network, after drops.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.VnicFromNetworkPackets
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: 'oci.compute.vnic.metrics.get[{#ID}]'
              tags:
                - tag: component
                  value: network
                - tag: vnic
                  value: '{#ID}'
            - uuid: 400c523fe78b4264948e363f278bbc6d
              name: 'VNIC [{#NAME}]: Smartnic buffer drops from network'
              type: DEPENDENT
              key: 'oci.compute.vnic.net.smartnic.drops[{#ID}]'
              units: '!packets'
              description: |
                Number of packets dropped in SmartNIC from the network due to buffer exhaustion.
                This metric is available only for Bare Metal Instances. For virtual machines, these metric values are zero.
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.SmartnicBufferDropsFromNetwork
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: 'oci.compute.vnic.metrics.get[{#ID}]'
              tags:
                - tag: component
                  value: network
                - tag: vnic
                  value: '{#ID}'
          graph_prototypes:
            - uuid: 7a02ebf104a24f3ebd1631003dc7365c
              name: 'VNIC [{#NAME}]: Network bytes in'
              graph_items:
                - color: 00D936
                  item:
                    host: 'Oracle Cloud Compute by HTTP'
                    key: 'oci.compute.vnic.net.bytes.ingr[{#ID}]'
            - uuid: 50306b25bef24d95acd2d9ae9e0c1f6f
              name: 'VNIC [{#NAME}]: Network bytes out'
              graph_items:
                - color: 2196F3
                  item:
                    host: 'Oracle Cloud Compute by HTTP'
                    key: 'oci.compute.vnic.net.bytes.egr[{#ID}]'
            - uuid: 4f3c1eabc2be43b68c4a76a6bed17761
              name: 'VNIC [{#NAME}]: Network packets dropped by connection tracking table'
              graph_items:
                - color: 199C0D
                  yaxisside: RIGHT
                  item:
                    host: 'Oracle Cloud Compute by HTTP'
                    key: 'oci.compute.vnic.net.conntrack.util[{#ID}]'
                - sortorder: '1'
                  color: 00D936
                  item:
                    host: 'Oracle Cloud Compute by HTTP'
                    key: 'oci.compute.vnic.net.packets.ingr.drop[{#ID}]'
                - sortorder: '2'
                  color: 0208bf
                  item:
                    host: 'Oracle Cloud Compute by HTTP'
                    key: 'oci.compute.vnic.net.packets.egr.drop[{#ID}]'
            - uuid: 3d9f549442ac455eb0e5296594eac004
              name: 'VNIC [{#NAME}]: Network packets dropped by security list'
              graph_items:
                - color: 00D936
                  item:
                    host: 'Oracle Cloud Compute by HTTP'
                    key: 'oci.compute.vnic.net.packets.ingr.drop[{#ID}]'
                - sortorder: '1'
                  color: 0208bf
                  item:
                    host: 'Oracle Cloud Compute by HTTP'
                    key: 'oci.compute.vnic.net.packets.egr.drop[{#ID}]'
            - uuid: 2c4626b63df0468caef94e405e499aaa
              name: 'VNIC [{#NAME}]: Network packets in'
              graph_items:
                - color: 00D936
                  item:
                    host: 'Oracle Cloud Compute by HTTP'
                    key: 'oci.compute.vnic.net.packets.ingr[{#ID}]'
                - sortorder: '1'
                  color: 008C23
                  item:
                    host: 'Oracle Cloud Compute by HTTP'
                    key: 'oci.compute.vnic.net.packets.ingr.throttled[{#ID}]'
            - uuid: 4fe14e23a0414b8787749aababc35ceb
              name: 'VNIC [{#NAME}]: Network packets out'
              graph_items:
                - color: 2196F3
                  item:
                    host: 'Oracle Cloud Compute by HTTP'
                    key: 'oci.compute.vnic.net.packets.egr[{#ID}]'
                - sortorder: '1'
                  color: 0208bf
                  item:
                    host: 'Oracle Cloud Compute by HTTP'
                    key: 'oci.compute.vnic.net.packets.egr.throttled[{#ID}]'
            - uuid: fdaad88126dd486b948348e993217c8f
              name: 'VNIC [{#NAME}]: Smartnic buffer drops'
              graph_items:
                - color: 199C0D
                  item:
                    host: 'Oracle Cloud Compute by HTTP'
                    key: 'oci.compute.vnic.net.smartnic.drops[{#ID}]'
                - sortorder: '1'
                  color: F63100
                  item:
                    host: 'Oracle Cloud Compute by HTTP'
                    key: 'oci.compute.vnic.host.smartnic.drops[{#ID}]'
          master_item:
            key: oci.compute.vnic.get
          lld_macro_paths:
            - lld_macro: '{#ID}'
              path: $.id
            - lld_macro: '{#NAME}'
              path: $.name
            - lld_macro: '{#STATE}'
              path: $.state
          preprocessing:
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
      tags:
        - tag: class
          value: cloud
        - tag: class
          value: database
        - tag: subclass
          value: automation
        - tag: subclass
          value: bigdata
        - tag: subclass
          value: deploy
        - tag: target
          value: oci
        - tag: target
          value: oracle-cloud-infrastructure
      macros:
        - macro: '{$OCI.COMPUTE.CPU.UTIL.HIGH}'
          value: '90'
          description: 'Sets the percentage threshold for creating a "high" severity event about CPU resource utilization.'
        - macro: '{$OCI.COMPUTE.CPU.UTIL.WARN}'
          value: '75'
          description: 'Sets the percentage threshold for creating a "warning" severity event about CPU resource utilization.'
        - macro: '{$OCI.COMPUTE.MEM.UTIL.HIGH}'
          value: '90'
          description: 'Sets the percentage threshold for creating a "high" severity event about memory resource utilization.'
        - macro: '{$OCI.COMPUTE.MEM.UTIL.WARN}'
          value: '75'
          description: 'Sets the percentage threshold for creating a "warning" severity event about memory resource utilization.'
        - macro: '{$OCI.COMPUTE.VNIC.CONNTRACK.UTIL.HIGH}'
          value: '90'
          description: 'Sets the percentage threshold for creating a "high" severity event about VNIC connection tracking table utilization.'
        - macro: '{$OCI.COMPUTE.VNIC.CONNTRACK.UTIL.WARN}'
          value: '75'
          description: 'Sets the percentage threshold for creating a "warning" severity event about VNIC connection tracking table utilization.'
        - macro: '{$OCI.COMPUTE.VNIC.DISCOVERY.NAME.MATCHES}'
          value: '.*'
          description: 'Sets the regex string of VNIC names to allow in discovery.'
        - macro: '{$OCI.COMPUTE.VNIC.DISCOVERY.NAME.NOT_MATCHES}'
          value: CHANGE_IF_NEEDED
          description: 'Sets the regex string of VNIC names to ignore in discovery.'
        - macro: '{$OCI.COMPUTE.VNIC.DISCOVERY.STATE.MATCHES}'
          value: '.*'
          description: 'Sets the regex string of VNIC states to allow in discovery.'
        - macro: '{$OCI.COMPUTE.VNIC.DISCOVERY.STATE.NOT_MATCHES}'
          value: CHANGE_IF_NEEDED
          description: 'Sets the regex string of VNIC states to ignore in discovery.'
        - macro: '{$OCI.HTTP.PROXY}'
          description: 'Set an HTTP proxy for OCI API requests if needed.'
        - macro: '{$OCI.HTTP.RETURN.CODE.OK}'
          value: '200'
          description: 'Set the HTTP return code that represents an OK response from the API. The default is "200",  but can vary, for example, if a proxy is used.'
      dashboards:
        - uuid: edab80c89bcf43d6ada2e4ed5477d36f
          name: 'OCI Compute: Overview'
          pages:
            - name: Main
              display_period: '60'
              widgets:
                - type: item
                  name: State
                  width: '27'
                  height: '4'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: 6C00D9
                    - type: STRING
                      name: description
                      value: 'Current State'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Compute by HTTP'
                        key: oci.compute.availability.get
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: INTEGER
                      name: units_show
                      value: '0'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                    - type: INTEGER
                      name: value_size
                      value: '35'
                - type: item
                  name: 'Disk bytes read'
                  'y': '4'
                  width: '15'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: 00D936
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'Disk Bytes Read'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Compute by HTTP'
                        key: oci.compute.disk.read
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '20'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: item
                  name: 'Disk read I/O'
                  'y': '7'
                  width: '15'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: 00D936
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'Disk Read I/O'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Compute by HTTP'
                        key: oci.compute.disk.io.read
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '20'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: item
                  name: 'Disk bytes written'
                  x: '15'
                  'y': '4'
                  width: '15'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: 00D936
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'Disk Bytes Written'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Compute by HTTP'
                        key: oci.compute.disk.written
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '20'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: item
                  name: 'Disk write I/O'
                  x: '15'
                  'y': '7'
                  width: '15'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: 00D936
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'Disk Write I/O'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Compute by HTTP'
                        key: oci.compute.disk.io.write
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '20'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: item
                  name: Availability
                  x: '27'
                  width: '15'
                  height: '4'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: 6C00D9
                    - type: STRING
                      name: description
                      value: Availability
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Compute by HTTP'
                        key: oci.compute.availability.get
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: INTEGER
                      name: units_show
                      value: '0'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                    - type: INTEGER
                      name: value_size
                      value: '20'
                - type: item
                  name: 'Net bytes in'
                  x: '30'
                  'y': '4'
                  width: '18'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: FF0000
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'Net Bytes In'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Compute by HTTP'
                        key: oci.compute.network.in
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: item
                  name: 'Net bytes out'
                  x: '30'
                  'y': '7'
                  width: '18'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: FF0000
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'Net Bytes Out'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Compute by HTTP'
                        key: oci.compute.network.out
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: item
                  name: 'Load average'
                  x: '42'
                  width: '30'
                  height: '4'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: 6C00D9
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'Load Average'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Compute by HTTP'
                        key: oci.compute.load.avg
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: gauge
                  name: CPU
                  x: '48'
                  'y': '4'
                  width: '12'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: 2196F3
                    - type: STRING
                      name: description
                      value: CPU
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: STRING
                      name: empty_color
                      value: 145C96
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Compute by HTTP'
                        key: oci.compute.cpu.util
                    - type: INTEGER
                      name: rf_rate
                      value: '30'
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: INTEGER
                      name: show.2
                      value: '5'
                    - type: STRING
                      name: units
                      value: '%'
                    - type: INTEGER
                      name: units_bold
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: STRING
                      name: value_arc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: value_arc_size
                      value: '35'
                    - type: INTEGER
                      name: value_bold
                      value: '1'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: item
                  name: 'Memory allocation stalls'
                  x: '48'
                  'y': '7'
                  width: '24'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: FBC02D
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'Memory Allocation Stalls'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Compute by HTTP'
                        key: oci.compute.mem.stalls
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: gauge
                  name: Memory
                  x: '60'
                  'y': '4'
                  width: '12'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: 2196F3
                    - type: STRING
                      name: description
                      value: Memory
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: STRING
                      name: empty_color
                      value: 145C96
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Compute by HTTP'
                        key: oci.compute.mem.util
                    - type: INTEGER
                      name: rf_rate
                      value: '30'
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: INTEGER
                      name: show.2
                      value: '5'
                    - type: STRING
                      name: units
                      value: '%'
                    - type: INTEGER
                      name: units_bold
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: STRING
                      name: value_arc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: value_arc_size
                      value: '35'
                    - type: INTEGER
                      name: value_bold
                      value: '1'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
            - name: CPU/Mem
              display_period: '30'
              widgets:
                - type: gauge
                  name: CPU
                  width: '24'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: 2196F3
                    - type: STRING
                      name: description
                      value: CPU
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: STRING
                      name: empty_color
                      value: 145C96
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Compute by HTTP'
                        key: oci.compute.cpu.util
                    - type: INTEGER
                      name: rf_rate
                      value: '30'
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: INTEGER
                      name: show.2
                      value: '5'
                    - type: STRING
                      name: units
                      value: '%'
                    - type: INTEGER
                      name: units_bold
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: STRING
                      name: value_arc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: value_arc_size
                      value: '35'
                    - type: INTEGER
                      name: value_bold
                      value: '1'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: graph
                  name: 'CPU utilization'
                  'y': '3'
                  width: '24'
                  height: '8'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Oracle Cloud Compute by HTTP'
                        name: 'OCI Compute: Cpu utilization'
                    - type: STRING
                      name: reference
                      value: ABAAA
                - type: gauge
                  name: Memory
                  x: '24'
                  width: '48'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: 2196F3
                    - type: STRING
                      name: description
                      value: Memory
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: STRING
                      name: empty_color
                      value: 145C96
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Compute by HTTP'
                        key: oci.compute.mem.util
                    - type: INTEGER
                      name: rf_rate
                      value: '30'
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: INTEGER
                      name: show.2
                      value: '5'
                    - type: STRING
                      name: units
                      value: '%'
                    - type: INTEGER
                      name: units_bold
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: STRING
                      name: value_arc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: value_arc_size
                      value: '35'
                    - type: INTEGER
                      name: value_bold
                      value: '1'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: graph
                  name: 'Memory utilization'
                  x: '24'
                  'y': '3'
                  width: '24'
                  height: '8'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Oracle Cloud Compute by HTTP'
                        name: 'OCI Compute: Memory utilization'
                    - type: STRING
                      name: reference
                      value: ABAAB
                - type: graph
                  name: 'Memory allocation stalls'
                  x: '48'
                  'y': '3'
                  width: '24'
                  height: '8'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Oracle Cloud Compute by HTTP'
                        name: 'OCI Compute: Memory allocation stalls'
                    - type: STRING
                      name: reference
                      value: ABAAC
            - name: 'Net In/Out'
              display_period: '30'
              widgets:
                - type: item
                  name: 'Net bytes in'
                  width: '36'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: FF0000
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'Net Bytes In'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Compute by HTTP'
                        key: oci.compute.network.in
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: graph
                  name: 'Network bytes in'
                  'y': '3'
                  width: '36'
                  height: '8'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Oracle Cloud Compute by HTTP'
                        name: 'OCI Compute: Network bytes in'
                    - type: STRING
                      name: reference
                      value: ACAAA
                - type: item
                  name: 'Net bytes out'
                  x: '36'
                  width: '36'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: FF0000
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'Net Bytes Out'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Compute by HTTP'
                        key: oci.compute.network.out
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: graph
                  name: 'Network bytes out'
                  x: '36'
                  'y': '3'
                  width: '36'
                  height: '8'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Oracle Cloud Compute by HTTP'
                        name: 'OCI Compute: Network bytes out'
                    - type: STRING
                      name: reference
                      value: ACAAC
            - name: Disk
              display_period: '30'
              widgets:
                - type: item
                  name: 'Disk bytes read'
                  width: '18'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: 00D936
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'Disk Bytes Read'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Compute by HTTP'
                        key: oci.compute.disk.read
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: graph
                  name: 'Disk bytes read'
                  'y': '3'
                  width: '18'
                  height: '8'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Oracle Cloud Compute by HTTP'
                        name: 'OCI Compute: Disk bytes read'
                    - type: STRING
                      name: reference
                      value: ADAAA
                - type: item
                  name: 'Disk bytes written'
                  x: '18'
                  width: '18'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: 00D936
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'Disk Bytes Written'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Compute by HTTP'
                        key: oci.compute.disk.written
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: graph
                  name: 'Disk bytes written'
                  x: '18'
                  'y': '3'
                  width: '18'
                  height: '8'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Oracle Cloud Compute by HTTP'
                        name: 'OCI Compute: Disk bytes written'
                    - type: STRING
                      name: reference
                      value: ADAAB
                - type: item
                  name: 'Disk read i/o'
                  x: '36'
                  width: '18'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: 00D936
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'Disk Read I/O'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Compute by HTTP'
                        key: oci.compute.disk.io.read
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: graph
                  name: 'Disk read i/o'
                  x: '36'
                  'y': '3'
                  width: '18'
                  height: '8'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Oracle Cloud Compute by HTTP'
                        name: 'OCI Compute: Disk bytes read I/O'
                    - type: STRING
                      name: reference
                      value: ADAAC
                - type: item
                  name: 'Disk write i/o'
                  x: '54'
                  width: '18'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: 00D936
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'Disk Write I/O'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Compute by HTTP'
                        key: oci.compute.disk.io.write
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: graph
                  name: 'Disk write i/o'
                  x: '54'
                  'y': '3'
                  width: '18'
                  height: '8'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Oracle Cloud Compute by HTTP'
                        name: 'OCI Compute: Disk bytes write I/O'
                    - type: STRING
                      name: reference
                      value: ADAAD
            - name: 'VNIC In/Out'
              display_period: '30'
              widgets:
                - type: item
                  name: 'Total bytes in'
                  width: '6'
                  height: '11'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: FF0000
                    - type: INTEGER
                      name: decimal_places
                      value: '1'
                    - type: INTEGER
                      name: decimal_size
                      value: '4'
                    - type: STRING
                      name: description
                      value: Ingress
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_size
                      value: '3'
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Compute by HTTP'
                        key: oci.compute.network.in
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '2'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                    - type: INTEGER
                      name: value_size
                      value: '4'
                - type: graph
                  name: 'Network bytes in'
                  x: '6'
                  width: '30'
                  height: '3'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Oracle Cloud Compute by HTTP'
                        name: 'OCI Compute: Network bytes in'
                    - type: STRING
                      name: reference
                      value: AEAAA
                    - type: INTEGER
                      name: show_legend
                      value: '0'
                - type: graphprototype
                  name: 'VNIC bytes in'
                  x: '6'
                  'y': '3'
                  width: '30'
                  height: '4'
                  fields:
                    - type: INTEGER
                      name: columns
                      value: '1'
                    - type: GRAPH_PROTOTYPE
                      name: graphid.0
                      value:
                        host: 'Oracle Cloud Compute by HTTP'
                        name: 'VNIC [{#NAME}]: Network bytes in'
                    - type: STRING
                      name: reference
                      value: AEAAB
                - type: graphprototype
                  name: 'VNIC packets in'
                  x: '6'
                  'y': '7'
                  width: '30'
                  height: '4'
                  fields:
                    - type: INTEGER
                      name: columns
                      value: '1'
                    - type: GRAPH_PROTOTYPE
                      name: graphid.0
                      value:
                        host: 'Oracle Cloud Compute by HTTP'
                        name: 'VNIC [{#NAME}]: Network packets in'
                    - type: STRING
                      name: reference
                      value: AEAAC
                - type: item
                  name: 'Total bytes out'
                  x: '36'
                  width: '6'
                  height: '11'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: FF0000
                    - type: INTEGER
                      name: decimal_places
                      value: '1'
                    - type: INTEGER
                      name: decimal_size
                      value: '4'
                    - type: STRING
                      name: description
                      value: Egress
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_size
                      value: '3'
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Compute by HTTP'
                        key: oci.compute.network.out
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '2'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                    - type: INTEGER
                      name: value_size
                      value: '4'
                - type: graph
                  name: 'Network bytes out'
                  x: '42'
                  width: '30'
                  height: '3'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Oracle Cloud Compute by HTTP'
                        name: 'OCI Compute: Network bytes out'
                    - type: STRING
                      name: reference
                      value: AEAAD
                    - type: INTEGER
                      name: show_legend
                      value: '0'
                - type: graphprototype
                  name: 'VNIC bytes out'
                  x: '42'
                  'y': '3'
                  width: '30'
                  height: '4'
                  fields:
                    - type: INTEGER
                      name: columns
                      value: '1'
                    - type: GRAPH_PROTOTYPE
                      name: graphid.0
                      value:
                        host: 'Oracle Cloud Compute by HTTP'
                        name: 'VNIC [{#NAME}]: Network bytes out'
                    - type: STRING
                      name: reference
                      value: AEAAE
                - type: graphprototype
                  name: 'VNIC packets out'
                  x: '42'
                  'y': '7'
                  width: '30'
                  height: '4'
                  fields:
                    - type: INTEGER
                      name: columns
                      value: '1'
                    - type: GRAPH_PROTOTYPE
                      name: graphid.0
                      value:
                        host: 'Oracle Cloud Compute by HTTP'
                        name: 'VNIC [{#NAME}]: Network packets out'
                    - type: STRING
                      name: reference
                      value: AEAAF
            - name: 'VNIC Detailed'
              display_period: '30'
              widgets:
                - type: graphprototype
                  name: 'Connection tracking table'
                  width: '24'
                  height: '11'
                  fields:
                    - type: INTEGER
                      name: columns
                      value: '1'
                    - type: GRAPH_PROTOTYPE
                      name: graphid.0
                      value:
                        host: 'Oracle Cloud Compute by HTTP'
                        name: 'VNIC [{#NAME}]: Network packets dropped by connection tracking table'
                    - type: STRING
                      name: reference
                      value: AFAAA
                - type: graphprototype
                  name: 'Security list'
                  x: '24'
                  width: '24'
                  height: '11'
                  fields:
                    - type: INTEGER
                      name: columns
                      value: '1'
                    - type: GRAPH_PROTOTYPE
                      name: graphid.0
                      value:
                        host: 'Oracle Cloud Compute by HTTP'
                        name: 'VNIC [{#NAME}]: Network packets dropped by security list'
                    - type: STRING
                      name: reference
                      value: AFAAB
                - type: graphprototype
                  name: Smartnic
                  x: '48'
                  width: '24'
                  height: '11'
                  fields:
                    - type: INTEGER
                      name: columns
                      value: '1'
                    - type: GRAPH_PROTOTYPE
                      name: graphid.0
                      value:
                        host: 'Oracle Cloud Compute by HTTP'
                        name: 'VNIC [{#NAME}]: Smartnic buffer drops'
                    - type: STRING
                      name: reference
                      value: AFAAC
      valuemaps:
        - uuid: 9e238671edca4ed7b58eefacc861a77d
          name: 'Compute instance availability'
          mappings:
            - value: '0'
              newvalue: Available
            - value: '1'
              newvalue: Unavailable
        - uuid: c336821eced54261afb0d10a0de6601d
          name: 'Compute instance state'
          mappings:
            - value: '0'
              newvalue: Unknown
            - value: '1'
              newvalue: Moving
            - value: '2'
              newvalue: Provisioning
            - value: '3'
              newvalue: Running
            - value: '4'
              newvalue: Starting
            - value: '5'
              newvalue: Stopping
            - value: '6'
              newvalue: Stopped
            - value: '7'
              newvalue: 'Creating image'
            - value: '8'
              newvalue: Terminating
            - value: '9'
              newvalue: Terminated
        - uuid: dce0b4413ede4dbca55f89cbc86736b3
          name: 'Generic Bool'
          mappings:
            - value: '0'
              newvalue: 'False'
            - value: '1'
              newvalue: 'True'
        - uuid: 8fdcb86d1dde4d2489239dd61fbd8b08
          name: 'VNIC attachment state'
          mappings:
            - value: '0'
              newvalue: Unknown
            - value: '1'
              newvalue: Attaching
            - value: '2'
              newvalue: Attached
            - value: '3'
              newvalue: Detaching
            - value: '4'
              newvalue: Detached
    - uuid: 62d99b55585e41dd89736f5f46074dcb
      template: 'Oracle Cloud Networking by HTTP'
      name: 'Oracle Cloud Networking by HTTP'
      description: |
        This template monitors Oracle Cloud Infrastructure (OCI) single virtual network card availability and discovers
        attached subnets and monitors their availability.
        
        This template is not meant to be used independently, but together with Oracle Cloud by HTTP as a template for 
        LLD host prototypes.
        
        Read the template documentation prior to using this template.
        
        You can discuss this template or leave feedback on our forum https://www.zabbix.com/forum/zabbix-suggestions-and-feedback
        
        Generated by official Zabbix template tool "Templator"
      wizard_ready: 'YES'
      readme: |
        ## Setup
        
        This template is used in low-level discovery and will be auto-assigned to host prototypes. Additional configuration is not required.
      vendor:
        name: Zabbix
        version: 8.0-1
      groups:
        - name: Templates/Cloud
      items:
        - uuid: 7b2fdfb034ba4657a731ab11ffa175f6
          name: 'Get VCN state'
          type: SCRIPT
          key: oci.vcn.state.get
          delay: 5m
          params: |
            function validateZabbixParams(requiredParams, allParams) {
            	requiredParams.forEach(function (field) {
            		if (typeof allParams !== 'object' || typeof allParams[field] === 'undefined' || allParams[field] === '') {
            			throw 'Required param is not set: ' + field + '.';
            		}
            	});
            }
            
            function OCI(service, action, params) {
            	this.zabbixLogPrefix = '[ OCI ] [ ' + service + ' ] [ ' + action + ' ]';
            	this.request = new HttpRequest();
            
            	this.hash = function (string) {
            		return sha256(string);
            	};
            
            	this.sign = function (string) {
            		return sign('sha256', params['private_key'], string);
            	};
            
            	this.encode = function (hash) {
            		const hexArr = hash.match(/.{1,2}/g);
            		var uInt8Array = new Uint8Array(hexArr.length);
            		hexArr.forEach(function (hex, idx) {
            			uInt8Array[idx] = parseInt(hex, 16);
            		});
            		return btoa(uInt8Array);
            	};
            
            	this.getDate = function () {
            		const weekdayShortList = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
            		const monthShortList = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'];
            		const today = new Date();
            		return weekdayShortList[today.getUTCDay()] + ', ' + today.getUTCDate() + ' ' + monthShortList[today.getUTCMonth()] + ' ' + today.getUTCFullYear() + ' ' + today.getUTCHours() + ':' + today.getUTCMinutes() + ':' + today.getUTCSeconds() + ' GMT';
            	};
            
            	this.executeRequest = function (httpMethod, apiPath, apiParams, mql, namespace) {
            		var headers = '(request-target) date host';
            		const contentTypeHeader = 'content-type: application/json';
            		const dateHeader = 'date: ' + this.getDate();
            		const hostHeader = 'host: ' + params['api_host'];
            		const requestTarget = '(request-target): ' + httpMethod + ' ' + apiPath + apiParams;
            		var signingString = requestTarget + '\n' + dateHeader + '\n' + hostHeader;
            		var reqHeaders = [contentTypeHeader, dateHeader];
            
            		if (httpMethod === 'post') {
            			var body = JSON.stringify({
            				'namespace': namespace,
            				'query': mql
            			});
            			headers = headers + ' x-content-sha256 content-type content-length';
            			const bodyHeader = 'x-content-sha256: ' + this.encode(this.hash(body));
            			const bodyLengthHeader = 'content-length: ' + body.length;
            			signingString = signingString + '\n' + bodyHeader + '\n' + contentTypeHeader + '\n' + bodyLengthHeader;
            			reqHeaders.push(bodyHeader, bodyLengthHeader);
            		}
            
            		const signature = this.encode(this.sign(signingString));
            
            		reqHeaders.push('Authorization: Signature version="1",keyId="' + params['tenancy_ocid'] + '/' + params['user_ocid'] + '/' + params['fingerprint'] + '",algorithm="rsa-sha256",headers="' + headers + '",signature="' + signature + '"');
            		for (var header = 0, headerLength = reqHeaders.length; header < headerLength; header++) {
            			this.request.addHeader(reqHeaders[header]);
            		}
            
            		if (params['http_proxy']) {
            			this.request.setProxy(params['http_proxy']);
            			Zabbix.log(4, this.zabbixLogPrefix + ' Using http proxy: ' + params['http_proxy']);
            		}
            
            		if (httpMethod === 'post') {
            			var apiRateLimitExceeded = false;
            			do {
            				const response = this.request.post('https://' + params['api_host'] + apiPath + apiParams, body);
            
            				try {
            					if (JSON.parse(response)['code'] === 'TooManyRequests') {
            
            						apiRateLimitExceeded = true;
            						Zabbix.sleep(1000);
            					} else {
            						apiRateLimitExceeded = false;
            					}
            				} catch (error) {
            					Zabbix.log(3, this.zabbixLogPrefix + ' Could not parse the response: ' + JSON.stringify(response));
            					throw 'Could not parse the response. See logs for more information.';
            				}
            			} while (apiRateLimitExceeded);
            		} else {
            			const response = this.request.get('https://' + params['api_host'] + apiPath + apiParams);
            		}
            
            		this.request.clearHeader();
            
            		if (this.request.getStatus() === parseInt(params['http_status_code'])) {
            			return response;
            		} else {
            			Zabbix.log(3, this.zabbixLogPrefix + ' Unexpected HTTP response code: ' + this.request.getStatus());
            			throw 'Unexpected HTTP response code: ' + this.request.getStatus();
            		}
            	};
            
            	this.extractData = function (httpMethod, data, keys, compartment) {
            		try {
            			data = JSON.parse(data);
            		} catch (error) {
            			Zabbix.log(3, this.zabbixLogPrefix + ' Could not parse the received JSON object: ' + data);
            			throw 'Could not parse received JSON object. See logs for more information.';
            		}
            
            		if (typeof keys == 'object') {
            			var returnBuffer = [];
            			for (var dataObj = 0, dataLength = data.length; dataObj < dataLength; dataObj++) {
            
            				var objectBuffer = {};
            				for (var key = 0, keysLength = keys.length; key < keysLength; key++) {
            					if (data[dataObj][keys[key]] || data[dataObj][keys[key]] == null) {
            						objectBuffer[keys[key].match(/^[a-z]+$|[A-Z][a-z]+$/)[0].toLowerCase()] = data[dataObj][keys[key]];
            					} else {
            						Zabbix.log(3, this.zabbixLogPrefix + ' Received an unexpected JSON object. Could not get value for key "' + keys[key] + '" in JSON: ' + JSON.stringify(data[dataObj]));
            						throw 'Received an unexpected JSON object. See logs for more information.';
            					}
            				}
            				if (typeof compartment != 'undefined' && compartment != '') objectBuffer['compartment'] = compartment;
            				returnBuffer.push(objectBuffer);
            			}
            			return returnBuffer;
            		}
            
            		try {
            			if (httpMethod === 'get') {
            				return data[keys];
            			} else {
            				if (data.length === 0) {
            					return 0;
            				}
            				data = data[0][keys];
            				return data[data.length - 1]['value'];
            			}
            		} catch (error) {
            			Zabbix.log(3, this.zabbixLogPrefix + ' Could not find key "' + keys + '" in JSON: ' + JSON.stringify(data));
            			throw 'Could not find required key in JSON object. See logs for more information.';
            		}
            	};
            }
            
            
            const params = JSON.parse(value);
            validateZabbixParams(['tenancy_ocid', 'user_ocid', 'private_key', 'fingerprint', 'api_host', 'vcn_id', 'http_status_code'], params);
            var oci = new OCI('VCN', 'Get VCN status', params);
            
            return JSON.stringify(oci.extractData('get', oci.executeRequest('get', '/20160918/vcns/' + encodeURIComponent(params['vcn_id']), ''), 'lifecycleState'));
          description: 'State of the virtual cloud network.'
          valuemap:
            name: 'Lifecycle state'
          preprocessing:
            - type: STR_REPLACE
              parameters:
                - '"'
                - ''
            - type: JAVASCRIPT
              parameters:
                - |
                  const idx = {
                  	'PROVISIONING': 1,
                  	'AVAILABLE': 2,
                  	'TERMINATING': 3,
                  	'TERMINATED': 4,
                  	'UPDATING': 5
                  };
                  
                  return typeof idx[value] === 'undefined' ? 0 : idx[value];
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          timeout: 10s
          parameters:
            - name: api_host
              value: '{$OCI.API.CORE.HOST}'
            - name: fingerprint
              value: '{$OCI.API.FINGERPRINT}'
            - name: http_proxy
              value: '{$OCI.HTTP.PROXY}'
            - name: http_status_code
              value: '{$OCI.HTTP.RETURN.CODE.OK}'
            - name: private_key
              value: '{$OCI.API.PRIVATE.KEY}'
            - name: tenancy_ocid
              value: '{$OCI.API.TENANCY}'
            - name: user_ocid
              value: '{$OCI.API.USER}'
            - name: vcn_id
              value: '{$OCI.VCN.ID}'
          tags:
            - tag: component
              value: network
          triggers:
            - uuid: 8a5a94ea28db43df93e85d26703f9e7c
              expression: 'min(/Oracle Cloud Networking by HTTP/oci.vcn.state.get,5m) = 3 or min(/Oracle Cloud Networking by HTTP/oci.vcn.state.get,5m) = 4'
              name: 'OCI VCN: VCN state terminated'
              priority: HIGH
              description: 'Virtual cloud network state is "terminated" or "terminating".'
              tags:
                - tag: scope
                  value: availability
            - uuid: 80c3f4d6696c40a78ddb2c00378eeae1
              expression: 'min(/Oracle Cloud Networking by HTTP/oci.vcn.state.get,5m) = 0'
              name: 'OCI VCN: VCN state unknown'
              priority: WARNING
              description: 'Virtual cloud network state is unknown.'
              tags:
                - tag: scope
                  value: availability
        - uuid: 83236aeedf5e4ba39f0425c21f745690
          name: 'Get subnets'
          type: SCRIPT
          key: oci.vcn.subnets.get
          delay: 5m
          history: '0'
          value_type: TEXT
          params: |
            function validateZabbixParams(requiredParams, allParams) {
            	requiredParams.forEach(function (field) {
            		if (typeof allParams !== 'object' || typeof allParams[field] === 'undefined' || allParams[field] === '') {
            			throw 'Required param is not set: ' + field + '.';
            		}
            	});
            }
            
            function OCI(service, action, params) {
            	this.zabbixLogPrefix = '[ OCI ] [ ' + service + ' ] [ ' + action + ' ]';
            	this.request = new HttpRequest();
            
            	this.hash = function (string) {
            		return sha256(string);
            	};
            
            	this.sign = function (string) {
            		return sign('sha256', params['private_key'], string);
            	};
            
            	this.encode = function (hash) {
            		const hexArr = hash.match(/.{1,2}/g);
            		var uInt8Array = new Uint8Array(hexArr.length);
            		hexArr.forEach(function (hex, idx) {
            			uInt8Array[idx] = parseInt(hex, 16);
            		});
            		return btoa(uInt8Array);
            	};
            
            	this.getDate = function () {
            		const weekdayShortList = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
            		const monthShortList = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'];
            		const today = new Date();
            		return weekdayShortList[today.getUTCDay()] + ', ' + today.getUTCDate() + ' ' + monthShortList[today.getUTCMonth()] + ' ' + today.getUTCFullYear() + ' ' + today.getUTCHours() + ':' + today.getUTCMinutes() + ':' + today.getUTCSeconds() + ' GMT';
            	};
            
            	this.executeRequest = function (httpMethod, apiPath, apiParams, mql, namespace) {
            		var headers = '(request-target) date host';
            		const contentTypeHeader = 'content-type: application/json';
            		const dateHeader = 'date: ' + this.getDate();
            		const hostHeader = 'host: ' + params['api_host'];
            		const requestTarget = '(request-target): ' + httpMethod + ' ' + apiPath + apiParams;
            		var signingString = requestTarget + '\n' + dateHeader + '\n' + hostHeader;
            		var reqHeaders = [contentTypeHeader, dateHeader];
            
            		if (httpMethod === 'post') {
            			var body = JSON.stringify({
            				'namespace': namespace,
            				'query': mql
            			});
            			headers = headers + ' x-content-sha256 content-type content-length';
            			const bodyHeader = 'x-content-sha256: ' + this.encode(this.hash(body));
            			const bodyLengthHeader = 'content-length: ' + body.length;
            			signingString = signingString + '\n' + bodyHeader + '\n' + contentTypeHeader + '\n' + bodyLengthHeader;
            			reqHeaders.push(bodyHeader, bodyLengthHeader);
            		}
            
            		const signature = this.encode(this.sign(signingString));
            
            		reqHeaders.push('Authorization: Signature version="1",keyId="' + params['tenancy_ocid'] + '/' + params['user_ocid'] + '/' + params['fingerprint'] + '",algorithm="rsa-sha256",headers="' + headers + '",signature="' + signature + '"');
            		for (var header = 0, headerLength = reqHeaders.length; header < headerLength; header++) {
            			this.request.addHeader(reqHeaders[header]);
            		}
            
            		if (params['http_proxy']) {
            			this.request.setProxy(params['http_proxy']);
            			Zabbix.log(4, this.zabbixLogPrefix + ' Using http proxy: ' + params['http_proxy']);
            		}
            
            		if (httpMethod === 'post') {
            			var apiRateLimitExceeded = false;
            			do {
            				const response = this.request.post('https://' + params['api_host'] + apiPath + apiParams, body);
            
            				try {
            					if (JSON.parse(response)['code'] === 'TooManyRequests') {
            
            						apiRateLimitExceeded = true;
            						Zabbix.sleep(1000);
            					} else {
            						apiRateLimitExceeded = false;
            					}
            				} catch (error) {
            					Zabbix.log(3, this.zabbixLogPrefix + ' Could not parse the response: ' + JSON.stringify(response));
            					throw 'Could not parse the response. See logs for more information.';
            				}
            			} while (apiRateLimitExceeded);
            		} else {
            			const response = this.request.get('https://' + params['api_host'] + apiPath + apiParams);
            		}
            
            		this.request.clearHeader();
            
            		if (this.request.getStatus() === parseInt(params['http_status_code'])) {
            			return response;
            		} else {
            			Zabbix.log(3, this.zabbixLogPrefix + ' Unexpected HTTP response code: ' + this.request.getStatus());
            			throw 'Unexpected HTTP response code: ' + this.request.getStatus();
            		}
            	};
            
            	this.extractData = function (httpMethod, data, keys, compartment) {
            		try {
            			data = JSON.parse(data);
            		} catch (error) {
            			Zabbix.log(3, this.zabbixLogPrefix + ' Could not parse the received JSON object: ' + data);
            			throw 'Could not parse received JSON object. See logs for more information.';
            		}
            
            		if (typeof keys == 'object') {
            			var returnBuffer = [];
            			for (var dataObj = 0, dataLength = data.length; dataObj < dataLength; dataObj++) {
            
            				var objectBuffer = {};
            				for (var key = 0, keysLength = keys.length; key < keysLength; key++) {
            					if (data[dataObj][keys[key]] || data[dataObj][keys[key]] == null) {
            						objectBuffer[keys[key].match(/^[a-z]+$|[A-Z][a-z]+$/)[0].toLowerCase()] = data[dataObj][keys[key]];
            					} else {
            						Zabbix.log(3, this.zabbixLogPrefix + ' Received an unexpected JSON object. Could not get value for key "' + keys[key] + '" in JSON: ' + JSON.stringify(data[dataObj]));
            						throw 'Received an unexpected JSON object. See logs for more information.';
            					}
            				}
            				if (typeof compartment != 'undefined' && compartment != '') objectBuffer['compartment'] = compartment;
            				returnBuffer.push(objectBuffer);
            			}
            			return returnBuffer;
            		}
            
            		try {
            			if (httpMethod === 'get') {
            				return data[keys];
            			} else {
            				if (data.length === 0) {
            					return 0;
            				}
            				data = data[0][keys];
            				return data[data.length - 1]['value'];
            			}
            		} catch (error) {
            			Zabbix.log(3, this.zabbixLogPrefix + ' Could not find key "' + keys + '" in JSON: ' + JSON.stringify(data));
            			throw 'Could not find required key in JSON object. See logs for more information.';
            		}
            	};
            }
            
            
            const params = JSON.parse(value);
            validateZabbixParams(['tenancy_ocid', 'user_ocid', 'private_key', 'fingerprint', 'api_host', 'vcn_id', 'http_status_code', 'compartment_id'], params);
            var oci = new OCI('VCN', 'Get subnets', params);
            
            return JSON.stringify(oci.extractData('get', oci.executeRequest('get', '/20160918/subnets', '?compartmentId=' + encodeURIComponent(params['compartment_id']) + '&vcnId=' + encodeURIComponent(params['vcn_id'])), ['id', 'displayName', 'lifecycleState', 'freeformTags']));
          description: 'Get data about subnets linked to the particular VCN.'
          timeout: 30s
          parameters:
            - name: api_host
              value: '{$OCI.API.CORE.HOST}'
            - name: compartment_id
              value: '{$OCI.VCN.COMPARTMENT.ID}'
            - name: fingerprint
              value: '{$OCI.API.FINGERPRINT}'
            - name: http_proxy
              value: '{$OCI.HTTP.PROXY}'
            - name: http_status_code
              value: '{$OCI.HTTP.RETURN.CODE.OK}'
            - name: private_key
              value: '{$OCI.API.PRIVATE.KEY}'
            - name: tenancy_ocid
              value: '{$OCI.API.TENANCY}'
            - name: user_ocid
              value: '{$OCI.API.USER}'
            - name: vcn_id
              value: '{$OCI.VCN.ID}'
          tags:
            - tag: component
              value: raw
      discovery_rules:
        - uuid: 6aca3a2d8b9a4231ae9364611ed4df82
          name: 'Subnet discovery'
          type: DEPENDENT
          key: oci.vcn.subnet.discovery
          filter:
            evaltype: AND
            conditions:
              - macro: '{#NAME}'
                value: '{$OCI.VCN.SUBNET.DISCOVERY.NAME.MATCHES}'
              - macro: '{#NAME}'
                value: '{$OCI.VCN.SUBNET.DISCOVERY.NAME.NOT_MATCHES}'
                operator: NOT_MATCHES_REGEX
              - macro: '{#STATE}'
                value: '{$OCI.VCN.SUBNET.DISCOVERY.STATE.MATCHES}'
              - macro: '{#STATE}'
                value: '{$OCI.VCN.SUBNET.DISCOVERY.STATE.NOT_MATCHES}'
                operator: NOT_MATCHES_REGEX
          description: 'Discover subnets linked to the particular VCN.'
          item_prototypes:
            - uuid: 759c6bff98fb4cb3bc8c9269513339bf
              name: 'Subnet [{#NAME}]: Get subnet state'
              type: DEPENDENT
              key: 'oci.vcn.subnet.state[{#ID}]'
              description: 'Current state of subnet.'
              valuemap:
                name: 'Lifecycle state'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$..[?(@.id == ''{#ID}'')].state.first()'
                - type: JAVASCRIPT
                  parameters:
                    - |
                      const idx = {
                      	'PROVISIONING': 1,
                      	'AVAILABLE': 2,
                      	'TERMINATING': 3,
                      	'TERMINATED': 4
                      };
                      
                      return typeof idx[value] === 'undefined' ? 0 : idx[value];
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: oci.vcn.subnets.get
              tags:
                - tag: component
                  value: network
                - tag: subnet
                  value: '{#ID}'
              trigger_prototypes:
                - uuid: f048db860c0c4134acdbcbf19ea554eb
                  expression: 'min(/Oracle Cloud Networking by HTTP/oci.vcn.subnet.state[{#ID}],5m) = 3 or min(/Oracle Cloud Networking by HTTP/oci.vcn.subnet.state[{#ID}],5m) = 4'
                  name: 'OCI VCN: Subnet [{#NAME}]: Subnet state terminated'
                  priority: HIGH
                  description: 'Virtual cloud network subnet state is "terminated" or "terminating".'
                  tags:
                    - tag: scope
                      value: availability
                - uuid: d34e5b8c571b41f9ba5dc11453431860
                  expression: 'min(/Oracle Cloud Networking by HTTP/oci.vcn.subnet.state[{#ID}],5m) = 0'
                  name: 'OCI VCN: Subnet [{#NAME}]: Subnet state unknown'
                  priority: WARNING
                  description: 'Virtual cloud network subnet state is unknown.'
                  tags:
                    - tag: scope
                      value: availability
          master_item:
            key: oci.vcn.subnets.get
          lld_macro_paths:
            - lld_macro: '{#ID}'
              path: $.id
            - lld_macro: '{#NAME}'
              path: $.name
            - lld_macro: '{#STATE}'
              path: $.state
          preprocessing:
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
      tags:
        - tag: class
          value: cloud
        - tag: class
          value: database
        - tag: subclass
          value: automation
        - tag: subclass
          value: bigdata
        - tag: subclass
          value: deploy
        - tag: target
          value: oci
        - tag: target
          value: oracle-cloud-infrastructure
      macros:
        - macro: '{$OCI.HTTP.PROXY}'
          description: 'Set an HTTP proxy for OCI API requests if needed.'
        - macro: '{$OCI.HTTP.RETURN.CODE.OK}'
          value: '200'
          description: 'Set the HTTP return code that represents an OK response from the API. The default is "200",  but can vary, for example, if a proxy is used.'
        - macro: '{$OCI.VCN.SUBNET.DISCOVERY.NAME.MATCHES}'
          value: '.*'
          description: 'Sets the regex string of VCN subnet names to allow in discovery.'
        - macro: '{$OCI.VCN.SUBNET.DISCOVERY.NAME.NOT_MATCHES}'
          value: CHANGE_IF_NEEDED
          description: 'Sets the regex string of VCN subnet names to ignore in discovery.'
        - macro: '{$OCI.VCN.SUBNET.DISCOVERY.STATE.MATCHES}'
          value: '.*'
          description: 'Sets the regex string of VCN subnet states to allow in discovery.'
        - macro: '{$OCI.VCN.SUBNET.DISCOVERY.STATE.NOT_MATCHES}'
          value: CHANGE_IF_NEEDED
          description: 'Sets the regex string of VCN subnet states to ignore in discovery.'
      valuemaps:
        - uuid: abf7b45647ee4a339df92bf06b12f0df
          name: 'Lifecycle state'
          mappings:
            - value: '0'
              newvalue: Unknown
            - value: '1'
              newvalue: Provisioning
            - value: '2'
              newvalue: Available
            - value: '3'
              newvalue: Terminating
            - value: '4'
              newvalue: Terminated
            - value: '5'
              newvalue: Updating
    - uuid: e8f89476695848e99ba900a5664d290b
      template: 'Oracle Cloud Object Storage by HTTP'
      name: 'Oracle Cloud Object Storage by HTTP'
      description: |
        This template monitors Oracle Cloud Infrastructure (OCI) object storage resources.
        
        This template is not meant to be used independently, but together with Oracle Cloud by HTTP as a template for
        LLD host prototypes.
        
        Read the template documentation prior to using this template.
        
        You can discuss this template or leave feedback on our forum https://www.zabbix.com/forum/zabbix-suggestions-and-feedback
        
        Generated by official Zabbix template tool "Templator"
      wizard_ready: 'YES'
      readme: |
        ## Setup
        
        This template is used in low-level discovery and will be auto-assigned to host prototypes. Additional configuration is not required.
      vendor:
        name: Zabbix
        version: 8.0-1
      groups:
        - name: Templates/Cloud
      items:
        - uuid: 8a216ff99ea84e169ba24305a5501b45
          name: 'Client-side error count'
          type: DEPENDENT
          key: oci.obj.storage.client.errors
          value_type: FLOAT
          description: 'The total number of 4xx errors for requests made in a bucket.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.ClientErrors
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: oci.obj.storage.metrics.frequent.get
          tags:
            - tag: component
              value: storage
        - uuid: 3d41eed5ab23438d9f2a87c48bb3def4
          name: 'First byte latency time'
          type: DEPENDENT
          key: oci.obj.storage.latency.byte
          value_type: FLOAT
          units: s
          description: 'The per-request time measured from the time Object Storage receives the complete request to when Object Storage returns the first byte of the response.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.FirstByteLatency
            - type: MULTIPLIER
              parameters:
                - '0.001'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: oci.obj.storage.metrics.frequent.get
          tags:
            - tag: component
              value: storage
        - uuid: a47bb44ccb35489e965432c332bd8892
          name: 'Overall latency time'
          type: DEPENDENT
          key: oci.obj.storage.latency.overall
          value_type: FLOAT
          units: s
          description: |
            The per-request time from the first byte received by Object Storage to the last byte sent from
            Object Storage.
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.TotalRequestLatency
            - type: MULTIPLIER
              parameters:
                - '0.001'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: oci.obj.storage.metrics.frequent.get
          tags:
            - tag: component
              value: storage
        - uuid: 5463c35f2c48408997532001025989fa
          name: 'Get frequent metrics'
          type: SCRIPT
          key: oci.obj.storage.metrics.frequent.get
          history: '0'
          value_type: TEXT
          params: |
            function validateZabbixParams(requiredParams, allParams) {
            	requiredParams.forEach(function (field) {
            		if (typeof allParams !== 'object' || typeof allParams[field] === 'undefined' || allParams[field] === '') {
            			throw 'Required param is not set: ' + field + '.';
            		}
            	});
            }
            
            function OCI(service, action, params) {
            	this.zabbixLogPrefix = '[ OCI ] [ ' + service + ' ] [ ' + action + ' ]';
            	this.request = new HttpRequest();
            
            	this.hash = function (string) {
            		return sha256(string);
            	};
            
            	this.sign = function (string) {
            		return sign('sha256', params['private_key'], string);
            	};
            
            	this.encode = function (hash) {
            		const hexArr = hash.match(/.{1,2}/g);
            		var uInt8Array = new Uint8Array(hexArr.length);
            		hexArr.forEach(function (hex, idx) {
            			uInt8Array[idx] = parseInt(hex, 16);
            		});
            		return btoa(uInt8Array);
            	};
            
            	this.getDate = function () {
            		const weekdayShortList = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
            		const monthShortList = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'];
            		const today = new Date();
            		return weekdayShortList[today.getUTCDay()] + ', ' + today.getUTCDate() + ' ' + monthShortList[today.getUTCMonth()] + ' ' + today.getUTCFullYear() + ' ' + today.getUTCHours() + ':' + today.getUTCMinutes() + ':' + today.getUTCSeconds() + ' GMT';
            	};
            
            	this.executeRequest = function (httpMethod, apiPath, apiParams, mql, namespace) {
            		var headers = '(request-target) date host';
            		const contentTypeHeader = 'content-type: application/json';
            		const dateHeader = 'date: ' + this.getDate();
            		const hostHeader = 'host: ' + params['api_host'];
            		const requestTarget = '(request-target): ' + httpMethod + ' ' + apiPath + apiParams;
            		var signingString = requestTarget + '\n' + dateHeader + '\n' + hostHeader;
            		var reqHeaders = [contentTypeHeader, dateHeader];
            
            		if (httpMethod === 'post') {
            			var body = JSON.stringify({
            				'namespace': namespace,
            				'query': mql
            			});
            			headers = headers + ' x-content-sha256 content-type content-length';
            			const bodyHeader = 'x-content-sha256: ' + this.encode(this.hash(body));
            			const bodyLengthHeader = 'content-length: ' + body.length;
            			signingString = signingString + '\n' + bodyHeader + '\n' + contentTypeHeader + '\n' + bodyLengthHeader;
            			reqHeaders.push(bodyHeader, bodyLengthHeader);
            		}
            
            		const signature = this.encode(this.sign(signingString));
            
            		reqHeaders.push('Authorization: Signature version="1",keyId="' + params['tenancy_ocid'] + '/' + params['user_ocid'] + '/' + params['fingerprint'] + '",algorithm="rsa-sha256",headers="' + headers + '",signature="' + signature + '"');
            		for (var header = 0, headerLength = reqHeaders.length; header < headerLength; header++) {
            			this.request.addHeader(reqHeaders[header]);
            		}
            
            		if (params['http_proxy']) {
            			this.request.setProxy(params['http_proxy']);
            			Zabbix.log(4, this.zabbixLogPrefix + ' Using http proxy: ' + params['http_proxy']);
            		}
            
            		if (httpMethod === 'post') {
            			var apiRateLimitExceeded = false;
            			do {
            				const response = this.request.post('https://' + params['api_host'] + apiPath + apiParams, body);
            
            				try {
            					if (JSON.parse(response)['code'] === 'TooManyRequests') {
            
            						apiRateLimitExceeded = true;
            						Zabbix.sleep(1000);
            					} else {
            						apiRateLimitExceeded = false;
            					}
            				} catch (error) {
            					Zabbix.log(3, this.zabbixLogPrefix + ' Could not parse the response: ' + JSON.stringify(response));
            					throw 'Could not parse the response. See logs for more information.';
            				}
            			} while (apiRateLimitExceeded);
            		} else {
            			const response = this.request.get('https://' + params['api_host'] + apiPath + apiParams);
            		}
            
            		this.request.clearHeader();
            
            		if (this.request.getStatus() === parseInt(params['http_status_code'])) {
            			return response;
            		} else {
            			Zabbix.log(3, this.zabbixLogPrefix + ' Unexpected HTTP response code: ' + this.request.getStatus());
            			throw 'Unexpected HTTP response code: ' + this.request.getStatus();
            		}
            	};
            
            	this.extractData = function (httpMethod, data, keys, compartment) {
            		try {
            			data = JSON.parse(data);
            		} catch (error) {
            			Zabbix.log(3, this.zabbixLogPrefix + ' Could not parse the received JSON object: ' + data);
            			throw 'Could not parse received JSON object. See logs for more information.';
            		}
            
            		if (typeof keys == 'object') {
            			var returnBuffer = [];
            			for (var dataObj = 0, dataLength = data.length; dataObj < dataLength; dataObj++) {
            
            				var objectBuffer = {};
            				for (var key = 0, keysLength = keys.length; key < keysLength; key++) {
            					if (data[dataObj][keys[key]] || data[dataObj][keys[key]] == null) {
            						objectBuffer[keys[key].match(/^[a-z]+$|[A-Z][a-z]+$/)[0].toLowerCase()] = data[dataObj][keys[key]];
            					} else {
            						Zabbix.log(3, this.zabbixLogPrefix + ' Received an unexpected JSON object. Could not get value for key "' + keys[key] + '" in JSON: ' + JSON.stringify(data[dataObj]));
            						throw 'Received an unexpected JSON object. See logs for more information.';
            					}
            				}
            				if (typeof compartment != 'undefined' && compartment != '') objectBuffer['compartment'] = compartment;
            				returnBuffer.push(objectBuffer);
            			}
            			return returnBuffer;
            		}
            
            		try {
            			if (httpMethod === 'get') {
            				return data[keys];
            			} else {
            				if (data.length === 0) {
            					return 0;
            				}
            				data = data[0][keys];
            				return data[data.length - 1]['value'];
            			}
            		} catch (error) {
            			Zabbix.log(3, this.zabbixLogPrefix + ' Could not find key "' + keys + '" in JSON: ' + JSON.stringify(data));
            			throw 'Could not find required key in JSON object. See logs for more information.';
            		}
            	};
            }
            
            function buildMql(id, metrics, defaultStatistic, resourceType) {
            	resourceType = resourceType === '' || resourceType === undefined ? 'resourceId' : resourceType;
            	this.query = '[' + params['req_interval'] + 'm]{' + resourceType + '=' + id + '}.';
            
            	for (var i = 0, metricsLength = metrics.length; i < metricsLength; i++) {
            		const metric = ((Array.isArray(metrics[i]) ? metrics[i] : [metrics[i], defaultStatistic]));
            		metrics[i] = [metric[0], this.query + metric[1]];
            	}
            }
            
            
            const params = JSON.parse(value);
            validateZabbixParams(['tenancy_ocid', 'user_ocid', 'private_key', 'fingerprint', 'api_host', 'bucket_name', 'http_status_code', 'req_interval', 'compartment_id'], params);
            var oci = new OCI('Object storage', 'Get metrics ' + params['req_interval'] + 'm', params);
            
            const metrics = [
            	'AllRequests',
            	'ClientErrors',
            	'FirstByteLatency',
            	'PostRequests',
            	'PutRequests',
            	'TotalRequestLatency'
            ];
            buildMql(params['bucket_name'], metrics, 'mean', 'resourceDisplayName');
            
            var result = {};
            for (var i = 0, metricsLength = metrics.length; i < metricsLength; i++) {
            	result[metrics[i][0]] = oci.extractData('post', oci.executeRequest('post', '/20180401/metrics/actions/summarizeMetricsData', '?compartmentId=' + encodeURIComponent(params['compartment_id']), metrics[i][0] + metrics[i][1] + '()', 'oci_objectstorage'), 'aggregatedDatapoints');
            }
            return JSON.stringify(result);
          description: 'Gets all metrics related to a specific bucket that have frequent update time (100 milliseconds).'
          timeout: 30s
          parameters:
            - name: api_host
              value: '{$OCI.API.TELEMETRY.HOST}'
            - name: bucket_name
              value: '{$OCI.OBJECT.STORAGE.BUCKET}'
            - name: compartment_id
              value: '{$OCI.OBJECT.STORAGE.COMPARTMENT.ID}'
            - name: fingerprint
              value: '{$OCI.API.FINGERPRINT}'
            - name: http_proxy
              value: '{$OCI.HTTP.PROXY}'
            - name: http_status_code
              value: '{$OCI.HTTP.RETURN.CODE.OK}'
            - name: private_key
              value: '{$OCI.API.PRIVATE.KEY}'
            - name: req_interval
              value: '1'
            - name: tenancy_ocid
              value: '{$OCI.API.TENANCY}'
            - name: user_ocid
              value: '{$OCI.API.USER}'
          tags:
            - tag: component
              value: raw
        - uuid: 4a12f1c73e8f40be9136a095ad147775
          name: 'Get hourly metrics'
          type: SCRIPT
          key: oci.obj.storage.metrics.hourly.get
          delay: 1h
          history: '0'
          value_type: TEXT
          params: |
            function validateZabbixParams(requiredParams, allParams) {
            	requiredParams.forEach(function (field) {
            		if (typeof allParams !== 'object' || typeof allParams[field] === 'undefined' || allParams[field] === '') {
            			throw 'Required param is not set: ' + field + '.';
            		}
            	});
            }
            
            function OCI(service, action, params) {
            	this.zabbixLogPrefix = '[ OCI ] [ ' + service + ' ] [ ' + action + ' ]';
            	this.request = new HttpRequest();
            
            	this.hash = function (string) {
            		return sha256(string);
            	};
            
            	this.sign = function (string) {
            		return sign('sha256', params['private_key'], string);
            	};
            
            	this.encode = function (hash) {
            		const hexArr = hash.match(/.{1,2}/g);
            		var uInt8Array = new Uint8Array(hexArr.length);
            		hexArr.forEach(function (hex, idx) {
            			uInt8Array[idx] = parseInt(hex, 16);
            		});
            		return btoa(uInt8Array);
            	};
            
            	this.getDate = function () {
            		const weekdayShortList = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
            		const monthShortList = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'];
            		const today = new Date();
            		return weekdayShortList[today.getUTCDay()] + ', ' + today.getUTCDate() + ' ' + monthShortList[today.getUTCMonth()] + ' ' + today.getUTCFullYear() + ' ' + today.getUTCHours() + ':' + today.getUTCMinutes() + ':' + today.getUTCSeconds() + ' GMT';
            	};
            
            	this.executeRequest = function (httpMethod, apiPath, apiParams, mql, namespace) {
            		var headers = '(request-target) date host';
            		const contentTypeHeader = 'content-type: application/json';
            		const dateHeader = 'date: ' + this.getDate();
            		const hostHeader = 'host: ' + params['api_host'];
            		const requestTarget = '(request-target): ' + httpMethod + ' ' + apiPath + apiParams;
            		var signingString = requestTarget + '\n' + dateHeader + '\n' + hostHeader;
            		var reqHeaders = [contentTypeHeader, dateHeader];
            
            		if (httpMethod === 'post') {
            			var body = JSON.stringify({
            				'namespace': namespace,
            				'query': mql
            			});
            			headers = headers + ' x-content-sha256 content-type content-length';
            			const bodyHeader = 'x-content-sha256: ' + this.encode(this.hash(body));
            			const bodyLengthHeader = 'content-length: ' + body.length;
            			signingString = signingString + '\n' + bodyHeader + '\n' + contentTypeHeader + '\n' + bodyLengthHeader;
            			reqHeaders.push(bodyHeader, bodyLengthHeader);
            		}
            
            		const signature = this.encode(this.sign(signingString));
            
            		reqHeaders.push('Authorization: Signature version="1",keyId="' + params['tenancy_ocid'] + '/' + params['user_ocid'] + '/' + params['fingerprint'] + '",algorithm="rsa-sha256",headers="' + headers + '",signature="' + signature + '"');
            		for (var header = 0, headerLength = reqHeaders.length; header < headerLength; header++) {
            			this.request.addHeader(reqHeaders[header]);
            		}
            
            		if (params['http_proxy']) {
            			this.request.setProxy(params['http_proxy']);
            			Zabbix.log(4, this.zabbixLogPrefix + ' Using http proxy: ' + params['http_proxy']);
            		}
            
            		if (httpMethod === 'post') {
            			var apiRateLimitExceeded = false;
            			do {
            				const response = this.request.post('https://' + params['api_host'] + apiPath + apiParams, body);
            
            				try {
            					if (JSON.parse(response)['code'] === 'TooManyRequests') {
            
            						apiRateLimitExceeded = true;
            						Zabbix.sleep(1000);
            					} else {
            						apiRateLimitExceeded = false;
            					}
            				} catch (error) {
            					Zabbix.log(3, this.zabbixLogPrefix + ' Could not parse the response: ' + JSON.stringify(response));
            					throw 'Could not parse the response. See logs for more information.';
            				}
            			} while (apiRateLimitExceeded);
            		} else {
            			const response = this.request.get('https://' + params['api_host'] + apiPath + apiParams);
            		}
            
            		this.request.clearHeader();
            
            		if (this.request.getStatus() === parseInt(params['http_status_code'])) {
            			return response;
            		} else {
            			Zabbix.log(3, this.zabbixLogPrefix + ' Unexpected HTTP response code: ' + this.request.getStatus());
            			throw 'Unexpected HTTP response code: ' + this.request.getStatus();
            		}
            	};
            
            	this.extractData = function (httpMethod, data, keys, compartment) {
            		try {
            			data = JSON.parse(data);
            		} catch (error) {
            			Zabbix.log(3, this.zabbixLogPrefix + ' Could not parse the received JSON object: ' + data);
            			throw 'Could not parse received JSON object. See logs for more information.';
            		}
            
            		if (typeof keys == 'object') {
            			var returnBuffer = [];
            			for (var dataObj = 0, dataLength = data.length; dataObj < dataLength; dataObj++) {
            
            				var objectBuffer = {};
            				for (var key = 0, keysLength = keys.length; key < keysLength; key++) {
            					if (data[dataObj][keys[key]] || data[dataObj][keys[key]] == null) {
            						objectBuffer[keys[key].match(/^[a-z]+$|[A-Z][a-z]+$/)[0].toLowerCase()] = data[dataObj][keys[key]];
            					} else {
            						Zabbix.log(3, this.zabbixLogPrefix + ' Received an unexpected JSON object. Could not get value for key "' + keys[key] + '" in JSON: ' + JSON.stringify(data[dataObj]));
            						throw 'Received an unexpected JSON object. See logs for more information.';
            					}
            				}
            				if (typeof compartment != 'undefined' && compartment != '') objectBuffer['compartment'] = compartment;
            				returnBuffer.push(objectBuffer);
            			}
            			return returnBuffer;
            		}
            
            		try {
            			if (httpMethod === 'get') {
            				return data[keys];
            			} else {
            				if (data.length === 0) {
            					return 0;
            				}
            				data = data[0][keys];
            				return data[data.length - 1]['value'];
            			}
            		} catch (error) {
            			Zabbix.log(3, this.zabbixLogPrefix + ' Could not find key "' + keys + '" in JSON: ' + JSON.stringify(data));
            			throw 'Could not find required key in JSON object. See logs for more information.';
            		}
            	};
            }
            
            function buildMql(id, metrics, defaultStatistic, resourceType) {
            	resourceType = resourceType === '' || resourceType === undefined ? 'resourceId' : resourceType;
            	this.query = '[' + params['req_interval'] + 'm]{' + resourceType + '=' + id + '}.';
            
            	for (var i = 0, metricsLength = metrics.length; i < metricsLength; i++) {
            		const metric = ((Array.isArray(metrics[i]) ? metrics[i] : [metrics[i], defaultStatistic]));
            		metrics[i] = [metric[0], this.query + metric[1]];
            	}
            }
            
            
            const params = JSON.parse(value);
            validateZabbixParams(['tenancy_ocid', 'user_ocid', 'private_key', 'fingerprint', 'api_host', 'bucket_name', 'http_status_code', 'req_interval', 'compartment_id'], params);
            var oci = new OCI('Object storage', 'Get metrics ' + params['req_interval'] + 'm', params);
            
            const metrics = [
            	'ObjectCount',
            	'StoredBytes',
            	'UncommittedParts'
            ];
            buildMql(params['bucket_name'], metrics, 'mean', 'resourceDisplayName')
            
            var result = {};
            for (var i = 0, metricsLength = metrics.length; i < metricsLength; i++) {
            	result[metrics[i][0]] = oci.extractData('post', oci.executeRequest('post', '/20180401/metrics/actions/summarizeMetricsData', '?compartmentId=' + encodeURIComponent(params['compartment_id']), metrics[i][0] + metrics[i][1] + '()', 'oci_objectstorage'), 'aggregatedDatapoints');
            }
            return JSON.stringify(result);
          description: 'Gets all metrics related to specific bucket that have update time of 1 hour.'
          timeout: 30s
          parameters:
            - name: api_host
              value: '{$OCI.API.TELEMETRY.HOST}'
            - name: bucket_name
              value: '{$OCI.OBJECT.STORAGE.BUCKET}'
            - name: compartment_id
              value: '{$OCI.OBJECT.STORAGE.COMPARTMENT.ID}'
            - name: fingerprint
              value: '{$OCI.API.FINGERPRINT}'
            - name: http_proxy
              value: '{$OCI.HTTP.PROXY}'
            - name: http_status_code
              value: '{$OCI.HTTP.RETURN.CODE.OK}'
            - name: private_key
              value: '{$OCI.API.PRIVATE.KEY}'
            - name: req_interval
              value: '60'
            - name: tenancy_ocid
              value: '{$OCI.API.TENANCY}'
            - name: user_ocid
              value: '{$OCI.API.USER}'
          tags:
            - tag: component
              value: raw
        - uuid: 5bb5ba3011e94e43bb1fdc79668c9537
          name: 'Get enabled object lifecycle management'
          type: SCRIPT
          key: oci.obj.storage.metrics.olm.get
          delay: 3h
          params: |
            function validateZabbixParams(requiredParams, allParams) {
            	requiredParams.forEach(function (field) {
            		if (typeof allParams !== 'object' || typeof allParams[field] === 'undefined' || allParams[field] === '') {
            			throw 'Required param is not set: ' + field + '.';
            		}
            	});
            }
            
            function OCI(service, action, params) {
            	this.zabbixLogPrefix = '[ OCI ] [ ' + service + ' ] [ ' + action + ' ]';
            	this.request = new HttpRequest();
            
            	this.hash = function (string) {
            		return sha256(string);
            	};
            
            	this.sign = function (string) {
            		return sign('sha256', params['private_key'], string);
            	};
            
            	this.encode = function (hash) {
            		const hexArr = hash.match(/.{1,2}/g);
            		var uInt8Array = new Uint8Array(hexArr.length);
            		hexArr.forEach(function (hex, idx) {
            			uInt8Array[idx] = parseInt(hex, 16);
            		});
            		return btoa(uInt8Array);
            	};
            
            	this.getDate = function () {
            		const weekdayShortList = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
            		const monthShortList = ['jan', 'feb', 'mar', 'apr', 'may', 'jun', 'jul', 'aug', 'sep', 'oct', 'nov', 'dec'];
            		const today = new Date();
            		return weekdayShortList[today.getUTCDay()] + ', ' + today.getUTCDate() + ' ' + monthShortList[today.getUTCMonth()] + ' ' + today.getUTCFullYear() + ' ' + today.getUTCHours() + ':' + today.getUTCMinutes() + ':' + today.getUTCSeconds() + ' GMT';
            	};
            
            	this.executeRequest = function (httpMethod, apiPath, apiParams, mql, namespace) {
            		var headers = '(request-target) date host';
            		const contentTypeHeader = 'content-type: application/json';
            		const dateHeader = 'date: ' + this.getDate();
            		const hostHeader = 'host: ' + params['api_host'];
            		const requestTarget = '(request-target): ' + httpMethod + ' ' + apiPath + apiParams;
            		var signingString = requestTarget + '\n' + dateHeader + '\n' + hostHeader;
            		var reqHeaders = [contentTypeHeader, dateHeader];
            
            		if (httpMethod === 'post') {
            			var body = JSON.stringify({
            				'namespace': namespace,
            				'query': mql
            			});
            			headers = headers + ' x-content-sha256 content-type content-length';
            			const bodyHeader = 'x-content-sha256: ' + this.encode(this.hash(body));
            			const bodyLengthHeader = 'content-length: ' + body.length;
            			signingString = signingString + '\n' + bodyHeader + '\n' + contentTypeHeader + '\n' + bodyLengthHeader;
            			reqHeaders.push(bodyHeader, bodyLengthHeader);
            		}
            
            		const signature = this.encode(this.sign(signingString));
            
            		reqHeaders.push('Authorization: Signature version="1",keyId="' + params['tenancy_ocid'] + '/' + params['user_ocid'] + '/' + params['fingerprint'] + '",algorithm="rsa-sha256",headers="' + headers + '",signature="' + signature + '"');
            		for (var header = 0, headerLength = reqHeaders.length; header < headerLength; header++) {
            			this.request.addHeader(reqHeaders[header]);
            		}
            
            		if (params['http_proxy']) {
            			this.request.setProxy(params['http_proxy']);
            			Zabbix.log(4, this.zabbixLogPrefix + ' Using http proxy: ' + params['http_proxy']);
            		}
            
            		if (httpMethod === 'post') {
            			var apiRateLimitExceeded = false;
            			do {
            				const response = this.request.post('https://' + params['api_host'] + apiPath + apiParams, body);
            
            				try {
            					if (JSON.parse(response)['code'] === 'TooManyRequests') {
            
            						apiRateLimitExceeded = true;
            						Zabbix.sleep(1000);
            					} else {
            						apiRateLimitExceeded = false;
            					}
            				} catch (error) {
            					Zabbix.log(3, this.zabbixLogPrefix + ' Could not parse the response: ' + JSON.stringify(response));
            					throw 'Could not parse the response. See logs for more information.';
            				}
            			} while (apiRateLimitExceeded);
            		} else {
            			const response = this.request.get('https://' + params['api_host'] + apiPath + apiParams);
            		}
            
            		this.request.clearHeader();
            
            		if (this.request.getStatus() === parseInt(params['http_status_code'])) {
            			return response;
            		} else {
            			Zabbix.log(3, this.zabbixLogPrefix + ' Unexpected HTTP response code: ' + this.request.getStatus());
            			throw 'Unexpected HTTP response code: ' + this.request.getStatus();
            		}
            	};
            
            	this.extractData = function (httpMethod, data, keys, compartment) {
            		try {
            			data = JSON.parse(data);
            		} catch (error) {
            			Zabbix.log(3, this.zabbixLogPrefix + ' Could not parse the received JSON object: ' + data);
            			throw 'Could not parse received JSON object. See logs for more information.';
            		}
            
            		if (typeof keys == 'object') {
            			var returnBuffer = [];
            			for (var dataObj = 0, dataLength = data.length; dataObj < dataLength; dataObj++) {
            
            				var objectBuffer = {};
            				for (var key = 0, keysLength = keys.length; key < keysLength; key++) {
            					if (data[dataObj][keys[key]] || data[dataObj][keys[key]] == null) {
            						objectBuffer[keys[key].match(/^[a-z]+$|[A-Z][a-z]+$/)[0].toLowerCase()] = data[dataObj][keys[key]];
            					} else {
            						Zabbix.log(3, this.zabbixLogPrefix + ' Received an unexpected JSON object. Could not get value for key "' + keys[key] + '" in JSON: ' + JSON.stringify(data[dataObj]));
            						throw 'Received an unexpected JSON object. See logs for more information.';
            					}
            				}
            				if (typeof compartment != 'undefined' && compartment != '') objectBuffer['compartment'] = compartment;
            				returnBuffer.push(objectBuffer);
            			}
            			return returnBuffer;
            		}
            
            		try {
            			if (httpMethod === 'get') {
            				return data[keys];
            			} else {
            				if (data.length === 0) {
            					return 0;
            				}
            				data = data[0][keys];
            				return data[data.length - 1]['value'];
            			}
            		} catch (error) {
            			Zabbix.log(3, this.zabbixLogPrefix + ' Could not find key "' + keys + '" in JSON: ' + JSON.stringify(data));
            			throw 'Could not find required key in JSON object. See logs for more information.';
            		}
            	};
            }
            
            
            const params = JSON.parse(value);
            validateZabbixParams(['tenancy_ocid', 'user_ocid', 'private_key', 'fingerprint', 'api_host', 'bucket_name', 'http_status_code', 'req_interval', 'compartment_id'], params);
            var oci = new OCI('Object storage', 'Get metrics ' + params['req_interval'] + 'm', params);
            const mql = 'EnabledOLM[' + params['req_interval'] + 'm]{resourceDisplayName=' + params['bucket_name'] + '}.mean()';
            
            return JSON.stringify(oci.extractData('post', oci.executeRequest('post', '/20180401/metrics/actions/summarizeMetricsData', '?compartmentId=' + encodeURIComponent(params['compartment_id']), mql, 'oci_objectstorage'), 'aggregatedDatapoints'));
          description: |
            Indicates whether a bucket has any executable Object Lifecycle Management policies configured. `EnabledOLM` emits:
            
                1 - if policies are configured
                0 - if no policies are configured
          preprocessing:
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1d
          timeout: 10s
          parameters:
            - name: api_host
              value: '{$OCI.API.TELEMETRY.HOST}'
            - name: bucket_name
              value: '{$OCI.OBJECT.STORAGE.BUCKET}'
            - name: compartment_id
              value: '{$OCI.OBJECT.STORAGE.COMPARTMENT.ID}'
            - name: fingerprint
              value: '{$OCI.API.FINGERPRINT}'
            - name: http_proxy
              value: '{$OCI.HTTP.PROXY}'
            - name: http_status_code
              value: '{$OCI.HTTP.RETURN.CODE.OK}'
            - name: private_key
              value: '{$OCI.API.PRIVATE.KEY}'
            - name: req_interval
              value: '180'
            - name: tenancy_ocid
              value: '{$OCI.API.TENANCY}'
            - name: user_ocid
              value: '{$OCI.API.USER}'
          tags:
            - tag: component
              value: storage
          triggers:
            - uuid: 5d9652a8736247c2bcac15cf02012824
              expression: 'last(/Oracle Cloud Object Storage by HTTP/oci.obj.storage.metrics.olm.get,#1)<>last(/Oracle Cloud Object Storage by HTTP/oci.obj.storage.metrics.olm.get,#2) and length(last(/Oracle Cloud Object Storage by HTTP/oci.obj.storage.metrics.olm.get))>0'
              name: 'OCI Object Storage: Object lifecycle management policy has changed'
              priority: INFO
              description: 'The object lifecycle management policy configuration has changed.'
              tags:
                - tag: scope
                  value: notice
        - uuid: 867aa1736d4c40a18a4f660023d117f4
          name: 'Number of objects'
          type: DEPENDENT
          key: oci.obj.storage.objects
          value_type: FLOAT
          description: 'The count of objects in the bucket, excluding any multipart upload parts that have not been discarded (aborted) or committed.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.ObjectCount
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 12h
          master_item:
            key: oci.obj.storage.metrics.hourly.get
          tags:
            - tag: component
              value: storage
        - uuid: a3d83de1735d4c409192d187d793f7b2
          name: 'All requests count'
          type: DEPENDENT
          key: oci.obj.storage.requests
          value_type: FLOAT
          description: 'The total number of all HTTP requests made in a bucket.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.AllRequests
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: oci.obj.storage.metrics.frequent.get
          tags:
            - tag: component
              value: storage
        - uuid: 2baef7eb0b1348499eda8fb9fd11e0c8
          name: 'Post object request count'
          type: DEPENDENT
          key: oci.obj.storage.requests.post
          value_type: FLOAT
          description: 'The total number of HTTP `POST` requests made in a bucket.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.PostRequests
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: oci.obj.storage.metrics.frequent.get
          tags:
            - tag: component
              value: storage
        - uuid: 1853b681b5e64a0f9c172e6166a430ae
          name: 'Put object request count'
          type: DEPENDENT
          key: oci.obj.storage.requests.put
          value_type: FLOAT
          description: 'The total number of `PutObject` requests made in a bucket.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.PutRequests
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: oci.obj.storage.metrics.frequent.get
          tags:
            - tag: component
              value: storage
        - uuid: 61901f89399c413186c9df957760c2d5
          name: 'Bucket size'
          type: DEPENDENT
          key: oci.obj.storage.size
          value_type: FLOAT
          units: B
          description: 'The size of the bucket, excluding any multipart upload parts that have not been discarded (aborted) or committed.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.StoredBytes
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 12h
          master_item:
            key: oci.obj.storage.metrics.hourly.get
          tags:
            - tag: component
              value: storage
        - uuid: a4dc04db6b294aef865d137e5fdd0dc2
          name: 'Incomplete multipart upload size'
          type: DEPENDENT
          key: oci.obj.storage.size.incomplete
          value_type: FLOAT
          units: B
          description: 'The size of any multipart upload parts that have not been discarded (aborted) or committed.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.UncommittedParts
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 12h
          master_item:
            key: oci.obj.storage.metrics.hourly.get
          tags:
            - tag: component
              value: storage
      tags:
        - tag: class
          value: cloud
        - tag: class
          value: database
        - tag: subclass
          value: automation
        - tag: subclass
          value: bigdata
        - tag: subclass
          value: deploy
        - tag: target
          value: oci
        - tag: target
          value: oracle-cloud-infrastructure
      macros:
        - macro: '{$OCI.HTTP.PROXY}'
          description: 'Set an HTTP proxy for OCI API requests if needed.'
        - macro: '{$OCI.HTTP.RETURN.CODE.OK}'
          value: '200'
          description: 'Set the HTTP return code that represents an OK response from the API. The default is "200",  but can vary, for example, if a proxy is used.'
      dashboards:
        - uuid: 6dd3714db62046249cf3ff50a09091e2
          name: 'OCI Object Storage: Overview'
          pages:
            - name: Overview
              display_period: '30'
              widgets:
                - type: item
                  name: 'Overall latency time'
                  width: '30'
                  height: '5'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: 6C00D9
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'Overall Latency Time'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Object Storage by HTTP'
                        key: oci.obj.storage.latency.overall
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: item
                  name: 'Bucket Size'
                  'y': '5'
                  width: '15'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: 00D936
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'Bucket Size'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Object Storage by HTTP'
                        key: oci.obj.storage.size
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: item
                  name: 'Client-side error count'
                  'y': '8'
                  width: '15'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: FF0000
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'Client-side Error Count'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Object Storage by HTTP'
                        key: oci.obj.storage.client.errors
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: item
                  name: 'Number of objects'
                  x: '15'
                  'y': '5'
                  width: '15'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: 00D936
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'Number of Objects'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Object Storage by HTTP'
                        key: oci.obj.storage.objects
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: item
                  name: 'Incomplete multipart upload size'
                  x: '15'
                  'y': '8'
                  width: '15'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: FF0000
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'Incomplete Multipart Upload Size'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Object Storage by HTTP'
                        key: oci.obj.storage.size.incomplete
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: item
                  name: 'First byte latency time'
                  x: '30'
                  width: '30'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: 6C00D9
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'First Byte Latency Time'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Object Storage by HTTP'
                        key: oci.obj.storage.latency.byte
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: item
                  name: 'All requests'
                  x: '30'
                  'y': '3'
                  width: '18'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: 2196F3
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'All Requests'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Object Storage by HTTP'
                        key: oci.obj.storage.requests
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: graph
                  name: Requests
                  x: '30'
                  'y': '6'
                  width: '42'
                  height: '5'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Oracle Cloud Object Storage by HTTP'
                        name: 'OCI Object Storage: Requests'
                    - type: STRING
                      name: reference
                      value: AAAAA
                - type: item
                  name: 'Post object requests'
                  x: '48'
                  'y': '3'
                  width: '12'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: 2196F3
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'Post Object Requests'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Object Storage by HTTP'
                        key: oci.obj.storage.requests.post
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: item
                  name: 'OLM status'
                  x: '60'
                  width: '12'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: 6C00D9
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'OLM Status'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Object Storage by HTTP'
                        key: oci.obj.storage.metrics.olm.get
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: item
                  name: 'Put object requests'
                  x: '60'
                  'y': '3'
                  width: '12'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: 2196F3
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'Post Object Requests'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Object Storage by HTTP'
                        key: oci.obj.storage.requests.post
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
            - name: Latency
              display_period: '30'
              widgets:
                - type: item
                  name: 'Overall latency time'
                  width: '36'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: 6C00D9
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'Overall Latency Time'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Object Storage by HTTP'
                        key: oci.obj.storage.latency.overall
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: graph
                  name: 'Overall latency'
                  'y': '3'
                  width: '36'
                  height: '8'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Oracle Cloud Object Storage by HTTP'
                        name: 'OCI Object Storage: Overall latency'
                    - type: STRING
                      name: reference
                      value: ABAAA
                - type: item
                  name: 'First byte latency time'
                  x: '36'
                  width: '36'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: 6C00D9
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: description
                      value: 'First Byte Latency Time'
                    - type: STRING
                      name: desc_color
                      value: FFFFFF
                    - type: INTEGER
                      name: desc_v_pos
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Oracle Cloud Object Storage by HTTP'
                        key: oci.obj.storage.latency.byte
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: STRING
                      name: units_color
                      value: FFFFFF
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: STRING
                      name: value_color
                      value: FFFFFF
                - type: graph
                  name: 'First byte latency'
                  x: '36'
                  'y': '3'
                  width: '36'
                  height: '8'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Oracle Cloud Object Storage by HTTP'
                        name: 'OCI Object Storage: First byte latency'
                    - type: STRING
                      name: reference
                      value: ABAAB
    - uuid: 650bec3f2f364a478b82317396949459
      template: 'Zabbix agent active'
      name: 'Zabbix agent active'
      description: |
        Use this template instead of 'Zabbix agent' for agents running in active mode only.
        
        Generated by official Zabbix template tool "Templator"
      wizard_ready: 'YES'
      readme: |
        ## Setup
        
        Set the timeout value after which the agent is considered unavailable and threshold value of time since the last data was received from the agent.
      vendor:
        name: Zabbix
        version: 8.0-1
      groups:
        - name: Templates/Applications
      items:
        - uuid: ca27c17d8ca34643a7db8b99d2cc3025
          name: 'Host name of Zabbix agent running'
          type: ZABBIX_ACTIVE
          key: agent.hostname
          delay: 1h
          value_type: CHAR
          preprocessing:
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1d
          tags:
            - tag: component
              value: system
        - uuid: 0f86ec6cde2249f7946c678f9fd2665a
          name: 'Zabbix agent ping'
          type: ZABBIX_ACTIVE
          key: agent.ping
          description: 'The agent always returns "1" for this item. May be used in combination with `nodata()` for the availability check.'
          valuemap:
            name: 'Zabbix agent ping status'
          tags:
            - tag: component
              value: system
          triggers:
            - uuid: 6bbb74c522d44baea8c6ceb666423da2
              expression: 'nodata(/Zabbix agent active/agent.ping,{$AGENT.NODATA_TIMEOUT})=1'
              name: 'Zabbix agent is not available'
              event_name: 'Zabbix agent is not available (or nodata for {$AGENT.NODATA_TIMEOUT})'
              priority: AVERAGE
              description: 'For active agents, `nodata()` with `agent.ping` is used with `{$AGENT.NODATA_TIMEOUT}` as a time threshold.'
              manual_close: 'YES'
              tags:
                - tag: scope
                  value: availability
        - uuid: 41fb0f76fa1d464f8ab67f744fc29e8b
          name: 'Version of Zabbix agent running'
          type: ZABBIX_ACTIVE
          key: agent.version
          delay: 1h
          value_type: CHAR
          preprocessing:
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1d
          tags:
            - tag: component
              value: application
        - uuid: 0fd83c56dce244738607cd6585a6acb3
          name: 'Active agent availability'
          type: INTERNAL
          key: 'zabbix[host,active_agent,available]'
          description: |
            Availability of active checks on the host. The value of this item corresponds to availability icons in the host list.
            Possible values:
            0 - unknown
            1 - available
            2 - not available
          valuemap:
            name: zabbix.host.active_agent.available
          tags:
            - tag: component
              value: health
            - tag: component
              value: network
          triggers:
            - uuid: e91c556b0ff64292b9b9b5709a5d74b3
              expression: 'min(/Zabbix agent active/zabbix[host,active_agent,available],{$AGENT.TIMEOUT})=2'
              name: 'Active checks are not available'
              opdata: 'Current state: {ITEM.LASTVALUE1}'
              priority: HIGH
              description: 'Active checks are considered unavailable. Agent has not sent a heartbeat for a prolonged time.'
              tags:
                - tag: scope
                  value: availability
      tags:
        - tag: class
          value: software
        - tag: subclass
          value: logging
        - tag: subclass
          value: monitoring
        - tag: target
          value: zabbix-agent
      macros:
        - macro: '{$AGENT.NODATA_TIMEOUT}'
          value: 30m
          description: 'No data timeout for active agents. Consider to keep it relatively high.'
          config:
            type: TEXT
            priority: '1'
            section_name: Thresholds
            label: 'Time since the last agent data was received'
            description: 'Threshold value of time since the last data was received from the agent.'
        - macro: '{$AGENT.TIMEOUT}'
          value: 5m
          description: 'Timeout after which agent is considered unavailable.'
          config:
            type: TEXT
            priority: '2'
            label: 'Seconds since the last Zabbix agent seen'
            description: 'Timeout after which agent is considered unavailable.'
      dashboards:
        - uuid: 27dea14380314e67906525ad3d2a995a
          name: 'Zabbix agent active: Overview'
          pages:
            - name: Main
              widgets:
                - type: item
                  name: 'Agent availability'
                  width: '18'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Zabbix agent active'
                        key: agent.ping
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: Version
                  x: '18'
                  width: '18'
                  height: '3'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Zabbix agent active'
                        key: agent.version
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: graph
                  x: '36'
                  width: '36'
                  height: '5'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Zabbix agent active'
                        key: agent.ping
                    - type: STRING
                      name: reference
                      value: AAAAA
                    - type: INTEGER
                      name: source_type
                      value: '1'
      valuemaps:
        - uuid: 9f93aabb08794395b1c62cf784fc58c3
          name: zabbix.host.active_agent.available
          mappings:
            - value: '0'
              newvalue: unknown
            - value: '1'
              newvalue: available
            - value: '2'
              newvalue: 'not available'
        - uuid: 9bf3eef7e8d8402ca6f826b377ea2db6
          name: 'Zabbix agent ping status'
          mappings:
            - value: '1'
              newvalue: Up
  triggers:
    - uuid: 95d69032f7d7426d8073524ecd72fcd4
      expression: 'last(/Nutanix Cluster Prism Element by HTTP/nutanix.cluster.redundancy.factor.current)<>last(/Nutanix Cluster Prism Element by HTTP/nutanix.cluster.redundancy.factor.desired)'
      name: 'Nutanix: Redundancy factor mismatched'
      priority: HIGH
      description: 'Current redundancy factor does not match the desired redundancy factor.'
      tags:
        - tag: scope
          value: availability
  graphs:
    - uuid: 65515b97fe634d65a85a1d364887c67b
      name: 'Content Cache: Hit rate, %'
      ymin_type_1: FIXED
      ymax_type_1: FIXED
      graph_items:
        - drawtype: GRADIENT_LINE
          color: 0040FF
          item:
            host: 'Nutanix Cluster Prism Element by HTTP'
            key: nutanix.cluster.content.cache.hit.percent
    - uuid: 10cc868569aa457194f23f000d76c42c
      name: 'Content Cache: Hit rate, %'
      ymin_type_1: FIXED
      ymax_type_1: FIXED
      graph_items:
        - drawtype: GRADIENT_LINE
          color: 0040FF
          item:
            host: 'Nutanix Host Prism Element by HTTP'
            key: nutanix.host.content.cache.hit.percent
    - uuid: 47934bfa13084fa4a3986796298e0b47
      name: 'Content Cache: Memory, bytes'
      graph_items:
        - drawtype: GRADIENT_LINE
          color: 00BFFF
          item:
            host: 'Nutanix Cluster Prism Element by HTTP'
            key: nutanix.cluster.content.cache.logical.memory.usage.bytes
        - sortorder: '1'
          drawtype: GRADIENT_LINE
          color: FF0080
          item:
            host: 'Nutanix Cluster Prism Element by HTTP'
            key: nutanix.cluster.content.cache.saved.memory.usage.bytes
        - sortorder: '2'
          drawtype: GRADIENT_LINE
          color: 0040FF
          item:
            host: 'Nutanix Cluster Prism Element by HTTP'
            key: nutanix.cluster.content.cache.physical.memory.usage.bytes
    - uuid: 7573a56ef8c147b7af2a3d6208af7169
      name: 'Content Cache: Memory, bytes'
      graph_items:
        - drawtype: GRADIENT_LINE
          color: 00BFFF
          item:
            host: 'Nutanix Host Prism Element by HTTP'
            key: nutanix.host.content.cache.logical.memory.usage.bytes
        - sortorder: '1'
          drawtype: GRADIENT_LINE
          color: FF0080
          item:
            host: 'Nutanix Host Prism Element by HTTP'
            key: nutanix.host.content.cache.saved.memory.usage.bytes
        - sortorder: '2'
          drawtype: GRADIENT_LINE
          color: 0040FF
          item:
            host: 'Nutanix Host Prism Element by HTTP'
            key: nutanix.host.content.cache.physical.memory.usage.bytes
    - uuid: d044e823d54444c4985f653685b9b438
      name: 'Content Cache: SSD usage, bytes'
      graph_items:
        - drawtype: GRADIENT_LINE
          color: 00BFFF
          item:
            host: 'Nutanix Cluster Prism Element by HTTP'
            key: nutanix.cluster.content.cache.logical.ssd.usage.bytes
        - sortorder: '1'
          drawtype: GRADIENT_LINE
          color: FF0080
          item:
            host: 'Nutanix Cluster Prism Element by HTTP'
            key: nutanix.cluster.content.cache.physical.ssd.usage.bytes
        - sortorder: '2'
          drawtype: GRADIENT_LINE
          color: 0040FF
          item:
            host: 'Nutanix Cluster Prism Element by HTTP'
            key: nutanix.cluster.content.cache.saved.ssd.usage.bytes
    - uuid: 6ec9ec1bcf17441fbe2fa2130a154f4e
      name: 'Content Cache: SSD usage, bytes'
      graph_items:
        - drawtype: GRADIENT_LINE
          color: 00BFFF
          item:
            host: 'Nutanix Host Prism Element by HTTP'
            key: nutanix.host.content.cache.logical.ssd.usage.bytes
        - sortorder: '1'
          drawtype: GRADIENT_LINE
          color: FF0080
          item:
            host: 'Nutanix Host Prism Element by HTTP'
            key: nutanix.host.content.cache.physical.ssd.usage.bytes
        - sortorder: '2'
          drawtype: GRADIENT_LINE
          color: 0040FF
          item:
            host: 'Nutanix Host Prism Element by HTTP'
            key: nutanix.host.content.cache.saved.ssd.usage.bytes
    - uuid: 3ef6efe82e004c9bb274e8f653a1ae9e
      name: 'General: IO, bandwidth'
      graph_items:
        - drawtype: GRADIENT_LINE
          color: 00BFFF
          item:
            host: 'Nutanix Cluster Prism Element by HTTP'
            key: nutanix.cluster.general.io.bandwidth
        - sortorder: '1'
          drawtype: GRADIENT_LINE
          color: FF0080
          item:
            host: 'Nutanix Cluster Prism Element by HTTP'
            key: nutanix.cluster.general.io.read.bandwidth
        - sortorder: '2'
          drawtype: GRADIENT_LINE
          color: 0040FF
          item:
            host: 'Nutanix Cluster Prism Element by HTTP'
            key: nutanix.cluster.general.io.write.bandwidth
    - uuid: 75c38f9f8c1c4760bff3f73f97de2f81
      name: 'General: IO, bandwidth'
      graph_items:
        - drawtype: GRADIENT_LINE
          color: 00BFFF
          item:
            host: 'Nutanix Host Prism Element by HTTP'
            key: nutanix.host.general.io.bandwidth
        - sortorder: '1'
          drawtype: GRADIENT_LINE
          color: FF0080
          item:
            host: 'Nutanix Host Prism Element by HTTP'
            key: nutanix.host.general.io.read.bandwidth
        - sortorder: '2'
          drawtype: GRADIENT_LINE
          color: 0040FF
          item:
            host: 'Nutanix Host Prism Element by HTTP'
            key: nutanix.host.general.io.write.bandwidth
    - uuid: 9630f812813549d8909ee46d06b38a7b
      name: 'General: IO, latency'
      graph_items:
        - drawtype: GRADIENT_LINE
          color: 00BFFF
          item:
            host: 'Nutanix Cluster Prism Element by HTTP'
            key: nutanix.cluster.general.io.latency
        - sortorder: '1'
          drawtype: GRADIENT_LINE
          color: FF0080
          item:
            host: 'Nutanix Cluster Prism Element by HTTP'
            key: nutanix.cluster.general.io.read.latency
        - sortorder: '2'
          drawtype: GRADIENT_LINE
          color: 0040FF
          item:
            host: 'Nutanix Cluster Prism Element by HTTP'
            key: nutanix.cluster.general.io.write.latency
    - uuid: c987de890149423184078af71fa4929e
      name: 'General: IO, latency'
      graph_items:
        - drawtype: GRADIENT_LINE
          color: 00BFFF
          item:
            host: 'Nutanix Host Prism Element by HTTP'
            key: nutanix.host.general.io.latency
        - sortorder: '1'
          drawtype: GRADIENT_LINE
          color: FF0080
          item:
            host: 'Nutanix Host Prism Element by HTTP'
            key: nutanix.host.general.io.read.latency
        - sortorder: '2'
          drawtype: GRADIENT_LINE
          color: 0040FF
          item:
            host: 'Nutanix Host Prism Element by HTTP'
            key: nutanix.host.general.io.write.latency
    - uuid: 03b6d22744a5461f937f481cf1ca0854
      name: 'General: IOPS'
      graph_items:
        - drawtype: GRADIENT_LINE
          color: 00BFFF
          item:
            host: 'Nutanix Cluster Prism Element by HTTP'
            key: nutanix.cluster.general.iops
        - sortorder: '1'
          drawtype: GRADIENT_LINE
          color: FF0080
          item:
            host: 'Nutanix Cluster Prism Element by HTTP'
            key: nutanix.cluster.general.iops.read
        - sortorder: '2'
          drawtype: GRADIENT_LINE
          color: 0040FF
          item:
            host: 'Nutanix Cluster Prism Element by HTTP'
            key: nutanix.cluster.general.iops.write
    - uuid: 6ba2e066462543b1a5c732d4fe692f94
      name: 'General: IOPS'
      graph_items:
        - drawtype: GRADIENT_LINE
          color: 00BFFF
          item:
            host: 'Nutanix Host Prism Element by HTTP'
            key: nutanix.host.general.iops
        - sortorder: '1'
          drawtype: GRADIENT_LINE
          color: FF0080
          item:
            host: 'Nutanix Host Prism Element by HTTP'
            key: nutanix.host.general.iops.read
        - sortorder: '2'
          drawtype: GRADIENT_LINE
          color: 0040FF
          item:
            host: 'Nutanix Host Prism Element by HTTP'
            key: nutanix.host.general.iops.write
    - uuid: b0881e58124f4e3c8967177a18293b01
      name: 'General: Read IO / Write IO'
      type: STACKED
      graph_items:
        - color: 0040FF
          item:
            host: 'Nutanix Cluster Prism Element by HTTP'
            key: nutanix.cluster.general.io.write.percent
        - sortorder: '1'
          color: 00BFFF
          item:
            host: 'Nutanix Cluster Prism Element by HTTP'
            key: nutanix.cluster.general.io.read.percent
    - uuid: ef5cc6450ff849d6bb17bca58f1ded6e
      name: 'General: Read IO / Write IO'
      type: STACKED
      graph_items:
        - color: 0040FF
          item:
            host: 'Nutanix Host Prism Element by HTTP'
            key: nutanix.host.general.io.write.percent
        - sortorder: '1'
          color: 00BFFF
          item:
            host: 'Nutanix Host Prism Element by HTTP'
            key: nutanix.host.general.io.read.percent
    - uuid: 2eb73e5623dc444d9296efb721b44534
      name: 'Hypervisor: CPU usage, %'
      ymin_type_1: FIXED
      ymax_type_1: FIXED
      graph_items:
        - drawtype: GRADIENT_LINE
          color: 0040FF
          item:
            host: 'Nutanix Cluster Prism Element by HTTP'
            key: nutanix.cluster.hypervisor.cpu.usage.percent
    - uuid: d81d699dcc8f40928fc200919a6d18ca
      name: 'Hypervisor: CPU usage, %'
      ymin_type_1: FIXED
      ymax_type_1: FIXED
      graph_items:
        - drawtype: GRADIENT_LINE
          color: 0040FF
          item:
            host: 'Nutanix Host Prism Element by HTTP'
            key: nutanix.host.hypervisor.cpu.usage.percent
    - uuid: 80d34c61ea8b436caf6d295b2330c4fd
      name: 'Hypervisor: IO, bandwidth'
      graph_items:
        - drawtype: GRADIENT_LINE
          color: 00BFFF
          item:
            host: 'Nutanix Cluster Prism Element by HTTP'
            key: nutanix.cluster.hypervisor.io.bandwidth
        - sortorder: '1'
          drawtype: GRADIENT_LINE
          color: FF0080
          item:
            host: 'Nutanix Cluster Prism Element by HTTP'
            key: nutanix.cluster.hypervisor.io.read.bandwidth
        - sortorder: '2'
          drawtype: GRADIENT_LINE
          color: 0040FF
          item:
            host: 'Nutanix Cluster Prism Element by HTTP'
            key: nutanix.cluster.hypervisor.io.write.bandwidth
    - uuid: d0053e62420149cdaea9ea121d35b12f
      name: 'Hypervisor: IO, bandwidth'
      graph_items:
        - drawtype: GRADIENT_LINE
          color: 00BFFF
          item:
            host: 'Nutanix Host Prism Element by HTTP'
            key: nutanix.host.hypervisor.io.bandwidth
        - sortorder: '1'
          drawtype: GRADIENT_LINE
          color: FF0080
          item:
            host: 'Nutanix Host Prism Element by HTTP'
            key: nutanix.host.hypervisor.io.read.bandwidth
        - sortorder: '2'
          drawtype: GRADIENT_LINE
          color: 0040FF
          item:
            host: 'Nutanix Host Prism Element by HTTP'
            key: nutanix.host.hypervisor.io.write.bandwidth
    - uuid: 167229af868b49b5a0c66eaa3c6fad93
      name: 'Hypervisor: IO, latency'
      graph_items:
        - drawtype: GRADIENT_LINE
          color: 00BFFF
          item:
            host: 'Nutanix Cluster Prism Element by HTTP'
            key: nutanix.cluster.hypervisor.io.latency
        - sortorder: '1'
          drawtype: GRADIENT_LINE
          color: FF0080
          item:
            host: 'Nutanix Cluster Prism Element by HTTP'
            key: nutanix.cluster.hypervisor.io.read.latency
        - sortorder: '2'
          drawtype: GRADIENT_LINE
          color: 0040FF
          item:
            host: 'Nutanix Cluster Prism Element by HTTP'
            key: nutanix.cluster.hypervisor.io.write.latency
    - uuid: 4856dc8a3c1c4932bbcf6a2c2a98a33e
      name: 'Hypervisor: IO, latency'
      graph_items:
        - drawtype: GRADIENT_LINE
          color: 00BFFF
          item:
            host: 'Nutanix Host Prism Element by HTTP'
            key: nutanix.host.hypervisor.io.latency
        - sortorder: '1'
          drawtype: GRADIENT_LINE
          color: FF0080
          item:
            host: 'Nutanix Host Prism Element by HTTP'
            key: nutanix.host.hypervisor.io.read.latency
        - sortorder: '2'
          drawtype: GRADIENT_LINE
          color: 0040FF
          item:
            host: 'Nutanix Host Prism Element by HTTP'
            key: nutanix.host.hypervisor.io.write.latency
    - uuid: f8a6865e91c44452bcfd26fdaefa42ba
      name: 'Hypervisor: IOPS'
      graph_items:
        - drawtype: GRADIENT_LINE
          color: 00BFFF
          item:
            host: 'Nutanix Cluster Prism Element by HTTP'
            key: nutanix.cluster.hypervisor.iops
        - sortorder: '1'
          drawtype: GRADIENT_LINE
          color: FF0080
          item:
            host: 'Nutanix Cluster Prism Element by HTTP'
            key: nutanix.cluster.hypervisor.iops.read
        - sortorder: '2'
          drawtype: GRADIENT_LINE
          color: 0040FF
          item:
            host: 'Nutanix Cluster Prism Element by HTTP'
            key: nutanix.cluster.hypervisor.iops.write
    - uuid: 1829358efd7445bbbf3d05233eb6d45d
      name: 'Hypervisor: IOPS'
      graph_items:
        - drawtype: GRADIENT_LINE
          color: 00BFFF
          item:
            host: 'Nutanix Host Prism Element by HTTP'
            key: nutanix.host.hypervisor.iops
        - sortorder: '1'
          drawtype: GRADIENT_LINE
          color: FF0080
          item:
            host: 'Nutanix Host Prism Element by HTTP'
            key: nutanix.host.hypervisor.iops.read
        - sortorder: '2'
          drawtype: GRADIENT_LINE
          color: 0040FF
          item:
            host: 'Nutanix Host Prism Element by HTTP'
            key: nutanix.host.hypervisor.iops.write
    - uuid: 9da8e4c6642d4150ac5d45f1cb817253
      name: 'Hypervisor: Memory usage, %'
      ymin_type_1: FIXED
      ymax_type_1: FIXED
      graph_items:
        - drawtype: GRADIENT_LINE
          color: FF465C
          item:
            host: 'Nutanix Cluster Prism Element by HTTP'
            key: nutanix.cluster.hypervisor.memory.usage.percent
    - uuid: d95d9844425b4db5af1346aeac315021
      name: 'Hypervisor: Memory usage, %'
      ymin_type_1: FIXED
      ymax_type_1: FIXED
      graph_items:
        - drawtype: GRADIENT_LINE
          color: FF465C
          item:
            host: 'Nutanix Host Prism Element by HTTP'
            key: nutanix.host.hypervisor.memory.usage.percent
    - uuid: 943cbd42a13147bdb76a5a171351b5c0
      name: 'Hypervisor: Received, bytes'
      graph_items:
        - drawtype: GRADIENT_LINE
          color: 0040FF
          item:
            host: 'Nutanix Host Prism Element by HTTP'
            key: nutanix.host.hypervisor.received.bytes
    - uuid: e60a52fb92a043258b962457ea0cd616
      name: 'Hypervisor: Transmitted, bytes'
      graph_items:
        - drawtype: GRADIENT_LINE
          color: FF465C
          item:
            host: 'Nutanix Host Prism Element by HTTP'
            key: nutanix.host.hypervisor.transmitted.bytes
    - uuid: ad7e987b56954a51b898f9aa09b2ef89
      name: 'IO overview'
      graph_items:
        - drawtype: GRADIENT_LINE
          color: 00BFFF
          item:
            host: 'Nutanix Cluster Prism Element by HTTP'
            key: nutanix.cluster.general.io
        - sortorder: '1'
          drawtype: GRADIENT_LINE
          color: FF0080
          item:
            host: 'Nutanix Cluster Prism Element by HTTP'
            key: nutanix.cluster.hypervisor.io
        - sortorder: '2'
          drawtype: GRADIENT_LINE
          color: 0040FF
          item:
            host: 'Nutanix Cluster Prism Element by HTTP'
            key: nutanix.cluster.storage.controller.io
    - uuid: c1ea65971d3d4816a68c9cf608939e0f
      name: 'IOPS overview'
      graph_items:
        - drawtype: GRADIENT_LINE
          color: 00BFFF
          item:
            host: 'Nutanix Cluster Prism Element by HTTP'
            key: nutanix.cluster.general.iops
        - sortorder: '1'
          drawtype: GRADIENT_LINE
          color: FF0080
          item:
            host: 'Nutanix Cluster Prism Element by HTTP'
            key: nutanix.cluster.hypervisor.iops
        - sortorder: '2'
          drawtype: GRADIENT_LINE
          color: 0040FF
          item:
            host: 'Nutanix Cluster Prism Element by HTTP'
            key: nutanix.cluster.storage.controller.iops
    - uuid: 0dc058779ebb484e85cc886ea431f669
      name: 'IOPS overview'
      graph_items:
        - drawtype: GRADIENT_LINE
          color: 00BFFF
          item:
            host: 'Nutanix Host Prism Element by HTTP'
            key: nutanix.host.general.iops
        - sortorder: '1'
          drawtype: GRADIENT_LINE
          color: FF0080
          item:
            host: 'Nutanix Host Prism Element by HTTP'
            key: nutanix.host.hypervisor.iops
        - sortorder: '2'
          drawtype: GRADIENT_LINE
          color: 0040FF
          item:
            host: 'Nutanix Host Prism Element by HTTP'
            key: nutanix.host.storage.controller.iops
    - uuid: 97956d8f4b084cf38c8e46c842e806f5
      name: 'OCI Autonomous DB: Connection latency'
      graph_items:
        - color: 199C0D
          item:
            host: 'Oracle Cloud Autonomous Database by HTTP'
            key: oci.aut.db.latency.conn
    - uuid: adcd338dbf2746c980929932575ed953
      name: 'OCI Autonomous DB: CPU time'
      graph_items:
        - color: 199C0D
          item:
            host: 'Oracle Cloud Autonomous Database by HTTP'
            key: oci.aut.db.cpu.time
    - uuid: 1324dac0566447fa9ae3808fb79a65e1
      name: 'OCI Autonomous DB: CPU utilization'
      graph_items:
        - color: 199C0D
          item:
            host: 'Oracle Cloud Autonomous Database by HTTP'
            key: oci.aut.db.cpu.util
    - uuid: 14ffe3b6eb084fdeac6cbdefdb356a3b
      name: 'OCI Autonomous DB: DB time'
      graph_items:
        - color: 199C0D
          item:
            host: 'Oracle Cloud Autonomous Database by HTTP'
            key: oci.aut.db.time
    - uuid: 464902ef122a438bba519071f29df0c8
      name: 'OCI Autonomous DB: Execute count'
      graph_items:
        - color: 199C0D
          item:
            host: 'Oracle Cloud Autonomous Database by HTTP'
            key: oci.aut.db.exec.count
    - uuid: a23cf1625b5d4f6c848a6f7236dbeb6b
      name: 'OCI Autonomous DB: Parse count failures'
      graph_items:
        - color: 199C0D
          item:
            host: 'Oracle Cloud Autonomous Database by HTTP'
            key: oci.aut.db.parse.count.failed
    - uuid: e13b6b26310d4954a2df15244a7b2de9
      name: 'OCI Autonomous DB: Parse count hard'
      graph_items:
        - color: 199C0D
          item:
            host: 'Oracle Cloud Autonomous Database by HTTP'
            key: oci.aut.db.parse.count.hard
    - uuid: 75997227333c46de87199c0247d5bdb5
      name: 'OCI Autonomous DB: Parse count total'
      graph_items:
        - color: 199C0D
          item:
            host: 'Oracle Cloud Autonomous Database by HTTP'
            key: oci.aut.db.parse.count.total
    - uuid: e160cc5a9e22404a91e2bdcc33e22108
      name: 'OCI Autonomous DB: Physical read/write total bytes'
      graph_items:
        - color: 199C0D
          item:
            host: 'Oracle Cloud Autonomous Database by HTTP'
            key: oci.aut.db.physical.read.bytes
        - sortorder: '1'
          color: F63100
          item:
            host: 'Oracle Cloud Autonomous Database by HTTP'
            key: oci.aut.db.physical.write.bytes
    - uuid: 2def3ab2a81a4b6abfb2b209f134c1af
      name: 'OCI Autonomous DB: Physical reads/writes'
      graph_items:
        - color: 199C0D
          item:
            host: 'Oracle Cloud Autonomous Database by HTTP'
            key: oci.aut.db.physical.reads
        - sortorder: '1'
          color: F63100
          item:
            host: 'Oracle Cloud Autonomous Database by HTTP'
            key: oci.aut.db.physical.writes
    - uuid: fd5d001fb93a409db9ebfdc66d0a8861
      name: 'OCI Autonomous DB: Query latency'
      graph_items:
        - color: 199C0D
          item:
            host: 'Oracle Cloud Autonomous Database by HTTP'
            key: oci.aut.db.latency.query
    - uuid: 71a7e76a9bc34cc58abd77ef76d9ed4a
      name: 'OCI Autonomous DB: Session logical reads'
      graph_items:
        - color: 199C0D
          item:
            host: 'Oracle Cloud Autonomous Database by HTTP'
            key: oci.aut.db.logical.reads.session
    - uuid: c03100979bbf485dbd5c36900ec73469
      name: 'OCI Autonomous DB: Session stats'
      graph_items:
        - color: 199C0D
          item:
            host: 'Oracle Cloud Autonomous Database by HTTP'
            key: oci.aut.db.sessions
        - sortorder: '1'
          color: F63100
          item:
            host: 'Oracle Cloud Autonomous Database by HTTP'
            key: oci.aut.db.conn.failed
        - sortorder: '2'
          color: 00611C
          item:
            host: 'Oracle Cloud Autonomous Database by HTTP'
            key: oci.aut.db.logons
        - sortorder: '3'
          color: F7941D
          item:
            host: 'Oracle Cloud Autonomous Database by HTTP'
            key: oci.aut.db.logons.failed
    - uuid: e8f1cdda63e44ca9a5b73bbd8c55ffa0
      name: 'OCI Autonomous DB: SQL*Net client bytes'
      graph_items:
        - color: 199C0D
          item:
            host: 'Oracle Cloud Autonomous Database by HTTP'
            key: oci.aut.db.sqlnet.bytes.recv.client
        - sortorder: '1'
          color: F63100
          item:
            host: 'Oracle Cloud Autonomous Database by HTTP'
            key: oci.aut.db.sqlnet.bytes.sent.client
    - uuid: c485b41073d341a98e5aa239fc7afd21
      name: 'OCI Autonomous DB: SQL*Net DBLink bytes'
      graph_items:
        - color: 199C0D
          item:
            host: 'Oracle Cloud Autonomous Database by HTTP'
            key: oci.aut.db.sqlnet.bytes.recv.dblink
        - sortorder: '1'
          color: F63100
          item:
            host: 'Oracle Cloud Autonomous Database by HTTP'
            key: oci.aut.db.sqlnet.bytes.sent.dblink
    - uuid: 8adb6f1a0b3242be8142fc62370db900
      name: 'OCI Autonomous DB: Statements'
      graph_items:
        - color: 199C0D
          item:
            host: 'Oracle Cloud Autonomous Database by HTTP'
            key: oci.aut.db.statements.running
        - sortorder: '1'
          color: F63100
          item:
            host: 'Oracle Cloud Autonomous Database by HTTP'
            key: oci.aut.db.queued.statements
        - sortorder: '2'
          color: 00611C
          item:
            host: 'Oracle Cloud Autonomous Database by HTTP'
            key: oci.aut.db.transaction.count
    - uuid: 2579982f4501490283fe2cbcf90330f0
      name: 'OCI Autonomous DB: Storage stats'
      graph_items:
        - color: 199C0D
          item:
            host: 'Oracle Cloud Autonomous Database by HTTP'
            key: oci.aut.db.storage.space.max
        - sortorder: '1'
          color: F63100
          item:
            host: 'Oracle Cloud Autonomous Database by HTTP'
            key: oci.aut.db.storage.space.alloc
        - sortorder: '2'
          color: 00611C
          item:
            host: 'Oracle Cloud Autonomous Database by HTTP'
            key: oci.aut.db.storage.space.used
    - uuid: d96a821b6e6e4557a40e87246d2ffdfe
      name: 'OCI Autonomous DB: Storage utilization'
      graph_items:
        - color: 199C0D
          item:
            host: 'Oracle Cloud Autonomous Database by HTTP'
            key: oci.aut.db.storage.space.util
    - uuid: 3040bdaf0f8c49a68b80dbe60f8f9c9a
      name: 'OCI Autonomous DB: User calls'
      graph_items:
        - color: 199C0D
          item:
            host: 'Oracle Cloud Autonomous Database by HTTP'
            key: oci.aut.db.user.calls
    - uuid: 2620ae19fd7243d2ac37daabf9dbce46
      name: 'OCI Autonomous DB: User commits'
      graph_items:
        - color: 199C0D
          item:
            host: 'Oracle Cloud Autonomous Database by HTTP'
            key: oci.aut.db.user.commits
    - uuid: 1e5d6a326c7e45cb83f7689c9a4bfce1
      name: 'OCI Autonomous DB: User rollbacks'
      graph_items:
        - color: 199C0D
          item:
            host: 'Oracle Cloud Autonomous Database by HTTP'
            key: oci.aut.db.user.rollbacks
    - uuid: 3d55d19a57b34764a5f5cdc364204849
      name: 'OCI Autonomous DB: Wait time'
      graph_items:
        - color: 199C0D
          item:
            host: 'Oracle Cloud Autonomous Database by HTTP'
            key: oci.aut.db.wait.time
    - uuid: 68f6c72e67f947b29f879b89a205d59c
      name: 'OCI Block Volume: Operations'
      graph_items:
        - color: 199C0D
          item:
            host: 'Oracle Cloud Block Volume by HTTP'
            key: oci.block.volume.read.ops
        - sortorder: '1'
          color: F63100
          item:
            host: 'Oracle Cloud Block Volume by HTTP'
            key: oci.block.volume.write.ops
        - sortorder: '2'
          color: 00611C
          item:
            host: 'Oracle Cloud Block Volume by HTTP'
            key: oci.block.volume.throttled.ops
        - sortorder: '3'
          color: F7941D
          yaxisside: RIGHT
          item:
            host: 'Oracle Cloud Block Volume by HTTP'
            key: oci.block.volume.iops
    - uuid: 16076dfa25244b5093e8985ca2e3f18c
      name: 'OCI Block Volume: Throughput'
      graph_items:
        - color: 199C0D
          item:
            host: 'Oracle Cloud Block Volume by HTTP'
            key: oci.block.volume.read
        - sortorder: '1'
          color: F63100
          item:
            host: 'Oracle Cloud Block Volume by HTTP'
            key: oci.block.volume.write
        - sortorder: '2'
          color: 00611C
          yaxisside: RIGHT
          item:
            host: 'Oracle Cloud Block Volume by HTTP'
            key: oci.block.volume.throughput
    - uuid: 6078da9c1eb249548536663e57e7743c
      name: 'OCI Block Volume: VPUs/GB'
      graph_items:
        - color: 199C0D
          item:
            host: 'Oracle Cloud Block Volume by HTTP'
            key: oci.block.volume.vpu
    - uuid: 265e1b5e20084bfb9ab272996915b45d
      name: 'OCI Boot Volume: Operations'
      graph_items:
        - color: 199C0D
          item:
            host: 'Oracle Cloud Boot Volume by HTTP'
            key: oci.boot.volume.read.ops
        - sortorder: '1'
          color: F63100
          item:
            host: 'Oracle Cloud Boot Volume by HTTP'
            key: oci.boot.volume.write.ops
        - sortorder: '2'
          color: 00611C
          item:
            host: 'Oracle Cloud Boot Volume by HTTP'
            key: oci.boot.volume.throttled.ops
        - sortorder: '3'
          color: F7941D
          yaxisside: RIGHT
          item:
            host: 'Oracle Cloud Boot Volume by HTTP'
            key: oci.boot.volume.iops
    - uuid: 7e8aa92414d5431f80fdb1d1981d25f9
      name: 'OCI Boot Volume: Throughput'
      graph_items:
        - color: 199C0D
          item:
            host: 'Oracle Cloud Boot Volume by HTTP'
            key: oci.boot.volume.read
        - sortorder: '1'
          color: F63100
          item:
            host: 'Oracle Cloud Boot Volume by HTTP'
            key: oci.boot.volume.write
        - sortorder: '2'
          color: 00611C
          yaxisside: RIGHT
          item:
            host: 'Oracle Cloud Boot Volume by HTTP'
            key: oci.boot.volume.throughput
    - uuid: fdfb060d0823480abe77581503f82a96
      name: 'OCI Boot Volume: VPUs/GB'
      graph_items:
        - color: 199C0D
          item:
            host: 'Oracle Cloud Boot Volume by HTTP'
            key: oci.boot.volume.vpu
    - uuid: 70f0b43207cd4e28bf93e0b41ad45a10
      name: 'OCI Compute: Cpu utilization'
      graph_items:
        - color: 199C0D
          item:
            host: 'Oracle Cloud Compute by HTTP'
            key: oci.compute.cpu.util
    - uuid: 944bf71570b549ce8682d3f1beea5c57
      name: 'OCI Compute: Disk bytes read'
      graph_items:
        - color: 199C0D
          item:
            host: 'Oracle Cloud Compute by HTTP'
            key: oci.compute.disk.read
    - uuid: 39ece65d2b2b402abee59432cc3a3cea
      name: 'OCI Compute: Disk bytes read I/O'
      graph_items:
        - color: 199C0D
          item:
            host: 'Oracle Cloud Compute by HTTP'
            key: oci.compute.disk.io.read
    - uuid: f073ce71549946509fe9f021b3c2d2e9
      name: 'OCI Compute: Disk bytes write I/O'
      graph_items:
        - color: 199C0D
          item:
            host: 'Oracle Cloud Compute by HTTP'
            key: oci.compute.disk.io.write
    - uuid: 784735022c1e40fc9cf7d065e95124f3
      name: 'OCI Compute: Disk bytes written'
      graph_items:
        - color: 199C0D
          item:
            host: 'Oracle Cloud Compute by HTTP'
            key: oci.compute.disk.written
    - uuid: 9f4a1426c49f47bfade03875a6af0a60
      name: 'OCI Compute: Memory allocation stalls'
      graph_items:
        - color: 199C0D
          item:
            host: 'Oracle Cloud Compute by HTTP'
            key: oci.compute.mem.stalls
    - uuid: db9ad56d9e334de0a3ba7f6c3862fb76
      name: 'OCI Compute: Memory utilization'
      graph_items:
        - color: 199C0D
          item:
            host: 'Oracle Cloud Compute by HTTP'
            key: oci.compute.mem.util
    - uuid: 609ba54782934bb8b60696588bf57038
      name: 'OCI Compute: Network bytes in'
      graph_items:
        - color: 00D936
          item:
            host: 'Oracle Cloud Compute by HTTP'
            key: oci.compute.network.in
    - uuid: 807729ba0afb4710a33307286d5c027a
      name: 'OCI Compute: Network bytes out'
      graph_items:
        - color: 2196F3
          item:
            host: 'Oracle Cloud Compute by HTTP'
            key: oci.compute.network.out
    - uuid: fa3fab6874614a3cbea45dee87660253
      name: 'OCI Object Storage: Bucket size'
      graph_items:
        - color: 199C0D
          item:
            host: 'Oracle Cloud Object Storage by HTTP'
            key: oci.obj.storage.size
        - sortorder: '1'
          color: F63100
          yaxisside: RIGHT
          item:
            host: 'Oracle Cloud Object Storage by HTTP'
            key: oci.obj.storage.objects
    - uuid: 2c32d269e0274b26a40b0b5069abda7c
      name: 'OCI Object Storage: Client-side error count'
      graph_items:
        - color: 199C0D
          item:
            host: 'Oracle Cloud Object Storage by HTTP'
            key: oci.obj.storage.client.errors
    - uuid: 445af3dbf17e4046b5350fd1b4b3734b
      name: 'OCI Object Storage: First byte latency'
      graph_items:
        - color: 199C0D
          item:
            host: 'Oracle Cloud Object Storage by HTTP'
            key: oci.obj.storage.latency.byte
    - uuid: 15fb3f080d6244a48d1a7c98f69a2793
      name: 'OCI Object Storage: Incomplete multipart upload size'
      graph_items:
        - color: 199C0D
          item:
            host: 'Oracle Cloud Object Storage by HTTP'
            key: oci.obj.storage.size.incomplete
    - uuid: 0f71c9aa038d437fa28312c58d417ad1
      name: 'OCI Object Storage: Overall latency'
      graph_items:
        - color: 199C0D
          item:
            host: 'Oracle Cloud Object Storage by HTTP'
            key: oci.obj.storage.latency.overall
    - uuid: 49c9abb27e194d1788ee1c62688ff57b
      name: 'OCI Object Storage: Requests'
      graph_items:
        - color: 199C0D
          item:
            host: 'Oracle Cloud Object Storage by HTTP'
            key: oci.obj.storage.requests
        - sortorder: '1'
          color: F63100
          item:
            host: 'Oracle Cloud Object Storage by HTTP'
            key: oci.obj.storage.requests.post
        - sortorder: '2'
          color: 00611C
          item:
            host: 'Oracle Cloud Object Storage by HTTP'
            key: oci.obj.storage.requests.put
    - uuid: 66c94c9ea2264d96864df112f09b7d5f
      name: 'Storage Controller: IO'
      graph_items:
        - drawtype: GRADIENT_LINE
          color: 00BFFF
          item:
            host: 'Nutanix Cluster Prism Element by HTTP'
            key: nutanix.cluster.storage.controller.io
        - sortorder: '1'
          drawtype: GRADIENT_LINE
          color: FF0080
          item:
            host: 'Nutanix Cluster Prism Element by HTTP'
            key: nutanix.cluster.storage.controller.io.read
        - sortorder: '2'
          drawtype: GRADIENT_LINE
          color: 0040FF
          item:
            host: 'Nutanix Cluster Prism Element by HTTP'
            key: nutanix.cluster.storage.controller.io.write
    - uuid: be009461151d40f2a8e655eb3e9381fe
      name: 'Storage Controller: IO'
      graph_items:
        - drawtype: GRADIENT_LINE
          color: 00BFFF
          item:
            host: 'Nutanix Host Prism Element by HTTP'
            key: nutanix.host.storage.controller.io
        - sortorder: '1'
          drawtype: GRADIENT_LINE
          color: FF0080
          item:
            host: 'Nutanix Host Prism Element by HTTP'
            key: nutanix.host.storage.controller.io.read
        - sortorder: '2'
          drawtype: GRADIENT_LINE
          color: 0040FF
          item:
            host: 'Nutanix Host Prism Element by HTTP'
            key: nutanix.host.storage.controller.io.write
    - uuid: ed97331326f14627900146141aff0333
      name: 'Storage Controller: IO, bandwidth'
      graph_items:
        - drawtype: GRADIENT_LINE
          color: 00BFFF
          item:
            host: 'Nutanix Cluster Prism Element by HTTP'
            key: nutanix.cluster.storage.controller.io.bandwidth
        - sortorder: '1'
          drawtype: GRADIENT_LINE
          color: FF0080
          item:
            host: 'Nutanix Cluster Prism Element by HTTP'
            key: nutanix.cluster.storage.controller.io.read.bandwidth
        - sortorder: '2'
          drawtype: GRADIENT_LINE
          color: 0040FF
          item:
            host: 'Nutanix Cluster Prism Element by HTTP'
            key: nutanix.cluster.storage.controller.io.write.bandwidth
    - uuid: b6529f70381a4762b0bf965be9a52e2f
      name: 'Storage Controller: IO, bandwidth'
      graph_items:
        - drawtype: GRADIENT_LINE
          color: 00BFFF
          item:
            host: 'Nutanix Host Prism Element by HTTP'
            key: nutanix.host.storage.controller.io.bandwidth
        - sortorder: '1'
          drawtype: GRADIENT_LINE
          color: FF0080
          item:
            host: 'Nutanix Host Prism Element by HTTP'
            key: nutanix.host.storage.controller.io.read.bandwidth
        - sortorder: '2'
          drawtype: GRADIENT_LINE
          color: 0040FF
          item:
            host: 'Nutanix Host Prism Element by HTTP'
            key: nutanix.host.storage.controller.io.write.bandwidth
    - uuid: 3a8aa7c3dc2d44ed8ab3c54fa092797d
      name: 'Storage Controller: IOPS'
      graph_items:
        - drawtype: GRADIENT_LINE
          color: 00BFFF
          item:
            host: 'Nutanix Cluster Prism Element by HTTP'
            key: nutanix.cluster.storage.controller.iops
        - sortorder: '1'
          drawtype: GRADIENT_LINE
          color: FF0080
          item:
            host: 'Nutanix Cluster Prism Element by HTTP'
            key: nutanix.cluster.storage.controller.iops.read
        - sortorder: '2'
          drawtype: GRADIENT_LINE
          color: 0040FF
          item:
            host: 'Nutanix Cluster Prism Element by HTTP'
            key: nutanix.cluster.storage.controller.iops.write
    - uuid: 031f1610f18441b9b96c8bb47e8913ac
      name: 'Storage Controller: IOPS'
      graph_items:
        - drawtype: GRADIENT_LINE
          color: 00BFFF
          item:
            host: 'Nutanix Host Prism Element by HTTP'
            key: nutanix.host.storage.controller.iops
        - sortorder: '1'
          drawtype: GRADIENT_LINE
          color: FF0080
          item:
            host: 'Nutanix Host Prism Element by HTTP'
            key: nutanix.host.storage.controller.iops.read
        - sortorder: '2'
          drawtype: GRADIENT_LINE
          color: 0040FF
          item:
            host: 'Nutanix Host Prism Element by HTTP'
            key: nutanix.host.storage.controller.iops.write
    - uuid: baa376dae2024a5f83b5d84120878fd5
      name: 'Storage Controller: Read IO / Write IO'
      type: STACKED
      graph_items:
        - color: FF0080
          item:
            host: 'Nutanix Cluster Prism Element by HTTP'
            key: nutanix.cluster.storage.controller.io.read.percent
        - sortorder: '1'
          color: 00BFFF
          item:
            host: 'Nutanix Cluster Prism Element by HTTP'
            key: nutanix.cluster.storage.controller.io.write.percent
    - uuid: d52026a6d40844fbadc9b5e02f0e02ef
      name: 'Storage Controller: Read IO / Write IO'
      type: STACKED
      graph_items:
        - color: FF0080
          item:
            host: 'Nutanix Host Prism Element by HTTP'
            key: nutanix.host.storage.controller.io.read.percent
        - sortorder: '1'
          color: 00BFFF
          item:
            host: 'Nutanix Host Prism Element by HTTP'
            key: nutanix.host.storage.controller.io.write.percent
    - uuid: ac4df503b04a4f339c5d39bd72fd3832
      name: 'Storage Tier: Das-sata'
      type: STACKED
      graph_items:
        - color: 00BFFF
          item:
            host: 'Nutanix Cluster Prism Element by HTTP'
            key: nutanix.cluster.storage.controller.tier.das_sata.free.bytes
        - sortorder: '1'
          color: 0040FF
          item:
            host: 'Nutanix Cluster Prism Element by HTTP'
            key: nutanix.cluster.storage.controller.tier.das_sata.usage.bytes
    - uuid: c0740b2c536646ceb85aabeca052e2cb
      name: 'Storage Tier: Das-sata'
      type: STACKED
      graph_items:
        - color: 00BFFF
          item:
            host: 'Nutanix Host Prism Element by HTTP'
            key: nutanix.host.storage.controller.tier.das_sata.free.bytes
        - sortorder: '1'
          color: 0040FF
          item:
            host: 'Nutanix Host Prism Element by HTTP'
            key: nutanix.host.storage.controller.tier.das_sata.usage.bytes
    - uuid: 1edd2ff1710649ed9e037b2a00dc9f22
      name: 'Storage Tier: Free, bytes'
      graph_items:
        - drawtype: GRADIENT_LINE
          color: 00BFFF
          item:
            host: 'Nutanix Cluster Prism Element by HTTP'
            key: nutanix.cluster.storage.controller.tier.das_sata.free.bytes
        - sortorder: '1'
          drawtype: GRADIENT_LINE
          color: 0040FF
          item:
            host: 'Nutanix Cluster Prism Element by HTTP'
            key: nutanix.cluster.storage.controller.tier.ssd.free.bytes
    - uuid: ff4e11828c9244c2b4021c826bec0700
      name: 'Storage Tier: SSD'
      type: STACKED
      graph_items:
        - color: 00BFFF
          item:
            host: 'Nutanix Cluster Prism Element by HTTP'
            key: nutanix.cluster.storage.controller.tier.ssd.free.bytes
        - sortorder: '1'
          color: 0040FF
          item:
            host: 'Nutanix Cluster Prism Element by HTTP'
            key: nutanix.cluster.storage.controller.tier.ssd.usage.bytes
    - uuid: 12fb09594c2f449182e641e5f12f32d0
      name: 'Storage Tier: SSD'
      type: STACKED
      graph_items:
        - color: 00BFFF
          item:
            host: 'Nutanix Host Prism Element by HTTP'
            key: nutanix.host.storage.controller.tier.ssd.free.bytes
        - sortorder: '1'
          color: 0040FF
          item:
            host: 'Nutanix Host Prism Element by HTTP'
            key: nutanix.host.storage.controller.tier.ssd.usage.bytes
