zabbix_export:
  version: '6.4'
  template_groups:
    - uuid: e960332b3f6c46a1956486d4f3f99fce
      name: 'Templates/Server hardware'
  templates:
    - uuid: 9f5f658638eb43af88ebf74ce8d2acf3
      template: 'Nvidia Multi-GPU'
      name: 'Nvidia Multi-GPU'
      groups:
        - name: 'Templates/Server hardware'
      items:
        - uuid: 6ca47609e7564842bb51f1818bdad56c
          name: 'GPU Count'
          type: DEPENDENT
          key: gpu.count
          delay: '0'
          history: 30d
          trends: 90d
          description: 'Number of GPUs detected'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[*].1.length()'
          master_item:
            key: gpu.discovery
        - uuid: 6a68154deed448699a39aa4b6e522cd7
          name: 'GPU Discovery'
          key: gpu.discovery
          delay: 5m
          history: '0'
          trends: '0'
          value_type: TEXT
          description: 'GPUs detection'
          preprocessing:
            - type: CHECK_NOT_SUPPORTED
              parameters:
                - ''
              error_handler: CUSTOM_VALUE
            - type: CSV_TO_JSON
              parameters:
                - ','
                - '"'
                - '0'
        - uuid: 59985a010958410699e80f3dc3f81069
          name: 'GPU Driver Version'
          type: DEPENDENT
          key: gpu.driver_version
          delay: '0'
          history: 30d
          trends: '0'
          value_type: TEXT
          description: 'GPU driver version'
          inventory_link: SOFTWARE
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[0].3'
              error_handler: CUSTOM_VALUE
              error_handler_params: Fault
          master_item:
            key: gpu.discovery
        - uuid: d6926fcc2b6449ada019f1b96ff8be8a
          name: 'GPU Power Total'
          type: CALCULATED
          key: gpu.power_total
          history: 30d
          trends: 90d
          value_type: FLOAT
          units: W
          params: 'sum(last_foreach(/*/gpu.power.[*]))'
          description: 'Power consumption of all GPUs'
          preprocessing:
            - type: CHECK_NOT_SUPPORTED
              parameters:
                - ''
              error_handler: CUSTOM_VALUE
              error_handler_params: '0'
        - uuid: 5fb5abcae9e04feeb5651ce367d577b6
          name: 'GPUs Maximum Temperature'
          type: CALCULATED
          key: gpu.temp_max
          history: 30d
          trends: 90d
          units: °C
          params: 'max(last_foreach(/*/gpu.temperature.[*]))'
          description: 'Temperature of the hottest GPU'
          preprocessing:
            - type: CHECK_NOT_SUPPORTED
              parameters:
                - ''
              error_handler: CUSTOM_VALUE
              error_handler_params: '0'
        - uuid: 4f63285a711045eab4d62c46127cc1da
          name: 'GPU Utilization Total'
          type: CALCULATED
          key: gpu.utilization_total
          history: 30d
          trends: 90d
          value_type: FLOAT
          units: '%'
          params: 'avg(last_foreach(/*/gpu.utilization.[*]))'
          description: 'Total GPU utilisation'
          preprocessing:
            - type: CHECK_NOT_SUPPORTED
              parameters:
                - ''
              error_handler: CUSTOM_VALUE
              error_handler_params: '0'
      discovery_rules:
        - uuid: 10011d82dcad4162b7ca36a66dd4d618
          name: 'GPU Card'
          type: DEPENDENT
          key: gpu.id
          delay: '0'
          lifetime: 1d
          item_prototypes:
            - uuid: 082be4addefa43e98ded2ab15be17d38
              name: 'GPU {#GPUID} Data'
              key: 'gpu.card[{#GPUID}]'
              history: '0'
              trends: '0'
              value_type: TEXT
              description: 'GPU Data Collection'
              preprocessing:
                - type: CHECK_NOT_SUPPORTED
                  parameters:
                    - ''
                  error_handler: CUSTOM_VALUE
                - type: CSV_TO_JSON
                  parameters:
                    - ''
                    - ''
                    - '0'
            - uuid: 4a2648721a0048c7a900f7a8f499d589
              name: 'GPU {#GPUID} Fan Speed - {#NAME}'
              type: DEPENDENT
              key: 'gpu.fan.[{#GPUID}]'
              delay: '0'
              history: 30d
              trends: 90d
              units: '%'
              description: 'GPU Fan Speed (%)'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$[0].4'
              master_item:
                key: 'gpu.card[{#GPUID}]'
            - uuid: 5bb28babb98e4469bde899cb22977277
              name: 'GPU {#GPUID} Memory Total - {#NAME}'
              type: DEPENDENT
              key: 'gpu.mtotal.[{#GPUID}]'
              delay: '0'
              history: 30d
              trends: 90d
              units: B
              description: 'GPU memory capacity'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$[0].2'
                - type: MULTIPLIER
                  parameters:
                    - '1048576'
              master_item:
                key: 'gpu.card[{#GPUID}]'
            - uuid: da7fbbcfc1da46288b879640f49658ec
              name: 'GPU {#GPUID} Memory Used - {#NAME}'
              type: DEPENDENT
              key: 'gpu.mused.[{#GPUID}]'
              delay: '0'
              history: 30d
              trends: 90d
              units: B
              description: 'The amount of GPU memory used'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$[0].3'
                - type: MULTIPLIER
                  parameters:
                    - '1048576'
              master_item:
                key: 'gpu.card[{#GPUID}]'
            - uuid: 64e478f5ac654022bcd28b2ef4da208b
              name: 'GPU {#GPUID} Power - {#NAME}'
              type: DEPENDENT
              key: 'gpu.power.[{#GPUID}]'
              delay: '0'
              history: 30d
              trends: 90d
              value_type: FLOAT
              units: W
              description: 'Power consumption of the GPU'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$[0].6'
              master_item:
                key: 'gpu.card[{#GPUID}]'
            - uuid: f9d3d0b8811347ca8f415d08c48aa564
              name: 'GPU {#GPUID} Temperature - {#NAME}'
              type: DEPENDENT
              key: 'gpu.temperature.[{#GPUID}]'
              delay: '0'
              history: 30d
              trends: 90d
              value_type: FLOAT
              units: °C
              description: 'GPU Temperature'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$[0].1'
              master_item:
                key: 'gpu.card[{#GPUID}]'
              trigger_prototypes:
                - uuid: 7b25e87f388c41a5b3b9605cc02ac7fd
                  expression: 'last(/Nvidia Multi-GPU/gpu.temperature.[{#GPUID}])>=85'
                  name: 'GPU {#GPUID} Temperature is extremely high'
                  priority: HIGH
                  description: 'The temperature of the GPU is very high. Possibility of failure'
                - uuid: ffbe376213334c8f9bbbf3382b37e872
                  expression: 'last(/Nvidia Multi-GPU/gpu.temperature.[{#GPUID}])>=80'
                  name: 'GPU {#GPUID} Temperature is high'
                  priority: AVERAGE
                  description: 'Temperature of the graphics processor is high'
                  dependencies:
                    - name: 'GPU {#GPUID} Temperature is extremely high'
                      expression: 'last(/Nvidia Multi-GPU/gpu.temperature.[{#GPUID}])>=85'
            - uuid: 64b4543c0bcf4e08b3c7902e2952c011
              name: 'GPU {#GPUID} Utilization - {#NAME}'
              type: DEPENDENT
              key: 'gpu.utilization.[{#GPUID}]'
              delay: '0'
              history: 30d
              trends: 90d
              units: '%'
              description: 'GPU utilisation'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$[0].5'
              master_item:
                key: 'gpu.card[{#GPUID}]'
              trigger_prototypes:
                - uuid: 20784c31e14d40f6bf7903bba23e23e6
                  expression: 'nodata(/Nvidia Multi-GPU/gpu.utilization.[{#GPUID}],3m)=1'
                  name: 'Error receiving data for GPU {#GPUID}'
                  priority: DISASTER
                  description: |
                    Problem with data retrieval
                    To diagnose the problem, run the nvidia-smi command on the host
          trigger_prototypes:
            - uuid: c9adbd6229e34983809ba171bac5207a
              expression: 'last(/Nvidia Multi-GPU/gpu.fan.[{#GPUID}])=0 and last(/Nvidia Multi-GPU/gpu.temperature.[{#GPUID}])>70'
              name: 'GPU {#GPUID} Problem with the fan'
              priority: HIGH
              description: 'Fan does not spin when GPU is hot'
          graph_prototypes:
            - uuid: c497e77563f44ab5b96d541218081b21
              name: 'GPU {#GPUID} Load,Fan,Temp'
              show_work_period: 'NO'
              show_triggers: 'NO'
              ymin_type_1: FIXED
              ymax_type_1: FIXED
              graph_items:
                - drawtype: GRADIENT_LINE
                  color: 00A000
                  calc_fnc: MAX
                  item:
                    host: 'Nvidia Multi-GPU'
                    key: 'gpu.utilization.[{#GPUID}]'
                - sortorder: '1'
                  color: FF4000
                  calc_fnc: MAX
                  item:
                    host: 'Nvidia Multi-GPU'
                    key: 'gpu.temperature.[{#GPUID}]'
                - sortorder: '2'
                  color: 00BFFF
                  item:
                    host: 'Nvidia Multi-GPU'
                    key: 'gpu.fan.[{#GPUID}]'
            - uuid: 69931017386e4dc8b792fc4c877e60ef
              name: 'GPU {#GPUID} Memory'
              show_work_period: 'NO'
              show_triggers: 'NO'
              ymin_type_1: FIXED
              ymax_type_1: ITEM
              ymax_item_1:
                host: 'Nvidia Multi-GPU'
                key: 'gpu.mtotal.[{#GPUID}]'
              graph_items:
                - drawtype: FILLED_REGION
                  color: 199C0D
                  calc_fnc: MIN
                  item:
                    host: 'Nvidia Multi-GPU'
                    key: 'gpu.mtotal.[{#GPUID}]'
                - sortorder: '1'
                  drawtype: GRADIENT_LINE
                  color: F63100
                  calc_fnc: MAX
                  item:
                    host: 'Nvidia Multi-GPU'
                    key: 'gpu.mused.[{#GPUID}]'
          master_item:
            key: gpu.discovery
          lld_macro_paths:
            - lld_macro: '{#NAME}'
              path: $.2
            - lld_macro: '{#GPUID}'
              path: $.1
      tags:
        - tag: application
          value: nvidia
      dashboards:
        - uuid: f7a3512d10254206b41830ba4e683db6
          name: 'GPU Panel'
          pages:
            - name: GPU
              widgets:
                - type: item
                  x: '6'
                  width: '4'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: show
                      value: '1'
                    - type: INTEGER
                      name: show
                      value: '2'
                    - type: INTEGER
                      name: show
                      value: '4'
                    - type: INTEGER
                      name: adv_conf
                      value: '1'
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: INTEGER
                      name: value_size
                      value: '60'
                    - type: INTEGER
                      name: units_size
                      value: '60'
                    - type: STRING
                      name: thresholds.color.0
                      value: FFF59D
                    - type: STRING
                      name: thresholds.threshold.0
                      value: '50'
                    - type: STRING
                      name: thresholds.color.1
                      value: FFA726
                    - type: STRING
                      name: thresholds.threshold.1
                      value: '75'
                    - type: STRING
                      name: thresholds.color.2
                      value: D32F2F
                    - type: STRING
                      name: thresholds.threshold.2
                      value: '90'
                    - type: ITEM
                      name: itemid
                      value:
                        host: 'Nvidia Multi-GPU'
                        key: gpu.utilization_total
                - type: item
                  x: '10'
                  width: '5'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: show
                      value: '1'
                    - type: INTEGER
                      name: show
                      value: '2'
                    - type: INTEGER
                      name: show
                      value: '4'
                    - type: INTEGER
                      name: adv_conf
                      value: '1'
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: INTEGER
                      name: value_size
                      value: '60'
                    - type: INTEGER
                      name: units_size
                      value: '60'
                    - type: STRING
                      name: up_color
                      value: FF0000
                    - type: STRING
                      name: down_color
                      value: 00FF00
                    - type: STRING
                      name: updown_color
                      value: FFFF00
                    - type: STRING
                      name: description
                      value: 'The hottest GPU'
                    - type: STRING
                      name: thresholds.color.0
                      value: '909000'
                    - type: STRING
                      name: thresholds.threshold.0
                      value: '70'
                    - type: STRING
                      name: thresholds.color.1
                      value: A07000
                    - type: STRING
                      name: thresholds.threshold.1
                      value: '75'
                    - type: STRING
                      name: thresholds.color.2
                      value: A04000
                    - type: STRING
                      name: thresholds.threshold.2
                      value: '80'
                    - type: STRING
                      name: thresholds.color.3
                      value: A00000
                    - type: STRING
                      name: thresholds.threshold.3
                      value: '85'
                    - type: ITEM
                      name: itemid
                      value:
                        host: 'Nvidia Multi-GPU'
                        key: gpu.temp_max
                - type: item
                  name: 'Driver Version'
                  x: '18'
                  width: '6'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: show
                      value: '1'
                    - type: INTEGER
                      name: show
                      value: '2'
                    - type: INTEGER
                      name: adv_conf
                      value: '1'
                    - type: ITEM
                      name: itemid
                      value:
                        host: 'Nvidia Multi-GPU'
                        key: gpu.driver_version
                - type: item
                  name: 'GPU Count'
                  x: '15'
                  width: '3'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: INTEGER
                      name: units_size
                      value: '60'
                    - type: INTEGER
                      name: show
                      value: '1'
                    - type: INTEGER
                      name: show
                      value: '2'
                    - type: INTEGER
                      name: adv_conf
                      value: '1'
                    - type: INTEGER
                      name: value_size
                      value: '60'
                    - type: ITEM
                      name: itemid
                      value:
                        host: 'Nvidia Multi-GPU'
                        key: gpu.count
                - type: graphprototype
                  name: 'GPU MEMORY'
                  x: '12'
                  'y': '2'
                  width: '12'
                  height: '27'
                  fields:
                    - type: INTEGER
                      name: rows
                      value: '9'
                    - type: INTEGER
                      name: show_legend
                      value: '0'
                    - type: INTEGER
                      name: columns
                      value: '1'
                    - type: GRAPH_PROTOTYPE
                      name: graphid
                      value:
                        host: 'Nvidia Multi-GPU'
                        name: 'GPU {#GPUID} Memory'
                - type: graphprototype
                  name: 'GPU Utilization'
                  'y': '2'
                  width: '12'
                  height: '27'
                  fields:
                    - type: INTEGER
                      name: rows
                      value: '9'
                    - type: INTEGER
                      name: show_legend
                      value: '0'
                    - type: INTEGER
                      name: columns
                      value: '1'
                    - type: GRAPH_PROTOTYPE
                      name: graphid
                      value:
                        host: 'Nvidia Multi-GPU'
                        name: 'GPU {#GPUID} Load,Fan,Temp'
                - type: item
                  name: 'Power Total'
                  width: '6'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: show
                      value: '1'
                    - type: INTEGER
                      name: show
                      value: '2'
                    - type: INTEGER
                      name: adv_conf
                      value: '1'
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: INTEGER
                      name: show
                      value: '4'
                    - type: INTEGER
                      name: value_size
                      value: '60'
                    - type: INTEGER
                      name: units_size
                      value: '60'
                    - type: STRING
                      name: up_color
                      value: FF0000
                    - type: STRING
                      name: down_color
                      value: 00FF00
                    - type: STRING
                      name: updown_color
                      value: FFFF00
                    - type: ITEM
                      name: itemid
                      value:
                        host: 'Nvidia Multi-GPU'
                        key: gpu.power_total
