zabbix_export:
  version: '7.0'
  template_groups:
    - uuid: cde62966de7b4533a3a66254ce9201a7
      name: X5/HW
  templates:
    - uuid: af0a232601aa49adb416bddabb223b44
      template: x5.hw.gigabyte.server
      name: 'X5 HW Gigabyte Server'
      description: |
        (C) 2025, X5 Tech
        Author: Evgeny.Semerikov@x5.ru
        
        (!!!) REQUIRED MACRO:
        
        {$X5.API.PASSWORD}
        {$X5.API.USERNAME}
      templates:
        - name: x5.http
        - name: x5.icmp
      groups:
        - name: X5/HW
      items:
        - uuid: 4175e88626034db6a8f1342d39f118d3
          name: '[API] Availability'
          type: SIMPLE
          key: 'net.tcp.service[https,{HOST.CONN},{$CONN.PORT}]'
          history: 90d
          valuemap:
            name: Availability
          tags:
            - tag: COMMON
              value: Availability
          triggers:
            - uuid: 4f0f17b204c14189bc0edd5308281adc
              expression: 'max(/x5.hw.gigabyte.server/net.tcp.service[https,{HOST.CONN},{$CONN.PORT}],30m) = 0'
              name: 'Host is unavailable by API'
              event_name: 'Host is unavailable by API more than 30m'
              priority: AVERAGE
              manual_close: 'YES'
              dependencies:
                - name: 'Host is unavailable by ICMP'
                  expression: 'max(/x5.hw.dell.poweredge/icmpping,15m) = 0'
        - uuid: 4717f2c909344693b3172f1f520cc3af
          name: 'BIOS: Version'
          type: DEPENDENT
          key: x5.hw.common.bios.version
          delay: '0'
          history: 90d
          value_type: CHAR
          trends: '0'
          preprocessing:
            - type: CHECK_NOT_SUPPORTED
              parameters:
                - '-1'
            - type: JSONPATH
              parameters:
                - $.BiosVersion
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 3d
          master_item:
            key: x5.hw.redfish.systems
          tags:
            - tag: COMMON
              value: Inventory
        - uuid: 78717903bab64fc38454107a196e6afa
          name: 'BMC: FQDN'
          type: DEPENDENT
          key: x5.hw.common.bmc.fqdn
          delay: '0'
          history: 90d
          value_type: CHAR
          trends: '0'
          preprocessing:
            - type: CHECK_NOT_SUPPORTED
              parameters:
                - '-1'
            - type: JSONPATH
              parameters:
                - $.FQDN
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 3d
          master_item:
            key: x5.hw.redfish.managers.network
          tags:
            - tag: COMMON
              value: Inventory
          triggers:
            - uuid: ca4a33b73d544a928a6956ef5dac4afc
              expression: 'last(/x5.hw.gigabyte.server/x5.hw.common.bmc.fqdn) <> {$FQDN}'
              name: 'BMC: FQDN is mismatch'
              event_name: 'BMC: FQDN ({$FQDN}) is mismatch'
              status: DISABLED
              manual_close: 'YES'
        - uuid: 26c8e69714094f5e9b9932b54ac79708
          name: 'BMC: Host name'
          type: DEPENDENT
          key: x5.hw.common.bmc.hostname
          delay: '0'
          history: 90d
          value_type: CHAR
          trends: '0'
          preprocessing:
            - type: CHECK_NOT_SUPPORTED
              parameters:
                - '-1'
            - type: JSONPATH
              parameters:
                - $.HostName
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 3d
          master_item:
            key: x5.hw.redfish.managers.network
          tags:
            - tag: COMMON
              value: Inventory
          triggers:
            - uuid: 404c77f0a5a24c3584bb8d155ac38b4b
              expression: 'last(/x5.hw.gigabyte.server/x5.hw.common.bmc.hostname) <> {$NAME}'
              name: 'BMC: Host name is mismatch'
              event_name: 'BMC: Host name ({$NAME}) is mismatch'
              status: DISABLED
              manual_close: 'YES'
        - uuid: 76d65c69b369458ea092e2b22304d503
          name: 'BMC: Version'
          type: DEPENDENT
          key: x5.hw.common.bmc.version
          delay: '0'
          history: 90d
          value_type: CHAR
          trends: '0'
          preprocessing:
            - type: CHECK_NOT_SUPPORTED
              parameters:
                - '-1'
            - type: JSONPATH
              parameters:
                - $.FirmwareVersion
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 3d
          master_item:
            key: x5.hw.redfish.managers
          tags:
            - tag: COMMON
              value: Inventory
        - uuid: 140751550e32413f877d35ca27740411
          name: 'Total CPU cores'
          type: CALCULATED
          key: x5.hw.common.cpu.cores.count
          delay: 15m
          history: 90d
          params: 'sum(last_foreach(//x5.hw.redfish.processor.cores[*]))'
          preprocessing:
            - type: CHECK_NOT_SUPPORTED
              parameters:
                - '-1'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 3d
          tags:
            - tag: COMMON
              value: Inventory
        - uuid: 7abee1a9b82147dfa75345413e8ceac6
          name: 'Total CPU processors'
          type: DEPENDENT
          key: x5.hw.common.cpu.processors.count
          delay: '0'
          history: 90d
          preprocessing:
            - type: CHECK_NOT_SUPPORTED
              parameters:
                - '-1'
            - type: JSONPATH
              parameters:
                - $.ProcessorSummary.Count
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 3d
          master_item:
            key: x5.hw.redfish.systems
          tags:
            - tag: COMMON
              value: Inventory
        - uuid: ec32b9e7c3014e64abd3f4763e143933
          name: 'Total CPU threads'
          type: CALCULATED
          key: x5.hw.common.cpu.threads.count
          delay: 15m
          history: 90d
          params: 'sum(last_foreach(//x5.hw.redfish.processor.threads[*]))'
          preprocessing:
            - type: CHECK_NOT_SUPPORTED
              parameters:
                - '-1'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 3d
          tags:
            - tag: COMMON
              value: Inventory
        - uuid: 79537f9a443e486a861bc683c20972d4
          name: Health
          type: DEPENDENT
          key: x5.hw.common.health
          delay: '0'
          history: 90d
          value_type: FLOAT
          valuemap:
            name: 'Redfish (enum): Health'
          preprocessing:
            - type: CHECK_NOT_SUPPORTED
              parameters:
                - '-1'
            - type: JSONPATH
              parameters:
                - $.Status.Health
              error_handler: DISCARD_VALUE
            - type: JAVASCRIPT
              parameters:
                - |
                  // Redfish (enum): Health    
                  switch(value) {
                      case 'OK':                  return 0;
                      case 'Warning':             return 1;
                      case 'Critical':            return 2;
                      default:                    return -1;
                  }
          master_item:
            key: x5.hw.redfish.systems
          tags:
            - tag: COMMON
              value: Availability
          triggers:
            - uuid: a0e0e7eee9104332aebe9c4df8679f04
              expression: 'avg(/x5.hw.gigabyte.server/x5.hw.common.health,15m) = 2'
              name: 'BMC: Health is in critical state'
              event_name: 'BMC: Health is in critical state more than 15m'
              priority: AVERAGE
              manual_close: 'YES'
            - uuid: 7da5653fed014abc84738a65539f9221
              expression: 'avg(/x5.hw.gigabyte.server/x5.hw.common.health,15m) = -1'
              name: 'BMC: Health is in unknown state'
              event_name: 'BMC: Health is in unknown state more than 15m'
              priority: INFO
              manual_close: 'YES'
            - uuid: fccadee3b00143c397c50f0467f9018f
              expression: 'avg(/x5.hw.gigabyte.server/x5.hw.common.health,15m) = 1'
              name: 'BMC: Health is in warning state'
              event_name: 'BMC: Health is in warning state more than 15m'
              priority: WARNING
              manual_close: 'YES'
            - uuid: 8b40e9678dcd44a78c32f18c52da6f86
              expression: 'nodata(/x5.hw.gigabyte.server/x5.hw.common.health,{$HEALTH.TIMEOUT}) = 1'
              name: 'BMC: No health data'
              event_name: 'BMC: No health data more than {$HEALTH.TIMEOUT}'
              opdata: N/A
              priority: AVERAGE
              manual_close: 'YES'
              dependencies:
                - name: 'Host is unavailable by API'
                  expression: 'max(/x5.hw.gigabyte.server/net.tcp.service[https,{HOST.CONN},{$CONN.PORT}],30m) = 0'
            - uuid: 52f364c452114b48a64d56d0aa18e4d2
              expression: 'nodata(/x5.hw.gigabyte.server/x5.hw.common.health,3m) = 1'
              name: 'BMC: No health data more than 3m'
              opdata: N/A
              manual_close: 'YES'
              dependencies:
                - name: 'BMC: No health data'
                  expression: 'nodata(/x5.hw.gigabyte.server/x5.hw.common.health,{$HEALTH.TIMEOUT}) = 1'
                - name: 'Host is unavailable by API'
                  expression: 'max(/x5.hw.gigabyte.server/net.tcp.service[https,{HOST.CONN},{$CONN.PORT}],30m) = 0'
        - uuid: 6131a9136bf54784baab83b9d93e9a4f
          name: Manufacturer
          type: DEPENDENT
          key: x5.hw.common.manufacturer
          delay: '0'
          history: 90d
          value_type: CHAR
          trends: '0'
          preprocessing:
            - type: CHECK_NOT_SUPPORTED
              parameters:
                - '-1'
            - type: JSONPATH
              parameters:
                - $.Manufacturer
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 3d
          master_item:
            key: x5.hw.redfish.systems
          tags:
            - tag: COMMON
              value: Inventory
        - uuid: 3f17cfac335a4c0bb5e489d21f52be06
          name: 'Total memory'
          type: DEPENDENT
          key: x5.hw.common.memory.count
          delay: '0'
          history: 90d
          units: B
          preprocessing:
            - type: CHECK_NOT_SUPPORTED
              parameters:
                - '-1'
            - type: JSONPATH
              parameters:
                - $.MemorySummary.TotalSystemMemoryGiB
              error_handler: DISCARD_VALUE
            - type: MULTIPLIER
              parameters:
                - '1024'
            - type: MULTIPLIER
              parameters:
                - '1024'
            - type: MULTIPLIER
              parameters:
                - '1024'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 3d
          master_item:
            key: x5.hw.redfish.systems
          tags:
            - tag: COMMON
              value: Inventory
        - uuid: 525273bd5336497ba13b106ceba4fefe
          name: Model
          type: DEPENDENT
          key: x5.hw.common.model
          delay: '0'
          history: 90d
          value_type: CHAR
          trends: '0'
          preprocessing:
            - type: CHECK_NOT_SUPPORTED
              parameters:
                - '-1'
            - type: JSONPATH
              parameters:
                - $.Model
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 3d
          master_item:
            key: x5.hw.redfish.systems
          tags:
            - tag: COMMON
              value: Inventory
        - uuid: 8eca112cc2ff41a4b22e8d418539f8f5
          name: 'Part number'
          type: DEPENDENT
          key: x5.hw.common.part
          delay: '0'
          history: 90d
          value_type: CHAR
          trends: '0'
          preprocessing:
            - type: CHECK_NOT_SUPPORTED
              parameters:
                - '-1'
            - type: JSONPATH
              parameters:
                - $.PartNumber
              error_handler: CUSTOM_VALUE
              error_handler_params: N/A
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 3d
          master_item:
            key: x5.hw.redfish.chassis
          tags:
            - tag: COMMON
              value: Inventory
        - uuid: 885d698fc8bb4f6482b30b971b6f4664
          name: 'Total power consumption'
          type: DEPENDENT
          key: x5.hw.common.power
          delay: '0'
          history: 90d
          value_type: FLOAT
          units: W
          preprocessing:
            - type: CHECK_NOT_SUPPORTED
              parameters:
                - '-1'
            - type: JSONPATH
              parameters:
                - '$.PowerControl.[0].PowerConsumedWatts'
              error_handler: DISCARD_VALUE
          master_item:
            key: x5.hw.redfish.power
          tags:
            - tag: COMMON
              value: Electricity
        - uuid: 53b2f971a4e5456b95ad8310f06abcef
          name: 'Power redundancy: Health'
          type: DEPENDENT
          key: x5.hw.common.power.redundancy.health
          delay: '0'
          history: 90d
          valuemap:
            name: 'Redfish (enum): Health'
          preprocessing:
            - type: CHECK_NOT_SUPPORTED
              parameters:
                - '-1'
            - type: JSONPATH
              parameters:
                - '$.Redundancy[0].Status.Health'
              error_handler: DISCARD_VALUE
            - type: JAVASCRIPT
              parameters:
                - |
                  switch(value) {
                      case 'OK':              return 0;
                      case 'Warning':         return 1;
                      case 'Critical':        return 2;
                      default:                return "Value not supported";
                  }
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 15m
          master_item:
            key: x5.hw.redfish.power
          tags:
            - tag: COMMON
              value: Availability
        - uuid: 9fb735edfd3c4a74a061d1dfbf09cfa1
          name: 'Power redundancy: State'
          type: DEPENDENT
          key: x5.hw.common.power.redundancy.state
          delay: '0'
          history: 90d
          valuemap:
            name: 'Redfish (enum): State'
          preprocessing:
            - type: CHECK_NOT_SUPPORTED
              parameters:
                - '-1'
            - type: JSONPATH
              parameters:
                - '$.Redundancy[0].Status.State'
              error_handler: DISCARD_VALUE
            - type: JAVASCRIPT
              parameters:
                - |
                  switch(value) {
                      case 'Enabled':         return 0;
                      case 'Disabled':        return 1;
                      default:                return "Value not supported";
                  }
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 15m
          master_item:
            key: x5.hw.redfish.power
          tags:
            - tag: COMMON
              value: Availability
        - uuid: 2ea435ad45de46c8a4d1148a9c9ea41d
          name: 'Power state'
          type: DEPENDENT
          key: x5.hw.common.power.state
          delay: '0'
          history: 90d
          valuemap:
            name: 'Redfish (enum): PowerState'
          preprocessing:
            - type: CHECK_NOT_SUPPORTED
              parameters:
                - '-1'
            - type: JSONPATH
              parameters:
                - $.PowerState
              error_handler: DISCARD_VALUE
            - type: JAVASCRIPT
              parameters:
                - |
                  // Redfish (enum): PowerState 
                  switch(value) {
                      case 'Off':             return 0;
                      case 'On':              return 1;
                      case 'Paused':          return 2;
                      case 'PoweringOff':     return 3;
                      case 'PoweringOn':      return 4;
                      default:                return value + " not supported";
                  }
          master_item:
            key: x5.hw.redfish.systems
          tags:
            - tag: COMMON
              value: Environment
        - uuid: 5f5b9ad049794d559a4a0a349b94a1f8
          name: 'Serial number'
          type: DEPENDENT
          key: x5.hw.common.serial
          delay: '0'
          history: 90d
          value_type: CHAR
          trends: '0'
          preprocessing:
            - type: CHECK_NOT_SUPPORTED
              parameters:
                - '-1'
            - type: JSONPATH
              parameters:
                - $.SerialNumber
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 3d
          master_item:
            key: x5.hw.redfish.chassis
          tags:
            - tag: COMMON
              value: Inventory
        - uuid: b72ac7fc360e48b29421dadab9d5cd0a
          name: SKU
          type: DEPENDENT
          key: x5.hw.common.sku
          delay: '0'
          history: 90d
          value_type: CHAR
          trends: '0'
          preprocessing:
            - type: CHECK_NOT_SUPPORTED
              parameters:
                - '-1'
            - type: JSONPATH
              parameters:
                - $.SKU
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 3d
          master_item:
            key: x5.hw.redfish.systems
          tags:
            - tag: COMMON
              value: Inventory
          triggers:
            - uuid: d9a335d6292a424ca43c6c472cab676a
              expression: 'last(/x5.hw.gigabyte.server/x5.hw.common.sku) <> {$SERIAL}'
              name: 'Serial number is mismatch'
              event_name: 'Serial number ({$SERIAL}) is mismatch'
              priority: INFO
              manual_close: 'YES'
        - uuid: 30b714e9e56b42eabc2439200f49e803
          name: State
          type: DEPENDENT
          key: x5.hw.common.state
          delay: '0'
          history: 90d
          valuemap:
            name: 'Redfish (enum): State'
          preprocessing:
            - type: CHECK_NOT_SUPPORTED
              parameters:
                - '-1'
            - type: JSONPATH
              parameters:
                - $.Status.State
              error_handler: DISCARD_VALUE
            - type: JAVASCRIPT
              parameters:
                - |
                  // Redfish (enum): State 
                  switch(value) {
                      case 'Disabled':            return 0;
                      case 'Enabled':             return 1;
                      case 'StandbyOffline':      return 2;
                      case 'StandbySpare':        return 3;
                      case 'InTest':              return 4;
                      case 'Starting':            return 5;
                      case 'Absent':         	return 6;
                      case 'UnavailableOffline':  return 7;
                      case 'Deferring':           return 8;
                      case 'Quiesced':            return 9;
                      case 'Updating':            return 10;
                      case 'Qualified':           return 11;
                      default:                    return "Value not supported";
                  }
          master_item:
            key: x5.hw.redfish.systems
          tags:
            - tag: COMMON
              value: Availability
        - uuid: 3ce846b873c643c39926c9a2151f1101
          name: 'Total storage capacity'
          type: CALCULATED
          key: x5.hw.common.storage.count
          delay: 15m
          history: 90d
          units: B
          params: 'sum(last_foreach(//x5.hw.redfish.storage.disk.capacity[*]))'
          preprocessing:
            - type: CHECK_NOT_SUPPORTED
              parameters:
                - '-1'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 3d
          tags:
            - tag: COMMON
              value: Inventory
        - uuid: ec3beeaec2a341989d3dc877927fc692
          name: UID
          type: DEPENDENT
          key: x5.hw.common.uid
          delay: '0'
          history: 90d
          description: 'Indicator LED'
          valuemap:
            name: 'Redfish (enum): IndicatorLED'
          preprocessing:
            - type: CHECK_NOT_SUPPORTED
              parameters:
                - '-1'
            - type: JSONPATH
              parameters:
                - $.IndicatorLED
              error_handler: DISCARD_VALUE
            - type: JAVASCRIPT
              parameters:
                - |
                  // Redfish (enum): IndicatorLED  
                  switch(value) {
                      case 'Off':             return 0;
                      case 'Lit':             return 1;
                      case 'Blinking':        return 2;
                      default:                return value + " not supported";
                  }
          master_item:
            key: x5.hw.redfish.systems
          tags:
            - tag: COMMON
              value: Environment
        - uuid: 084d52033dde412c914017049c167873
          name: UUID
          type: DEPENDENT
          key: x5.hw.common.uuid
          delay: '0'
          history: 90d
          value_type: CHAR
          trends: '0'
          preprocessing:
            - type: CHECK_NOT_SUPPORTED
              parameters:
                - '-1'
            - type: JSONPATH
              parameters:
                - $.UUID
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 3d
          master_item:
            key: x5.hw.redfish.systems
          tags:
            - tag: COMMON
              value: Inventory
        - uuid: 2de34db3c297417d8390d9a5e1f8ef10
          name: '[API: Chassis]'
          type: HTTP_AGENT
          key: x5.hw.redfish.chassis
          delay: 3m
          history: '0'
          value_type: TEXT
          trends: '0'
          authtype: BASIC
          username: '{$X5.API.USERNAME}'
          password: '{$X5.API.PASSWORD}'
          preprocessing:
            - type: CHECK_JSON_ERROR
              parameters:
                - $.error
          url: '{$REDFISH.PROT}://{HOST.CONN}:{$REDFISH.PORT}/redfish/v1/Chassis/{$REDFISH.CHASSIS.ID}'
          headers:
            - name: Content-type
              value: application/json
            - name: Accept
              value: application/json
          tags:
            - tag: COMMON
              value: '[GET]'
        - uuid: c627d9faeb664906b5f3d8dc544004f3
          name: '[API: Managers]'
          type: HTTP_AGENT
          key: x5.hw.redfish.managers
          delay: 3m
          history: '0'
          value_type: TEXT
          trends: '0'
          authtype: BASIC
          username: '{$X5.API.USERNAME}'
          password: '{$X5.API.PASSWORD}'
          preprocessing:
            - type: CHECK_JSON_ERROR
              parameters:
                - $.error
          url: 'https://{HOST.CONN}:{$CONN.PORT}/redfish/v1/Managers/{$REDFISH.MANAGER.ID}'
          headers:
            - name: Content-type
              value: application/json
          tags:
            - tag: COMMON
              value: '[GET]'
        - uuid: d3fb39c71e8345a594632f04f6a5ee6c
          name: '[API: Managers/Network]'
          type: HTTP_AGENT
          key: x5.hw.redfish.managers.network
          delay: 3m
          history: '0'
          value_type: TEXT
          trends: '0'
          authtype: BASIC
          username: '{$X5.API.USERNAME}'
          password: '{$X5.API.PASSWORD}'
          preprocessing:
            - type: CHECK_JSON_ERROR
              parameters:
                - $.error
          url: 'https://{HOST.CONN}:{$CONN.PORT}/redfish/v1/Managers/{$REDFISH.MANAGER.ID}/NetworkProtocol'
          headers:
            - name: Content-type
              value: application/json
          tags:
            - tag: COMMON
              value: '[GET]'
        - uuid: f91ba6609fda4ec4a950cd0b34ff8825
          name: '[API: Power]'
          type: HTTP_AGENT
          key: x5.hw.redfish.power
          delay: 3m
          history: '0'
          value_type: TEXT
          trends: '0'
          authtype: BASIC
          username: '{$X5.API.USERNAME}'
          password: '{$X5.API.PASSWORD}'
          preprocessing:
            - type: CHECK_JSON_ERROR
              parameters:
                - $.error
          url: 'https://{HOST.CONN}:{$CONN.PORT}/redfish/v1/Chassis/{$REDFISH.CHASSIS.ID}/Power'
          headers:
            - name: Content-type
              value: application/json
          tags:
            - tag: COMMON
              value: '[GET]'
        - uuid: 77d507bc8dc9416c811bd0c345da87c7
          name: '[API: Systems]'
          type: HTTP_AGENT
          key: x5.hw.redfish.systems
          history: '0'
          value_type: TEXT
          trends: '0'
          authtype: BASIC
          username: '{$X5.API.USERNAME}'
          password: '{$X5.API.PASSWORD}'
          preprocessing:
            - type: CHECK_JSON_ERROR
              parameters:
                - $.error
          url: 'https://{HOST.CONN}:{$CONN.PORT}/redfish/v1/Systems/{$REDFISH.SYSTEM.ID}'
          headers:
            - name: Content-type
              value: application/json
          tags:
            - tag: COMMON
              value: '[GET]'
        - uuid: c1ea75348af349a087633f8acf399d91
          name: '[API: Thermal]'
          type: HTTP_AGENT
          key: x5.hw.redfish.thermal
          delay: 3m
          history: '0'
          value_type: TEXT
          trends: '0'
          authtype: BASIC
          username: '{$X5.API.USERNAME}'
          password: '{$X5.API.PASSWORD}'
          preprocessing:
            - type: CHECK_JSON_ERROR
              parameters:
                - $.error
          url: 'https://{HOST.CONN}:{$CONN.PORT}/redfish/v1/Chassis/{$REDFISH.CHASSIS.ID}/Thermal'
          headers:
            - name: Content-type
              value: application/json
          tags:
            - tag: COMMON
              value: '[GET]'
      discovery_rules:
        - uuid: f03e12c83d6c411c8696bb0bdc2cc053
          name: Fan
          type: DEPENDENT
          key: x5.hw.redfish.fan.discovery
          delay: '0'
          lifetime: 30d
          item_prototypes:
            - uuid: 2481755a98de4fe2ab8c3a0c2f9fa8c2
              name: 'Fan {#ID} ({#NAME}): Health'
              type: DEPENDENT
              key: 'x5.hw.redfish.fan.health[{#ID}]'
              delay: '0'
              history: 90d
              valuemap:
                name: 'Redfish (enum): Health'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.Fans.[?(@.[''MemberId'']== "{#ID}")].[''Status''].[''Health''].first()'
                  error_handler: DISCARD_VALUE
                - type: NOT_MATCHES_REGEX
                  parameters:
                    - 'null'
                  error_handler: DISCARD_VALUE
                - type: JAVASCRIPT
                  parameters:
                    - |
                      // Redfish (enum): Health    
                      switch(value) {
                          case 'OK':              return 0;
                          case 'Warning':         return 1;
                          case 'Critical':        return 2;
                          default:                return value + " not supported";
                      }
              master_item:
                key: x5.hw.redfish.thermal
              tags:
                - tag: Fan
                  value: Availability
              trigger_prototypes:
                - uuid: 2f0405bb3e464ff897f258b1dc2946de
                  expression: 'last(/x5.hw.gigabyte.server/x5.hw.redfish.fan.health[{#ID}]) = 2'
                  name: 'Fan {#ID} ({#NAME}): Health is in critical state'
                  priority: AVERAGE
                  manual_close: 'YES'
                - uuid: b242646a814a449a9e03d3ca2e2a5afb
                  expression: 'last(/x5.hw.gigabyte.server/x5.hw.redfish.fan.health[{#ID}]) = 1'
                  name: 'Fan {#ID} ({#NAME}): Health is in warning state'
                  priority: WARNING
                  manual_close: 'YES'
            - uuid: 8f53654878284992b73b5d33d9d9057c
              name: 'Fan {#ID} ({#NAME}): Speed'
              type: DEPENDENT
              key: 'x5.hw.redfish.fan.speed.current[{#ID}]'
              delay: '0'
              history: 90d
              units: '!RPM'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.Fans.[?(@.[''MemberId'']== "{#ID}")].[''Reading''].first()'
                  error_handler: DISCARD_VALUE
              master_item:
                key: x5.hw.redfish.thermal
              tags:
                - tag: Fan
                  value: Usage
            - uuid: af710c2c4d294435b40c0d4b4ef10828
              name: 'Fan {#ID} ({#NAME}): Maximum speed'
              type: DEPENDENT
              key: 'x5.hw.redfish.fan.speed.max[{#ID}]'
              delay: '0'
              history: 90d
              units: '!RPM'
              valuemap:
                name: N/A
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.Fans.[?(@.[''MemberId'']== "{#ID}")].[''MaxReadingRange''].first()'
                  error_handler: DISCARD_VALUE
                - type: STR_REPLACE
                  parameters:
                    - 'null'
                    - '0'
              master_item:
                key: x5.hw.redfish.thermal
              tags:
                - tag: Fan
                  value: Limits
            - uuid: 9a0cf4b51f1140f0ad5df24253c830b3
              name: 'Fan {#ID} ({#NAME}): Utilization'
              type: CALCULATED
              key: 'x5.hw.redfish.fan.speed.utilization[{#ID}]'
              history: 90d
              units: '%'
              params: |
                last(//x5.hw.redfish.fan.speed.current[{#ID}])
                /
                last(//x5.hw.redfish.fan.speed.max[{#ID}])
                *100
              preprocessing:
                - type: CHECK_NOT_SUPPORTED
                  parameters:
                    - '-1'
              tags:
                - tag: Fan
                  value: Utilization
            - uuid: c8137d48700f430f9dafad773467fd66
              name: 'Fan {#ID} ({#NAME}): State'
              type: DEPENDENT
              key: 'x5.hw.redfish.fan.state[{#ID}]'
              delay: '0'
              history: 90d
              valuemap:
                name: 'Redfish (enum): State'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.Fans.[?(@.[''MemberId'']== "{#ID}")].[''Status''].[''State''].first()'
                  error_handler: DISCARD_VALUE
                - type: NOT_MATCHES_REGEX
                  parameters:
                    - 'null'
                  error_handler: DISCARD_VALUE
                - type: JAVASCRIPT
                  parameters:
                    - |
                      // Redfish (enum): State 
                      switch(value) {
                          case 'Disabled':            return 0;
                          case 'Enabled':             return 1;
                          case 'StandbyOffline':      return 2;
                          case 'StandbySpare':        return 3;
                          case 'InTest':              return 4;
                          case 'Starting':            return 5;
                          case 'Absent':              return 6;
                          case 'UnavailableOffline':  return 7;
                          case 'Deferring':           return 8;
                          case 'Quiesced':            return 9;
                          case 'Updating':            return 10;
                          case 'Qualified':           return 11;
                          case 'Unknown':             return 99;
                          default:                    return value + " not supported";
                      }
              master_item:
                key: x5.hw.redfish.thermal
              tags:
                - tag: Fan
                  value: Availability
          trigger_prototypes:
            - uuid: 95ac72d365c24b96b0adeac93a697836
              expression: |
                last(/x5.hw.gigabyte.server/x5.hw.redfish.fan.state[{#ID}]) = 99
                and
                min(/x5.hw.gigabyte.server/x5.hw.common.power.state,15m) = 1
              name: 'Fan {#ID} ({#NAME}): State is unknown'
              opdata: '{ITEM.LASTVALUE1}'
              priority: AVERAGE
              manual_close: 'YES'
          master_item:
            key: x5.hw.redfish.thermal
          lld_macro_paths:
            - lld_macro: '{#ID}'
              path: $.MemberId
            - lld_macro: '{#NAME}'
              path: $.Name
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$.Fans.[*]'
        - uuid: 52359d4966a14270bacffae29c64461a
          name: Memory
          type: SCRIPT
          key: x5.hw.redfish.memory.discovery
          delay: 1h
          params: |
            function request(url) {
                api_request = new HttpRequest();
                api_request.addHeader('Accept: application/json');
                api_request.addHeader('Authorization: Basic ' + btoa(params.username + ':' + params.password));
                api_request.addHeader('Content-type: application/json');
                Zabbix.log(4, '[API: ' + params.url + '] Sending request');
                try {
                    response = api_request.get(url);
                } catch (error) {
                    Zabbix.log(3, '[API: ' + params.url + '] Request returned error: ' + error);
                    throw 'Get request returned error ' + error;
                }
                Zabbix.log(4, '[API: ' + params.url + '] Received response with status code ' + api_request.getStatus() + '\n' + response);
                if (api_request.getStatus() !== 200) {
                    var message = 'Request failed with status code ' + api_request.getStatus();
                    if (response !== null) {
                        if (typeof response.message === 'string') {
                            message += ': ' + response.message;
                        }
                    }
                    throw message + ' Check debug log for more information.';
                }
                if (response !== null) {
                    try {
                        response = JSON.parse(response);
                    }
                    catch (error) {
                        Zabbix.log(3, '[API: ' + params.url + '] Failed to parse response: ' + response);
                        response = null;
                    }
                }
                return response;
            }
            var params = JSON.parse(value);
            var result = [];
            response = request(params.url + '/redfish/v1/Systems/' + params.id + '/Memory');
            if (response.Members instanceof Array) {
                response.Members.forEach(function (member) {
                    if (typeof member["@odata.id"] === 'string') {
                        result.push({
                            '{#ODATA}': member["@odata.id"],
                            '{#ID}': member["@odata.id"].match(/([\w\.\-\_\:]+)[\/]*$/)[1]
                        });
                    }
                });
            }
            return JSON.stringify(result);
          lifetime: 30d
          item_prototypes:
            - uuid: 0e1e19313e8b4695a23c5c76858fff1e
              name: 'Memory ({#ID}): Capacity'
              type: DEPENDENT
              key: 'x5.hw.redfish.memory.capacity[{#ID}]'
              delay: '0'
              history: 90d
              units: B
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.CapacityMiB
                  error_handler: DISCARD_VALUE
                - type: NOT_MATCHES_REGEX
                  parameters:
                    - 'null'
                  error_handler: DISCARD_VALUE
                - type: MULTIPLIER
                  parameters:
                    - '1024'
                - type: MULTIPLIER
                  parameters:
                    - '1024'
              master_item:
                key: 'x5.hw.redfish.memory[{#ID}]'
              tags:
                - tag: Memory
                  value: Inventory
            - uuid: d49a654a1f474e25b10c57213ecad835
              name: 'Memory ({#ID}): Health'
              type: DEPENDENT
              key: 'x5.hw.redfish.memory.health[{#ID}]'
              delay: '0'
              history: 90d
              valuemap:
                name: 'Redfish (enum): Health'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.Status.Health
                  error_handler: DISCARD_VALUE
                - type: NOT_MATCHES_REGEX
                  parameters:
                    - 'null'
                  error_handler: DISCARD_VALUE
                - type: JAVASCRIPT
                  parameters:
                    - |
                      // Redfish (enum): Health    
                      switch(value) {
                          case 'OK':              return 0;
                          case 'Warning':         return 1;
                          case 'Critical':        return 2;
                          default:                return value + " not supported";
                      }
              master_item:
                key: 'x5.hw.redfish.memory[{#ID}]'
              tags:
                - tag: Memory
                  value: Availability
              trigger_prototypes:
                - uuid: 4ba77ce343644b72a4441f8f685d1a19
                  expression: 'last(/x5.hw.gigabyte.server/x5.hw.redfish.memory.health[{#ID}]) = 2'
                  name: 'Memory ({#ID}): Health is in critical state'
                  priority: AVERAGE
                  manual_close: 'YES'
                - uuid: e79ac265eca9493992b34a7e391392af
                  expression: 'last(/x5.hw.gigabyte.server/x5.hw.redfish.memory.health[{#ID}]) = 1'
                  name: 'Memory ({#ID}): Health is in warning state'
                  priority: WARNING
                  manual_close: 'YES'
            - uuid: 825166326bb643c48e2b523118bafb1d
              name: 'Memory ({#ID}): ID'
              type: DEPENDENT
              key: 'x5.hw.redfish.memory.id[{#ID}]'
              delay: '0'
              history: 90d
              value_type: CHAR
              trends: '0'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.Id
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3d
              master_item:
                key: 'x5.hw.redfish.memory[{#ID}]'
              tags:
                - tag: Memory
                  value: Inventory
            - uuid: e888a10cf3b04a1ea4207b3b5eeae80f
              name: 'Memory ({#ID}): Manufacturer'
              type: DEPENDENT
              key: 'x5.hw.redfish.memory.manufacturer[{#ID}]'
              delay: '0'
              history: 90d
              value_type: CHAR
              trends: '0'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.Manufacturer
                  error_handler: DISCARD_VALUE
                - type: NOT_MATCHES_REGEX
                  parameters:
                    - 'null'
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3d
              master_item:
                key: 'x5.hw.redfish.memory[{#ID}]'
              tags:
                - tag: Memory
                  value: Inventory
            - uuid: 2df264ad1d9a4ff0b5d666ae75faed14
              name: 'Memory ({#ID}): Name'
              type: DEPENDENT
              key: 'x5.hw.redfish.memory.name[{#ID}]'
              delay: '0'
              history: 90d
              value_type: CHAR
              trends: '0'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.Name
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3d
              master_item:
                key: 'x5.hw.redfish.memory[{#ID}]'
              tags:
                - tag: Memory
                  value: Inventory
            - uuid: 615e7b3ecc7249a1a7f20551af0ff6a0
              name: 'Memory ({#ID}): Part number'
              type: DEPENDENT
              key: 'x5.hw.redfish.memory.part[{#ID}]'
              delay: '0'
              history: 90d
              value_type: CHAR
              trends: '0'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.PartNumber
                  error_handler: DISCARD_VALUE
                - type: NOT_MATCHES_REGEX
                  parameters:
                    - 'null'
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3d
              master_item:
                key: 'x5.hw.redfish.memory[{#ID}]'
              tags:
                - tag: Memory
                  value: Inventory
            - uuid: ada3236a71314b0b9c12275f238ce790
              name: 'Memory ({#ID}): Serial number'
              type: DEPENDENT
              key: 'x5.hw.redfish.memory.serial[{#ID}]'
              delay: '0'
              history: 90d
              value_type: CHAR
              trends: '0'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.SerialNumber
                  error_handler: DISCARD_VALUE
                - type: NOT_MATCHES_REGEX
                  parameters:
                    - 'null'
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3d
              master_item:
                key: 'x5.hw.redfish.memory[{#ID}]'
              tags:
                - tag: Memory
                  value: Inventory
            - uuid: 947a496a813a423592cc05de954add80
              name: 'Memory ({#ID}): State'
              type: DEPENDENT
              key: 'x5.hw.redfish.memory.state[{#ID}]'
              delay: '0'
              history: 90d
              valuemap:
                name: 'Redfish (enum): State'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.Status.State
                  error_handler: DISCARD_VALUE
                - type: NOT_MATCHES_REGEX
                  parameters:
                    - 'null'
                  error_handler: DISCARD_VALUE
                - type: JAVASCRIPT
                  parameters:
                    - |
                      // Redfish (enum): State 
                      switch(value) {
                          case 'Disabled':            return 0;
                          case 'Enabled':             return 1;
                          case 'StandbyOffline':      return 2;
                          case 'StandbySpare':        return 3;
                          case 'InTest':              return 4;
                          case 'Starting':            return 5;
                          case 'Absent':              return 6;
                          case 'UnavailableOffline':  return 7;
                          case 'Deferring':           return 8;
                          case 'Quiesced':            return 9;
                          case 'Updating':            return 10;
                          case 'Qualified':           return 11;
                          case 'Unknown':             return 99;
                          default:                    return value + " not supported";
                      }
              master_item:
                key: 'x5.hw.redfish.memory[{#ID}]'
              tags:
                - tag: Memory
                  value: Availability
            - uuid: 64d8a319bb6a4f8ca0e04ac71c832b96
              name: '[API: Memory ({#ID})]'
              type: HTTP_AGENT
              key: 'x5.hw.redfish.memory[{#ID}]'
              delay: 5m
              history: '0'
              value_type: TEXT
              trends: '0'
              authtype: BASIC
              username: '{$X5.API.USERNAME}'
              password: '{$X5.API.PASSWORD}'
              preprocessing:
                - type: CHECK_NOT_SUPPORTED
                  parameters:
                    - '-1'
                - type: CHECK_JSON_ERROR
                  parameters:
                    - $.error
              url: 'https://{HOST.CONN}:{$CONN.PORT}{#ODATA}'
              headers:
                - name: Content-type
                  value: application/json
              tags:
                - tag: Memory
                  value: '[GET]'
          trigger_prototypes:
            - uuid: ee58ce1d316047d0bc28db45c18c0eb5
              expression: |
                last(/x5.hw.gigabyte.server/x5.hw.redfish.memory.state[{#ID}]) = 99
                and
                min(/x5.hw.gigabyte.server/x5.hw.common.power.state,15m) = 1
              name: 'Memory ({#ID}): State is unknown'
              opdata: '{ITEM.LASTVALUE1}'
              priority: AVERAGE
              manual_close: 'YES'
          parameters:
            - name: id
              value: '{$REDFISH.SYSTEM.ID}'
            - name: password
              value: '{$X5.API.PASSWORD}'
            - name: url
              value: '{$REDFISH.PROT}://{HOST.CONN}:{$REDFISH.PORT}'
            - name: username
              value: '{$X5.API.USERNAME}'
          preprocessing:
            - type: CHECK_JSON_ERROR
              parameters:
                - $.error
        - uuid: b8b9784ced9f41a6a708bc2408082f3d
          name: 'Network adapter'
          type: SCRIPT
          key: x5.hw.redfish.network.adapter.discovery
          delay: 1h
          params: |
            function request(url) {
                api_request = new HttpRequest();
                api_request.addHeader('Accept: application/json');
                api_request.addHeader('Authorization: Basic ' + btoa(params.username + ':' + params.password));
                api_request.addHeader('Content-type: application/json');
                Zabbix.log(4, '[API: ' + params.url + '] Sending request');
                try {
                    response = api_request.get(url);
                } catch (error) {
                    Zabbix.log(3, '[API: ' + params.url + '] Request returned error: ' + error);
                    throw 'Get request returned error ' + error;
                }
                Zabbix.log(4, '[API: ' + params.url + '] Received response with status code ' + api_request.getStatus() + '\n' + response);
                if (api_request.getStatus() !== 200) {
                    var message = 'Request failed with status code ' + api_request.getStatus();
                    if (response !== null) {
                        if (typeof response.message === 'string') {
                            message += ': ' + response.message;
                        }
                    }
                    throw message + ' Check debug log for more information.';
                }
                if (response !== null) {
                    try {
                        response = JSON.parse(response);
                    }
                    catch (error) {
                        Zabbix.log(3, '[API: ' + params.url + '] Failed to parse response: ' + response);
                        response = null;
                    }
                }
                return response;
            }
            var params = JSON.parse(value);
            var result = [];
            response = request(params.url + '/redfish/v1/Systems/' + params.id + '/NetworkAdapters');
            if (response.Members instanceof Array) {
                response.Members.forEach(function (member) {
                    if (typeof member["@odata.id"] === 'string') {
                        result.push({
                            '{#ODATA}': member["@odata.id"],
                            '{#ID}': member["@odata.id"].match(/([\w\.\-\_\:]+)[\/]*$/)[1]
                        });
                    }
                });
            }
            return JSON.stringify(result);
          lifetime: 30d
          item_prototypes:
            - uuid: cf4ad284cc6d4135b153487082c60603
              name: 'Network adapter ({#ID}): Firmware'
              type: DEPENDENT
              key: 'x5.hw.redfish.network.adapter.firmware[{#ID}]'
              delay: '0'
              history: 90d
              value_type: CHAR
              trends: '0'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.Controllers[0].FirmwarePackageVersion'
                  error_handler: DISCARD_VALUE
                - type: NOT_MATCHES_REGEX
                  parameters:
                    - 'null'
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3d
              master_item:
                key: 'x5.hw.redfish.network.adapter[{#ID}]'
              tags:
                - tag: Network
                  value: Inventory
            - uuid: 2b219ed134f64593a7fcbe47420bdd11
              name: 'Network adapter ({#ID}): Health'
              type: DEPENDENT
              key: 'x5.hw.redfish.network.adapter.health[{#ID}]'
              delay: '0'
              history: 90d
              valuemap:
                name: 'Redfish (enum): Health'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.Status.Health
                  error_handler: DISCARD_VALUE
                - type: NOT_MATCHES_REGEX
                  parameters:
                    - 'null'
                  error_handler: DISCARD_VALUE
                - type: JAVASCRIPT
                  parameters:
                    - |
                      // Redfish (enum): Health    
                      switch(value) {
                          case 'OK':              return 0;
                          case 'Warning':         return 1;
                          case 'Critical':        return 2;
                          default:                return value + " not supported";
                      }
              master_item:
                key: 'x5.hw.redfish.network.adapter[{#ID}]'
              tags:
                - tag: Network
                  value: Availability
              trigger_prototypes:
                - uuid: ba887b22808b4e1f989f34e8f19ca4cc
                  expression: 'last(/x5.hw.gigabyte.server/x5.hw.redfish.network.adapter.health[{#ID}]) = 2'
                  name: 'Network adapter ({#ID}): Health is in critical state'
                  priority: AVERAGE
                  manual_close: 'YES'
                - uuid: 6623ffe24ee24cfcb2cacbd9d67563c7
                  expression: 'last(/x5.hw.gigabyte.server/x5.hw.redfish.network.adapter.health[{#ID}]) = 1'
                  name: 'Network adapter ({#ID}): Health is in warning state'
                  priority: WARNING
                  manual_close: 'YES'
            - uuid: 64cca18f8a8646be9824e0d1beef9e49
              name: 'Network adapter ({#ID}): ID'
              type: DEPENDENT
              key: 'x5.hw.redfish.network.adapter.id[{#ID}]'
              delay: '0'
              history: 90d
              value_type: CHAR
              trends: '0'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.Id
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3d
              master_item:
                key: 'x5.hw.redfish.network.adapter[{#ID}]'
              tags:
                - tag: Network
                  value: Inventory
            - uuid: 5e051a8889634ac1bd5a83d98b150c31
              name: 'Network adapter ({#ID}): Manufacturer'
              type: DEPENDENT
              key: 'x5.hw.redfish.network.adapter.manufacturer[{#ID}]'
              delay: '0'
              history: 90d
              value_type: CHAR
              trends: '0'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.Manufacturer
                  error_handler: DISCARD_VALUE
                - type: NOT_MATCHES_REGEX
                  parameters:
                    - 'null'
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3d
              master_item:
                key: 'x5.hw.redfish.network.adapter[{#ID}]'
              tags:
                - tag: Network
                  value: Inventory
            - uuid: 05ab4c75c37244349a8726aa7dd399a6
              name: 'Network adapter ({#ID}): Model'
              type: DEPENDENT
              key: 'x5.hw.redfish.network.adapter.model[{#ID}]'
              delay: '0'
              history: 90d
              value_type: CHAR
              trends: '0'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.Model
                  error_handler: DISCARD_VALUE
                - type: NOT_MATCHES_REGEX
                  parameters:
                    - 'null'
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3d
              master_item:
                key: 'x5.hw.redfish.network.adapter[{#ID}]'
              tags:
                - tag: Network
                  value: Inventory
            - uuid: 943c8ea01081458a929a24700977d770
              name: 'Network adapter ({#ID}): Part number'
              type: DEPENDENT
              key: 'x5.hw.redfish.network.adapter.part[{#ID}]'
              delay: '0'
              history: 90d
              value_type: CHAR
              trends: '0'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.PartNumber
                  error_handler: DISCARD_VALUE
                - type: NOT_MATCHES_REGEX
                  parameters:
                    - 'null'
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3d
              master_item:
                key: 'x5.hw.redfish.network.adapter[{#ID}]'
              tags:
                - tag: Network
                  value: Inventory
            - uuid: adda83e2cb264063bdaf9551effc30dc
              name: 'Network adapter ({#ID}): Serial number'
              type: DEPENDENT
              key: 'x5.hw.redfish.network.adapter.serial[{#ID}]'
              delay: '0'
              history: 90d
              value_type: CHAR
              trends: '0'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.SerialNumber
                  error_handler: DISCARD_VALUE
                - type: NOT_MATCHES_REGEX
                  parameters:
                    - 'null'
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3d
              master_item:
                key: 'x5.hw.redfish.network.adapter[{#ID}]'
              tags:
                - tag: Network
                  value: Inventory
            - uuid: 36ff4d35096b4434a788599f0d968ee6
              name: 'Network adapter ({#ID}): State'
              type: DEPENDENT
              key: 'x5.hw.redfish.network.adapter.state[{#ID}]'
              delay: '0'
              history: 90d
              valuemap:
                name: 'Redfish (enum): State'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.Status.State
                  error_handler: DISCARD_VALUE
                - type: NOT_MATCHES_REGEX
                  parameters:
                    - 'null'
                  error_handler: DISCARD_VALUE
                - type: JAVASCRIPT
                  parameters:
                    - |
                      // Redfish (enum): State 
                      switch(value) {
                          case 'Disabled':            return 0;
                          case 'Enabled':             return 1;
                          case 'StandbyOffline':      return 2;
                          case 'StandbySpare':        return 3;
                          case 'InTest':              return 4;
                          case 'Starting':            return 5;
                          case 'Absent':              return 6;
                          case 'UnavailableOffline':  return 7;
                          case 'Deferring':           return 8;
                          case 'Quiesced':            return 9;
                          case 'Updating':            return 10;
                          case 'Qualified':           return 11;
                          case 'Unknown':             return 99;
                          default:                    return value + " not supported";
                      }
              master_item:
                key: 'x5.hw.redfish.network.adapter[{#ID}]'
              tags:
                - tag: Network
                  value: Availability
            - uuid: 901635112e0246ad9e88cef6e212670d
              name: '[API: Network adapter ({#ID})]'
              type: HTTP_AGENT
              key: 'x5.hw.redfish.network.adapter[{#ID}]'
              delay: 5m
              history: '0'
              value_type: TEXT
              trends: '0'
              authtype: BASIC
              username: '{$X5.API.USERNAME}'
              password: '{$X5.API.PASSWORD}'
              preprocessing:
                - type: CHECK_NOT_SUPPORTED
                  parameters:
                    - '-1'
                - type: CHECK_JSON_ERROR
                  parameters:
                    - $.error
              url: 'https://{HOST.CONN}:{$CONN.PORT}{#ODATA}'
              headers:
                - name: Content-type
                  value: application/json
              tags:
                - tag: Network
                  value: '[GET]'
          trigger_prototypes:
            - uuid: 05d8c9e08cc4483bb5b5e37e4bea628b
              expression: |
                last(/x5.hw.gigabyte.server/x5.hw.redfish.network.adapter.state[{#ID}]) = 99
                and
                min(/x5.hw.gigabyte.server/x5.hw.common.power.state,15m) = 1
              name: 'Network adapter ({#ID}): State is unknown'
              opdata: '{ITEM.LASTVALUE1}'
              priority: AVERAGE
              manual_close: 'YES'
          parameters:
            - name: id
              value: '{$REDFISH.SYSTEM.ID}'
            - name: password
              value: '{$X5.API.PASSWORD}'
            - name: url
              value: '{$REDFISH.PROT}://{HOST.CONN}:{$REDFISH.PORT}'
            - name: username
              value: '{$X5.API.USERNAME}'
          preprocessing:
            - type: CHECK_JSON_ERROR
              parameters:
                - $.error
        - uuid: 0e2b1ebb469b48af92d88e638bd4f492
          name: 'Network port'
          type: SCRIPT
          key: x5.hw.redfish.network.port.discovery
          delay: 1h
          params: |
            function request(url) {
                api_request = new HttpRequest();
                api_request.addHeader('Accept: application/json');
                api_request.addHeader('Authorization: Basic ' + btoa(params.username + ':' + params.password));
                api_request.addHeader('Content-type: application/json');
                Zabbix.log(4, '[API: ' + params.url + '] Sending request');
                try {
                    response = api_request.get(url);
                } catch (error) {
                    Zabbix.log(3, '[API: ' + params.url + '] Request returned error: ' + error);
                    throw 'Get request returned error ' + error;
                }
                Zabbix.log(4, '[API: ' + params.url + '] Received response with status code ' + api_request.getStatus() + '\n' + response);
                if (api_request.getStatus() !== 200) {
                    var message = 'Request failed with status code ' + api_request.getStatus();
                    if (response !== null) {
                        if (typeof response.message === 'string') {
                            message += ': ' + response.message;
                        }
                    }
                    throw message + ' Check debug log for more information.';
                }
                if (response !== null) {
                    try {
                        response = JSON.parse(response);
                    }
                    catch (error) {
                        Zabbix.log(3, '[API: ' + params.url + '] Failed to parse response: ' + response);
                        response = null;
                    }
                }
                return response;
            }
            var params = JSON.parse(value);
            var result = [];
            response = request(params.url + '/redfish/v1/Systems/' + params.id + '/NetworkAdapters');
            if (response.Members instanceof Array) {
                response.Members.forEach(function (member) {
                    if (typeof member["@odata.id"] === 'string') {
                        response = request(params.url + member["@odata.id"] + '/NetworkPorts');
                        if (response.Members instanceof Array) {
                            response.Members.forEach(function (port) {
                                if (typeof port["@odata.id"] === 'string') {
                                    result.push({
                                        '{#ODATA}': port["@odata.id"],
                                        '{#ID}': port["@odata.id"].match(/([\w\.\-\_\:]+)[\/]*$/)[1]
                                    });
                                }
                            });
                        }
                    }
                });
            }
            return JSON.stringify(result);
          lifetime: 30d
          item_prototypes:
            - uuid: 6095ed5a9b3b4468b69e377b6cc29b32
              name: 'Network port ({#ID}): Network address'
              type: DEPENDENT
              key: 'x5.hw.redfish.network.port.address[{#ID}]'
              delay: '0'
              history: 90d
              value_type: CHAR
              trends: '0'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.AssociatedNetworkAddresses.first()
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3d
              master_item:
                key: 'x5.hw.redfish.network.port[{#ID}]'
              tags:
                - tag: Network
                  value: Inventory
            - uuid: 5357fa3c98d8486cb4dce71a12fe8008
              name: 'Network port ({#ID}): Health'
              type: DEPENDENT
              key: 'x5.hw.redfish.network.port.health[{#ID}]'
              delay: '0'
              history: 90d
              valuemap:
                name: 'Redfish (enum): Health'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.Status.Health
                  error_handler: DISCARD_VALUE
                - type: NOT_MATCHES_REGEX
                  parameters:
                    - 'null'
                  error_handler: DISCARD_VALUE
                - type: JAVASCRIPT
                  parameters:
                    - |
                      // Redfish (enum): Health    
                      switch(value) {
                          case 'OK':              return 0;
                          case 'Warning':         return 1;
                          case 'Critical':        return 2;
                          default:                return value + " not supported";
                      }
              master_item:
                key: 'x5.hw.redfish.network.port[{#ID}]'
              tags:
                - tag: Network
                  value: Availability
              trigger_prototypes:
                - uuid: f16ef12e2f544170938df88504359f44
                  expression: 'last(/x5.hw.gigabyte.server/x5.hw.redfish.network.port.health[{#ID}]) = 2'
                  name: 'Network port ({#ID}): Health is in critical state'
                  priority: AVERAGE
                  manual_close: 'YES'
                - uuid: 3f4efda1cc4448b9858416a2ed01a66e
                  expression: 'last(/x5.hw.gigabyte.server/x5.hw.redfish.network.port.health[{#ID}]) = 1'
                  name: 'Network port ({#ID}): Health is in warning state'
                  priority: WARNING
                  manual_close: 'YES'
            - uuid: b4fd6d91553b4be08c833c5077f496a1
              name: 'Network port ({#ID}): ID'
              type: DEPENDENT
              key: 'x5.hw.redfish.network.port.id[{#ID}]'
              delay: '0'
              history: 90d
              value_type: CHAR
              trends: '0'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.Id
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3d
              master_item:
                key: 'x5.hw.redfish.network.port[{#ID}]'
              tags:
                - tag: Network
                  value: Inventory
            - uuid: 77a93a7444fa424ab1b2530f2f1fe453
              name: 'Network port ({#ID}): State'
              type: DEPENDENT
              key: 'x5.hw.redfish.network.port.state[{#ID}]'
              delay: '0'
              history: 90d
              valuemap:
                name: 'Redfish (enum): State'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.Status.State
                  error_handler: DISCARD_VALUE
                - type: NOT_MATCHES_REGEX
                  parameters:
                    - 'null'
                  error_handler: DISCARD_VALUE
                - type: JAVASCRIPT
                  parameters:
                    - |
                      // Redfish (enum): State 
                      switch(value) {
                          case 'Disabled':            return 0;
                          case 'Enabled':             return 1;
                          case 'StandbyOffline':      return 2;
                          case 'StandbySpare':        return 3;
                          case 'InTest':              return 4;
                          case 'Starting':            return 5;
                          case 'Absent':              return 6;
                          case 'UnavailableOffline':  return 7;
                          case 'Deferring':           return 8;
                          case 'Quiesced':            return 9;
                          case 'Updating':            return 10;
                          case 'Qualified':           return 11;
                          case 'Unknown':             return 99;
                          default:                    return value + " not supported";
                      }
              master_item:
                key: 'x5.hw.redfish.network.port[{#ID}]'
              tags:
                - tag: Network
                  value: Availability
            - uuid: e392d1518c394f0ba8c8bd0f6802a5bf
              name: 'Network port ({#ID}): Link status'
              type: DEPENDENT
              key: 'x5.hw.redfish.network.port.status[{#ID}]'
              delay: '0'
              history: 90d
              valuemap:
                name: 'Redfish (enum): LinkStatus'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.LinkStatus
                  error_handler: DISCARD_VALUE
                - type: NOT_MATCHES_REGEX
                  parameters:
                    - 'null'
                  error_handler: DISCARD_VALUE
                - type: JAVASCRIPT
                  parameters:
                    - |
                      // Redfish (enum): LinkStatus  
                      switch(value) {
                          case 'Down':                return 0;
                          case 'Up':                  return 1;
                          default:                    return value + " not supported";
                      }
              master_item:
                key: 'x5.hw.redfish.network.port[{#ID}]'
              tags:
                - tag: Network
                  value: Availability
            - uuid: 3122eded497846ce9437b861a3847571
              name: 'Network port ({#ID}): Type'
              type: DEPENDENT
              key: 'x5.hw.redfish.network.port.type[{#ID}]'
              delay: '0'
              history: 90d
              value_type: CHAR
              trends: '0'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.ActiveLinkTechnology
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3d
              master_item:
                key: 'x5.hw.redfish.network.port[{#ID}]'
              tags:
                - tag: Network
                  value: Inventory
            - uuid: 0ca7cb7a4ef2410cb6c2ad6bf5cf7529
              name: '[API: Network port ({#ID})]'
              type: HTTP_AGENT
              key: 'x5.hw.redfish.network.port[{#ID}]'
              delay: 5m
              history: '0'
              value_type: TEXT
              trends: '0'
              authtype: BASIC
              username: '{$X5.API.USERNAME}'
              password: '{$X5.API.PASSWORD}'
              preprocessing:
                - type: CHECK_NOT_SUPPORTED
                  parameters:
                    - '-1'
                - type: CHECK_JSON_ERROR
                  parameters:
                    - $.error
              url: 'https://{HOST.CONN}:{$CONN.PORT}{#ODATA}'
              headers:
                - name: Content-type
                  value: application/json
              tags:
                - tag: Network
                  value: '[GET]'
          trigger_prototypes:
            - uuid: e4bd8766d5cd4eb29fe85a454428d990
              expression: |
                last(/x5.hw.gigabyte.server/x5.hw.redfish.network.port.state[{#ID}]) = 99
                and
                min(/x5.hw.gigabyte.server/x5.hw.common.power.state,15m) = 1
              name: 'Network port ({#ID}): State is unknown'
              opdata: '{ITEM.LASTVALUE1}'
              priority: AVERAGE
              manual_close: 'YES'
          parameters:
            - name: id
              value: '{$REDFISH.SYSTEM.ID}'
            - name: password
              value: '{$X5.API.PASSWORD}'
            - name: url
              value: '{$REDFISH.PROT}://{HOST.CONN}:{$REDFISH.PORT}'
            - name: username
              value: '{$X5.API.USERNAME}'
          preprocessing:
            - type: CHECK_JSON_ERROR
              parameters:
                - $.error
        - uuid: 974e51c1a12b43cd9764434036d8eef8
          name: PCIe
          type: DEPENDENT
          key: x5.hw.redfish.pcie.discovery
          delay: '0'
          lifetime: 30d
          item_prototypes:
            - uuid: f6855ff8ccda4340b910c38060ed7665
              name: 'PCIe ({#ID}): Health'
              type: DEPENDENT
              key: 'x5.hw.redfish.pcie.health[{#ID}]'
              delay: '0'
              history: 90d
              trends: '0'
              valuemap:
                name: 'Redfish (enum): Health'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.Status.Health
                  error_handler: DISCARD_VALUE
                - type: NOT_MATCHES_REGEX
                  parameters:
                    - 'null'
                  error_handler: DISCARD_VALUE
                - type: JAVASCRIPT
                  parameters:
                    - |
                      // Redfish (enum): Health    
                      switch(value) {
                          case 'OK':              return 0;
                          case 'Warning':         return 1;
                          case 'Critical':        return 2;
                          default:                return value + " not supported";
                      }
              master_item:
                key: 'x5.hw.redfish.pcie[{#ID}]'
              tags:
                - tag: PCIe
                  value: Availability
              trigger_prototypes:
                - uuid: a3fc246b0315418696fdd8ce6094fbf5
                  expression: 'last(/x5.hw.gigabyte.server/x5.hw.redfish.pcie.health[{#ID}]) = 2'
                  name: 'PCIe ({#ID}): Health is in critical state'
                  priority: AVERAGE
                  manual_close: 'YES'
                - uuid: 0c515500d40d4c9c8cc8c0532a74b94e
                  expression: 'last(/x5.hw.gigabyte.server/x5.hw.redfish.pcie.health[{#ID}]) = 1'
                  name: 'PCIe ({#ID}): Health is in warning state'
                  priority: WARNING
                  manual_close: 'YES'
            - uuid: 36341602b8c641dda21882c6e4040989
              name: 'PCIe ({#ID}): ID'
              type: DEPENDENT
              key: 'x5.hw.redfish.pcie.id[{#ID}]'
              delay: '0'
              history: 90d
              value_type: CHAR
              trends: '0'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.Id
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3d
              master_item:
                key: 'x5.hw.redfish.pcie[{#ID}]'
              tags:
                - tag: PCIe
                  value: Inventory
            - uuid: 3e439435cb404759b7af3593526003d3
              name: 'PCIe ({#ID}): Manufacturer'
              type: DEPENDENT
              key: 'x5.hw.redfish.pcie.manufacturer[{#ID}]'
              delay: '0'
              history: 90d
              value_type: CHAR
              trends: '0'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.Manufacturer
                  error_handler: DISCARD_VALUE
                - type: NOT_MATCHES_REGEX
                  parameters:
                    - 'null'
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3d
              master_item:
                key: 'x5.hw.redfish.pcie[{#ID}]'
              tags:
                - tag: PCIe
                  value: Inventory
            - uuid: 9748f72c330c4fce9fbc1dae42063e44
              name: 'PCIe ({#ID}): Model'
              type: DEPENDENT
              key: 'x5.hw.redfish.pcie.model[{#ID}]'
              delay: '0'
              history: 90d
              value_type: CHAR
              trends: '0'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.Model
                  error_handler: DISCARD_VALUE
                - type: NOT_MATCHES_REGEX
                  parameters:
                    - 'null'
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3d
              master_item:
                key: 'x5.hw.redfish.pcie[{#ID}]'
              tags:
                - tag: PCIe
                  value: Inventory
            - uuid: 31078879a87c4599b9aa88678af5c7f1
              name: 'PCIe ({#ID}): Name'
              type: DEPENDENT
              key: 'x5.hw.redfish.pcie.name[{#ID}]'
              delay: '0'
              history: 90d
              value_type: CHAR
              trends: '0'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.Name
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3d
              master_item:
                key: 'x5.hw.redfish.pcie[{#ID}]'
              tags:
                - tag: PCIe
                  value: Inventory
            - uuid: 179a629c1f4b4ce182913f7ed6dce85d
              name: 'PCIe ({#ID}): Part number'
              type: DEPENDENT
              key: 'x5.hw.redfish.pcie.part[{#ID}]'
              delay: '0'
              history: 90d
              value_type: CHAR
              trends: '0'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.PartNumber
                  error_handler: DISCARD_VALUE
                - type: NOT_MATCHES_REGEX
                  parameters:
                    - 'null'
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3d
              master_item:
                key: 'x5.hw.redfish.pcie[{#ID}]'
              tags:
                - tag: PCIe
                  value: Inventory
            - uuid: 608415045c7446fc990aeaab00cf3e8e
              name: 'PCIe ({#ID}): Serial number'
              type: DEPENDENT
              key: 'x5.hw.redfish.pcie.serial[{#ID}]'
              delay: '0'
              history: 90d
              value_type: CHAR
              trends: '0'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.SerialNumber
                  error_handler: DISCARD_VALUE
                - type: NOT_MATCHES_REGEX
                  parameters:
                    - 'null'
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3d
              master_item:
                key: 'x5.hw.redfish.pcie[{#ID}]'
              tags:
                - tag: PCIe
                  value: Inventory
            - uuid: 3a9939788edf4952b383d15d54d60d7c
              name: 'PCIe ({#ID}): SKU'
              type: DEPENDENT
              key: 'x5.hw.redfish.pcie.sku[{#ID}]'
              delay: '0'
              history: 90d
              value_type: CHAR
              trends: '0'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.SKU
                  error_handler: DISCARD_VALUE
                - type: NOT_MATCHES_REGEX
                  parameters:
                    - 'null'
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3d
              master_item:
                key: 'x5.hw.redfish.pcie[{#ID}]'
              tags:
                - tag: PCIe
                  value: Inventory
            - uuid: 8e3719fff6bd475a9be8203936308a20
              name: 'PCIe ({#ID}): State'
              type: DEPENDENT
              key: 'x5.hw.redfish.pcie.state[{#ID}]'
              delay: '0'
              history: 90d
              trends: '0'
              valuemap:
                name: 'Redfish (enum): State'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.Status.State
                  error_handler: DISCARD_VALUE
                - type: NOT_MATCHES_REGEX
                  parameters:
                    - 'null'
                  error_handler: DISCARD_VALUE
                - type: JAVASCRIPT
                  parameters:
                    - |
                      // Redfish (enum): State 
                      switch(value) {
                          case 'Disabled':            return 0;
                          case 'Enabled':             return 1;
                          case 'StandbyOffline':      return 2;
                          case 'StandbySpare':        return 3;
                          case 'InTest':              return 4;
                          case 'Starting':            return 5;
                          case 'Absent':              return 6;
                          case 'UnavailableOffline':  return 7;
                          case 'Deferring':           return 8;
                          case 'Quiesced':            return 9;
                          case 'Updating':            return 10;
                          case 'Qualified':           return 11;
                          case 'Unknown':             return 99;
                          default:                    return value + " not supported";
                      }
              master_item:
                key: 'x5.hw.redfish.pcie[{#ID}]'
              tags:
                - tag: PCIe
                  value: Availability
            - uuid: c4ca96b87740433e8e9e49ede6c616fe
              name: '[API: PCIe ({#ID})]'
              type: HTTP_AGENT
              key: 'x5.hw.redfish.pcie[{#ID}]'
              history: '0'
              value_type: TEXT
              trends: '0'
              authtype: BASIC
              username: '{$X5.API.USERNAME}'
              password: '{$X5.API.PASSWORD}'
              preprocessing:
                - type: CHECK_JSON_ERROR
                  parameters:
                    - $.error
              url: '{$REDFISH.PROT}://{HOST.CONN}:{$REDFISH.PORT}{#ODATA}'
              tags:
                - tag: PCIe
                  value: '[GET]'
          trigger_prototypes:
            - uuid: 2a51f530c26a4cee9fa06f42370c13a2
              expression: |
                last(/x5.hw.gigabyte.server/x5.hw.redfish.pcie.state[{#ID}]) = 99
                and
                min(/x5.hw.gigabyte.server/x5.hw.common.power.state,15m) = 1
              name: 'PCIe ({#ID}): State is unknown'
              opdata: '{ITEM.LASTVALUE1}'
              priority: AVERAGE
              manual_close: 'YES'
          master_item:
            key: x5.hw.redfish.systems
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$.PCIeDevices.[*]'
            - type: JAVASCRIPT
              parameters:
                - |
                  var input = JSON.parse(value);
                  var result = [];
                  if (input instanceof Array) {
                      input.forEach(function (member) {
                          if (typeof member["@odata.id"] === 'string') {
                  	        result.push({
                  	            '{#ODATA}': member["@odata.id"],
                  	            '{#ID}': member["@odata.id"].match(/([\w\.\-\_\:]+)[\/]*$/)[1]
                  	        });
                          }
                      });
                  }
                  return JSON.stringify(result);
        - uuid: 8cbccc0cd7254f0bb016149e629b91c4
          name: Processor
          type: SCRIPT
          key: x5.hw.redfish.processor.discovery
          delay: 1h
          params: |
            function request(url) {
                api_request = new HttpRequest();
                api_request.addHeader('Accept: application/json');
                api_request.addHeader('Authorization: Basic ' + btoa(params.username + ':' + params.password));
                api_request.addHeader('Content-type: application/json');
                Zabbix.log(4, '[API: ' + params.url + '] Sending request');
                try {
                    response = api_request.get(url);
                } catch (error) {
                    Zabbix.log(3, '[API: ' + params.url + '] Request returned error: ' + error);
                    throw 'Get request returned error ' + error;
                }
                Zabbix.log(4, '[API: ' + params.url + '] Received response with status code ' + api_request.getStatus() + '\n' + response);
                if (api_request.getStatus() !== 200) {
                    var message = 'Request failed with status code ' + api_request.getStatus();
                    if (response !== null) {
                        if (typeof response.message === 'string') {
                            message += ': ' + response.message;
                        }
                    }
                    throw message + ' Check debug log for more information.';
                }
                if (response !== null) {
                    try {
                        response = JSON.parse(response);
                    }
                    catch (error) {
                        Zabbix.log(3, '[API: ' + params.url + '] Failed to parse response: ' + response);
                        response = null;
                    }
                }
                return response;
            }
            var params = JSON.parse(value);
            var result = [];
            response = request(params.url + '/redfish/v1/Systems/' + params.id + '/Processors');
            if (response.Members instanceof Array) {
                response.Members.forEach(function (member) {
                    if (typeof member["@odata.id"] === 'string') {
                        result.push({
                            '{#ODATA}': member["@odata.id"],
                            '{#ID}': member["@odata.id"].match(/([\w\.\-\_\:]+)[\/]*$/)[1]
                        });
                    }
                });
            }
            return JSON.stringify(result);
          lifetime: 30d
          item_prototypes:
            - uuid: 6ad335c1394c472f993207983a7b2fa8
              name: 'Processor ({#ID}): Total cores'
              type: DEPENDENT
              key: 'x5.hw.redfish.processor.cores[{#ID}]'
              delay: '0'
              history: 90d
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.TotalCores
                  error_handler: DISCARD_VALUE
              master_item:
                key: 'x5.hw.redfish.processor[{#ID}]'
              tags:
                - tag: Processor
                  value: Inventory
            - uuid: b37793bb65b8433c826f9873493a8ae1
              name: 'Processor ({#ID}): Health'
              type: DEPENDENT
              key: 'x5.hw.redfish.processor.health[{#ID}]'
              delay: '0'
              history: 90d
              valuemap:
                name: 'Redfish (enum): Health'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.Status.Health
                  error_handler: DISCARD_VALUE
                - type: NOT_MATCHES_REGEX
                  parameters:
                    - 'null'
                  error_handler: DISCARD_VALUE
                - type: JAVASCRIPT
                  parameters:
                    - |
                      // Redfish (enum): Health    
                      switch(value) {
                          case 'OK':              return 0;
                          case 'Warning':         return 1;
                          case 'Critical':        return 2;
                          default:                return value + " not supported";
                      }
              master_item:
                key: 'x5.hw.redfish.processor[{#ID}]'
              tags:
                - tag: Processor
                  value: Availability
              trigger_prototypes:
                - uuid: 3e3aa76e1ff640be88b2c41675c5f8c3
                  expression: 'last(/x5.hw.gigabyte.server/x5.hw.redfish.processor.health[{#ID}]) = 2'
                  name: 'Processor ({#ID}): Health is in critical state'
                  priority: AVERAGE
                  manual_close: 'YES'
                - uuid: c1d84955d6fb4735aa976502c75cc8a3
                  expression: 'last(/x5.hw.gigabyte.server/x5.hw.redfish.processor.health[{#ID}]) = 1'
                  name: 'Processor ({#ID}): Health is in warning state'
                  priority: WARNING
                  manual_close: 'YES'
            - uuid: a172bf1cb82f49c895e4d0ef37256010
              name: 'Processor ({#ID}): ID'
              type: DEPENDENT
              key: 'x5.hw.redfish.processor.id[{#ID}]'
              delay: '0'
              history: 90d
              value_type: CHAR
              trends: '0'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.Id
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3d
              master_item:
                key: 'x5.hw.redfish.processor[{#ID}]'
              tags:
                - tag: Processor
                  value: Inventory
            - uuid: 6502adbe156340ef8fdeba07cb1573df
              name: 'Processor ({#ID}): Manufacturer'
              type: DEPENDENT
              key: 'x5.hw.redfish.processor.manufacturer[{#ID}]'
              delay: '0'
              history: 90d
              value_type: CHAR
              trends: '0'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.Manufacturer
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3d
              master_item:
                key: 'x5.hw.redfish.processor[{#ID}]'
              tags:
                - tag: Processor
                  value: Inventory
            - uuid: 387bce2254ae48438f19dd4823a08503
              name: 'Processor ({#ID}): Model'
              type: DEPENDENT
              key: 'x5.hw.redfish.processor.model[{#ID}]'
              delay: '0'
              history: 90d
              value_type: CHAR
              trends: '0'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.Model
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3d
              master_item:
                key: 'x5.hw.redfish.processor[{#ID}]'
              tags:
                - tag: Processor
                  value: Inventory
            - uuid: 967b4b3b079044e685e84341f57468a6
              name: 'Processor ({#ID}): Name'
              type: DEPENDENT
              key: 'x5.hw.redfish.processor.name[{#ID}]'
              delay: '0'
              history: 90d
              value_type: CHAR
              trends: '0'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.Name
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3d
              master_item:
                key: 'x5.hw.redfish.processor[{#ID}]'
              tags:
                - tag: Processor
                  value: Inventory
            - uuid: 96aea74e76904f7b8ee73a611e62c269
              name: 'Processor ({#ID}): Part number'
              type: DEPENDENT
              key: 'x5.hw.redfish.processor.part[{#ID}]'
              delay: '0'
              history: 90d
              value_type: CHAR
              trends: '0'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.PartNumber
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3d
              master_item:
                key: 'x5.hw.redfish.processor[{#ID}]'
              tags:
                - tag: Processor
                  value: Inventory
            - uuid: d90a8f9f5f474d05b5c96bfd3129f64b
              name: 'Processor ({#ID}): Serial number'
              type: DEPENDENT
              key: 'x5.hw.redfish.processor.serial[{#ID}]'
              delay: '0'
              history: 90d
              value_type: CHAR
              trends: '0'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.SerialNumber
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3d
              master_item:
                key: 'x5.hw.redfish.processor[{#ID}]'
              tags:
                - tag: Processor
                  value: Inventory
            - uuid: 3ca63619f21f42e8ad6fabf17ccc7565
              name: 'Processor ({#ID}): Socket'
              type: DEPENDENT
              key: 'x5.hw.redfish.processor.socket[{#ID}]'
              delay: '0'
              history: 90d
              value_type: CHAR
              trends: '0'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.Socket
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3d
              master_item:
                key: 'x5.hw.redfish.processor[{#ID}]'
              tags:
                - tag: Processor
                  value: Inventory
            - uuid: 5bed5429944c40e3aa013eb54d543f14
              name: 'Processor ({#ID}): State'
              type: DEPENDENT
              key: 'x5.hw.redfish.processor.state[{#ID}]'
              delay: '0'
              history: 90d
              valuemap:
                name: 'Redfish (enum): State'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.Status.State
                  error_handler: DISCARD_VALUE
                - type: NOT_MATCHES_REGEX
                  parameters:
                    - 'null'
                  error_handler: DISCARD_VALUE
                - type: JAVASCRIPT
                  parameters:
                    - |
                      // Redfish (enum): State 
                      switch(value) {
                          case 'Disabled':            return 0;
                          case 'Enabled':             return 1;
                          case 'StandbyOffline':      return 2;
                          case 'StandbySpare':        return 3;
                          case 'InTest':              return 4;
                          case 'Starting':            return 5;
                          case 'Absent':              return 6;
                          case 'UnavailableOffline':  return 7;
                          case 'Deferring':           return 8;
                          case 'Quiesced':            return 9;
                          case 'Updating':            return 10;
                          case 'Qualified':           return 11;
                          case 'Unknown':             return 99;
                          default:                    return value + " not supported";
                      }
              master_item:
                key: 'x5.hw.redfish.processor[{#ID}]'
              tags:
                - tag: Processor
                  value: Availability
            - uuid: ff5aa57120a24654b2a3c8c9e01aad81
              name: 'Processor ({#ID}): Total threads'
              type: DEPENDENT
              key: 'x5.hw.redfish.processor.threads[{#ID}]'
              delay: '0'
              history: 90d
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.TotalThreads
                  error_handler: DISCARD_VALUE
              master_item:
                key: 'x5.hw.redfish.processor[{#ID}]'
              tags:
                - tag: Processor
                  value: Inventory
            - uuid: a23b6856741b4aa8a875a37a48bfec37
              name: 'Processor ({#ID}): Type'
              type: DEPENDENT
              key: 'x5.hw.redfish.processor.type[{#ID}]'
              delay: '0'
              history: 90d
              value_type: CHAR
              trends: '0'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.ProcessorType
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3d
              master_item:
                key: 'x5.hw.redfish.processor[{#ID}]'
              tags:
                - tag: Processor
                  value: Inventory
            - uuid: 192dc2e764154c14a57461896183f927
              name: '[API: Processor ({#ID})]'
              type: HTTP_AGENT
              key: 'x5.hw.redfish.processor[{#ID}]'
              delay: 5m
              history: '0'
              value_type: TEXT
              trends: '0'
              authtype: BASIC
              username: '{$X5.API.USERNAME}'
              password: '{$X5.API.PASSWORD}'
              preprocessing:
                - type: CHECK_NOT_SUPPORTED
                  parameters:
                    - '-1'
                - type: CHECK_JSON_ERROR
                  parameters:
                    - $.error
              timeout: 30s
              url: 'https://{HOST.CONN}:{$CONN.PORT}{#ODATA}'
              headers:
                - name: Content-type
                  value: application/json
              tags:
                - tag: Processor
                  value: '[GET]'
          trigger_prototypes:
            - uuid: d43bd2475a5f42c39c6bf5e3deaac2f1
              expression: |
                last(/x5.hw.gigabyte.server/x5.hw.redfish.processor.state[{#ID}]) = 99
                and
                min(/x5.hw.gigabyte.server/x5.hw.common.power.state,15m) = 1
              name: 'Processor ({#ID}): State is unknown'
              opdata: '{ITEM.LASTVALUE1}'
              priority: AVERAGE
              manual_close: 'YES'
          parameters:
            - name: id
              value: '{$REDFISH.SYSTEM.ID}'
            - name: password
              value: '{$X5.API.PASSWORD}'
            - name: url
              value: '{$REDFISH.PROT}://{HOST.CONN}:{$REDFISH.PORT}'
            - name: username
              value: '{$X5.API.USERNAME}'
          preprocessing:
            - type: CHECK_JSON_ERROR
              parameters:
                - $.error
        - uuid: d9b18400cabd41899a37b718db5f89e5
          name: PSU
          type: DEPENDENT
          key: x5.hw.redfish.psu.discovery
          delay: '0'
          lifetime: 30d
          item_prototypes:
            - uuid: 1e9056a7257347cb83866e6d28a368fa
              name: 'PSU {#ID} ({#NAME}): Health'
              type: DEPENDENT
              key: 'x5.hw.redfish.psu.health[{#ID}]'
              delay: '0'
              history: 90d
              valuemap:
                name: 'Redfish (enum): Health'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.PowerSupplies.[?(@.[''Name'']== "{#NAME}")].[''Status''].[''Health''].first()'
                  error_handler: DISCARD_VALUE
                - type: NOT_MATCHES_REGEX
                  parameters:
                    - 'null'
                  error_handler: DISCARD_VALUE
                - type: JAVASCRIPT
                  parameters:
                    - |
                      // Redfish (enum): Health    
                      switch(value) {
                          case 'OK':              return 0;
                          case 'Warning':         return 1;
                          case 'Critical':        return 2;
                          default:                return value + " not supported";
                      }
              master_item:
                key: x5.hw.redfish.power
              tags:
                - tag: PSU
                  value: Availability
              trigger_prototypes:
                - uuid: e2ef98163807413c854d974d2620fae8
                  expression: 'last(/x5.hw.gigabyte.server/x5.hw.redfish.psu.health[{#ID}]) = 2'
                  name: 'PSU {#ID} ({#NAME}): Health is in critical state'
                  priority: AVERAGE
                  manual_close: 'YES'
                - uuid: 21598aadfc1c4e86ad0284f5060b39d7
                  expression: 'last(/x5.hw.gigabyte.server/x5.hw.redfish.psu.health[{#ID}]) = 1'
                  name: 'PSU {#ID} ({#NAME}): Health is in warning state'
                  priority: WARNING
                  manual_close: 'YES'
            - uuid: 0ecbf7bc3c42423d8816e02cf5cc2cec
              name: 'PSU {#ID} ({#NAME}): Part number'
              type: DEPENDENT
              key: 'x5.hw.redfish.psu.part[{#ID}]'
              delay: '0'
              history: 90d
              value_type: CHAR
              trends: '0'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.PowerSupplies.[?(@.[''Name'']== "{#NAME}")].[''PartNumber''].first()'
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3d
              master_item:
                key: x5.hw.redfish.power
              tags:
                - tag: PSU
                  value: Inventory
            - uuid: fd00807a5c5b41f4a1da0b289f45bb9d
              name: 'PSU {#ID} ({#NAME}): Serial number'
              type: DEPENDENT
              key: 'x5.hw.redfish.psu.serial[{#ID}]'
              delay: '0'
              history: 90d
              value_type: CHAR
              trends: '0'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.PowerSupplies.[?(@.[''Name'']== "{#NAME}")].[''SerialNumber''].first()'
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3d
              master_item:
                key: x5.hw.redfish.power
              tags:
                - tag: PSU
                  value: Inventory
            - uuid: fca1882522f442c784f7911ebe413888
              name: 'PSU {#ID} ({#NAME}): State'
              type: DEPENDENT
              key: 'x5.hw.redfish.psu.state[{#ID}]'
              delay: '0'
              history: 90d
              valuemap:
                name: 'Redfish (enum): State'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.PowerSupplies.[?(@.[''Name'']== "{#NAME}")].[''Status''].[''State''].first()'
                  error_handler: DISCARD_VALUE
                - type: NOT_MATCHES_REGEX
                  parameters:
                    - 'null'
                  error_handler: DISCARD_VALUE
                - type: JAVASCRIPT
                  parameters:
                    - |
                      // Redfish (enum): State 
                      switch(value) {
                          case 'Disabled':            return 0;
                          case 'Enabled':             return 1;
                          case 'StandbyOffline':      return 2;
                          case 'StandbySpare':        return 3;
                          case 'InTest':              return 4;
                          case 'Starting':            return 5;
                          case 'Absent':              return 6;
                          case 'UnavailableOffline':  return 7;
                          case 'Deferring':           return 8;
                          case 'Quiesced':            return 9;
                          case 'Updating':            return 10;
                          case 'Qualified':           return 11;
                          case 'Unknown':             return 99;
                          default:                    return value + " not supported";
                      }
              master_item:
                key: x5.hw.redfish.power
              tags:
                - tag: PSU
                  value: Availability
            - uuid: 89beab36ae024705bc8dac254753149d
              name: 'PSU {#ID} ({#NAME}): Utilization'
              type: DEPENDENT
              key: 'x5.hw.redfish.psu.utilization[{#ID}]'
              delay: '0'
              history: 90d
              value_type: FLOAT
              units: '%'
              description: 'Efficiency percent'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.PowerSupplies.[?(@.[''Name'']== "{#NAME}")].[''EfficiencyPercent''].first()'
                  error_handler: DISCARD_VALUE
              master_item:
                key: x5.hw.redfish.power
              tags:
                - tag: PSU
                  value: Utilization
            - uuid: bc71099aeb094c9db9ac292e1691a21c
              name: 'PSU {#ID} ({#NAME}): Voltage'
              type: DEPENDENT
              key: 'x5.hw.redfish.psu.voltage[{#ID}]'
              delay: '0'
              history: 90d
              units: V
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.PowerSupplies.[?(@.[''Name'']== "{#NAME}")].[''LineInputVoltage''].first()'
                  error_handler: DISCARD_VALUE
                - type: NOT_MATCHES_REGEX
                  parameters:
                    - 'null'
                  error_handler: DISCARD_VALUE
              master_item:
                key: x5.hw.redfish.power
              tags:
                - tag: PSU
                  value: Usage
          trigger_prototypes:
            - uuid: 1e87f8efd3f947c0ab7fa2f7fb76daec
              expression: |
                last(/x5.hw.gigabyte.server/x5.hw.redfish.psu.state[{#ID}]) = 99
                and
                min(/x5.hw.gigabyte.server/x5.hw.common.power.state,15m) = 1
              name: 'PSU {#ID} ({#NAME}): State is unknown'
              opdata: '{ITEM.LASTVALUE1}'
              priority: AVERAGE
              manual_close: 'YES'
          master_item:
            key: x5.hw.redfish.power
          lld_macro_paths:
            - lld_macro: '{#ID}'
              path: $.MemberId
            - lld_macro: '{#NAME}'
              path: $.Name
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$.PowerSupplies.[*]'
        - uuid: ba4166f6153e4586bbb489fb1c09ee5d
          name: Sensor
          type: DEPENDENT
          key: x5.hw.redfish.sensor.discovery
          delay: '0'
          lifetime: 30d
          item_prototypes:
            - uuid: 9a9c44e6f4054c37811898b08649faee
              name: 'Sensor {#ID} ({#NAME}): State'
              type: DEPENDENT
              key: 'x5.hw.redfish.sensor.state[{#ID}]'
              delay: '0'
              history: 90d
              valuemap:
                name: 'Redfish (enum): State'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.Temperatures.[?(@.[''MemberId'']=="{#ID}")].[''Status''].[''State''].first()'
                  error_handler: DISCARD_VALUE
                - type: NOT_MATCHES_REGEX
                  parameters:
                    - 'null'
                  error_handler: CUSTOM_VALUE
                  error_handler_params: Unknown
                - type: JAVASCRIPT
                  parameters:
                    - |
                      // Redfish (enum): State 
                      switch(value) {
                          case 'Disabled':            return 0;
                          case 'Enabled':             return 1;
                          case 'StandbyOffline':      return 2;
                          case 'StandbySpare':        return 3;
                          case 'InTest':              return 4;
                          case 'Starting':            return 5;
                          case 'Absent':              return 6;
                          case 'UnavailableOffline':  return 7;
                          case 'Deferring':           return 8;
                          case 'Quiesced':            return 9;
                          case 'Updating':            return 10;
                          case 'Qualified':           return 11;
                          case 'Unknown':             return 99;
                          default:                    return value + " not supported";
                      }
              master_item:
                key: x5.hw.redfish.thermal
              tags:
                - tag: Sensor
                  value: Availability
            - uuid: c020136040cc479e829bf77bca9853c8
              name: 'Sensor {#ID} ({#NAME}): Threshold (Critical)'
              type: DEPENDENT
              key: 'x5.hw.redfish.sensor.threshold.critical[{#ID}]'
              delay: '0'
              history: 90d
              value_type: FLOAT
              units: ℃
              valuemap:
                name: N/A
              preprocessing:
                - type: CHECK_NOT_SUPPORTED
                  parameters:
                    - '-1'
                - type: JSONPATH
                  parameters:
                    - '$.Temperatures.[?(@.[''MemberId'']=="{#ID}")].[''UpperThresholdCritical''].first()'
                  error_handler: DISCARD_VALUE
                - type: STR_REPLACE
                  parameters:
                    - 'null'
                    - '0'
              master_item:
                key: x5.hw.redfish.thermal
              tags:
                - tag: Sensor
                  value: Threshold
            - uuid: 27d78f9a2f8847418cd3a86a4ee5d32b
              name: 'Sensor {#ID} ({#NAME}): Threshold (Warning)'
              type: DEPENDENT
              key: 'x5.hw.redfish.sensor.threshold.warning[{#ID}]'
              delay: '0'
              history: 90d
              value_type: FLOAT
              units: ℃
              valuemap:
                name: N/A
              preprocessing:
                - type: CHECK_NOT_SUPPORTED
                  parameters:
                    - '-1'
                - type: JSONPATH
                  parameters:
                    - '$.Temperatures.[?(@.[''MemberId'']=="{#ID}")].[''UpperThresholdNonCritical''].first()'
                  error_handler: DISCARD_VALUE
                - type: STR_REPLACE
                  parameters:
                    - 'null'
                    - '0'
              master_item:
                key: x5.hw.redfish.thermal
              tags:
                - tag: Sensor
                  value: Threshold
            - uuid: 140d8d1d6a0d4b92baa5b121e8b25aa0
              name: 'Sensor {#ID} ({#NAME}): Value'
              type: DEPENDENT
              key: 'x5.hw.redfish.sensor.value[{#ID}]'
              delay: '0'
              history: 90d
              value_type: FLOAT
              units: ℃
              preprocessing:
                - type: CHECK_NOT_SUPPORTED
                  parameters:
                    - '-1'
                - type: JSONPATH
                  parameters:
                    - '$.Temperatures.[?(@.[''MemberId'']=="{#ID}")].[''ReadingCelsius''].first()'
                  error_handler: DISCARD_VALUE
              master_item:
                key: x5.hw.redfish.thermal
              tags:
                - tag: Sensor
                  value: Usage
          trigger_prototypes:
            - uuid: 11e3e500f1d44e4ebdec8500e2015580
              expression: |
                min(/x5.hw.gigabyte.server/x5.hw.redfish.sensor.state[{#ID}],15m) = 99
                and
                min(/x5.hw.gigabyte.server/x5.hw.common.power.state,15m) = 1
              name: 'Sensor {#ID} ({#NAME}): State is unknown'
              event_name: 'Sensor {#ID} ({#NAME}): State is unknown more than 15m'
              opdata: '{ITEM.LASTVALUE1}'
              priority: AVERAGE
              manual_close: 'YES'
            - uuid: d794f6ffb8204358b293b9d9e370a341
              expression: |
                min(/x5.hw.gigabyte.server/x5.hw.redfish.sensor.value[{#ID}],30m) >= last(/x5.hw.gigabyte.server/x5.hw.redfish.sensor.threshold.warning[{#ID}])
                and
                last(/x5.hw.gigabyte.server/x5.hw.redfish.sensor.threshold.warning[{#ID}]) > 0
              recovery_mode: RECOVERY_EXPRESSION
              recovery_expression: |
                max(/x5.hw.gigabyte.server/x5.hw.redfish.sensor.value[{#ID}],30m) < last(/x5.hw.gigabyte.server/x5.hw.redfish.sensor.threshold.warning[{#ID}])*0.9
                or
                last(/x5.hw.gigabyte.server/x5.hw.redfish.sensor.threshold.warning[{#ID}]) <= 0
              name: 'Sensor {#ID} ({#NAME}): Temperature is over information threshold'
              event_name: 'Sensor {#ID} ({#NAME}): Temperature is over {ITEM.LASTVALUE2} more than 30m'
              opdata: '{ITEM.LASTVALUE1}'
              priority: INFO
              manual_close: 'YES'
              dependencies:
                - name: 'Sensor {#ID} ({#NAME}): Temperature is over warning threshold'
                  expression: |
                    min(/x5.hw.gigabyte.server/x5.hw.redfish.sensor.value[{#ID}],30m) >= last(/x5.hw.gigabyte.server/x5.hw.redfish.sensor.threshold.critical[{#ID}])
                    and
                    last(/x5.hw.gigabyte.server/x5.hw.redfish.sensor.threshold.critical[{#ID}]) > 0
                  recovery_expression: |
                    max(/x5.hw.gigabyte.server/x5.hw.redfish.sensor.value[{#ID}],30m) < last(/x5.hw.gigabyte.server/x5.hw.redfish.sensor.threshold.critical[{#ID}])*0.9
                    or
                    last(/x5.hw.gigabyte.server/x5.hw.redfish.sensor.threshold.critical[{#ID}]) <= 0
            - uuid: d79d6e94d5c84e42a0f12974664b46a4
              expression: |
                min(/x5.hw.gigabyte.server/x5.hw.redfish.sensor.value[{#ID}],30m) >= last(/x5.hw.gigabyte.server/x5.hw.redfish.sensor.threshold.critical[{#ID}])
                and
                last(/x5.hw.gigabyte.server/x5.hw.redfish.sensor.threshold.critical[{#ID}]) > 0
              recovery_mode: RECOVERY_EXPRESSION
              recovery_expression: |
                max(/x5.hw.gigabyte.server/x5.hw.redfish.sensor.value[{#ID}],30m) < last(/x5.hw.gigabyte.server/x5.hw.redfish.sensor.threshold.critical[{#ID}])*0.9
                or
                last(/x5.hw.gigabyte.server/x5.hw.redfish.sensor.threshold.critical[{#ID}]) <= 0
              name: 'Sensor {#ID} ({#NAME}): Temperature is over warning threshold'
              event_name: 'Sensor {#ID} ({#NAME}): Temperature is over {ITEM.LASTVALUE2} more than 30m'
              opdata: '{ITEM.LASTVALUE1}'
              priority: WARNING
              manual_close: 'YES'
          master_item:
            key: x5.hw.redfish.thermal
          lld_macro_paths:
            - lld_macro: '{#ID}'
              path: $.MemberId
            - lld_macro: '{#NAME}'
              path: $.Name
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$.Temperatures.[*]'
        - uuid: 13af84fcb4a14ae3a6579bf7da6adc61
          name: 'Storage controller'
          type: SCRIPT
          key: x5.hw.redfish.storage.controller.discovery
          delay: 1h
          params: |
            function request(url) {
                api_request = new HttpRequest();
                api_request.addHeader('Accept: application/json');
                api_request.addHeader('Authorization: Basic ' + btoa(params.username + ':' + params.password));
                api_request.addHeader('Content-type: application/json');
                Zabbix.log(4, '[API: ' + params.url + '] Sending request');
                try {
                    response = api_request.get(url);
                } catch (error) {
                    Zabbix.log(3, '[API: ' + params.url + '] Request returned error: ' + error);
                    throw 'Get request returned error ' + error;
                }
                Zabbix.log(4, '[API: ' + params.url + '] Received response with status code ' + api_request.getStatus() + '\n' + response);
                if (api_request.getStatus() !== 200) {
                    var message = 'Request failed with status code ' + api_request.getStatus();
                    if (response !== null) {
                        if (typeof response.message === 'string') {
                            message += ': ' + response.message;
                        }
                    }
                    throw message + ' Check debug log for more information.';
                }
                if (response !== null) {
                    try {
                        response = JSON.parse(response);
                    }
                    catch (error) {
                        Zabbix.log(3, '[API: ' + params.url + '] Failed to parse response: ' + response);
                        response = null;
                    }
                }
                return response;
            }
            var params = JSON.parse(value);
            var result = [];
            response = request(params.url + '/redfish/v1/Systems/' + params.id + '/Storage');
            if (response.Members instanceof Array) {
                response.Members.forEach(function (member) {
                    if (typeof member["@odata.id"] === 'string') {
                        result.push({
                            '{#ODATA}': member["@odata.id"],
                            '{#ID}': member["@odata.id"].match(/([\w\.\-\_\:]+)[\/]*$/)[1]
                        });
                    }
                });
            }
            return JSON.stringify(result);
          lifetime: 30d
          item_prototypes:
            - uuid: 0298ed494e8444b8beca9a06f6473227
              name: 'Storage controller ({#ID}): Health'
              type: DEPENDENT
              key: 'x5.hw.redfish.storage.controller.health[{#ID}]'
              delay: '0'
              history: 90d
              trends: '0'
              valuemap:
                name: 'Redfish (enum): Health'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.Status.Health
                  error_handler: DISCARD_VALUE
                - type: NOT_MATCHES_REGEX
                  parameters:
                    - 'null'
                  error_handler: DISCARD_VALUE
                - type: JAVASCRIPT
                  parameters:
                    - |
                      // Redfish (enum): Health    
                      switch(value) {
                          case 'OK':              return 0;
                          case 'Warning':         return 1;
                          case 'Critical':        return 2;
                          default:                return value + " not supported";
                      }
              master_item:
                key: 'x5.hw.redfish.storage.controller[{#ID}]'
              tags:
                - tag: Storage
                  value: Availability
              trigger_prototypes:
                - uuid: 2991854a287240e5a42242448d281bbb
                  expression: 'last(/x5.hw.gigabyte.server/x5.hw.redfish.storage.controller.health[{#ID}]) = 2'
                  name: 'Storage controller ({#ID}): Health is in critical state'
                  priority: AVERAGE
                  manual_close: 'YES'
                - uuid: 774c6caa0df94b35a86713634a9e9a04
                  expression: 'last(/x5.hw.gigabyte.server/x5.hw.redfish.storage.controller.health[{#ID}]) = 1'
                  name: 'Storage controller ({#ID}): Health is in warning state'
                  priority: WARNING
                  manual_close: 'YES'
            - uuid: 57f6efd9e3174d8cbc0c4b2192cfe502
              name: 'Storage controller ({#ID}): ID'
              type: DEPENDENT
              key: 'x5.hw.redfish.storage.controller.id[{#ID}]'
              delay: '0'
              history: 90d
              value_type: CHAR
              trends: '0'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.Id
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3d
              master_item:
                key: 'x5.hw.redfish.storage.controller[{#ID}]'
              tags:
                - tag: Storage
                  value: Inventory
            - uuid: f39dcf6023564fa398da6618c79e39d4
              name: 'Storage controller ({#ID}): Manufacturer'
              type: DEPENDENT
              key: 'x5.hw.redfish.storage.controller.manufacturer[{#ID}]'
              delay: '0'
              history: 90d
              value_type: CHAR
              trends: '0'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.StorageControllers[0].Manufacturer'
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3d
              master_item:
                key: 'x5.hw.redfish.storage.controller[{#ID}]'
              tags:
                - tag: Storage
                  value: Inventory
            - uuid: 72bb1fff77ad48d69632d99876e65f71
              name: 'Storage controller ({#ID}): Model'
              type: DEPENDENT
              key: 'x5.hw.redfish.storage.controller.model[{#ID}]'
              delay: '0'
              history: 90d
              value_type: CHAR
              trends: '0'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.StorageControllers[0].Model'
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3d
              master_item:
                key: 'x5.hw.redfish.storage.controller[{#ID}]'
              tags:
                - tag: Storage
                  value: Inventory
            - uuid: 26086a81c17546c6ba6dbe90e770cef6
              name: 'Storage controller ({#ID}): Name'
              type: DEPENDENT
              key: 'x5.hw.redfish.storage.controller.name[{#ID}]'
              delay: '0'
              history: 90d
              value_type: CHAR
              trends: '0'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.Name
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3d
              master_item:
                key: 'x5.hw.redfish.storage.controller[{#ID}]'
              tags:
                - tag: Storage
                  value: Inventory
            - uuid: 07340c0dc2714414b4d74c5ac37951a3
              name: 'Storage controller ({#ID}): State'
              type: DEPENDENT
              key: 'x5.hw.redfish.storage.controller.state[{#ID}]'
              delay: '0'
              history: 90d
              trends: '0'
              valuemap:
                name: 'Redfish (enum): State'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.Status.State
                  error_handler: DISCARD_VALUE
                - type: JAVASCRIPT
                  parameters:
                    - |
                      // Redfish (enum): State 
                      switch(value) {
                          case 'Disabled':            return 0;
                          case 'Enabled':             return 1;
                          case 'StandbyOffline':      return 2;
                          case 'StandbySpare':        return 3;
                          case 'InTest':              return 4;
                          case 'Starting':            return 5;
                          case 'Absent':              return 6;
                          case 'UnavailableOffline':  return 7;
                          case 'Deferring':           return 8;
                          case 'Quiesced':            return 9;
                          case 'Updating':            return 10;
                          case 'Qualified':           return 11;
                          case 'Unknown':             return 99;
                          default:                    return value + " not supported";
                      }
              master_item:
                key: 'x5.hw.redfish.storage.controller[{#ID}]'
              tags:
                - tag: Storage
                  value: Availability
            - uuid: 3a1d2a3cfa0b4c88b82861be71c4c88f
              name: '[API: Storage controller ({#ID})]'
              type: HTTP_AGENT
              key: 'x5.hw.redfish.storage.controller[{#ID}]'
              delay: 5m
              history: '0'
              value_type: TEXT
              trends: '0'
              authtype: BASIC
              username: '{$X5.API.USERNAME}'
              password: '{$X5.API.PASSWORD}'
              preprocessing:
                - type: CHECK_JSON_ERROR
                  parameters:
                    - $.error
              url: '{$REDFISH.PROT}://{HOST.CONN}:{$REDFISH.PORT}{#ODATA}'
              tags:
                - tag: Storage
                  value: '[GET]'
          trigger_prototypes:
            - uuid: 64c4ed07cafd4be6b7b348aede8c6963
              expression: |
                last(/x5.hw.gigabyte.server/x5.hw.redfish.storage.controller.state[{#ID}]) = 99
                and
                min(/x5.hw.gigabyte.server/x5.hw.common.power.state,15m) = 1
              name: 'Storage controller ({#ID}): State is unknown'
              opdata: '{ITEM.LASTVALUE1}'
              priority: AVERAGE
              manual_close: 'YES'
          parameters:
            - name: id
              value: '{$REDFISH.SYSTEM.ID}'
            - name: password
              value: '{$X5.API.PASSWORD}'
            - name: url
              value: '{$REDFISH.PROT}://{HOST.CONN}:{$REDFISH.PORT}'
            - name: username
              value: '{$X5.API.USERNAME}'
          preprocessing:
            - type: CHECK_JSON_ERROR
              parameters:
                - $.error
        - uuid: eb717b1e482248629376126054e9b5ba
          name: 'Storage disk'
          type: SCRIPT
          key: x5.hw.redfish.storage.disk.discovery
          delay: 1h
          params: |
            function request(url) {
                api_request = new HttpRequest();
                api_request.addHeader('Accept: application/json');
                api_request.addHeader('Authorization: Basic ' + btoa(params.username + ':' + params.password));
                api_request.addHeader('Content-type: application/json');
                Zabbix.log(4, '[API: ' + params.url + '] Sending request');
                try {
                    response = api_request.get(url);
                } catch (error) {
                    Zabbix.log(3, '[API: ' + params.url + '] Request returned error: ' + error);
                    throw 'Get request returned error ' + error;
                }
                Zabbix.log(4, '[API: ' + params.url + '] Received response with status code ' + api_request.getStatus() + '\n' + response);
                if (api_request.getStatus() !== 200) {
                    var message = 'Request failed with status code ' + api_request.getStatus();
                    if (response !== null) {
                        if (typeof response.message === 'string') {
                            message += ': ' + response.message;
                        }
                    }
                    throw message + ' Check debug log for more information.';
                }
                if (response !== null) {
                    try {
                        response = JSON.parse(response);
                    }
                    catch (error) {
                        Zabbix.log(3, '[API: ' + params.url + '] Failed to parse response: ' + response);
                        response = null;
                    }
                }
                return response;
            }
            var params = JSON.parse(value);
            var result = [];
            response = request(params.url + '/redfish/v1/Systems/' + params.id + '/Storage');
            if (response.Members instanceof Array) {
                response.Members.forEach(function (member) {
                    if (typeof member["@odata.id"] === 'string') {
                        response = request(params.url + member["@odata.id"]);
                        if (response.Drives instanceof Array) {
                            response.Drives.forEach(function (drive) {
                                if (typeof drive["@odata.id"] === 'string') {
                                    result.push({
                                        '{#ODATA}': drive["@odata.id"],
                                        '{#ID}': drive["@odata.id"].match(/([\w\.\-\_\:]+)[\/]*$/)[1]
                                    });
                                }
                            });
                        }
                    }
                });
            }
            return JSON.stringify(result);
          lifetime: 30d
          item_prototypes:
            - uuid: ebfc0ab4956340319bda69fc5a6a32ae
              name: 'Storage disk ({#ID}): Capacity'
              type: DEPENDENT
              key: 'x5.hw.redfish.storage.disk.capacity[{#ID}]'
              delay: '0'
              history: 90d
              units: B
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.CapacityBytes
                  error_handler: DISCARD_VALUE
                - type: NOT_MATCHES_REGEX
                  parameters:
                    - 'null'
              master_item:
                key: 'x5.hw.redfish.storage.disk[{#ID}]'
              tags:
                - tag: Storage
                  value: Inventory
            - uuid: b5b7ee788e584d7180fd79af20aa4e3b
              name: 'Storage disk ({#ID}): Health'
              type: DEPENDENT
              key: 'x5.hw.redfish.storage.disk.health[{#ID}]'
              delay: '0'
              history: 90d
              valuemap:
                name: 'Redfish (enum): Health'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.Status.Health
                  error_handler: DISCARD_VALUE
                - type: NOT_MATCHES_REGEX
                  parameters:
                    - 'null'
                  error_handler: DISCARD_VALUE
                - type: JAVASCRIPT
                  parameters:
                    - |
                      // Redfish (enum): Health    
                      switch(value) {
                          case 'OK':              return 0;
                          case 'Warning':         return 1;
                          case 'Critical':        return 2;
                          default:                return value + " not supported";
                      }
              master_item:
                key: 'x5.hw.redfish.storage.disk[{#ID}]'
              tags:
                - tag: Storage
                  value: Availability
              trigger_prototypes:
                - uuid: a10f6e7b0d334e15b44cf26ab50fcfbc
                  expression: 'last(/x5.hw.gigabyte.server/x5.hw.redfish.storage.disk.health[{#ID}]) = 2'
                  name: 'Storage disk ({#ID}): Health is in critical state'
                  priority: AVERAGE
                - uuid: 7d24b77eabfe4b478d0b49798062dd47
                  expression: 'last(/x5.hw.gigabyte.server/x5.hw.redfish.storage.disk.health[{#ID}]) = 1'
                  name: 'Storage disk ({#ID}): Health is in warning state'
                  priority: WARNING
            - uuid: f2eaa7d4ec8d4a75974a447222a63c84
              name: 'Storage disk ({#ID}): ID'
              type: DEPENDENT
              key: 'x5.hw.redfish.storage.disk.id[{#ID}]'
              delay: '0'
              history: 90d
              value_type: CHAR
              trends: '0'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.Id
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3d
              master_item:
                key: 'x5.hw.redfish.storage.disk[{#ID}]'
              tags:
                - tag: Storage
                  value: Inventory
            - uuid: 2c663f8da0ed47f69e8029e39c13c7fe
              name: 'Storage disk ({#ID}): Lifetime'
              type: DEPENDENT
              key: 'x5.hw.redfish.storage.disk.lifetime[{#ID}]'
              delay: '0'
              history: 90d
              units: '%'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.PredictedMediaLifeLeftPercent
                  error_handler: DISCARD_VALUE
                - type: NOT_MATCHES_REGEX
                  parameters:
                    - 'null'
                  error_handler: DISCARD_VALUE
              master_item:
                key: 'x5.hw.redfish.storage.disk[{#ID}]'
              tags:
                - tag: Storage
                  value: Usage
            - uuid: 465759de4880441ebd178715601cc6e8
              name: 'Storage disk ({#ID}): Manufacturer'
              type: DEPENDENT
              key: 'x5.hw.redfish.storage.disk.manufacturer[{#ID}]'
              delay: '0'
              history: 90d
              value_type: CHAR
              trends: '0'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.Manufacturer
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3d
              master_item:
                key: 'x5.hw.redfish.storage.disk[{#ID}]'
              tags:
                - tag: Storage
                  value: Inventory
            - uuid: c4e7baf911cd468490c641a2eb92d91f
              name: 'Storage disk ({#ID}): Model'
              type: DEPENDENT
              key: 'x5.hw.redfish.storage.disk.model[{#ID}]'
              delay: '0'
              history: 90d
              value_type: CHAR
              trends: '0'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.Model
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3d
              master_item:
                key: 'x5.hw.redfish.storage.disk[{#ID}]'
              tags:
                - tag: Storage
                  value: Inventory
            - uuid: 059ef53ba17641dda959fd0de66a7216
              name: 'Storage disk ({#ID}): Name'
              type: DEPENDENT
              key: 'x5.hw.redfish.storage.disk.name[{#ID}]'
              delay: '0'
              history: 90d
              value_type: CHAR
              trends: '0'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.Name
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3d
              master_item:
                key: 'x5.hw.redfish.storage.disk[{#ID}]'
              tags:
                - tag: Storage
                  value: Inventory
            - uuid: f00d0f38e65f4df1a1cbc4f5327c2767
              name: 'Storage disk ({#ID}): Part number'
              type: DEPENDENT
              key: 'x5.hw.redfish.storage.disk.part[{#ID}]'
              delay: '0'
              history: 90d
              value_type: CHAR
              trends: '0'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.PartNumber
                  error_handler: DISCARD_VALUE
                - type: MATCHES_REGEX
                  parameters:
                    - 'null'
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3d
              master_item:
                key: 'x5.hw.redfish.storage.disk[{#ID}]'
              tags:
                - tag: Storage
                  value: Inventory
            - uuid: f1e03d1b324048438dcddad95c307467
              name: 'Storage disk ({#ID}): Serial number'
              type: DEPENDENT
              key: 'x5.hw.redfish.storage.disk.serial[{#ID}]'
              delay: '0'
              history: 90d
              value_type: CHAR
              trends: '0'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.SerialNumber
                  error_handler: DISCARD_VALUE
                - type: MATCHES_REGEX
                  parameters:
                    - 'null'
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3d
              master_item:
                key: 'x5.hw.redfish.storage.disk[{#ID}]'
              tags:
                - tag: Storage
                  value: Inventory
            - uuid: 47076cefe6fe42cfbcf30981ed6c1f90
              name: 'Storage disk ({#ID}): State'
              type: DEPENDENT
              key: 'x5.hw.redfish.storage.disk.state[{#ID}]'
              delay: '0'
              history: 90d
              valuemap:
                name: 'Redfish (enum): State'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.Status.State
                  error_handler: DISCARD_VALUE
                - type: JAVASCRIPT
                  parameters:
                    - |
                      // Redfish (enum): State 
                      switch(value) {
                          case 'Disabled':            return 0;
                          case 'Enabled':             return 1;
                          case 'StandbyOffline':      return 2;
                          case 'StandbySpare':        return 3;
                          case 'InTest':              return 4;
                          case 'Starting':            return 5;
                          case 'Absent':              return 6;
                          case 'UnavailableOffline':  return 7;
                          case 'Deferring':           return 8;
                          case 'Quiesced':            return 9;
                          case 'Updating':            return 10;
                          case 'Qualified':           return 11;
                          case 'Unknown':             return 99;
                          default:                    return value + " not supported";
                      }
              master_item:
                key: 'x5.hw.redfish.storage.disk[{#ID}]'
              tags:
                - tag: Storage
                  value: Availability
            - uuid: a4a2d31ded2b4772a93863820974a1b1
              name: '[API: Storage disk ({#ID})]'
              type: HTTP_AGENT
              key: 'x5.hw.redfish.storage.disk[{#ID}]'
              delay: 5m
              history: '0'
              value_type: TEXT
              trends: '0'
              authtype: BASIC
              username: '{$X5.API.USERNAME}'
              password: '{$X5.API.PASSWORD}'
              preprocessing:
                - type: CHECK_JSON_ERROR
                  parameters:
                    - $.error
              url: '{$REDFISH.PROT}://{HOST.CONN}:{$REDFISH.PORT}{#ODATA}'
              headers:
                - name: Content-type
                  value: application/json
              tags:
                - tag: Storage
                  value: '[GET]'
          trigger_prototypes:
            - uuid: aab049b9383e4b3f8b076a8dca50dd37
              expression: |
                last(/x5.hw.gigabyte.server/x5.hw.redfish.storage.disk.state[{#ID}]) = 99
                and
                min(/x5.hw.gigabyte.server/x5.hw.common.power.state,15m) = 1
              name: 'Storage disk ({#ID}): State is unknown'
              opdata: '{ITEM.LASTVALUE1}'
              priority: AVERAGE
          parameters:
            - name: id
              value: '{$REDFISH.SYSTEM.ID}'
            - name: password
              value: '{$X5.API.PASSWORD}'
            - name: url
              value: '{$REDFISH.PROT}://{HOST.CONN}:{$REDFISH.PORT}'
            - name: username
              value: '{$X5.API.USERNAME}'
          preprocessing:
            - type: CHECK_JSON_ERROR
              parameters:
                - $.error
      tags:
        - tag: Model
          value: Server
        - tag: Type
          value: Server
        - tag: Vendor
          value: Gigabyte
      macros:
        - macro: '{$CONN.PORT}'
          value: '443'
        - macro: '{$FAN.MAX}'
          value: '20000'
        - macro: '{$HEALTH.TIMEOUT}'
          value: 10m
        - macro: '{$REDFISH.CHASSIS.ID}'
          value: Self
        - macro: '{$REDFISH.MANAGER.ID}'
          value: Self
        - macro: '{$REDFISH.PORT}'
          value: '443'
        - macro: '{$REDFISH.PROT}'
          value: https
        - macro: '{$REDFISH.SYSTEM.ID}'
          value: Self
        - macro: '{$VOLTAGE.3V3.HIGH}'
          value: '3.63'
        - macro: '{$VOLTAGE.3V3.LOW}'
          value: '2.97'
        - macro: '{$VOLTAGE.5V.HIGH}'
          value: '5.5'
        - macro: '{$VOLTAGE.5V.LOW}'
          value: '4.5'
        - macro: '{$VOLTAGE.12V.HIGH}'
          value: '13.2'
        - macro: '{$VOLTAGE.12V.LOW}'
          value: '10.8'
        - macro: '{$VOLTAGE.CMOS.LOW}'
          value: '2.7'
      valuemaps:
        - uuid: 32c5c324f5df477a91aace6c2359e2fe
          name: Availability
          mappings:
            - value: '1'
              newvalue: available
            - value: '0'
              newvalue: unavailable
            - type: DEFAULT
              newvalue: unknown
        - uuid: aac7ae82d6624c0aa2c8a110642d6f1e
          name: Boolean
          mappings:
            - value: '0'
              newvalue: 'false'
            - value: '1'
              newvalue: 'true'
            - type: DEFAULT
              newvalue: unknown
        - uuid: 10f8ed5c06c34ba8afd2cf065737c016
          name: N/A
          mappings:
            - value: '0'
              newvalue: N/A
        - uuid: 0894ccab74ca44279ee3137ee3899918
          name: 'Redfish (enum): Health'
          mappings:
            - value: '0'
              newvalue: OK
            - value: '1'
              newvalue: warning
            - value: '2'
              newvalue: critical
            - type: DEFAULT
              newvalue: unknown
        - uuid: 3806bfa3f9b2403bb1a6d787fe9f7e42
          name: 'Redfish (enum): IndicatorLED'
          mappings:
            - value: '0'
              newvalue: 'Off'
            - value: '1'
              newvalue: Lit
            - value: '2'
              newvalue: Blinking
        - uuid: e250c78134f64961ade7f4f66e204778
          name: 'Redfish (enum): LinkStatus'
          mappings:
            - value: '0'
              newvalue: Down
            - value: '1'
              newvalue: Up
            - type: DEFAULT
              newvalue: unknown
        - uuid: 1ca84ebc99a849d4bd29b2f713fe0c8b
          name: 'Redfish (enum): PowerState'
          mappings:
            - value: '0'
              newvalue: 'Off'
            - value: '1'
              newvalue: 'On'
            - value: '2'
              newvalue: Paused
            - value: '3'
              newvalue: PoweringOff
            - value: '4'
              newvalue: PoweringOn
            - type: DEFAULT
              newvalue: unknown
        - uuid: b5ad4079e3b64bc0b623123e499bdd58
          name: 'Redfish (enum): State'
          mappings:
            - value: '0'
              newvalue: Disabled
            - value: '1'
              newvalue: Enabled
            - value: '2'
              newvalue: StandbyOffline
            - value: '3'
              newvalue: StandbySpare
            - value: '4'
              newvalue: InTest
            - value: '5'
              newvalue: Starting
            - value: '6'
              newvalue: Absent
            - value: '7'
              newvalue: UnavailableOffline
            - value: '8'
              newvalue: Deferring
            - value: '9'
              newvalue: Quiesced
            - value: '10'
              newvalue: Updating
            - value: '11'
              newvalue: Qualified
            - value: '99'
              newvalue: Unknown
            - type: DEFAULT
              newvalue: unknown
