zabbix_export:
  version: '6.2'
  date: '2023-01-02T12:46:04Z'
  template_groups:
    -
      uuid: 7df96b18c230490a9a0a9e2307226338
      name: Templates
  templates:
    -
      uuid: e10d35d236bd4c2da08feaf43522a210
      template: 'Template Web scenario Availability API Just Watch - support'
      name: 'Template Web scenario Availability API Just Watch - support'
      description: 'Testing the availability of the Just Watch API'
      groups:
        -
          name: Templates
      items:
        -
          uuid: 2f46721354144b9c8e9d881cad9d4d37
          name: 'Just Watch - Collection ID'
          type: HTTP_AGENT
          key: get.jw.collection.id
          history: 1h
          trends: '0'
          value_type: TEXT
          timeout: 20s
          url: '{$PROTOCOL}://{$HOST_JW}/api/justwatch/v1/imports'
          headers:
            -
              name: Authorization
              value: '{$TOKEN1_JW}'
            -
              name: X-DeviceID
              value: 11552308200FFABF5C8A924601C3E800A664AE75CDF71
            -
              name: X-DeviceType
              value: browser
            -
              name: X-DeviceOS
              value: Linux
            -
              name: X-DeviceName
              value: 'Zabbix monitoring'
          tags:
            -
              tag: app
              value: jw
            -
              tag: CI
              value: '{ITEM.VALUE1}'
            -
              tag: lv
              value: '{ITEM.LASTVALUE}'
          triggers:
            -
              uuid: 0c4fc6b39c0c45e09077a89ec1f27263
              expression: 'last(/Template Web scenario Availability API Just Watch - support/get.jw.collection.id)=0'
              name: 'Collection ID is null'
              priority: WARNING
      discovery_rules:
        -
          uuid: 7973aeebb9ef4b87839d6768f5a9cc3d
          name: 'GET: JW Code'
          type: DEPENDENT
          key: get.jw.code.id
          delay: '0'
          item_prototypes:
            -
              uuid: 7a5c1ba892d94fb1a5215b81dce5d954
              name: 'CI: {#COLLECTION_ID}-{#COUNT}'
              type: DEPENDENT
              key: 'get.key.[{#COLLECTION_ID}-{#COUNT}]'
              delay: '0'
              trends: '0'
              value_type: CHAR
              master_item:
                key: get.jw.collection.id
              tags:
                -
                  tag: ci
                  value: '{#COLLECTION_ID}'
          master_item:
            key: get.jw.collection.id
          lld_macro_paths:
            -
              lld_macro: '{#CODE}'
              path: $.code
            -
              lld_macro: '{#COLLECTION_ID}'
              path: $.data.collectionId
            -
              lld_macro: '{#COUNT}'
              path: $.data.count
      httptests:
        -
          uuid: ae6d1e5829f34cd299981204b221a3af
          name: 'Availability API Just Watch'
          delay: 30s
          attempts: '3'
          headers:
            -
              name: Authorization
              value: '{$TOKEN1_JW}'
            -
              name: X-DeviceType
              value: browser
            -
              name: X-DeviceOS
              value: Linux
            -
              name: X-DeviceName
              value: 'Zabbix monitoring'
          steps:
            -
              name: 'Just Watch - Imports'
              url: '{$PROTOCOL}://{$HOST_JW}/api/justwatch/v1/imports'
              timeout: 20s
              status_codes: '200'
            -
              name: 'Just Watch - Collection ID'
              url: '{$PROTOCOL}://{$HOST_JW}/api/justwatch/v1/catalogue/{#COLLECTION_ID}?monitoring=1'
              timeout: 20s
              status_codes: '200'
          tags:
            -
              tag: Application
              value: 'Web checks'
      macros:
        -
          macro: '{$HOST_JW}'
          value: example.com
        -
          macro: '{$MONITORING_PARAM}'
          value: '?monitoring=1'
        -
          macro: '{$PROTOCOL}'
          value: https
        -
          macro: '{$TOKEN1_JW}'
          value: 'Bearer token_bla_bla'
  triggers:
    -
      uuid: 314e0ab5f9dd49a0ab6cbc469143c554
      expression: 'length(last(/Template Web scenario Availability API Just Watch - support/web.test.error[Availability API Just Watch]))>0 and last(/Template Web scenario Availability API Just Watch - support/web.test.fail[Availability API Just Watch])>0'
      name: 'Web scenario "Availability API Just Watch" failed'
      priority: AVERAGE
      description: 'Steps:<br>1: {$PROTOCOL}://{$HOST_JW}/api/justwatch/v1/imports'
      manual_close: 'YES'
