zabbix_export:
  version: '6.4'
  template_groups:
    - uuid: 7df96b18c230490a9a0a9e2307226338
      name: Templates
  templates:
    - uuid: 7ee36bbab9ed4f6cb7dec018dcb9b3a9
      template: 'Template OLT Fiberhome Complementar - BEE'
      name: 'Template OLT Fiberhome Complementar - BEE'
      groups:
        - name: Templates
      discovery_rules:
        - uuid: 91a0af2962844244b7ce5b304b536ecc
          name: 'Descoberta de Intefaces GPON'
          type: SNMP_AGENT
          snmp_oid: 'discovery[{#PON},1.3.6.1.4.1.5875.800.3.9.3.4.1.2]'
          key: descoberta.interface.gpon.bee.fiberhome
          delay: 1h
          item_prototypes:
            - uuid: 9642a95be32c413b88d367e1c1ee41c9
              name: 'PON {#PON}: Los'
              type: EXTERNAL
              key: 'ponfh["{#PON}","0","{HOST.CONN}"]'
              delay: 10m
              tags:
                - tag: 'ONUs LOS'
            - uuid: 12b4a4813ea94723bd99cc290b2ac76d
              name: 'PON {#PON}: Onlines'
              type: EXTERNAL
              key: 'ponfh["{#PON}","1","{HOST.CONN}"]'
              delay: 10m
              tags:
                - tag: 'ONUs ON'
              trigger_prototypes:
                - uuid: ccf2955e542a417dbec55933a1077640
                  expression: |
                    (last(/Template OLT Fiberhome Complementar - BEE/ponfh["{#PON}","1","{HOST.CONN}"],#2)
                    - last(/Template OLT Fiberhome Complementar - BEE/ponfh["{#PON}","1","{HOST.CONN}"]))
                    /
                    last(/Template OLT Fiberhome Complementar - BEE/ponfh["{#PON}","1","{HOST.CONN}"],#2)*100>=50
                  recovery_mode: RECOVERY_EXPRESSION
                  recovery_expression: |
                    (last(/Template OLT Fiberhome Complementar - BEE/ponfh["{#PON}","1","{HOST.CONN}"],#2)
                    - last(/Template OLT Fiberhome Complementar - BEE/ponfh["{#PON}","1","{HOST.CONN}"]))
                    /
                    last(/Template OLT Fiberhome Complementar - BEE/ponfh["{#PON}","1","{HOST.CONN}"],#2)*100<=50
                    and
                    last(/Template OLT Fiberhome Complementar - BEE/ponfh["{#PON}","1","{HOST.CONN}"])>=
                    avg(/Template OLT Fiberhome Complementar - BEE/ponfh["{#PON}","1","{HOST.CONN}"],12h)
                  name: 'Possível Queda Massiva de ONUs Onlines (-50%): {#PON}'
                  discover: NO_DISCOVER
                  priority: AVERAGE
                  manual_close: 'YES'
            - uuid: 9ab77d318c744bdaa7a3ee31c390bb17
              name: 'PON {#PON}: Offlines'
              type: EXTERNAL
              key: 'ponfh["{#PON}","2","{HOST.CONN}"]'
              delay: 10m
              tags:
                - tag: 'ONUs OFF'
            - uuid: 8da8a9c9fc8f4cdd89918c5ea6274567
              name: 'PON {#PON}: Sem dados'
              type: EXTERNAL
              key: 'ponfh["{#PON}","3","{HOST.CONN}"]'
              delay: 10m
              tags:
                - tag: 'ONUs SEM DADOS'
            - uuid: fc9753ab81e7409ea43d038ec6c915d7
              name: 'PON {#PON}: Energia'
              type: EXTERNAL
              key: 'ponfh["{#PON}","4","{HOST.CONN}"]'
              delay: 10m
              tags:
                - tag: 'ONUs ENERGIA'
          preprocessing:
            - type: STR_REPLACE
              parameters:
                - 'PON '
                - ''
