zabbix_export:
  version: '7.0'
  template_groups:
    - uuid: 7df96b18c230490a9a0a9e2307226338
      name: Templates
  templates:
    - uuid: f3ac755d84ab43c4b4b92d3445ee8f74
      template: '-- Template SNMP Router'
      name: '-- Template SNMP Router'
      description: |
        Thist template will work on Vivo/TP-Link Router
        
        OID BASE = .1.3.6.1.2.1
        
        By wiki.tiozaodolinux.com - GPL
        
        Based on "Template TP-LINK by SNMP" - https://www.zabbix.com/br/integrations/tp-link
      groups:
        - name: Templates
      items:
        - uuid: dbb27ba9954f446aa250d9e3eac07800
          name: 'System contact details'
          type: SNMP_AGENT
          snmp_oid: .1.3.6.1.2.1.1.4.0
          key: system.contact
          delay: 1h
          history: 2w
          value_type: CHAR
          trends: '0'
          tags:
            - tag: component
              value: system
        - uuid: 33bda24bbea34788ab7b6eadda4b599a
          name: 'System description'
          type: SNMP_AGENT
          snmp_oid: 1.3.6.1.2.1.1.1.0
          key: system.descr
          delay: 1h
          history: 2w
          value_type: CHAR
          trends: '0'
          description: |
            MIB: SNMPv2-MIB
            A textual description of the entity. This value should
            include the full name and version identification of the system's hardware type, software operating-system, and
            networking software.
          preprocessing:
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 12h
          tags:
            - tag: component
              value: system
        - uuid: 1f123e4c9ee741d89b1122b11474de7f
          name: Uptime
          type: SNMP_AGENT
          snmp_oid: .1.3.6.1.2.1.1.3.0
          key: system.hw.uptime
          history: 2w
          trends: '0'
          units: uptime
          description: 'The time (in hundredths of a second) since the network management portion of the system was last re-initialized.'
          preprocessing:
            - type: MULTIPLIER
              parameters:
                - '0.01'
          tags:
            - tag: component
              value: performance
          triggers:
            - uuid: 43dc2a1d349c492682e2310df42e0017
              expression: 'last(/-- Template SNMP Router/system.hw.uptime)<10m'
              name: 'Router: {HOST.NAME} ({HOST.IP}) - Has been restarted (uptime <10m)'
              priority: INFO
              description: 'The device uptime is less than 10 minutes.'
        - uuid: 3c803e30088147afbf3a588e4f9369d9
          name: 'System location'
          type: SNMP_AGENT
          snmp_oid: .1.3.6.1.2.1.1.6.0
          key: system.location
          delay: 1h
          history: 2w
          value_type: CHAR
          trends: '0'
          preprocessing:
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 12h
          tags:
            - tag: component
              value: system
        - uuid: 6fa5fc4eaf164da9b1da48bc2dcdd194
          name: 'System name'
          type: SNMP_AGENT
          snmp_oid: .1.3.6.1.2.1.1.5.0
          key: system.name
          delay: 1h
          history: 2w
          value_type: CHAR
          trends: '0'
          description: |
            MIB: SNMPv2-MIB
            An administratively-assigned name for this managed node.By convention, this is the node's fully-qualified domain name.  If the name is unknown, the value is the zero-length string.
          preprocessing:
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 12h
          tags:
            - tag: component
              value: system
        - uuid: f0c6ee64a3a740fdbd1086ab94da08e2
          name: 'System object ID'
          type: SNMP_AGENT
          snmp_oid: 1.3.6.1.2.1.1.2.0
          key: system.objectid
          delay: 1h
          history: 2w
          value_type: CHAR
          trends: '0'
          description: |
            MIB: SNMPv2-MIB
            The vendor's authoritative identification of the network management subsystem contained in the entity.  This value is allocated within the SMI enterprises subtree (1.3.6.1.4.1) and provides an easy and unambiguous means for determining`what kind of box' is being managed.  For example, if vendor`Flintstones, Inc.' was assigned the subtree1.3.6.1.4.1.4242, it could assign the identifier 1.3.6.1.4.1.4242.1.1 to its `Fred Router'.
          preprocessing:
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 12h
          tags:
            - tag: component
              value: system
        - uuid: b0264828057b41db810121e1c3192161
          name: 'SNMP agent availability'
          type: INTERNAL
          key: 'zabbix[host,snmp,available]'
          history: 2w
          description: |
            Availability of SNMP checks on the host. The value of this item corresponds to availability icons in the host list.
            Possible value:
            0 - not available
            1 - available
            2 - unknown
          valuemap:
            name: 'Service state'
          tags:
            - tag: component
              value: health
          triggers:
            - uuid: e5f7e68ddb624938bd74ddf5de32eb7e
              expression: 'max(/-- Template SNMP Router/zabbix[host,snmp,available],{$SNMP.TIMEOUT})=0'
              name: 'Router : {HOST.NAME} ({HOST.IP}) - No SNMP data collection for {$SNMP.TIMEOUT}'
              priority: DISASTER
              description: 'SNMP is not available for polling. Please check device connectivity and SNMP settings.'
              manual_close: 'YES'
      discovery_rules:
        - uuid: e328bd8cbeef487682ab60cc1105a3dd
          name: 'Network interfaces discovery'
          type: SNMP_AGENT
          snmp_oid: 'discovery[{#SNMPVALUE},.1.3.6.1.2.1.2.2.1.2]'
          key: router.ifDescr
          delay: 1h
          filter:
            conditions:
              - macro: '{#SNMPVALUE}'
                value: '{$NET.IF.IFNAME.NOT_MATCHES}'
                operator: NOT_MATCHES_REGEX
                formulaid: A
          lifetime: 2d
          enabled_lifetime_type: DISABLE_NEVER
          description: |
            Discovering interfaces
            IF-MIB::ifDescr = .1.3.6.1.2.1.2.2.1.2
          item_prototypes:
            - uuid: ac91c1854a3646b8be3a30f8570a87a5
              name: 'Interface {#SNMPVALUE}: Operational status'
              type: SNMP_AGENT
              snmp_oid: '.1.3.6.1.2.1.2.2.1.7.{#SNMPINDEX}'
              key: 'net.ifAdminStatus.[{#SNMPVALUE}]'
              history: 2w
              description: 'IF-MIB::ifAdminStatus = .1.3.6.1.2.1.2.2.1.7'
              valuemap:
                name: 'Service state'
              tags:
                - tag: component
                  value: health
            - uuid: c5d6cca0cd1248adaaf93ed685410d3d
              name: 'Interface {#SNMPVALUE}: Bits received'
              type: SNMP_AGENT
              snmp_oid: '.1.3.6.1.2.1.2.2.1.10.{#SNMPINDEX}'
              key: 'net.ifInOctets.[{#SNMPVALUE}]'
              history: 2w
              units: bps
              description: 'IF-MIB::ifInOctets = .1.3.6.1.2.1.2.2.1.10'
              preprocessing:
                - type: CHANGE_PER_SECOND
                  parameters:
                    - ''
                - type: MULTIPLIER
                  parameters:
                    - '8'
              tags:
                - tag: component
                  value: input
            - uuid: 448924977a4946918d1cc49c945b879a
              name: 'Interface {#SNMPVALUE}: Bits sent'
              type: SNMP_AGENT
              snmp_oid: '.1.3.6.1.2.1.2.2.1.16.{#SNMPINDEX}'
              key: 'net.ifOutOctets.[{#SNMPVALUE}]'
              history: 2w
              units: bps
              description: 'IF-MIB::ifOutOctets = .1.3.6.1.2.1.2.2.1.16'
              preprocessing:
                - type: CHANGE_PER_SECOND
                  parameters:
                    - ''
                - type: MULTIPLIER
                  parameters:
                    - '8'
              tags:
                - tag: component
                  value: output
          graph_prototypes:
            - uuid: 556bded538a349f79909901ccc549f48
              name: 'Router: Interface {#SNMPVALUE}'
              graph_items:
                - color: 1A7C11
                  calc_fnc: ALL
                  item:
                    host: '-- Template SNMP Router'
                    key: 'net.ifInOctets.[{#SNMPVALUE}]'
                - sortorder: '1'
                  color: FF0000
                  calc_fnc: ALL
                  item:
                    host: '-- Template SNMP Router'
                    key: 'net.ifOutOctets.[{#SNMPVALUE}]'
      tags:
        - tag: router
          value: template
      macros:
        - macro: '{$NET.IF.IFNAME.NOT_MATCHES}'
          value: '(^[alrsi][a-z0-9]*$)'
          description: 'remove: apcli0, ifb0, ra0, sit0'
        - macro: '{$SNMP.TIMEOUT}'
          value: 5m
          description: 'The time interval for SNMP availability trigger.'
      valuemaps:
        - uuid: 9308d80817e24e0ba0ab5549df663887
          name: 'Service state'
          mappings:
            - value: '0'
              newvalue: Down
            - value: '1'
              newvalue: Up
            - value: '2'
              newvalue: Unknown
        - uuid: 0a626c25e8884f1bbd88f60f49bdcba6
          name: zabbix.host.available
          mappings:
            - value: '0'
              newvalue: 'not available'
            - value: '1'
              newvalue: available
            - value: '2'
              newvalue: unknown
