zabbix_export:
  version: '6.0'
  date: '2024-05-16T18:37:09Z'
  groups:
    - uuid: 22941f4e01294888a9bed3aae15f6ef9
      name: Templates/AWNET
  templates:
    - uuid: 36ecb42516794d619a451029cce9303c
      template: Authelia
      name: Authelia
      groups:
        - name: Templates/AWNET
      items:
        - uuid: a3e7fcb6c2dd4a96887f97c27ad825d7
          name: 'Authelia: Отказов в авторизации'
          type: DEPENDENT
          key: aw.app.authelia.auth_fail
          delay: '0'
          preprocessing:
            - type: PROMETHEUS_PATTERN
              parameters:
                - 'authelia_authn{banned="false",success="false"}'
                - value
                - ''
            - type: SIMPLE_CHANGE
              parameters:
                - ''
          master_item:
            key: 'web.page.get[{$AW.AUTHELIA.URL}]'
          tags:
            - tag: Application
              value: Authelia
            - tag: Subsystem
              value: Auth
        - uuid: fcc7e961ce9b420a92fec46e65a8aa6c
          name: 'Authelia: Успешных авторизаций'
          type: DEPENDENT
          key: aw.app.authelia.auth_ok
          delay: '0'
          preprocessing:
            - type: PROMETHEUS_PATTERN
              parameters:
                - 'authelia_authn{banned="false",success="true"}'
                - value
                - ''
            - type: SIMPLE_CHANGE
              parameters:
                - ''
          master_item:
            key: 'web.page.get[{$AW.AUTHELIA.URL}]'
          tags:
            - tag: Application
              value: Authelia
            - tag: Subsystem
              value: Auth
        - uuid: 66c27cac80404699881d7d8081fc2e15
          name: 'Authelia: Количество рабочий потоков приложения'
          type: DEPENDENT
          key: aw.app.authelia.go_threads
          delay: '0'
          preprocessing:
            - type: PROMETHEUS_PATTERN
              parameters:
                - go_threads
                - value
                - ''
          master_item:
            key: 'web.page.get[{$AW.AUTHELIA.URL}]'
          tags:
            - tag: Application
              value: Authelia
        - uuid: 06b818dd09974179849d8f37cda9fdba
          name: 'Authelia: Запросы к сервису - код 200'
          type: DEPENDENT
          key: 'aw.app.authelia.http[200]'
          delay: '0'
          preprocessing:
            - type: PROMETHEUS_PATTERN
              parameters:
                - 'authelia_authz{code="200"}'
                - value
                - ''
            - type: SIMPLE_CHANGE
              parameters:
                - ''
          master_item:
            key: 'web.page.get[{$AW.AUTHELIA.URL}]'
          tags:
            - tag: Application
              value: Authelia
            - tag: Subsystem
              value: HTTP
        - uuid: ee22063cc43346a2afe58b43639eadf5
          name: 'Authelia: Запросы к сервису - код 401'
          type: DEPENDENT
          key: 'aw.app.authelia.http[401]'
          delay: '0'
          preprocessing:
            - type: PROMETHEUS_PATTERN
              parameters:
                - 'authelia_authz{code="401"}'
                - value
                - ''
            - type: SIMPLE_CHANGE
              parameters:
                - ''
          master_item:
            key: 'web.page.get[{$AW.AUTHELIA.URL}]'
          tags:
            - tag: Application
              value: Authelia
            - tag: Subsystem
              value: HTTP
        - uuid: eb31c9fabf2f471f95b549e8a274d0a3
          name: '_ Сырые метрики authelia'
          key: 'web.page.get[{$AW.AUTHELIA.URL}]'
          history: '0'
          trends: '0'
          value_type: TEXT
          preprocessing:
            - type: JAVASCRIPT
              parameters:
                - |
                  var value_p = value.split('\n');
                  var flag = false;
                  var res = ''
                  
                  for (var i in value_p) {
                     var _buf = value_p[i].trim();
                     if (flag) {
                        res += _buf + '\n';
                     } else if (_buf.length == 0 && i > 1) {
                         flag = true;
                     }
                  }
                  
                  return res;
                  
          tags:
            - tag: Application
              value: Authelia
        - uuid: d445124298294904970ad1ff8919db49
          name: 'Доступность страницы с метриками Authenia'
          key: 'web.page.perf[{$AW.AUTHELIA.URL}]'
          value_type: FLOAT
          tags:
            - tag: Application
              value: Authelia
          triggers:
            - uuid: 70ae70799fe64521a38335c002cbc4aa
              expression: 'last(/Authelia/web.page.perf[{$AW.AUTHELIA.URL}])=0 or nodata(/Authelia/web.page.perf[{$AW.AUTHELIA.URL}],{$AW.AUTHELIA.TIMEOUT.CRIT})=1'
              name: 'Не доступна страница с метриками Authenia'
              priority: HIGH
      macros:
        - macro: '{$AW.AUTHELIA.TIMEOUT.CRIT}'
          value: 5m
          description: 'Критическое время недоступности сервиса'
        - macro: '{$AW.AUTHELIA.URL}'
          value: 'http://127.0.0.1:9092/metrics'
          description: 'URL, где расположены метрики Authelia'
