zabbix_export:
  version: '6.0'
  date: '2021-11-21T22:03:59Z'
  groups:
    -
      uuid: a571c0d144b14fd4a87a9d9b2aa9fcd6
      name: Templates/Applications
  templates:
    -
      uuid: 1dc02848a0294c25a134c58ae6e2d136
      template: 'App Nginx Plus'
      name: 'App Nginx Plus'
      description: |
        ## Overview
        
        Zabbix NGINX Plus
        =================
        
        
        LLD template for nginx plus.
        
        
        Please check your api version in template, is macro {$NGINXPLUS\_API\_VER} in defaults is used version 6
        
        
        Use this command on nginx machine. Higest number is your API version.
        
        
        curl **<http://127.0.0.1/api/>** 
        
        
        **[1,2,3,4,5,6]**
        
        
        **Output (Higest is 6)**
        
        
        TODO: triggers
        
        
         
        
        
        <p style="font-size: 16px; box-sizing: border-box; margin-t
        
        
      groups:
        -
          name: Templates/Applications
      items:
        -
          uuid: 5b4c5a81eafa405d98ede35222d5737d
          name: 'Nginx+ General'
          type: HTTP_AGENT
          key: nginxplus.basic
          history: 1d
          trends: '0'
          value_type: TEXT
          timeout: 15s
          url: 'http://{HOST.NAME}.alz.lcl/api/{$NGINXPLUS_API_VER}/nginx?fields=version,build,generation'
          tags:
            -
              tag: Application
              value: Nginx+
        -
          uuid: aab45a0421f3427c9118e133911d15ea
          name: 'Nginx+ Connections'
          type: HTTP_AGENT
          key: nginxplus.connections
          history: 1d
          trends: '0'
          value_type: TEXT
          timeout: 15s
          url: 'http://{HOST.NAME}.alz.lcl/api/{$NGINXPLUS_API_VER}/connections'
          tags:
            -
              tag: Application
              value: Nginx+
        -
          uuid: f006eb0c333e4f8f8599ca82b429a377
          name: accepted
          type: DEPENDENT
          key: nginxplus.connections.accepted
          delay: '0'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.accepted
          master_item:
            key: nginxplus.connections
          tags:
            -
              tag: Application
              value: Nginx+
        -
          uuid: 7f9249f7e3574eb28b5a1b95c8d5a553
          name: active
          type: DEPENDENT
          key: nginxplus.connections.active
          delay: '0'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.active
          master_item:
            key: nginxplus.connections
          tags:
            -
              tag: Application
              value: Nginx+
        -
          uuid: 33661e3d24624851a26d0ee30c41c518
          name: dropped
          type: DEPENDENT
          key: nginxplus.connections.dropped
          delay: '0'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.dropped
          master_item:
            key: nginxplus.connections
          tags:
            -
              tag: Application
              value: Nginx+
        -
          uuid: 3dc77865863b4dc0b99410a0144458a5
          name: idle
          type: DEPENDENT
          key: nginxplus.connections.idle
          delay: '0'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.idle
          master_item:
            key: nginxplus.connections
          tags:
            -
              tag: Application
              value: Nginx+
        -
          uuid: ea14b5acd7164b2c9482a56062ae3ff9
          name: build
          type: DEPENDENT
          key: nginxplus.general.build
          delay: '0'
          trends: '0'
          value_type: CHAR
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.build
          master_item:
            key: nginxplus.basic
          tags:
            -
              tag: Application
              value: Nginx+
        -
          uuid: c4eb5d65feb64167886e109710870bc4
          name: generation
          type: DEPENDENT
          key: nginxplus.general.generation
          delay: '0'
          trends: '0'
          value_type: CHAR
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.generation
          master_item:
            key: nginxplus.basic
          tags:
            -
              tag: Application
              value: Nginx+
        -
          uuid: d70a8b1d969d40f78b92ce5097698422
          name: version
          type: DEPENDENT
          key: nginxplus.general.version
          delay: '0'
          trends: '0'
          value_type: CHAR
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.version
          master_item:
            key: nginxplus.basic
          tags:
            -
              tag: Application
              value: Nginx+
        -
          uuid: 34085f8344be45e983ae5510134ec31b
          name: 'Nginx+ HTTP Requests'
          type: HTTP_AGENT
          key: nginxplus.http.requests
          history: 1d
          trends: '0'
          value_type: TEXT
          timeout: 15s
          url: 'http://{HOST.NAME}.alz.lcl/api/{$NGINXPLUS_API_VER}/http/requests'
          tags:
            -
              tag: Application
              value: Nginx+
        -
          uuid: 5c1db30ee13f4aafa746734cf98a126f
          name: current
          type: DEPENDENT
          key: nginxplus.http.requests.current
          delay: '0'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.current
          master_item:
            key: nginxplus.http.requests
          tags:
            -
              tag: Application
              value: Nginx+
        -
          uuid: 3c0565e0f0e242a39241a7218044a2dc
          name: total
          type: DEPENDENT
          key: nginxplus.http.requests.total
          delay: '0'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.total
          master_item:
            key: nginxplus.http.requests
          tags:
            -
              tag: Application
              value: Nginx+
        -
          uuid: d1f19502198c4a8ab23d97a7a4100334
          name: 'Nginx+ Processes'
          type: HTTP_AGENT
          key: nginxplus.processes
          history: 1d
          trends: '0'
          value_type: TEXT
          timeout: 15s
          url: 'http://{HOST.NAME}.alz.lcl/api/{$NGINXPLUS_API_VER}/processes'
          tags:
            -
              tag: Application
              value: Nginx+
        -
          uuid: 974d55f781f24fc297c2467c10e07a51
          name: respawned
          type: DEPENDENT
          key: nginxplus.processes.respawned
          delay: '0'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.respawned
          master_item:
            key: nginxplus.processes
          tags:
            -
              tag: Application
              value: Nginx+
        -
          uuid: f3aba08c630d407e979993365ab6750e
          name: 'Nginx+ SSL'
          type: HTTP_AGENT
          key: nginxplus.ssl
          history: 1d
          trends: '0'
          value_type: TEXT
          timeout: 15s
          url: 'http://{HOST.NAME}.alz.lcl/api/{$NGINXPLUS_API_VER}/ssl'
          tags:
            -
              tag: Application
              value: Nginx+
        -
          uuid: 107056590095415dbca64f438533654a
          name: handshakes
          type: DEPENDENT
          key: nginxplus.ssl.handshakes
          delay: '0'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.handshakes
          master_item:
            key: nginxplus.ssl
          tags:
            -
              tag: Application
              value: Nginx+
        -
          uuid: 76d5b82f280a42ae8804a249188f5f69
          name: 'handshakes failed'
          type: DEPENDENT
          key: nginxplus.ssl.handshakes_failed
          delay: '0'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.handshakes_failed
          master_item:
            key: nginxplus.ssl
          tags:
            -
              tag: Application
              value: Nginx+
        -
          uuid: 7849ad678b274e449f9a817dd0e970db
          name: 'session reuses'
          type: DEPENDENT
          key: nginxplus.ssl.session_reuses
          delay: '0'
          preprocessing:
            -
              type: JSONPATH
              parameters:
                - $.session_reuses
          master_item:
            key: nginxplus.ssl
          tags:
            -
              tag: Application
              value: Nginx+
      discovery_rules:
        -
          uuid: aae1ece97413415cb0f514680eeef249
          name: 'Nginx+ HTTP caches discovery'
          type: HTTP_AGENT
          key: nginxplus.http.caches.discovery
          delay: 1h
          description: |
            when the "fields" param is empty it returns only names of upstreams
            creates LLD macro {#CACHE} containing upstream name
          item_prototypes:
            -
              uuid: 54676fd48ff84728bcdca5cc33fd3787
              name: 'bypass bytes'
              type: DEPENDENT
              key: 'nginxplus.http.caches[{#CACHE},bypass_bytes]'
              delay: '0'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.bypass.bytes
              master_item:
                key: 'nginxplus.http.caches[{#CACHE}]'
              tags:
                -
                  tag: Application
                  value: Nginx+
                -
                  tag: Application
                  value: 'Nginx+ Cache'
            -
              uuid: 1c3118eb351e488b8cafe417dec2050a
              name: 'bypass bytes written'
              type: DEPENDENT
              key: 'nginxplus.http.caches[{#CACHE},bypass_bytes_written]'
              delay: '0'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.bypass.bytes_written
              master_item:
                key: 'nginxplus.http.caches[{#CACHE}]'
              tags:
                -
                  tag: Application
                  value: Nginx+
                -
                  tag: Application
                  value: 'Nginx+ Cache'
            -
              uuid: 51242e227d6f41e297764f89dc054710
              name: 'bypass responses'
              type: DEPENDENT
              key: 'nginxplus.http.caches[{#CACHE},bypass_responses]'
              delay: '0'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.bypass.responses
              master_item:
                key: 'nginxplus.http.caches[{#CACHE}]'
              tags:
                -
                  tag: Application
                  value: Nginx+
                -
                  tag: Application
                  value: 'Nginx+ Cache'
            -
              uuid: d82209e5858f449aa8fa15cdbc4b6d7a
              name: 'bypass responses written'
              type: DEPENDENT
              key: 'nginxplus.http.caches[{#CACHE},bypass_responses_written]'
              delay: '0'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.bypass.responses_written
              master_item:
                key: 'nginxplus.http.caches[{#CACHE}]'
              tags:
                -
                  tag: Application
                  value: Nginx+
                -
                  tag: Application
                  value: 'Nginx+ Cache'
            -
              uuid: c37cefdaf862469ab0c0cd2ebd76d385
              name: cold
              type: DEPENDENT
              key: 'nginxplus.http.caches[{#CACHE},cold]'
              delay: '0'
              trends: '0'
              value_type: CHAR
              description: 'A boolean value indicating whether the "cache loader" process is still loading data from disk into the cache.'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.cold
              master_item:
                key: 'nginxplus.http.caches[{#CACHE}]'
              tags:
                -
                  tag: Application
                  value: Nginx+
                -
                  tag: Application
                  value: 'Nginx+ Cache'
            -
              uuid: 5005bf26b3764b9f9c055b392af1105d
              name: 'expired bytes'
              type: DEPENDENT
              key: 'nginxplus.http.caches[{#CACHE},expired_bytes]'
              delay: '0'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.expired.bytes
              master_item:
                key: 'nginxplus.http.caches[{#CACHE}]'
              tags:
                -
                  tag: Application
                  value: Nginx+
                -
                  tag: Application
                  value: 'Nginx+ Cache'
            -
              uuid: e2b30515e3a341459c32119c49642c84
              name: 'expired bytes written'
              type: DEPENDENT
              key: 'nginxplus.http.caches[{#CACHE},expired_bytes_written]'
              delay: '0'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.expired.bytes_written
              master_item:
                key: 'nginxplus.http.caches[{#CACHE}]'
              tags:
                -
                  tag: Application
                  value: Nginx+
                -
                  tag: Application
                  value: 'Nginx+ Cache'
            -
              uuid: 5e414907750c41edae56c5dc685e0e93
              name: 'expired responses'
              type: DEPENDENT
              key: 'nginxplus.http.caches[{#CACHE},expired_responses]'
              delay: '0'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.expired.responses
              master_item:
                key: 'nginxplus.http.caches[{#CACHE}]'
              tags:
                -
                  tag: Application
                  value: Nginx+
                -
                  tag: Application
                  value: 'Nginx+ Cache'
            -
              uuid: 3fbcba77f7d246a883e5a2e916beacb1
              name: 'expired responses written'
              type: DEPENDENT
              key: 'nginxplus.http.caches[{#CACHE},expired_responses_written]'
              delay: '0'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.expired.responses_written
              master_item:
                key: 'nginxplus.http.caches[{#CACHE}]'
              tags:
                -
                  tag: Application
                  value: Nginx+
                -
                  tag: Application
                  value: 'Nginx+ Cache'
            -
              uuid: f0a21cd934474eacadc588f94c353181
              name: 'hit bytes'
              type: DEPENDENT
              key: 'nginxplus.http.caches[{#CACHE},hit_bytes]'
              delay: '0'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.hit.bytes
              master_item:
                key: 'nginxplus.http.caches[{#CACHE}]'
              tags:
                -
                  tag: Application
                  value: Nginx+
                -
                  tag: Application
                  value: 'Nginx+ Cache'
            -
              uuid: 6f66566f4e70488f8eb659a39e14005d
              name: 'hit responses'
              type: DEPENDENT
              key: 'nginxplus.http.caches[{#CACHE},hit_responses]'
              delay: '0'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.hit.responses
              master_item:
                key: 'nginxplus.http.caches[{#CACHE}]'
              tags:
                -
                  tag: Application
                  value: Nginx+
                -
                  tag: Application
                  value: 'Nginx+ Cache'
            -
              uuid: cb89f3c6f3774365a4b534d8c1841249
              name: maxsize
              type: DEPENDENT
              key: 'nginxplus.http.caches[{#CACHE},max_size]'
              delay: '0'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.max_size
              master_item:
                key: 'nginxplus.http.caches[{#CACHE}]'
              tags:
                -
                  tag: Application
                  value: Nginx+
                -
                  tag: Application
                  value: 'Nginx+ Cache'
            -
              uuid: e4d83f2b605345a2b40254f1c9f71c35
              name: 'miss bytes'
              type: DEPENDENT
              key: 'nginxplus.http.caches[{#CACHE},miss_bytes]'
              delay: '0'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.miss.bytes
              master_item:
                key: 'nginxplus.http.caches[{#CACHE}]'
              tags:
                -
                  tag: Application
                  value: Nginx+
                -
                  tag: Application
                  value: 'Nginx+ Cache'
            -
              uuid: 6a9d54c5f4264160a1bbb38a26b31488
              name: 'miss bytes written'
              type: DEPENDENT
              key: 'nginxplus.http.caches[{#CACHE},miss_bytes_written]'
              delay: '0'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.miss.bytes_written
              master_item:
                key: 'nginxplus.http.caches[{#CACHE}]'
              tags:
                -
                  tag: Application
                  value: Nginx+
                -
                  tag: Application
                  value: 'Nginx+ Cache'
            -
              uuid: 3b6137d038a34326a560df92fffcfd88
              name: 'miss responses'
              type: DEPENDENT
              key: 'nginxplus.http.caches[{#CACHE},miss_responses]'
              delay: '0'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.miss.responses
              master_item:
                key: 'nginxplus.http.caches[{#CACHE}]'
              tags:
                -
                  tag: Application
                  value: Nginx+
                -
                  tag: Application
                  value: 'Nginx+ Cache'
            -
              uuid: 423bcb8827b44838a2f86d68566fec29
              name: 'miss responses written'
              type: DEPENDENT
              key: 'nginxplus.http.caches[{#CACHE},miss_responses_written]'
              delay: '0'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.miss.responses_written
              master_item:
                key: 'nginxplus.http.caches[{#CACHE}]'
              tags:
                -
                  tag: Application
                  value: Nginx+
                -
                  tag: Application
                  value: 'Nginx+ Cache'
            -
              uuid: 3e9d1261acb343059ad7f695b4fe9883
              name: 'revalidated bytes'
              type: DEPENDENT
              key: 'nginxplus.http.caches[{#CACHE},revalidated_bytes]'
              delay: '0'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.revalidated.bytes
              master_item:
                key: 'nginxplus.http.caches[{#CACHE}]'
              tags:
                -
                  tag: Application
                  value: Nginx+
                -
                  tag: Application
                  value: 'Nginx+ Cache'
            -
              uuid: 47e469a872d84a0cad3fa5f31cb9c75f
              name: 'revalidated responses'
              type: DEPENDENT
              key: 'nginxplus.http.caches[{#CACHE},revalidated_responses]'
              delay: '0'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.revalidated.responses
              master_item:
                key: 'nginxplus.http.caches[{#CACHE}]'
              tags:
                -
                  tag: Application
                  value: Nginx+
                -
                  tag: Application
                  value: 'Nginx+ Cache'
            -
              uuid: 31fbf16c8269485ea6c78da478302a8a
              name: size
              type: DEPENDENT
              key: 'nginxplus.http.caches[{#CACHE},size]'
              delay: '0'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.size
              master_item:
                key: 'nginxplus.http.caches[{#CACHE}]'
              tags:
                -
                  tag: Application
                  value: Nginx+
                -
                  tag: Application
                  value: 'Nginx+ Cache'
            -
              uuid: 5b95996a454b4363b105ad69f2d0b921
              name: 'stale bytes'
              type: DEPENDENT
              key: 'nginxplus.http.caches[{#CACHE},stale_bytes]'
              delay: '0'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.stale.bytes
              master_item:
                key: 'nginxplus.http.caches[{#CACHE}]'
              tags:
                -
                  tag: Application
                  value: Nginx+
                -
                  tag: Application
                  value: 'Nginx+ Cache'
            -
              uuid: 4a24d81952b248909d0fca8e287bb671
              name: 'stale responses'
              type: DEPENDENT
              key: 'nginxplus.http.caches[{#CACHE},stale_responses]'
              delay: '0'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.stale.responses
              master_item:
                key: 'nginxplus.http.caches[{#CACHE}]'
              tags:
                -
                  tag: Application
                  value: Nginx+
                -
                  tag: Application
                  value: 'Nginx+ Cache'
            -
              uuid: e0f1291218a9427ea51dcaa8e2155028
              name: 'updating bytes'
              type: DEPENDENT
              key: 'nginxplus.http.caches[{#CACHE},updating_bytes]'
              delay: '0'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.updating.bytes
              master_item:
                key: 'nginxplus.http.caches[{#CACHE}]'
              tags:
                -
                  tag: Application
                  value: Nginx+
                -
                  tag: Application
                  value: 'Nginx+ Cache'
            -
              uuid: d4978d5eea974343b72affd7a9d38c93
              name: 'updating responses'
              type: DEPENDENT
              key: 'nginxplus.http.caches[{#CACHE},updating_responses]'
              delay: '0'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.updating.responses
              master_item:
                key: 'nginxplus.http.caches[{#CACHE}]'
              tags:
                -
                  tag: Application
                  value: Nginx+
                -
                  tag: Application
                  value: 'Nginx+ Cache'
            -
              uuid: 89f956d3bc44437bb0219153aa84a161
              name: 'Nginx+ cache {#CACHE}'
              type: HTTP_AGENT
              key: 'nginxplus.http.caches[{#CACHE}]'
              history: 1d
              trends: '0'
              value_type: TEXT
              timeout: 15s
              url: 'http://{HOST.NAME}.alz.lcl/api/{$NGINXPLUS_API_VER}/http/caches/{#CACHE}'
              tags:
                -
                  tag: Application
                  value: Nginx+
                -
                  tag: Application
                  value: 'Nginx+ Cache'
          timeout: 15s
          url: 'http://{HOST.NAME}.alz.lcl/api/{$NGINXPLUS_API_VER}/http/caches?fields='
          preprocessing:
            -
              type: JAVASCRIPT
              parameters:
                - |
                  try {
                    var result = new Array();
                    var valarr = Object.getOwnPropertyNames(JSON.parse(value));
                  
                    for (var i = 0; i < valarr.length; i++) {
                      result.push({ "{#CACHE}": valarr[i] });
                    };
                  
                  } catch(error) {
                    result = [];
                    return error;
                  }
                  
                  return JSON.stringify(result);
        -
          uuid: 29321622e6f74d3bb75d7f8247a7c391
          name: 'Nginx+ HTTP limit_reqs discovery'
          type: HTTP_AGENT
          key: nginxplus.http.limit_reqs.discovery
          delay: 1h
          description: |
            when the "fields" param is empty it returns only names of upstreams
            creates LLD macro {#LIMIT_REQ} containing upstream name
          item_prototypes:
            -
              uuid: 53f66d76e5a3492997402bd1c8836a1d
              name: delayed
              type: DEPENDENT
              key: 'nginxplus.http.limit_reqs[{#LIMIT_REQ},delayed]'
              delay: '0'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.delayed
              master_item:
                key: 'nginxplus.http.limit_reqs[{#LIMIT_REQ}]'
              tags:
                -
                  tag: Application
                  value: Nginx+
                -
                  tag: Application
                  value: 'Nginx+ Limit_Reqs'
            -
              uuid: 2a935371e4f54190b9fa96fe2f15b60c
              name: 'delayed dry run'
              type: DEPENDENT
              key: 'nginxplus.http.limit_reqs[{#LIMIT_REQ},delayed_dry_run]'
              delay: '0'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.delayed_dry_run
              master_item:
                key: 'nginxplus.http.limit_reqs[{#LIMIT_REQ}]'
              tags:
                -
                  tag: Application
                  value: Nginx+
                -
                  tag: Application
                  value: 'Nginx+ Limit_Reqs'
            -
              uuid: 78d0de04a94c4464aeb0b8e4cf331309
              name: passed
              type: DEPENDENT
              key: 'nginxplus.http.limit_reqs[{#LIMIT_REQ},passed]'
              delay: '0'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.passed
              master_item:
                key: 'nginxplus.http.limit_reqs[{#LIMIT_REQ}]'
              tags:
                -
                  tag: Application
                  value: Nginx+
                -
                  tag: Application
                  value: 'Nginx+ Limit_Reqs'
            -
              uuid: 0bcd95fe129b4e308be101586ec49cf8
              name: rejected
              type: DEPENDENT
              key: 'nginxplus.http.limit_reqs[{#LIMIT_REQ},rejected]'
              delay: '0'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.rejected
              master_item:
                key: 'nginxplus.http.limit_reqs[{#LIMIT_REQ}]'
              tags:
                -
                  tag: Application
                  value: Nginx+
                -
                  tag: Application
                  value: 'Nginx+ Limit_Reqs'
            -
              uuid: 0675f1618ce94cc59e1e436a3838990b
              name: 'rejected dry run'
              type: DEPENDENT
              key: 'nginxplus.http.limit_reqs[{#LIMIT_REQ},rejected_dry_run]'
              delay: '0'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.rejected_dry_run
              master_item:
                key: 'nginxplus.http.limit_reqs[{#LIMIT_REQ}]'
              tags:
                -
                  tag: Application
                  value: Nginx+
                -
                  tag: Application
                  value: 'Nginx+ Limit_Reqs'
            -
              uuid: 881b295b959e4eeb9bb7100eaccb89be
              name: 'Nginx+ limit_req {#LIMIT_REQ}'
              type: HTTP_AGENT
              key: 'nginxplus.http.limit_reqs[{#LIMIT_REQ}]'
              history: 1d
              trends: '0'
              value_type: TEXT
              timeout: 15s
              url: 'http://{HOST.NAME}.alz.lcl/api/{$NGINXPLUS_API_VER}/http/limit_reqs/{#LIMIT_REQ}'
              tags:
                -
                  tag: Application
                  value: Nginx+
                -
                  tag: Application
                  value: 'Nginx+ Limit_Reqs'
          timeout: 15s
          url: 'http://{HOST.NAME}.alz.lcl/api/{$NGINXPLUS_API_VER}/http/limit_reqs?fields='
          preprocessing:
            -
              type: JAVASCRIPT
              parameters:
                - |
                  try {
                    var result = new Array();
                    var valarr = Object.getOwnPropertyNames(JSON.parse(value));
                  
                    for (var i = 0; i < valarr.length; i++) {
                      result.push({ "{#LIMIT_REQ}": valarr[i] });
                    };
                  
                  } catch(error) {
                    result = [];
                    return error;
                  }
                  
                  return JSON.stringify(result);
        -
          uuid: 8c03ef79ad9d4ee8a7bdeadfc4d5b528
          name: 'Nginx+ HTTP upstreams discovery'
          type: HTTP_AGENT
          key: nginxplus.http.upstreams.discovery
          delay: 1h
          description: |
            when the "fields" param is empty it returns only names of upstreams
            creates LLD macro {#UPSTREAM} containing upstream name
          item_prototypes:
            -
              uuid: ac1b825a9fee4b8187016fab2822b412
              name: state
              type: DEPENDENT
              key: 'nginxplus.http.upstream[{#UPSTREAM},peer_0,state]'
              delay: '0'
              trends: '0'
              value_type: CHAR
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.state
              master_item:
                key: 'nginxplus.http.upstream[{#UPSTREAM},peer_0]'
              tags:
                -
                  tag: Application
                  value: Nginx+
                -
                  tag: Application
                  value: 'Nginx+ HTTP Upstreams'
            -
              uuid: 897a835ee2464a1f8e2428bd1df012d8
              name: unhealthy
              type: DEPENDENT
              key: 'nginxplus.http.upstream[{#UPSTREAM},peer_0,unhealthy]'
              delay: '0'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.health_checks.unhealthy
              master_item:
                key: 'nginxplus.http.upstream[{#UPSTREAM},peer_0]'
              tags:
                -
                  tag: Application
                  value: Nginx+
                -
                  tag: Application
                  value: 'Nginx+ HTTP Upstreams'
            -
              uuid: 09ed06e6c94547149cca32669399b60e
              name: 'peer #0'
              type: DEPENDENT
              key: 'nginxplus.http.upstream[{#UPSTREAM},peer_0]'
              delay: '0'
              history: 1d
              trends: '0'
              value_type: TEXT
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.peers[0]'
              master_item:
                key: 'nginxplus.http.upstream[{#UPSTREAM}]'
              tags:
                -
                  tag: Application
                  value: Nginx+
                -
                  tag: Application
                  value: 'Nginx+ HTTP Upstreams'
            -
              uuid: 7b8b642e3c3e4b208ab95916f04509e6
              name: state
              type: DEPENDENT
              key: 'nginxplus.http.upstream[{#UPSTREAM},peer_1,state]'
              delay: '0'
              trends: '0'
              value_type: CHAR
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.state
              master_item:
                key: 'nginxplus.http.upstream[{#UPSTREAM},peer_1]'
              tags:
                -
                  tag: Application
                  value: Nginx+
                -
                  tag: Application
                  value: 'Nginx+ HTTP Upstreams'
            -
              uuid: a8828d6cbc9e4d9ba9c578ec1eb0e450
              name: unhealthy
              type: DEPENDENT
              key: 'nginxplus.http.upstream[{#UPSTREAM},peer_1,unhealthy]'
              delay: '0'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.health_checks.unhealthy
              master_item:
                key: 'nginxplus.http.upstream[{#UPSTREAM},peer_1]'
              tags:
                -
                  tag: Application
                  value: Nginx+
                -
                  tag: Application
                  value: 'Nginx+ HTTP Upstreams'
            -
              uuid: 75b93fc590eb43208deebb7dd58f8650
              name: 'peer #1'
              type: DEPENDENT
              key: 'nginxplus.http.upstream[{#UPSTREAM},peer_1]'
              delay: '0'
              history: 1d
              trends: '0'
              value_type: TEXT
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.peers[1]'
              master_item:
                key: 'nginxplus.http.upstream[{#UPSTREAM}]'
              tags:
                -
                  tag: Application
                  value: Nginx+
                -
                  tag: Application
                  value: 'Nginx+ HTTP Upstreams'
            -
              uuid: 65b6e7b8e37e4bb59ba9456bcabca6e5
              name: state
              type: DEPENDENT
              key: 'nginxplus.http.upstream[{#UPSTREAM},peer_2,state]'
              delay: '0'
              trends: '0'
              value_type: CHAR
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.state
              master_item:
                key: 'nginxplus.http.upstream[{#UPSTREAM},peer_2]'
              tags:
                -
                  tag: Application
                  value: Nginx+
                -
                  tag: Application
                  value: 'Nginx+ HTTP Upstreams'
            -
              uuid: bb95c1c387a0498ab751941932079b63
              name: unhealthy
              type: DEPENDENT
              key: 'nginxplus.http.upstream[{#UPSTREAM},peer_2,unhealthy]'
              delay: '0'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.health_checks.unhealthy
              master_item:
                key: 'nginxplus.http.upstream[{#UPSTREAM},peer_2]'
              tags:
                -
                  tag: Application
                  value: Nginx+
                -
                  tag: Application
                  value: 'Nginx+ HTTP Upstreams'
            -
              uuid: 4d8d0d8a65e04190a31d91206c0d5708
              name: 'peer #2'
              type: DEPENDENT
              key: 'nginxplus.http.upstream[{#UPSTREAM},peer_2]'
              delay: '0'
              history: 1d
              trends: '0'
              value_type: TEXT
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.peers[2]'
              master_item:
                key: 'nginxplus.http.upstream[{#UPSTREAM}]'
              tags:
                -
                  tag: Application
                  value: Nginx+
                -
                  tag: Application
                  value: 'Nginx+ HTTP Upstreams'
            -
              uuid: 8b8a6345650e4f48818d2b17bc62de7b
              name: state
              type: DEPENDENT
              key: 'nginxplus.http.upstream[{#UPSTREAM},peer_3,state]'
              delay: '0'
              trends: '0'
              value_type: CHAR
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.state
              master_item:
                key: 'nginxplus.http.upstream[{#UPSTREAM},peer_3]'
              tags:
                -
                  tag: Application
                  value: Nginx+
                -
                  tag: Application
                  value: 'Nginx+ HTTP Upstreams'
            -
              uuid: b13ec6c10ec24efabb744817d131f7c4
              name: unhealthy
              type: DEPENDENT
              key: 'nginxplus.http.upstream[{#UPSTREAM},peer_3,unhealthy]'
              delay: '0'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.health_checks.unhealthy
              master_item:
                key: 'nginxplus.http.upstream[{#UPSTREAM},peer_3]'
              tags:
                -
                  tag: Application
                  value: Nginx+
                -
                  tag: Application
                  value: 'Nginx+ HTTP Upstreams'
            -
              uuid: 70d4b1b81305467aac81070eccd5155d
              name: 'peer #3'
              type: DEPENDENT
              key: 'nginxplus.http.upstream[{#UPSTREAM},peer_3]'
              delay: '0'
              history: 1d
              trends: '0'
              value_type: TEXT
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.peers[3]'
              master_item:
                key: 'nginxplus.http.upstream[{#UPSTREAM}]'
              tags:
                -
                  tag: Application
                  value: Nginx+
                -
                  tag: Application
                  value: 'Nginx+ HTTP Upstreams'
            -
              uuid: 5556e4ff915a4644a22bac92ead8c3b6
              name: zombies
              type: DEPENDENT
              key: 'nginxplus.http.upstream[{#UPSTREAM},zombies]'
              delay: '0'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.zombies
              master_item:
                key: 'nginxplus.http.upstream[{#UPSTREAM}]'
              tags:
                -
                  tag: Application
                  value: Nginx+
                -
                  tag: Application
                  value: 'Nginx+ HTTP Upstreams'
            -
              uuid: 587d4f13159848c98dbfe62d5a991635
              name: 'Nginx+ HTTP upstream {#UPSTREAM}'
              type: HTTP_AGENT
              key: 'nginxplus.http.upstream[{#UPSTREAM}]'
              history: 1d
              trends: '0'
              value_type: TEXT
              timeout: 15s
              url: 'http://{HOST.NAME}.alz.lcl/api/{$NGINXPLUS_API_VER}/http/upstreams/{#UPSTREAM}'
              tags:
                -
                  tag: Application
                  value: Nginx+
                -
                  tag: Application
                  value: 'Nginx+ HTTP Upstreams'
          timeout: 15s
          url: 'http://{HOST.NAME}.alz.lcl/api/{$NGINXPLUS_API_VER}/http/upstreams?fields='
          preprocessing:
            -
              type: JAVASCRIPT
              parameters:
                - |
                  try {
                    var result = new Array();
                    var valarr = Object.getOwnPropertyNames(JSON.parse(value));
                  
                    for (var i = 0; i < valarr.length; i++) {
                      result.push({ "{#UPSTREAM}": valarr[i] });
                    };
                  
                  } catch(error) {
                    result = [];
                    return error;
                  }
                  
                  return JSON.stringify(result);
        -
          uuid: cae6f96a71d64ad8b52b2d12c9d717e8
          name: 'Nginx+ STREAM upstreams discovery'
          type: HTTP_AGENT
          key: nginxplus.stream.upstreams.discovery
          delay: 1h
          description: |
            when the "fields" param is empty it returns only names of upstreams
            creates LLD macro {#STREAM} containing upstream name
          item_prototypes:
            -
              uuid: c7a124a034d648b49b55f846b5c11e08
              name: state
              type: DEPENDENT
              key: 'nginxplus.stream.upstream[{#STREAM},peer_0,state]'
              delay: '0'
              trends: '0'
              value_type: CHAR
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.state
              master_item:
                key: 'nginxplus.stream.upstream[{#STREAM},peer_0]'
              tags:
                -
                  tag: Application
                  value: Nginx+
                -
                  tag: Application
                  value: 'Nginx+ STREAM Upstreams'
            -
              uuid: 8d97170f509748f899619af666eb9600
              name: unhealthy
              type: DEPENDENT
              key: 'nginxplus.stream.upstream[{#STREAM},peer_0,unhealthy]'
              delay: '0'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.health_checks.unhealthy
              master_item:
                key: 'nginxplus.stream.upstream[{#STREAM},peer_0]'
              tags:
                -
                  tag: Application
                  value: Nginx+
                -
                  tag: Application
                  value: 'Nginx+ STREAM Upstreams'
            -
              uuid: 40ce4d444e994b32aea2e454931cabad
              name: 'peer #0'
              type: DEPENDENT
              key: 'nginxplus.stream.upstream[{#STREAM},peer_0]'
              delay: '0'
              history: 1d
              trends: '0'
              value_type: TEXT
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.peers[0]'
              master_item:
                key: 'nginxplus.stream.upstream[{#STREAM}]'
              tags:
                -
                  tag: Application
                  value: Nginx+
                -
                  tag: Application
                  value: 'Nginx+ STREAM Upstreams'
            -
              uuid: 97aad6fa60bd4a839ebd23f98a43f03c
              name: state
              type: DEPENDENT
              key: 'nginxplus.stream.upstream[{#STREAM},peer_1,state]'
              delay: '0'
              trends: '0'
              value_type: CHAR
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.state
              master_item:
                key: 'nginxplus.stream.upstream[{#STREAM},peer_1]'
              tags:
                -
                  tag: Application
                  value: Nginx+
                -
                  tag: Application
                  value: 'Nginx+ STREAM Upstreams'
            -
              uuid: 0722f02aad834f469df31085b3c8487c
              name: unhealthy
              type: DEPENDENT
              key: 'nginxplus.stream.upstream[{#STREAM},peer_1,unhealthy]'
              delay: '0'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.health_checks.unhealthy
              master_item:
                key: 'nginxplus.stream.upstream[{#STREAM},peer_1]'
              tags:
                -
                  tag: Application
                  value: Nginx+
                -
                  tag: Application
                  value: 'Nginx+ STREAM Upstreams'
            -
              uuid: edd322fa7a7a45a39f01a45f2b5fe631
              name: 'peer #1'
              type: DEPENDENT
              key: 'nginxplus.stream.upstream[{#STREAM},peer_1]'
              delay: '0'
              history: 1d
              trends: '0'
              value_type: TEXT
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.peers[1]'
              master_item:
                key: 'nginxplus.stream.upstream[{#STREAM}]'
              tags:
                -
                  tag: Application
                  value: Nginx+
                -
                  tag: Application
                  value: 'Nginx+ STREAM Upstreams'
            -
              uuid: 173fa75a33a74278a9445766421521b3
              name: state
              type: DEPENDENT
              key: 'nginxplus.stream.upstream[{#STREAM},peer_2,state]'
              delay: '0'
              trends: '0'
              value_type: CHAR
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.state
              master_item:
                key: 'nginxplus.stream.upstream[{#STREAM},peer_2]'
              tags:
                -
                  tag: Application
                  value: Nginx+
                -
                  tag: Application
                  value: 'Nginx+ STREAM Upstreams'
            -
              uuid: 47891096085746e2bbea14dfafc9fa32
              name: unhealthy
              type: DEPENDENT
              key: 'nginxplus.stream.upstream[{#STREAM},peer_2,unhealthy]'
              delay: '0'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.health_checks.unhealthy
              master_item:
                key: 'nginxplus.stream.upstream[{#STREAM},peer_2]'
              tags:
                -
                  tag: Application
                  value: Nginx+
                -
                  tag: Application
                  value: 'Nginx+ STREAM Upstreams'
            -
              uuid: 56854aa45fae47d3b32dbd24edb8f638
              name: 'peer #2'
              type: DEPENDENT
              key: 'nginxplus.stream.upstream[{#STREAM},peer_2]'
              delay: '0'
              history: 1d
              trends: '0'
              value_type: TEXT
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - '$.peers[2]'
              master_item:
                key: 'nginxplus.stream.upstream[{#STREAM}]'
              tags:
                -
                  tag: Application
                  value: Nginx+
                -
                  tag: Application
                  value: 'Nginx+ STREAM Upstreams'
            -
              uuid: 42883623a6074efeb7b2d37d3a57b785
              name: zombies
              type: DEPENDENT
              key: 'nginxplus.stream.upstream[{#STREAM},zombies]'
              delay: '0'
              preprocessing:
                -
                  type: JSONPATH
                  parameters:
                    - $.zombies
              master_item:
                key: 'nginxplus.stream.upstream[{#STREAM}]'
              tags:
                -
                  tag: Application
                  value: Nginx+
                -
                  tag: Application
                  value: 'Nginx+ STREAM Upstreams'
            -
              uuid: 1f53c35a1402479da5e52d92d4d82d0a
              name: 'Nginx+ STREAM upstream {#STREAM}'
              type: HTTP_AGENT
              key: 'nginxplus.stream.upstream[{#STREAM}]'
              history: 1d
              trends: '0'
              value_type: TEXT
              timeout: 15s
              url: 'http://{HOST.NAME}.alz.lcl/api/{$NGINXPLUS_API_VER}/stream/upstreams/{#STREAM}'
              tags:
                -
                  tag: Application
                  value: Nginx+
                -
                  tag: Application
                  value: 'Nginx+ STREAM Upstreams'
          timeout: 15s
          url: 'http://{HOST.NAME}.alz.lcl/api/{$NGINXPLUS_API_VER}/stream/upstreams?fields='
          preprocessing:
            -
              type: JAVASCRIPT
              parameters:
                - |
                  try {
                    var result = new Array();
                    var valarr = Object.getOwnPropertyNames(JSON.parse(value));
                  
                    for (var i = 0; i < valarr.length; i++) {
                      result.push({ "{#STREAM}": valarr[i] });
                    };
                  
                  } catch(error) {
                    result = [];
                    return error;
                  }
                  
                  return JSON.stringify(result);
      macros:
        -
          macro: '{$NGINXPLUS_API_VER}'
          value: '6'
          description: 'Nginx+ API version'
