zabbix_export:
  version: '7.0'
  template_groups:
    - uuid: 7df96b18c230490a9a0a9e2307226338
      name: Templates
  templates:
    - uuid: f9c9e340c0164b868cbef3b79460ca0a
      template: '-- Tempo e Clima - HG Brasil'
      name: '-- Tempo e Clima - HG Brasil'
      description: |
        Find city code:
        ===========
        https://console.hgbrasil.com/documentation/weather/tools?stats=26804347&with_chart
        
        Get temperature in bash:
        ===================
        curl -s 'https://api.hgbrasil.com/weather?woeid=26804347' | jq .results.temp
      groups:
        - name: Templates
      items:
        - uuid: 92b43d28e71c4552afa8a4826a8395b5
          name: 'Cloudiness 🇧🇷'
          type: DEPENDENT
          key: hgbrasil.cloudiness
          delay: '0'
          trends: '0'
          units: '%'
          description: 'Nebulosidade em percentual'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.body.results.cloudiness
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: hgbrasil.json
          tags:
            - tag: component
              value: cloudiness
            - tag: source
              value: hgbrasil
        - uuid: f32c3346a7fc4f42b253a9d2cf311f10
          name: 'Condition 🇧🇷'
          type: DEPENDENT
          key: hgbrasil.condition
          delay: '0'
          value_type: CHAR
          trends: '0'
          description: |
            Condição de tempo atual
            
            https://console.hgbrasil.com/documentation/weather
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.body.results.description
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: hgbrasil.json
          tags:
            - tag: component
              value: condition
            - tag: source
              value: hgbrasil
        - uuid: bff87a9a8a724e5b8d354c7d8c8b2a39
          name: 'Humidity 🇧🇷'
          type: DEPENDENT
          key: hgbrasil.humidity
          delay: '0'
          trends: '0'
          units: '%'
          description: 'Umidade atual em percentual'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.body.results.humidity
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: hgbrasil.json
          tags:
            - tag: component
              value: humidity
            - tag: source
              value: hgbrasil
        - uuid: 0b55f6b25037434aa6776fabaf648eb7
          name: 'Get data hgbrasil 🇧🇷'
          type: HTTP_AGENT
          key: hgbrasil.json
          delay: 15m
          history: '0'
          value_type: TEXT
          trends: '0'
          description: 'JSON array with result of hgbrasil API requests.'
          preprocessing:
            - type: CHECK_NOT_SUPPORTED
              parameters:
                - '-1'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          url: 'https://api.hgbrasil.com/weather'
          query_fields:
            - name: key
              value: '{$HGBRASIL.KEY}'
            - name: woeid
              value: '{$HGBRASIL.LOCATION}'
          output_format: JSON
          tags:
            - tag: component
              value: raw
            - tag: source
              value: hgbrasil
        - uuid: 5843f5aa806347e89a9cd226b8b315d4
          name: 'Rain 🇧🇷'
          type: DEPENDENT
          key: hgbrasil.rain
          delay: '0'
          trends: '0'
          units: mm
          description: 'Volume de chuva em mm na última hora'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.body.results.rain
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: hgbrasil.json
          tags:
            - tag: component
              value: rain
            - tag: source
              value: hgbrasil
        - uuid: 68d52561fbc448fdbaf22ae0696d078b
          name: 'Temperature 🇧🇷'
          type: DEPENDENT
          key: hgbrasil.temp
          delay: '0'
          trends: '0'
          units: °C
          description: 'Temperatura atual em ºC'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.body.results.temp
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: hgbrasil.json
          tags:
            - tag: component
              value: temperature
            - tag: source
              value: hgbrasil
          triggers:
            - uuid: 0b9d74fd053345f38fd16590d1940fa0
              expression: 'last(/-- Tempo e Clima - HG Brasil/hgbrasil.temp)>{$HGBRASIL.AVG}'
              name: 'High temperature'
              event_name: 'Temperature 🥵 ( > {$HGBRASIL.AVG} ºC )🇧🇷'
              opdata: 'Current temperature {ITEM.LASTVALUE1}'
              priority: AVERAGE
              manual_close: 'YES'
              dependencies:
                - name: 'Very high temperature'
                  expression: 'last(/-- Tempo e Clima - HG Brasil/hgbrasil.temp)>{$HGBRASIL.MAX}'
              tags:
                - tag: target
                  value: hgbrasil
            - uuid: bcda2d82795343618a30a0e60bf82fc0
              expression: 'last(/-- Tempo e Clima - HG Brasil/hgbrasil.temp)<{$HGBRASIL.MIN}'
              name: 'Low temperature'
              event_name: 'Temperature 🥶 ( < {$HGBRASIL.MIN} ºC )🇧🇷'
              opdata: 'Current temperature {ITEM.LASTVALUE1}'
              priority: WARNING
              manual_close: 'YES'
              tags:
                - tag: target
                  value: hgbrasil
            - uuid: 1f5bf5dd6b10464b8fd2d278e8407dfe
              expression: 'last(/-- Tempo e Clima - HG Brasil/hgbrasil.temp)>{$HGBRASIL.MAX}'
              name: 'Very high temperature'
              event_name: 'Temperature 🥵🥵 ( > {$HGBRASIL.MAX} ºC )🇧🇷'
              opdata: 'Current temperature {ITEM.LASTVALUE1}'
              priority: HIGH
              manual_close: 'YES'
              tags:
                - tag: target
                  value: hgbrasil
        - uuid: 040e4014c9554046b38fc8dffccbc936
          name: 'Last Updated 🇧🇷'
          type: DEPENDENT
          key: hgbrasil.time
          delay: '0'
          history: 1d
          value_type: CHAR
          trends: '0'
          description: 'Hora da consulta, em fuso horário do local'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.body.results.time
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: hgbrasil.json
          tags:
            - tag: component
              value: last_updated
            - tag: source
              value: hgbrasil
        - uuid: 484104d1640048b4b0d4cd335546471f
          name: 'Wind Direction 🇧🇷'
          type: DEPENDENT
          key: hgbrasil.wind_direction
          delay: '0'
          trends: '0'
          units: º
          description: 'Direção do vento em grau. Assim 360º indica o norte, 90º o leste, 180º o sul e 270º oeste, como pode ser visto na rosa dos ventos.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.body.results.wind_direction
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: hgbrasil.json
          tags:
            - tag: component
              value: wind_direction
            - tag: source
              value: hgbrasil
        - uuid: 44da4855d8db4fb28b2f37d124e93041
          name: 'Wind Speedy 🇧🇷'
          type: DEPENDENT
          key: hgbrasil.wind_speedy
          delay: '0'
          trends: '0'
          units: km/h
          description: 'Velocidade do vento em km/h'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.body.results.wind_speedy
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
            - type: REGEX
              parameters:
                - '([0-9.]+)'
                - \1
          master_item:
            key: hgbrasil.json
          tags:
            - tag: component
              value: wind_speedy
            - tag: source
              value: hgbrasil
      tags:
        - tag: class
          value: service
        - tag: source
          value: hgbrasil
      macros:
        - macro: '{$HGBRASIL.AVG}'
          value: '30'
          description: 'Temperatura Media'
        - macro: '{$HGBRASIL.KEY}'
          type: SECRET_TEXT
          description: 'Chave de Acesso'
        - macro: '{$HGBRASIL.LANG}'
          value: pt
          description: 'O idioma de resposta da API'
        - macro: '{$HGBRASIL.LOCATION}'
          value: XXXXXXXX
          description: 'Código da Cidade'
        - macro: '{$HGBRASIL.MAX}'
          value: '35'
          description: 'Temperatura Maxima'
        - macro: '{$HGBRASIL.MIN}'
          value: '10'
          description: 'Temperatura Minima'
      dashboards:
        - uuid: 7d5baf9dfa1f40149fcae057336e81bd
          name: 'Temperature (HGBrasil 🇧🇷)'
          pages:
            - widgets:
                - type: clock
                  name: 'Date and Time'
                  width: '60'
                  height: '3'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: '000000'
                    - type: INTEGER
                      name: clock_type
                      value: '1'
                    - type: STRING
                      name: date_color
                      value: FFFFFF
                    - type: INTEGER
                      name: show.0
                      value: '1'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: STRING
                      name: time_color
                      value: FFFF00
                    - type: INTEGER
                      name: time_size
                      value: '80'
                - type: graph
                  'y': '3'
                  width: '72'
                  height: '10'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: '-- Tempo e Clima - HG Brasil'
                        name: 'Temperature (HGBrasil)'
                    - type: STRING
                      name: reference
                      value: MCFGK
                - type: item
                  name: 'Current temperature'
                  x: '60'
                  width: '12'
                  height: '3'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: '000000'
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: '-- Tempo e Clima - HG Brasil'
                        key: hgbrasil.temp
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '4'
                    - type: STRING
                      name: units
                      value: ºC
                    - type: STRING
                      name: units_color
                      value: FFFF00
                    - type: STRING
                      name: value_color
                      value: FFFFFF
    - uuid: 928aaf023735443c90007b59802a5b1e
      template: '-- Tempo e Clima - WeatherAPI'
      name: '-- Tempo e Clima - WeatherAPI'
      description: |
        Find city code:
        ===========
        
        https://www.weatherapi.com/docs/
        
        https://www.weatherapi.com/api-explorer.aspx
        
        Get temperature in bash:
        ===================
        curl -s -L 'http://api.weatherapi.com/v1/current.json?key=KEY&q=-20.45,-54.62&aqi=no'  |  jq
      groups:
        - name: Templates
      items:
        - uuid: 3f7e02415c8e44d8a2377cc45bae73fa
          name: 'Cloudiness 🇦🇪'
          type: DEPENDENT
          key: weatherapi.cloudiness
          delay: '0'
          trends: '0'
          units: '%'
          description: 'Cloud cover as percentage'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.body.current.cloud
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: weatherapi.json
          tags:
            - tag: component
              value: cloudiness
            - tag: source
              value: weatherapi
        - uuid: dbf70770e7c5468bb7dafa43babb4ca8
          name: 'Condition 🇦🇪'
          type: DEPENDENT
          key: weatherapi.condition
          delay: '0'
          value_type: CHAR
          trends: '0'
          description: 'Weather condition text'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.body.current.condition.text
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: weatherapi.json
          tags:
            - tag: component
              value: condition
            - tag: source
              value: weatherapi
        - uuid: ff0f3e6ca82c49f296818a43b7b2551b
          name: 'Humidity 🇦🇪'
          type: DEPENDENT
          key: weatherapi.humidity
          delay: '0'
          trends: '0'
          units: '%'
          description: 'Humidity as percentage'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.body.current.humidity
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: weatherapi.json
          tags:
            - tag: component
              value: humidity
            - tag: source
              value: weatherapi
        - uuid: 090eac0347b3471f993d4f8f99b77d74
          name: 'Get data weaterapi 🇦🇪'
          type: HTTP_AGENT
          key: weatherapi.json
          delay: 15m
          history: '0'
          value_type: TEXT
          trends: '0'
          description: 'JSON array with result of weather API requests.'
          preprocessing:
            - type: CHECK_NOT_SUPPORTED
              parameters:
                - '-1'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          url: 'https://api.weatherapi.com/v1/current.json'
          query_fields:
            - name: key
              value: '{$WEATHERAPI.KEY}'
            - name: q
              value: '{$WEATHERAPI.LOCATION}'
            - name: aqi
              value: '{$WEATHERAPI.AQI}'
            - name: lang
              value: '{$WEATHERAPI.LANG}'
          output_format: JSON
          tags:
            - tag: component
              value: raw
            - tag: source
              value: weatherapi
        - uuid: ac39b4bb7b0c4892a6b610ea13c99440
          name: 'Last Updated 🇦🇪'
          type: DEPENDENT
          key: weatherapi.last_updated_epoch
          delay: '0'
          history: 1d
          trends: '0'
          units: unixtime
          description: 'Local time when the real time data was updated in unix time'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.body.current.last_updated_epoch
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: weatherapi.json
          tags:
            - tag: component
              value: last_updated
            - tag: source
              value: weatherapi
        - uuid: 7305bc8c030349559fec62e91c1cf040
          name: 'Rain 🇦🇪'
          type: DEPENDENT
          key: weatherapi.rain
          delay: '0'
          trends: '0'
          units: mm
          description: 'Precipitation amount in millimeters'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.body.current.precip_mm
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: weatherapi.json
          tags:
            - tag: component
              value: rain
            - tag: source
              value: weatherapi
        - uuid: 37825070411a4ff0b95381b05de87363
          name: 'Temperature 🇦🇪'
          type: DEPENDENT
          key: weatherapi.temp_c
          delay: '0'
          trends: '0'
          units: °C
          description: 'Temperature in celsius'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.body.current.temp_c
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: weatherapi.json
          tags:
            - tag: component
              value: temperature
            - tag: source
              value: weatherapi
          triggers:
            - uuid: 3ec06c37fab24281b9286977cf76af4b
              expression: 'last(/-- Tempo e Clima - WeatherAPI/weatherapi.temp_c)>{$WEATHERAPI.AVG}'
              name: 'High temperature'
              event_name: 'Temperature 🥵 ( > {$WEATHERAPI.AVG} ºC )🇦🇪'
              opdata: 'Current temperature {ITEM.LASTVALUE1}'
              priority: AVERAGE
              manual_close: 'YES'
              dependencies:
                - name: 'Very high temperature'
                  expression: 'last(/-- Tempo e Clima - WeatherAPI/weatherapi.temp_c)>{$WEATHERAPI.MAX}'
              tags:
                - tag: target
                  value: weatherapi
            - uuid: 09766f2c83844272895a9126de9c2b8d
              expression: 'last(/-- Tempo e Clima - WeatherAPI/weatherapi.temp_c)<{$WEATHERAPI.MIN}'
              name: 'Low temperature'
              event_name: 'Temperature 🥶 ( < {$WEATHERAPI.MIN} ºC )🇦🇪'
              opdata: 'Current temperature {ITEM.LASTVALUE1}'
              priority: WARNING
              manual_close: 'YES'
              tags:
                - tag: target
                  value: weatherapi
            - uuid: c283508c3ff64770910056af7e71026b
              expression: 'last(/-- Tempo e Clima - WeatherAPI/weatherapi.temp_c)>{$WEATHERAPI.MAX}'
              name: 'Very high temperature'
              event_name: 'Temperature 🥵🥵 ( > {$WEATHERAPI.MAX} ºC )🇦🇪'
              opdata: 'Current temperature {ITEM.LASTVALUE1}'
              priority: HIGH
              manual_close: 'YES'
              tags:
                - tag: target
                  value: weatherapi
        - uuid: 812e15e55151451ab869939e702f2a1b
          name: 'Wind Direction 🇦🇪'
          type: DEPENDENT
          key: weatherapi.wind_degree
          delay: '0'
          trends: '0'
          units: º
          description: 'Wind direction in degrees'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.body.current.wind_degree
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: weatherapi.json
          tags:
            - tag: component
              value: wind_direction
            - tag: source
              value: weatherapi
        - uuid: 4f88a1e593b94f8fbbd9655029ff79f4
          name: 'Wind Speedy 🇦🇪'
          type: DEPENDENT
          key: weatherapi.wind_kph
          delay: '0'
          trends: '0'
          units: km/h
          description: 'Wind speed in kilometer per hour'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.body.current.wind_kph
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: weatherapi.json
          tags:
            - tag: component
              value: wind_speedy
            - tag: source
              value: weatherapi
      tags:
        - tag: class
          value: service
        - tag: source
          value: weatherapi
      macros:
        - macro: '{$WEATHERAPI.AQI}'
          value: 'yes'
          description: 'Air Quality Data (yes|no)'
        - macro: '{$WEATHERAPI.AVG}'
          value: '30'
          description: 'Average Temperature'
        - macro: '{$WEATHERAPI.KEY}'
          type: SECRET_TEXT
          description: 'API Key'
        - macro: '{$WEATHERAPI.LANG}'
          value: pt
          description: 'Returns field in API in the desired language'
        - macro: '{$WEATHERAPI.LOCATION}'
          value: 'LAT,LON'
          description: 'Latitude,Longitude'
        - macro: '{$WEATHERAPI.MAX}'
          value: '35'
          description: 'Maximum Temperature'
        - macro: '{$WEATHERAPI.MIN}'
          value: '10'
          description: 'Minimum Temperature'
      dashboards:
        - uuid: b701088252ef4635a05f8cc8725920bc
          name: 'Temperature (WeatherAPI 🇦🇪)'
          pages:
            - widgets:
                - type: clock
                  name: 'Date and Time'
                  width: '60'
                  height: '3'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: '000000'
                    - type: INTEGER
                      name: clock_type
                      value: '1'
                    - type: STRING
                      name: date_color
                      value: FFFFFF
                    - type: INTEGER
                      name: show.0
                      value: '1'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: STRING
                      name: time_color
                      value: FFFF00
                    - type: INTEGER
                      name: time_size
                      value: '80'
                - type: graph
                  'y': '3'
                  width: '72'
                  height: '10'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: '-- Tempo e Clima - WeatherAPI'
                        name: 'Temperature (WeaterAPI)'
                    - type: STRING
                      name: reference
                      value: MCFGK
                - type: item
                  name: 'Current temperature'
                  x: '60'
                  width: '12'
                  height: '3'
                  fields:
                    - type: STRING
                      name: bg_color
                      value: '000000'
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: '-- Tempo e Clima - WeatherAPI'
                        key: weatherapi.temp_c
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '4'
                    - type: STRING
                      name: units
                      value: ºC
                    - type: STRING
                      name: units_color
                      value: FFFF00
                    - type: STRING
                      name: value_color
                      value: FFFFFF
  graphs:
    - uuid: 34301f82f73642f2b9061b3edd790e92
      name: 'Temperature (HGBrasil)'
      yaxismin: '-10'
      yaxismax: '50'
      ymin_type_1: FIXED
      ymax_type_1: FIXED
      graph_items:
        - color: 1A7C11
          calc_fnc: ALL
          item:
            host: '-- Tempo e Clima - HG Brasil'
            key: hgbrasil.temp
    - uuid: b7eab085d08a4393a8b8c72aadd9c67a
      name: 'Temperature (WeaterAPI)'
      yaxismin: '-10'
      yaxismax: '50'
      ymin_type_1: FIXED
      ymax_type_1: FIXED
      graph_items:
        - color: 1A7C11
          calc_fnc: ALL
          item:
            host: '-- Tempo e Clima - WeatherAPI'
            key: weatherapi.temp_c
