zabbix_export:
  version: '7.0'
  template_groups:
    - uuid: 36bff6c29af64692839d077febfc7079
      name: 'Templates/Network devices'
  templates:
    - uuid: 8ea7299983f24d0a913606e334f0e526
      template: 'ZYXEL MGS-3712 by SNMP'
      name: 'ZYXEL MGS-3712 by SNMP'
      description: |
        ZYXEL MGS-3712
        
        MIBs used:
        RFC1213-MIB
        HOST-RESOURCES-MIB
        ZYXEL-MGS3712F-MIB
        IF-MIB
        
        Known Issues:
        
          Description: Incorrect handling of SNMP bulk requests. Disable the use of bulk requests in the SNMP interface settings.
          Version: all versions firmware
          Device: ZYXEL MGS-3712
        
        You can discuss this template or leave feedback on our forum https://www.zabbix.com/forum/zabbix-suggestions-and-feedback/422668-discussion-thread-for-official-zabbix-templates-for-zyxel
        
        Generated by official Zabbix template tool "Templator"
      vendor:
        name: Zabbix
        version: 7.0-0
      groups:
        - name: 'Templates/Network devices'
      items:
        - uuid: 8777bb95a4b64fd293e96b25febf3915
          name: 'SNMP agent availability'
          type: INTERNAL
          key: 'zabbix[host,snmp,available]'
          valuemap:
            name: 'SNMP available'
          preprocessing:
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          tags:
            - tag: component
              value: network
          triggers:
            - uuid: 60787fd1204b42bfb515b1b204c1d14f
              expression: 'max(/ZYXEL MGS-3712 by SNMP/zabbix[host,snmp,available],{$SNMP.TIMEOUT})=0'
              name: 'No SNMP data collection'
              opdata: 'Current state: {ITEM.LASTVALUE1}'
              priority: WARNING
              description: 'SNMP is not available for polling. Please check device connectivity and SNMP settings.'
              tags:
                - tag: scope
                  value: availability
        - uuid: b93b020818034096a973d8e171a099b2
          name: Contact
          type: SNMP_AGENT
          snmp_oid: .1.3.6.1.2.1.1.4.0
          key: zyxel.3712.contact
          delay: 1h
          value_type: CHAR
          description: |
            MIB: RFC1213-MIB
            The textual identification of the contact person
            for this managed node, together with information
            on how to contact this person.
          inventory_link: CONTACT
          preprocessing:
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 6h
          tags:
            - tag: component
              value: inventory
        - uuid: 4d13bad4f29f41b1890fa9e2709dd461
          name: 'CPU utilization'
          type: SNMP_AGENT
          snmp_oid: .1.3.6.1.4.1.890.1.5.8.47.11.7.0
          key: zyxel.3712.cpuusage
          value_type: FLOAT
          units: '%'
          description: |
            MIB: ZYXEL-MGS3712F-MIB
            Show device CPU load in %, it's the snapshot of CPU load when
            getting the values.
          tags:
            - tag: component
              value: cpu
          triggers:
            - uuid: b1ca06637dbe4c9ca84e2811e780d5d5
              expression: 'min(/ZYXEL MGS-3712 by SNMP/zyxel.3712.cpuusage,5m)>{$CPU.UTIL.CRIT}'
              name: 'High CPU utilization'
              event_name: 'High CPU utilization (over {$CPU.UTIL.CRIT}% for 5m)'
              opdata: 'Current utilization: {ITEM.LASTVALUE1}'
              priority: WARNING
              description: 'The CPU utilization is too high. The system might be slow to respond.'
              tags:
                - tag: scope
                  value: performance
        - uuid: efc31527c7af48729c1d5a229b115c55
          name: 'ZyNOS F/W Version'
          type: SNMP_AGENT
          snmp_oid: 'discovery[{#SNMP.ARRAY},.1.3.6.1.4.1.890.1.5.8.47.1]'
          key: zyxel.3712.fwversion
          delay: 1h
          value_type: CHAR
          description: 'MIB: ZYXEL-MGS3712F-MIB'
          inventory_link: SOFTWARE_FULL
          preprocessing:
            - type: JAVASCRIPT
              parameters:
                - |
                  var inArray = JSON.parse(value);
                  var tmpObj = {};
                  inArray.forEach(function(item, i, arr) {
                    tmpObj[item["{#SNMPINDEX}"]] = item["{#SNMP.ARRAY}"]
                  });
                  var strOut = 'V' + tmpObj["1.0"] + '.' + tmpObj["2.0"]
                    + '(' + tmpObj["3.0"] + '.' + tmpObj["4.0"] + ')_'
                    + tmpObj["7.0"] + '.' + tmpObj["6.0"] + '.' + tmpObj["5.0"];
                  return strOut;
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1d
          tags:
            - tag: component
              value: inventory
          triggers:
            - uuid: de7d7e7d976c4b9894259c4e7fb5a4dd
              expression: 'last(/ZYXEL MGS-3712 by SNMP/zyxel.3712.fwversion,#1)<>last(/ZYXEL MGS-3712 by SNMP/zyxel.3712.fwversion,#2) and length(last(/ZYXEL MGS-3712 by SNMP/zyxel.3712.fwversion))>0'
              name: 'Firmware has changed'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: INFO
              description: 'Firmware version has changed. Acknowledge to close the problem manually.'
              manual_close: 'YES'
              tags:
                - tag: scope
                  value: notice
        - uuid: 801ba0a2d20f440d822eb042146b8d16
          name: 'Uptime (hardware)'
          type: SNMP_AGENT
          snmp_oid: .1.3.6.1.2.1.25.1.1.0
          key: zyxel.3712.hw.uptime
          delay: 30s
          trends: '0'
          units: uptime
          description: |
            MIB: HOST-RESOURCES-MIB
            The amount of time since this host was last initialized.
            Note that this is different from sysUpTime in the SNMPv2-MIB
            [RFC1907] because sysUpTime is the uptime of the
            network management portion of the system.
          preprocessing:
            - type: CHECK_NOT_SUPPORTED
              parameters:
                - '-1'
              error_handler: CUSTOM_VALUE
              error_handler_params: '0'
            - type: MULTIPLIER
              parameters:
                - '0.01'
          tags:
            - tag: component
              value: system
        - uuid: a52f578cc57448f0a43641c75be89ce9
          name: Location
          type: SNMP_AGENT
          snmp_oid: .1.3.6.1.2.1.1.6.0
          key: zyxel.3712.location
          delay: 1h
          value_type: CHAR
          description: |
            MIB: RFC1213-MIB
            The physical location of this node (e.g.,
            `telephone closet, 3rd floor').
          inventory_link: LOCATION
          preprocessing:
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 6h
          tags:
            - tag: component
              value: inventory
        - uuid: 26236c6667c9411393fb45af2324e318
          name: 'MAC address'
          type: SNMP_AGENT
          snmp_oid: .1.3.6.1.2.1.2.2.1.6.1
          key: zyxel.3712.mac
          delay: 1h
          value_type: CHAR
          description: |
            MIB: IF-MIB
            The interface's address at the protocol layer
            immediately `below' the network layer in the
            protocol stack.  For interfaces which do not have
            such an address (e.g., a serial line), this object
            should contain an octet string of zero length.
          inventory_link: MACADDRESS_A
          preprocessing:
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 6h
          tags:
            - tag: component
              value: inventory
        - uuid: fc5d5cfb35a14ed597623db67433dcac
          name: 'Hardware model name'
          type: SNMP_AGENT
          snmp_oid: .1.3.6.1.2.1.1.1.0
          key: zyxel.3712.model
          delay: 1h
          value_type: CHAR
          description: |
            MIB: RFC1213-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.  It is mandatory that this only contain
            printable ASCII characters.
          inventory_link: MODEL
          preprocessing:
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 6h
          tags:
            - tag: component
              value: inventory
          triggers:
            - uuid: e0b4c4f09f6f496cb035af320fcf96a0
              expression: 'last(/ZYXEL MGS-3712 by SNMP/zyxel.3712.model)<>"MGS-3712"'
              name: 'Template does not match hardware'
              priority: INFO
              description: 'This template is for Zyxel MGS-3712, but connected to {ITEM.VALUE}'
              tags:
                - tag: scope
                  value: notice
        - uuid: 409fb8c9b315474db7602fba18702a1d
          name: 'Host name'
          type: SNMP_AGENT
          snmp_oid: .1.3.6.1.2.1.1.5.0
          key: zyxel.3712.name
          delay: 1h
          value_type: CHAR
          description: |
            MIB: RFC1213-MIB
            An administratively-assigned name for this
            managed node.  By convention, this is the node's
            fully-qualified domain name.
          inventory_link: NAME
          preprocessing:
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 6h
          tags:
            - tag: component
              value: inventory
        - uuid: 692e0384fcf44ec1ac6df0d8925358e3
          name: 'Uptime (network)'
          type: SNMP_AGENT
          snmp_oid: .1.3.6.1.2.1.1.3.0
          key: zyxel.3712.net.uptime
          delay: 30s
          trends: '0'
          units: uptime
          description: |
            MIB: RFC1213-MIB
            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: system
        - uuid: 91afb18daedc403a866302ef943beef7
          name: 'Hardware serial number'
          type: SNMP_AGENT
          snmp_oid: .1.3.6.1.4.1.890.1.5.8.47.1.10.0
          key: zyxel.3712.serialnumber
          delay: 1h
          value_type: CHAR
          description: |
            MIB: ZYXEL-MGS3712F-MIB
            Serial number
          inventory_link: SERIALNO_A
          preprocessing:
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 6h
          tags:
            - tag: component
              value: inventory
          triggers:
            - uuid: 4a9495748e09477ca5f12443fff533c9
              expression: 'last(/ZYXEL MGS-3712 by SNMP/zyxel.3712.serialnumber,#1)<>last(/ZYXEL MGS-3712 by SNMP/zyxel.3712.serialnumber,#2) and length(last(/ZYXEL MGS-3712 by SNMP/zyxel.3712.serialnumber))>0'
              name: 'Device has been replaced'
              event_name: 'Device has been replaced (new serial number received)'
              priority: INFO
              description: 'Device serial number has changed. Acknowledge to close the problem manually.'
              manual_close: 'YES'
              tags:
                - tag: scope
                  value: notice
      discovery_rules:
        - uuid: 8402d05803ff481497a5e6f95874e983
          name: 'Fan discovery'
          type: SNMP_AGENT
          snmp_oid: 'discovery[{#ZYXEL.FANRPM.THRESH.LOW},.1.3.6.1.4.1.890.1.5.8.47.8.1.1.5]'
          key: zyxel.3712.fan.discovery
          delay: 1h
          description: 'An entry in fanRpmTable.'
          item_prototypes:
            - uuid: 568dd120eb8b409dbc8c19d5869c6978
              name: 'Fan #{#SNMPINDEX}'
              type: SNMP_AGENT
              snmp_oid: '.1.3.6.1.4.1.890.1.5.8.47.8.1.1.2.{#SNMPINDEX}'
              key: 'zyxel.3712.fan[{#SNMPINDEX}]'
              units: '!rpm'
              description: |
                MIB: ZYXEL-MGS3712F-MIB
                Current speed in Revolutions Per Minute (RPM) on the fan.
              preprocessing:
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              tags:
                - tag: component
                  value: fan
                - tag: component
                  value: sensor
              trigger_prototypes:
                - uuid: edc0057dbdb64fd584cc968c5d8bb41f
                  expression: 'last(/ZYXEL MGS-3712 by SNMP/zyxel.3712.fan[{#SNMPINDEX}])<{#ZYXEL.FANRPM.THRESH.LOW}'
                  name: 'FAN{#SNMPINDEX} is in critical state'
                  opdata: 'Current state: {ITEM.LASTVALUE1}'
                  priority: AVERAGE
                  description: 'Please check the fan unit'
                  tags:
                    - tag: scope
                      value: notice
          graph_prototypes:
            - uuid: 06d4f886b788464fad9f0da91d78b0e4
              name: 'ZYXEL MGS-3712: Fan #{#SNMPINDEX}'
              graph_items:
                - color: 199C0D
                  item:
                    host: 'ZYXEL MGS-3712 by SNMP'
                    key: 'zyxel.3712.fan[{#SNMPINDEX}]'
        - uuid: 1568af5125ee4005abc1860e0610f7c4
          name: 'Interface discovery'
          type: SNMP_AGENT
          snmp_oid: 'discovery[{#ZYXEL.IF.NAME},.1.3.6.1.4.1.890.1.5.8.47.22.1.1.3,{#ZYXEL.IF.LINKUPTYPE},.1.3.6.1.4.1.890.1.5.8.47.22.1.1.5]'
          key: zyxel.3712.net.if.discovery
          delay: 1h
          filter:
            evaltype: AND
            conditions:
              - macro: '{#ZYXEL.IF.LINKUPTYPE}'
                value: '{$ZYXEL.LLD.FILTER.IF.LINKUPTYPE.MATCHES}'
              - macro: '{#ZYXEL.IF.LINKUPTYPE}'
                value: '{$ZYXEL.LLD.FILTER.IF.LINKUPTYPE.NOT_MATCHES}'
                operator: NOT_MATCHES_REGEX
              - macro: '{#ZYXEL.IF.NAME}'
                value: '{$ZYXEL.LLD.FILTER.IF.NAME.MATCHES}'
              - macro: '{#ZYXEL.IF.NAME}'
                value: '{$ZYXEL.LLD.FILTER.IF.NAME.NOT_MATCHES}'
                operator: NOT_MATCHES_REGEX
          item_prototypes:
            - uuid: 9a97d9e95dba4ba88e08ccbd48acce07
              name: 'Port {#SNMPINDEX}: Administrative status'
              type: SNMP_AGENT
              snmp_oid: '.1.3.6.1.2.1.2.2.1.7.{#SNMPINDEX}'
              key: 'zyxel.3712.net.if.adminstatus[{#SNMPINDEX}]'
              description: |
                MIB: IF-MIB
                The desired state of the interface.  The
                testing(3) state indicates that no operational
                packets can be passed.
              valuemap:
                name: 'ZYXEL MGS-3712 port admin status'
              preprocessing:
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 6h
              tags:
                - tag: component
                  value: network
                - tag: description
                  value: '{#ZYXEL.IF.NAME}'
                - tag: interface
                  value: '{#SNMPINDEX}'
            - uuid: f6e2db1bdfd0451a9ca896ade8df790f
              name: 'Port {#SNMPINDEX}: Interface name'
              type: SNMP_AGENT
              snmp_oid: '.1.3.6.1.2.1.2.2.1.2.{#SNMPINDEX}'
              key: 'zyxel.3712.net.if.descr[{#SNMPINDEX}]'
              value_type: CHAR
              description: |
                MIB: IF-MIB
                A textual string containing information about the interface
              preprocessing:
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 6h
              tags:
                - tag: component
                  value: network
                - tag: description
                  value: '{#ZYXEL.IF.NAME}'
                - tag: interface
                  value: '{#SNMPINDEX}'
            - uuid: ae4776dea7aa44e7a403aa8bab391a30
              name: 'Port {#SNMPINDEX}: Link speed'
              type: SNMP_AGENT
              snmp_oid: '.1.3.6.1.2.1.31.1.1.1.15.{#SNMPINDEX}'
              key: 'zyxel.3712.net.if.highspeed[{#SNMPINDEX}]'
              units: bps
              description: |
                MIB: IF-MIB
                An estimate of the interface's current bandwidth in bits per second
              preprocessing:
                - type: MULTIPLIER
                  parameters:
                    - '1000000'
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 6h
              tags:
                - tag: component
                  value: network
                - tag: description
                  value: '{#ZYXEL.IF.NAME}'
                - tag: interface
                  value: '{#SNMPINDEX}'
            - uuid: 5c48f1894ae449528d0ef9844c22dee2
              name: 'Port {#SNMPINDEX}: Incoming broadcast packages'
              type: SNMP_AGENT
              snmp_oid: '.1.3.6.1.2.1.31.1.1.1.9.{#SNMPINDEX}'
              key: 'zyxel.3712.net.if.in.broadcastpkts[{#SNMPINDEX}]'
              units: packets/s
              description: |
                MIB: IF-MIB
                The number of packets, delivered by this sub-layer to a
                higher (sub-)layer, which were addressed to a broadcast
                address at this sub-layer.
              preprocessing:
                - type: CHANGE_PER_SECOND
              tags:
                - tag: component
                  value: network
                - tag: description
                  value: '{#ZYXEL.IF.NAME}'
                - tag: interface
                  value: '{#SNMPINDEX}'
            - uuid: 83b692f16c7f40899fb802686dccffb5
              name: 'Port {#SNMPINDEX}: Incoming multicast packages'
              type: SNMP_AGENT
              snmp_oid: '.1.3.6.1.2.1.31.1.1.1.8.{#SNMPINDEX}'
              key: 'zyxel.3712.net.if.in.multicastpkts[{#SNMPINDEX}]'
              units: packets/s
              description: |
                MIB: IF-MIB
                The number of packets, delivered by this sub-layer to a
                higher (sub-)layer, which were addressed to a multicast
                address at this sub-layer.  For a MAC layer protocol, this
                includes both Group and Functional addresses.
              preprocessing:
                - type: CHANGE_PER_SECOND
              tags:
                - tag: component
                  value: network
                - tag: description
                  value: '{#ZYXEL.IF.NAME}'
                - tag: interface
                  value: '{#SNMPINDEX}'
            - uuid: a9880181229d44e0a60f173820eb5d67
              name: 'Port {#SNMPINDEX}: Incoming traffic'
              type: SNMP_AGENT
              snmp_oid: '.1.3.6.1.2.1.31.1.1.1.6.{#SNMPINDEX}'
              key: 'zyxel.3712.net.if.in.traffic[{#SNMPINDEX}]'
              units: bps
              description: |
                MIB: IF-MIB
                The total number of octets received on the interface,
                including framing characters.
              preprocessing:
                - type: MULTIPLIER
                  parameters:
                    - '8'
                - type: CHANGE_PER_SECOND
              tags:
                - tag: component
                  value: network
                - tag: description
                  value: '{#ZYXEL.IF.NAME}'
                - tag: interface
                  value: '{#SNMPINDEX}'
            - uuid: 2555e749de034c2db2c7a800a8785695
              name: 'Port {#SNMPINDEX}: Incoming unicast packages'
              type: SNMP_AGENT
              snmp_oid: '.1.3.6.1.2.1.31.1.1.1.7.{#SNMPINDEX}'
              key: 'zyxel.3712.net.if.in.ucastpkts[{#SNMPINDEX}]'
              units: packets/s
              description: |
                MIB: IF-MIB
                The number of packets, delivered by this sub-layer to a
                higher (sub-)layer, which were not addressed to a multicast
                or broadcast address at this sub-layer
              preprocessing:
                - type: CHANGE_PER_SECOND
              tags:
                - tag: component
                  value: network
                - tag: description
                  value: '{#ZYXEL.IF.NAME}'
                - tag: interface
                  value: '{#SNMPINDEX}'
            - uuid: ca42c0b40bf74f03b544b9d0dd678223
              name: 'Port {#SNMPINDEX}: Incoming utilization'
              type: CALCULATED
              key: 'zyxel.3712.net.if.in.util[{#SNMPINDEX}]'
              value_type: FLOAT
              units: '%'
              params: 'last(//zyxel.3712.net.if.in.traffic[{#SNMPINDEX}]) * (last(//zyxel.3712.net.if.highspeed[{#SNMPINDEX}]) <> 0) / ( last(//zyxel.3712.net.if.highspeed[{#SNMPINDEX}]) + (last(//zyxel.3712.net.if.highspeed[{#SNMPINDEX}]) = 0) ) * 100'
              description: 'Interface utilization percentage'
              preprocessing:
                - type: IN_RANGE
                  parameters:
                    - '0'
                    - '100'
                  error_handler: DISCARD_VALUE
                - type: JAVASCRIPT
                  parameters:
                    - 'return +parseFloat(value).toFixed(0);'
              tags:
                - tag: component
                  value: network
                - tag: description
                  value: '{#ZYXEL.IF.NAME}'
                - tag: interface
                  value: '{#SNMPINDEX}'
            - uuid: 4a4c54e3736246e1a534afa93303b481
              name: 'Port {#SNMPINDEX}: Link type'
              type: SNMP_AGENT
              snmp_oid: '.1.3.6.1.4.1.890.1.5.8.47.22.1.1.5.{#SNMPINDEX}'
              key: 'zyxel.3712.net.if.link_type[{#SNMPINDEX}]'
              description: |
                MIB: ZYXEL-MGS3712F-MIB
                Physical connection type
              valuemap:
                name: 'ZYXEL MGS-3712 operational mode port link up type'
              preprocessing:
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 6h
              tags:
                - tag: component
                  value: network
                - tag: description
                  value: '{#ZYXEL.IF.NAME}'
                - tag: interface
                  value: '{#SNMPINDEX}'
            - uuid: 2b4c245972454f24b703d4cb29581dfc
              name: 'Port {#SNMPINDEX}: Interface description'
              type: SNMP_AGENT
              snmp_oid: '.1.3.6.1.4.1.890.1.5.8.47.22.1.1.3.{#SNMPINDEX}'
              key: 'zyxel.3712.net.if.name[{#SNMPINDEX}]'
              value_type: CHAR
              description: |
                MIB: ZYXEL-MGS3712F-MIB
                A textual string containing information about the interface
              preprocessing:
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 6h
              tags:
                - tag: component
                  value: network
                - tag: description
                  value: '{#ZYXEL.IF.NAME}'
                - tag: interface
                  value: '{#SNMPINDEX}'
            - uuid: e12e5d4b36db44c38968652a048f1a26
              name: 'Port {#SNMPINDEX}: Operational status'
              type: SNMP_AGENT
              snmp_oid: '.1.3.6.1.2.1.2.2.1.8.{#SNMPINDEX}'
              key: 'zyxel.3712.net.if.operstatus[{#SNMPINDEX}]'
              description: |
                MIB: IF-MIB
                The current operational state of the interface.
                The testing(3) state indicates that no operational
                packets can be passed.
              valuemap:
                name: 'ZYXEL MGS-3712 port operational status'
              preprocessing:
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 6h
              tags:
                - tag: component
                  value: network
                - tag: description
                  value: '{#ZYXEL.IF.NAME}'
                - tag: interface
                  value: '{#SNMPINDEX}'
              trigger_prototypes:
                - uuid: e21751b08fe740f2ad9ad6bde6b879c4
                  expression: 'last(/ZYXEL MGS-3712 by SNMP/zyxel.3712.net.if.operstatus[{#SNMPINDEX}])=2 and last(/ZYXEL MGS-3712 by SNMP/zyxel.3712.net.if.operstatus[{#SNMPINDEX}],#1)<>last(/ZYXEL MGS-3712 by SNMP/zyxel.3712.net.if.operstatus[{#SNMPINDEX}],#2)'
                  recovery_mode: RECOVERY_EXPRESSION
                  recovery_expression: 'last(/ZYXEL MGS-3712 by SNMP/zyxel.3712.net.if.operstatus[{#SNMPINDEX}])<>2'
                  name: 'Port {#SNMPINDEX}: Link down'
                  opdata: 'Current state: {ITEM.LASTVALUE1}'
                  priority: AVERAGE
                  description: |
                    This trigger expression works as follows:
                    1. It can be triggered if the operations status is down.
                    2. `{$IFCONTROL:"{#IFNAME}"}=1` - a user can redefine context macro to value - 0. That marks this interface as not important. No new trigger will be fired if this interface is down.
                    3. `{TEMPLATE_NAME:METRIC.diff()}=1` - the trigger fires only if the operational status was up to (1) sometime before (so, do not fire for the 'eternal off' interfaces.)
                    
                    WARNING: if closed manually - it will not fire again on the next poll, because of .diff.
                  manual_close: 'YES'
                  tags:
                    - tag: scope
                      value: notice
            - uuid: a28bbd54c2e54e90b7280f84e964c681
              name: 'Port {#SNMPINDEX}: Outgoing broadcast packages'
              type: SNMP_AGENT
              snmp_oid: '.1.3.6.1.2.1.31.1.1.1.13.{#SNMPINDEX}'
              key: 'zyxel.3712.net.if.out.broadcastpkts[{#SNMPINDEX}]'
              units: packets/s
              description: |
                MIB: IF-MIB
                The total number of packets that higher-level protocols
                requested be transmitted, and which were addressed to a
                broadcast address at this sub-layer, including those that
                were discarded or not sent.
              preprocessing:
                - type: CHANGE_PER_SECOND
              tags:
                - tag: component
                  value: network
                - tag: description
                  value: '{#ZYXEL.IF.NAME}'
                - tag: interface
                  value: '{#SNMPINDEX}'
            - uuid: 1f6f7e4f23ee4208a5288dd6eaf0aed8
              name: 'Port {#SNMPINDEX}: Outgoing multicast packages'
              type: SNMP_AGENT
              snmp_oid: '.1.3.6.1.2.1.31.1.1.1.12.{#SNMPINDEX}'
              key: 'zyxel.3712.net.if.out.multicastpkts[{#SNMPINDEX}]'
              units: packets/s
              description: |
                MIB: IF-MIB
                The total number of packets that higher-level protocols
                requested be transmitted, and which were addressed to a
                multicast address at this sub-layer, including those that
                were discarded or not sent.  For a MAC layer protocol, this
                includes both Group and Functional addresses.
              preprocessing:
                - type: CHANGE_PER_SECOND
              tags:
                - tag: component
                  value: network
                - tag: description
                  value: '{#ZYXEL.IF.NAME}'
                - tag: interface
                  value: '{#SNMPINDEX}'
            - uuid: 2e5d50c95f4942e08f54feb989058cd0
              name: 'Port {#SNMPINDEX}: Outgoing traffic'
              type: SNMP_AGENT
              snmp_oid: '.1.3.6.1.2.1.31.1.1.1.10.{#SNMPINDEX}'
              key: 'zyxel.3712.net.if.out.traffic[{#SNMPINDEX}]'
              units: bps
              description: |
                MIB: IF-MIB
                The total number of octets transmitted out of the
                interface, including framing characters.  This object is a
                64-bit version of ifOutOctets.
              preprocessing:
                - type: MULTIPLIER
                  parameters:
                    - '8'
                - type: CHANGE_PER_SECOND
              tags:
                - tag: component
                  value: network
                - tag: description
                  value: '{#ZYXEL.IF.NAME}'
                - tag: interface
                  value: '{#SNMPINDEX}'
            - uuid: 8580f10654ea4020ae08d2917fdb8b17
              name: 'Port {#SNMPINDEX}: Outgoing unicast packages'
              type: SNMP_AGENT
              snmp_oid: '.1.3.6.1.2.1.31.1.1.1.11.{#SNMPINDEX}'
              key: 'zyxel.3712.net.if.out.ucastpkts[{#SNMPINDEX}]'
              units: packets/s
              description: |
                MIB: IF-MIB
                The total number of packets that higher-level protocols
                requested be transmitted, and which were not addressed to a
                multicast or broadcast address at this sub-layer, including
                those that were discarded or not sent.
              preprocessing:
                - type: CHANGE_PER_SECOND
              tags:
                - tag: component
                  value: network
                - tag: description
                  value: '{#ZYXEL.IF.NAME}'
                - tag: interface
                  value: '{#SNMPINDEX}'
            - uuid: d8b945fc71534a00ba35867d62bc8703
              name: 'Port {#SNMPINDEX}: Outgoing utilization'
              type: CALCULATED
              key: 'zyxel.3712.net.if.out.util[{#SNMPINDEX}]'
              value_type: FLOAT
              units: '%'
              params: 'last(//zyxel.3712.net.if.out.traffic[{#SNMPINDEX}]) * (last(//zyxel.3712.net.if.highspeed[{#SNMPINDEX}]) <> 0) / ( last(//zyxel.3712.net.if.highspeed[{#SNMPINDEX}]) + (last(//zyxel.3712.net.if.highspeed[{#SNMPINDEX}]) = 0) ) * 100'
              description: 'Interface utilization percentage'
              preprocessing:
                - type: IN_RANGE
                  parameters:
                    - '0'
                    - '100'
                  error_handler: DISCARD_VALUE
                - type: JAVASCRIPT
                  parameters:
                    - 'return +parseFloat(value).toFixed(0);'
              tags:
                - tag: component
                  value: network
                - tag: description
                  value: '{#ZYXEL.IF.NAME}'
                - tag: interface
                  value: '{#SNMPINDEX}'
            - uuid: b8c053a89b32400595d4a0673cfa1e81
              name: 'Port {#SNMPINDEX}: Speed Duplex'
              type: SNMP_AGENT
              snmp_oid: '.1.3.6.1.4.1.890.1.5.8.47.22.1.1.1.{#SNMPINDEX}'
              key: 'zyxel.3712.net.if.speed_duplex[{#SNMPINDEX}]'
              description: |
                MIB: ZYXEL-MGS3712F-MIB
                Transmission mode
              valuemap:
                name: 'ZYXEL MGS-3712 operational mode port speed duplex'
              preprocessing:
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 6h
              tags:
                - tag: component
                  value: network
                - tag: description
                  value: '{#ZYXEL.IF.NAME}'
                - tag: interface
                  value: '{#SNMPINDEX}'
          graph_prototypes:
            - uuid: b2bed2a4ab7b42119009f4aabd979656
              name: 'ZYXEL MGS-3712: Port {#SNMPINDEX}: Packets traffic'
              graph_items:
                - color: 199C0D
                  item:
                    host: 'ZYXEL MGS-3712 by SNMP'
                    key: 'zyxel.3712.net.if.in.ucastpkts[{#SNMPINDEX}]'
                - sortorder: '1'
                  color: F63100
                  item:
                    host: 'ZYXEL MGS-3712 by SNMP'
                    key: 'zyxel.3712.net.if.out.ucastpkts[{#SNMPINDEX}]'
                - sortorder: '2'
                  color: 00611C
                  item:
                    host: 'ZYXEL MGS-3712 by SNMP'
                    key: 'zyxel.3712.net.if.in.multicastpkts[{#SNMPINDEX}]'
                - sortorder: '3'
                  color: F7941D
                  item:
                    host: 'ZYXEL MGS-3712 by SNMP'
                    key: 'zyxel.3712.net.if.out.multicastpkts[{#SNMPINDEX}]'
                - sortorder: '4'
                  color: FC6EA3
                  item:
                    host: 'ZYXEL MGS-3712 by SNMP'
                    key: 'zyxel.3712.net.if.in.broadcastpkts[{#SNMPINDEX}]'
                - sortorder: '5'
                  color: 6C59DC
                  item:
                    host: 'ZYXEL MGS-3712 by SNMP'
                    key: 'zyxel.3712.net.if.out.broadcastpkts[{#SNMPINDEX}]'
            - uuid: 489edc6b24844d8cb5c718a8a4d45a3c
              name: 'ZYXEL MGS-3712: Port {#SNMPINDEX}: Traffic'
              graph_items:
                - color: 199C0D
                  item:
                    host: 'ZYXEL MGS-3712 by SNMP'
                    key: 'zyxel.3712.net.if.in.traffic[{#SNMPINDEX}]'
                - sortorder: '1'
                  color: F63100
                  item:
                    host: 'ZYXEL MGS-3712 by SNMP'
                    key: 'zyxel.3712.net.if.out.traffic[{#SNMPINDEX}]'
            - uuid: 1466f28d9f014bb39396cda181630fc4
              name: 'ZYXEL MGS-3712: Port {#SNMPINDEX}: Utilization'
              ymin_type_1: FIXED
              ymax_type_1: FIXED
              graph_items:
                - color: 199C0D
                  item:
                    host: 'ZYXEL MGS-3712 by SNMP'
                    key: 'zyxel.3712.net.if.out.util[{#SNMPINDEX}]'
                - sortorder: '1'
                  color: F63100
                  item:
                    host: 'ZYXEL MGS-3712 by SNMP'
                    key: 'zyxel.3712.net.if.in.util[{#SNMPINDEX}]'
          overrides:
            - name: 'Don''t create triggers for matching interface'
              step: '1'
              filter:
                conditions:
                  - macro: '{#ZYXEL.IF.NAME}'
                    value: '{$ZYXEL.LLD.FILTER.IF.CONTROL.MATCHES}'
                    operator: NOT_MATCHES_REGEX
              operations:
                - operationobject: TRIGGER_PROTOTYPE
                  operator: REGEXP
                  value: '.*'
                  discover: NO_DISCOVER
        - uuid: 65477e8c3f8948aea5f6101b08e307cc
          name: 'SFP with DDM discovery'
          type: SNMP_AGENT
          snmp_oid: 'discovery[{#ZYXEL.SFP.WARN.MAX},.1.3.6.1.4.1.890.1.5.8.47.117.2.1.5,{#ZYXEL.SFP.WARN.MIN},.1.3.6.1.4.1.890.1.5.8.47.117.2.1.6,{#ZYXEL.SFP.DESCRIPTION},.1.3.6.1.4.1.890.1.5.8.47.117.2.1.8]'
          key: zyxel.3712.sfp.ddm.discovery
          delay: 12h
          filter:
            evaltype: AND
            conditions:
              - macro: '{#ZYXEL.SFP.DESCRIPTION}'
                value: '{$ZYXEL.LLD.FILTER.SFPDDM.DESC.MATCHES}'
              - macro: '{#ZYXEL.SFP.DESCRIPTION}'
                value: '{$ZYXEL.LLD.FILTER.SFPDDM.DESC.NOT_MATCHES}'
                operator: NOT_MATCHES_REGEX
          description: 'SFP DDM module discovery.'
          item_prototypes:
            - uuid: cd2434237f264fd0aa57a9816eb9cdb1
              name: 'SFP {#ZYXEL.SFP.PORT}: {#ZYXEL.SFP.DESCRIPTION}'
              type: SNMP_AGENT
              snmp_oid: '.1.3.6.1.4.1.890.1.5.8.47.117.2.1.7.{#SNMPINDEX}'
              key: 'zyxel.3712.sfp.ddm[{#SNMPINDEX}]'
              delay: '{$ZYXEL.LLD.SFP.UPDATE}'
              value_type: FLOAT
              units: '!{#ZYXEL.SFP.UNIT}'
              description: |
                MIB: ZYXEL-MGS3712F-MIB
                Transceiver module DDM data ({#ZYXEL.SFP.DESCRIPTION}).
              preprocessing:
                - type: MULTIPLIER
                  parameters:
                    - '0.01'
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 6h
              tags:
                - tag: component
                  value: network
                - tag: description
                  value: '{#ZYXEL.IF.NAME}'
                - tag: interface
                  value: '{#SNMPINDEX}'
              trigger_prototypes:
                - uuid: e9d242819d7345a0b44cc14a392f05fa
                  expression: 'last(/ZYXEL MGS-3712 by SNMP/zyxel.3712.sfp.ddm[{#SNMPINDEX}]) > {#ZYXEL.SFP.WARN.MAX}'
                  name: 'SFP {#ZYXEL.SFP.PORT}: High {#ZYXEL.SFP.DESCRIPTION}'
                  event_name: 'SFP {#ZYXEL.SFP.PORT}: High {#ZYXEL.SFP.DESCRIPTION} (over {#ZYXEL.SFP.WARN.MAX}{#ZYXEL.SFP.UNIT})'
                  priority: WARNING
                  description: 'The upper threshold value of the parameter is exceeded'
                  tags:
                    - tag: scope
                      value: notice
                - uuid: 177c2fe88ec24e3d9a5ea9f6b3f346d9
                  expression: 'last(/ZYXEL MGS-3712 by SNMP/zyxel.3712.sfp.ddm[{#SNMPINDEX}]) < {#ZYXEL.SFP.WARN.MIN}'
                  name: 'SFP {#ZYXEL.SFP.PORT}: Low {#ZYXEL.SFP.DESCRIPTION}'
                  event_name: 'SFP {#ZYXEL.SFP.PORT}: Low {#ZYXEL.SFP.DESCRIPTION} (less than {#ZYXEL.SFP.WARN.MIN}{#ZYXEL.SFP.UNIT})'
                  priority: WARNING
                  description: 'The parameter values are less than the lower threshold'
                  tags:
                    - tag: scope
                      value: notice
          graph_prototypes:
            - uuid: 2d432abf28354f4193d93b21bc5f1507
              name: 'ZYXEL MGS-3712: SFP {#ZYXEL.SFP.PORT}: {#ZYXEL.SFP.DESCRIPTION}'
              graph_items:
                - color: 199C0D
                  item:
                    host: 'ZYXEL MGS-3712 by SNMP'
                    key: 'zyxel.3712.sfp.ddm[{#SNMPINDEX}]'
          preprocessing:
            - type: JAVASCRIPT
              parameters:
                - |
                  var inArray = JSON.parse(value);
                  var nameMap = {
                  	'Temperature': '°C',
                  	'Voltage': 'V',
                  	'TxBias': 'mA',
                  	'TxPower': 'dbm',
                  	'RxPower': 'dbm'
                  };
                  var outArr = [];
                  inArray.forEach(function (item, i, arr) {
                  	item['{#ZYXEL.SFP.PORT}'] = item['{#SNMPINDEX}'].split('.')[0];
                  	item['{#ZYXEL.SFP.UNIT}'] = nameMap[item['{#ZYXEL.SFP.DESCRIPTION}']] === undefined ? "" : nameMap[item['{#ZYXEL.SFP.DESCRIPTION}']];
                  	item['{#ZYXEL.SFP.WARN.MAX}'] /= 100;
                  	item['{#ZYXEL.SFP.WARN.MIN}'] /= 100;
                  	outArr.push(item)
                  });
                  return JSON.stringify(outArr);
        - uuid: e780a6c3b3db45d9b539bba14ca89ef9
          name: 'SFP without DDM discovery'
          type: SNMP_AGENT
          snmp_oid: 'discovery[{#ZYXEL.SFP.STATUS},.1.3.6.1.4.1.890.1.5.8.47.117.1.1.2]'
          key: zyxel.3712.sfp.discovery
          delay: 12h
          filter:
            evaltype: AND
            conditions:
              - macro: '{#ZYXEL.SFP.STATUS}'
                value: '{$ZYXEL.LLD.FILTER.SFP.STATUS.MATCHES}'
              - macro: '{#ZYXEL.SFP.STATUS}'
                value: '{$ZYXEL.LLD.FILTER.SFP.STATUS.NOT_MATCHES}'
                operator: NOT_MATCHES_REGEX
          description: 'SFP module discovery.'
          item_prototypes:
            - uuid: 434d614d231d41c49810342cb3d09797
              name: 'SFP {#SNMPINDEX}: Date code'
              type: SNMP_AGENT
              snmp_oid: '.1.3.6.1.4.1.890.1.5.8.47.117.1.1.7.{#SNMPINDEX}'
              key: 'zyxel.3712.sfp.datecode[{#SNMPINDEX}]'
              delay: '{$ZYXEL.LLD.SFP.UPDATE}'
              value_type: CHAR
              description: |
                MIB: ZYXEL-MGS3712F-MIB
                Transceiver module vendor's manufacturing date code.
              preprocessing:
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              tags:
                - tag: component
                  value: network
                - tag: description
                  value: '{#ZYXEL.IF.NAME}'
                - tag: interface
                  value: '{#SNMPINDEX}'
            - uuid: 184be2048cf64e7abf703cb16e1e128b
              name: 'SFP {#SNMPINDEX}: Part number'
              type: SNMP_AGENT
              snmp_oid: '.1.3.6.1.4.1.890.1.5.8.47.117.1.1.4.{#SNMPINDEX}'
              key: 'zyxel.3712.sfp.part[{#SNMPINDEX}]'
              delay: '{$ZYXEL.LLD.SFP.UPDATE}'
              value_type: CHAR
              description: |
                MIB: ZYXEL-MGS3712F-MIB
                Part number provided by transceiver module vendor.
              preprocessing:
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              tags:
                - tag: component
                  value: network
                - tag: description
                  value: '{#ZYXEL.IF.NAME}'
                - tag: interface
                  value: '{#SNMPINDEX}'
            - uuid: 80d2606b4d644993b13f7efd001ed096
              name: 'SFP {#SNMPINDEX}: Revision'
              type: SNMP_AGENT
              snmp_oid: '.1.3.6.1.4.1.890.1.5.8.47.117.1.1.6.{#SNMPINDEX}'
              key: 'zyxel.3712.sfp.revision[{#SNMPINDEX}]'
              delay: '{$ZYXEL.LLD.SFP.UPDATE}'
              value_type: CHAR
              description: |
                MIB: ZYXEL-MGS3712F-MIB
                Revision level for part number provided by transceiver module vendor.
              preprocessing:
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              tags:
                - tag: component
                  value: network
                - tag: description
                  value: '{#ZYXEL.IF.NAME}'
                - tag: interface
                  value: '{#SNMPINDEX}'
            - uuid: 2d974479665844ae86511d471e190d51
              name: 'SFP {#SNMPINDEX}: Serial number'
              type: SNMP_AGENT
              snmp_oid: '.1.3.6.1.4.1.890.1.5.8.47.117.1.1.5.{#SNMPINDEX}'
              key: 'zyxel.3712.sfp.serialnumber[{#SNMPINDEX}]'
              delay: '{$ZYXEL.LLD.SFP.UPDATE}'
              value_type: CHAR
              description: |
                MIB: ZYXEL-MGS3712F-MIB
                Serial number provided by transceiver module vendor.
              preprocessing:
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              tags:
                - tag: component
                  value: network
                - tag: description
                  value: '{#ZYXEL.IF.NAME}'
                - tag: interface
                  value: '{#SNMPINDEX}'
              trigger_prototypes:
                - uuid: aaa3492aa0c64e8a973d1a755fd24f50
                  expression: 'last(/ZYXEL MGS-3712 by SNMP/zyxel.3712.sfp.serialnumber[{#SNMPINDEX}],#1)<>last(/ZYXEL MGS-3712 by SNMP/zyxel.3712.sfp.serialnumber[{#SNMPINDEX}],#2) and length(last(/ZYXEL MGS-3712 by SNMP/zyxel.3712.sfp.serialnumber[{#SNMPINDEX}]))>0'
                  name: 'SFP {#SNMPINDEX} has been replaced'
                  event_name: 'SFP {#SNMPINDEX} has been replaced (new serial number received)'
                  priority: INFO
                  description: 'SFP {#SNMPINDEX} serial number has changed. Acknowledge to close the problem manually.'
                  manual_close: 'YES'
                  tags:
                    - tag: scope
                      value: notice
            - uuid: 46e11863a74f481aaea204148fe8b5b7
              name: 'SFP {#SNMPINDEX}: Status'
              type: SNMP_AGENT
              snmp_oid: '.1.3.6.1.4.1.890.1.5.8.47.117.1.1.2.{#SNMPINDEX}'
              key: 'zyxel.3712.sfp.status[{#SNMPINDEX}]'
              delay: '{$ZYXEL.LLD.SFP.UPDATE}'
              description: |
                MIB: ZYXEL-MGS3712F-MIB
                Transceiver module status.
              valuemap:
                name: 'ZYXEL MGS-3712 SFP status'
              preprocessing:
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              tags:
                - tag: component
                  value: network
                - tag: description
                  value: '{#ZYXEL.IF.NAME}'
                - tag: interface
                  value: '{#SNMPINDEX}'
            - uuid: e2e07835d3ef431ea6c5559151dee258
              name: 'SFP {#SNMPINDEX}: Transceiver'
              type: SNMP_AGENT
              snmp_oid: '.1.3.6.1.4.1.890.1.5.8.47.117.1.1.8.{#SNMPINDEX}'
              key: 'zyxel.3712.sfp.transceiver[{#SNMPINDEX}]'
              delay: '{$ZYXEL.LLD.SFP.UPDATE}'
              value_type: CHAR
              description: |
                MIB: ZYXEL-MGS3712F-MIB
                Transceiver module type names.
              preprocessing:
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              tags:
                - tag: component
                  value: network
                - tag: description
                  value: '{#ZYXEL.IF.NAME}'
                - tag: interface
                  value: '{#SNMPINDEX}'
            - uuid: 18f798a7ca0d4ea4a24a58c3bcdb9edd
              name: 'SFP {#SNMPINDEX}: Vendor'
              type: SNMP_AGENT
              snmp_oid: '.1.3.6.1.4.1.890.1.5.8.47.117.1.1.3.{#SNMPINDEX}'
              key: 'zyxel.3712.sfp.vendor[{#SNMPINDEX}]'
              delay: '{$ZYXEL.LLD.SFP.UPDATE}'
              value_type: CHAR
              description: |
                MIB: ZYXEL-MGS3712F-MIB
                Transceiver module vendor name.
              preprocessing:
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              tags:
                - tag: component
                  value: network
                - tag: description
                  value: '{#ZYXEL.IF.NAME}'
                - tag: interface
                  value: '{#SNMPINDEX}'
        - uuid: 6a39668b647f49f19591451cc977cc92
          name: 'Temperature discovery'
          type: SNMP_AGENT
          snmp_oid: 'discovery[{#ZYXEL.TEMP.THRESH.HIGH},.1.3.6.1.4.1.890.1.5.8.47.8.2.1.5]'
          key: zyxel.3712.temp.discovery
          delay: 1h
          description: |
            An entry in tempTable.
            Index of temperature unit. 1:MAC, 2:CPU, 3:PHY
          item_prototypes:
            - uuid: e1703024fdee4c6c812e9c0204510705
              name: 'Temperature "{#ZYXEL.TEMP.ID}"'
              type: SNMP_AGENT
              snmp_oid: '.1.3.6.1.4.1.890.1.5.8.47.8.2.1.2.{#SNMPINDEX}'
              key: 'zyxel.3712.temp[{#SNMPINDEX}]'
              units: '!°C'
              description: |
                MIB: ZYXEL-MGS3712F-MIB
                The current temperature measured at this sensor
              preprocessing:
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              tags:
                - tag: component
                  value: sensor
                - tag: component
                  value: temperature
              trigger_prototypes:
                - uuid: b5ba7daf05204f2b987b879a3d44fac2
                  expression: 'last(/ZYXEL MGS-3712 by SNMP/zyxel.3712.temp[{#SNMPINDEX}])>{#ZYXEL.TEMP.THRESH.HIGH}'
                  name: 'Temperature {#ZYXEL.TEMP.ID} is in critical state'
                  opdata: 'Current state: {ITEM.LASTVALUE1}'
                  priority: AVERAGE
                  description: 'Please check the temperature'
                  tags:
                    - tag: scope
                      value: notice
          graph_prototypes:
            - uuid: 952122594bf14cad9ce00e202209388a
              name: 'ZYXEL MGS-3712: Temperature "{#ZYXEL.TEMP.ID}"'
              graph_items:
                - color: 199C0D
                  item:
                    host: 'ZYXEL MGS-3712 by SNMP'
                    key: 'zyxel.3712.temp[{#SNMPINDEX}]'
          preprocessing:
            - type: JAVASCRIPT
              parameters:
                - |
                  var inArray = JSON.parse(value);
                  var nameMap = {"1":"MAC", "2":"CPU", "3":"PHY"};
                  var outArr = [];
                  inArray.forEach(function(item, i, arr) {
                  item["{#ZYXEL.TEMP.ID}"] = nameMap[item["{#SNMPINDEX}"]]
                  outArr.push(item)
                  });
                  return JSON.stringify(outArr);
        - uuid: fdaa0461127c489fac83161e9d388e8f
          name: 'Voltage discovery'
          type: SNMP_AGENT
          snmp_oid: 'discovery[{#ZYXEL.VOLT.THRESH.LOW},.1.3.6.1.4.1.890.1.5.8.47.8.3.1.6,{#ZYXEL.VOLT.NOMINAL},.1.3.6.1.4.1.890.1.5.8.47.8.3.1.5]'
          key: zyxel.3712.volt.discovery
          delay: 1h
          description: 'An entry in voltageTable.'
          item_prototypes:
            - uuid: 5ef499ecbada4691a5598d99c2a362eb
              name: 'Nominal "{#ZYXEL.VOLT.NOMINAL}"'
              type: SNMP_AGENT
              snmp_oid: '.1.3.6.1.4.1.890.1.5.8.47.8.3.1.2.{#SNMPINDEX}'
              key: 'zyxel.3712.volt[{#SNMPINDEX}]'
              value_type: FLOAT
              units: V
              description: |
                MIB: ZYXEL-MGS3712F-MIB
                The current voltage reading.
              preprocessing:
                - type: MULTIPLIER
                  parameters:
                    - '0.001'
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              tags:
                - tag: component
                  value: sensor
                - tag: component
                  value: voltage
              trigger_prototypes:
                - uuid: 02a7a32af7a440b6a7199b425305fdde
                  expression: 'last(/ZYXEL MGS-3712 by SNMP/zyxel.3712.volt[{#SNMPINDEX}])<{#ZYXEL.VOLT.THRESH.LOW}'
                  name: 'Voltage {#ZYXEL.VOLT.NOMINAL} is in critical state'
                  opdata: 'Current state: {ITEM.LASTVALUE1}'
                  priority: AVERAGE
                  description: 'Please check the power supply'
                  tags:
                    - tag: scope
                      value: notice
          graph_prototypes:
            - uuid: 67b6c6c6085e45cbbb58fb93c1b6eb2f
              name: 'ZYXEL MGS-3712: Nominal "{#ZYXEL.VOLT.NOMINAL}"'
              graph_items:
                - color: 199C0D
                  item:
                    host: 'ZYXEL MGS-3712 by SNMP'
                    key: 'zyxel.3712.volt[{#SNMPINDEX}]'
          preprocessing:
            - type: JAVASCRIPT
              parameters:
                - |
                  var inArray = JSON.parse(value);
                  var outArr = []
                  inArray.forEach(function(item, i, arr) {
                  item["{#ZYXEL.VOLT.NOMINAL}"] = "+" + item["{#ZYXEL.VOLT.NOMINAL}"] / 1000 + "V";
                  item["{#ZYXEL.VOLT.THRESH.LOW}"] = item["{#ZYXEL.VOLT.THRESH.LOW}"] / 1000;
                  outArr.push(item)
                  });
                  return JSON.stringify(outArr);
      tags:
        - tag: class
          value: network
        - tag: target
          value: mgs-3712
        - tag: target
          value: switch
        - tag: target
          value: zyxel
      macros:
        - macro: '{$CPU.UTIL.CRIT}'
          value: '90'
        - macro: '{$SNMP.TIMEOUT}'
          value: 5m
          description: 'The time interval for SNMP agent availability trigger expression.'
        - macro: '{$ZYXEL.LLD.FILTER.IF.CONTROL.MATCHES}'
          value: CHANGE_IF_NEEDED
          description: 'Triggers will be created only for interfaces whose description contains the value of this macro'
        - macro: '{$ZYXEL.LLD.FILTER.IF.LINKUPTYPE.MATCHES}'
          value: 1|2
          description: |
            Filter of discoverable link types.
            0 - Down link
            1 - Cooper link
            2 - Fiber link
        - macro: '{$ZYXEL.LLD.FILTER.IF.LINKUPTYPE.NOT_MATCHES}'
          value: CHANGE_IF_NEEDED
          description: 'Filter to exclude discovered by link types.'
        - macro: '{$ZYXEL.LLD.FILTER.IF.NAME.MATCHES}'
          value: '.*'
          description: 'Filter by discoverable interface names.'
        - macro: '{$ZYXEL.LLD.FILTER.IF.NAME.NOT_MATCHES}'
          value: CHANGE_IF_NEEDED
          description: 'Filter to exclude discovered interfaces by name.'
        - macro: '{$ZYXEL.LLD.FILTER.SFP.STATUS.MATCHES}'
          value: 1|2
          description: |
            Filter of discoverable status.
            0 - OK with DDM
            1 - OK without DDM
            2 - nonoperational
        - macro: '{$ZYXEL.LLD.FILTER.SFP.STATUS.NOT_MATCHES}'
          value: CHANGE_IF_NEEDED
          description: 'Filter to exclude discovered by status.'
        - macro: '{$ZYXEL.LLD.FILTER.SFPDDM.DESC.MATCHES}'
          value: '.*'
          description: 'Filter by discoverable SFP modules name.'
        - macro: '{$ZYXEL.LLD.FILTER.SFPDDM.DESC.NOT_MATCHES}'
          value: N/A
          description: 'Filter to exclude discovered SFP modules by name.'
        - macro: '{$ZYXEL.LLD.SFP.UPDATE}'
          value: 10m
          description: 'Receiving data from the SFP module is slow, we do not recommend setting the interval less than 10 minutes.'
      dashboards:
        - uuid: 03dc93374fae4d94821303539a651047
          name: 'Network interfaces'
          pages:
            - widgets:
                - type: graphprototype
                  width: '72'
                  height: '5'
                  fields:
                    - type: INTEGER
                      name: columns
                      value: '1'
                    - type: GRAPH_PROTOTYPE
                      name: graphid.0
                      value:
                        host: 'ZYXEL MGS-3712 by SNMP'
                        name: 'ZYXEL MGS-3712: Port {#SNMPINDEX}: Traffic'
                    - type: STRING
                      name: reference
                      value: AAAAA
                    - type: INTEGER
                      name: rows
                      value: '5'
      valuemaps:
        - uuid: 6e923e1e3ed34b8f87357b5fd7407c54
          name: 'SNMP available'
          mappings:
            - value: '0'
              newvalue: 'not available'
            - value: '1'
              newvalue: available
            - value: '2'
              newvalue: unknown
        - uuid: 7c5d7efbd17f48619a3f4211a269b38d
          name: 'ZYXEL MGS-3712 operational mode port link up type'
          mappings:
            - value: '0'
              newvalue: Down
            - value: '1'
              newvalue: Cooper
            - value: '2'
              newvalue: Fiber
        - uuid: da42da17340044ea83521107ac4dee04
          name: 'ZYXEL MGS-3712 operational mode port speed duplex'
          mappings:
            - value: '0'
              newvalue: auto
            - value: '1'
              newvalue: '10M half'
            - value: '2'
              newvalue: '10M full'
            - value: '3'
              newvalue: '100M half'
            - value: '4'
              newvalue: '100M full'
            - value: '5'
              newvalue: '1G full'
        - uuid: 7e107b2d754945dbaf833955fcae7f48
          name: 'ZYXEL MGS-3712 port admin status'
          mappings:
            - value: '1'
              newvalue: Up
            - value: '2'
              newvalue: Down
            - value: '3'
              newvalue: Testing
        - uuid: ed71a5038bf34198a3a56b0020ad728e
          name: 'ZYXEL MGS-3712 port operational status'
          mappings:
            - value: '1'
              newvalue: Up
            - value: '2'
              newvalue: Down
            - value: '3'
              newvalue: Testing
            - value: '4'
              newvalue: Unknown
            - value: '5'
              newvalue: Dormant
            - value: '6'
              newvalue: NotPresent
            - value: '7'
              newvalue: lowerLayerDown
        - uuid: b89570749c5d4dcb9378b7951803b8e4
          name: 'ZYXEL MGS-3712 SFP status'
          mappings:
            - value: '1'
              newvalue: 'OK with DDM'
            - value: '2'
              newvalue: 'OK without DDM'
            - value: '3'
              newvalue: nonoperational
  triggers:
    - uuid: eefe29ad784d40d3980a4cb1118dd816
      expression: '(last(/ZYXEL MGS-3712 by SNMP/zyxel.3712.hw.uptime)>0 and last(/ZYXEL MGS-3712 by SNMP/zyxel.3712.hw.uptime)<10m) or (last(/ZYXEL MGS-3712 by SNMP/zyxel.3712.hw.uptime)=0 and last(/ZYXEL MGS-3712 by SNMP/zyxel.3712.net.uptime)<10m)'
      name: 'Host has been restarted'
      event_name: '{HOST.NAME} has been restarted (uptime < 10m)'
      priority: INFO
      description: 'Uptime is less than 10 minutes.'
      manual_close: 'YES'
      tags:
        - tag: scope
          value: notice
  graphs:
    - uuid: 21c2da2f53e44f6a8b3fc722e415b4c8
      name: 'ZYXEL MGS-3712: CPU utilization'
      ymin_type_1: FIXED
      ymax_type_1: FIXED
      graph_items:
        - drawtype: GRADIENT_LINE
          color: 199C0D
          item:
            host: 'ZYXEL MGS-3712 by SNMP'
            key: zyxel.3712.cpuusage
