zabbix_export:
  version: '8.0'
  template_groups:
    - uuid: a571c0d144b14fd4a87a9d9b2aa9fcd6
      name: Templates/Applications
    - uuid: c2c162144c2d4c5491c8801193af4945
      name: Templates/Cloud
    - uuid: 748ad4d098d447d492bb935c907f652f
      name: Templates/Databases
    - uuid: 36bff6c29af64692839d077febfc7079
      name: 'Templates/Network devices'
    - uuid: 846977d1dfed4968bc5f8bdb363285bc
      name: 'Templates/Operating systems'
  host_groups:
    - uuid: a571c0d144b14fd4a87a9d9b2aa9fcd6
      name: Applications
  templates:
    - uuid: c87e0a2e0683483ab7c6f3c380e9f840
      template: 'Apache ActiveMQ by JMX'
      name: 'Apache ActiveMQ by JMX'
      description: |
        The template to monitor Apache ActiveMQ by Zabbix that work without any external scripts.
        The metrics are collected by JMX.
        You can set macro values and add macros with context for specific brokers or destinations following macro description.
        
        You can discuss this template or leave feedback on our forum https://www.zabbix.com/forum/zabbix-suggestions-and-feedback/411049-discussion-thread-for-official-zabbix-template-amq
        
        Generated by official Zabbix template tool "Templator"
      wizard_ready: 'YES'
      readme: |
        ## Setup
        
        Metrics are collected by JMX.
        
        1. Enable and configure JMX access to Apache ActiveMQ.
         See documentation for [instructions](https://activemq.apache.org/jmx.html).
        2. Set values in host wizard configuration field `JMX user`, `JMX password` and `JMX port`.
      vendor:
        name: Zabbix
        version: 8.0-1
      groups:
        - name: Templates/Applications
      discovery_rules:
        - uuid: cbd9f98c2c1e412081a546e18066a868
          name: 'Brokers discovery'
          type: JMX
          key: 'jmx.discovery[beans,"org.apache.activemq:type=Broker,brokerName=*"]'
          delay: 1h
          username: '{$ACTIVEMQ.USER}'
          password: '{$ACTIVEMQ.PASSWORD}'
          filter:
            evaltype: FORMULA
            formula: 'A and B'
            conditions:
              - macro: '{#JMXBROKERNAME}'
                value: '{$ACTIVEMQ.LLD.FILTER.BROKER.MATCHES}'
                formulaid: A
              - macro: '{#JMXBROKERNAME}'
                value: '{$ACTIVEMQ.LLD.FILTER.BROKER.NOT_MATCHES}'
                operator: NOT_MATCHES_REGEX
                formulaid: B
          description: 'Discovery of brokers'
          item_prototypes:
            - uuid: 29a0f197bfe847d596dad4923364490e
              name: 'Broker {#JMXBROKERNAME}: Version'
              type: JMX
              key: 'jmx[{#JMXOBJ},BrokerVersion]'
              value_type: TEXT
              username: '{$ACTIVEMQ.USER}'
              password: '{$ACTIVEMQ.PASSWORD}'
              description: 'The version of the broker.'
              preprocessing:
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3h
              jmx_endpoint: 'service:jmx:rmi:///jndi/rmi://{HOST.CONN}:{HOST.PORT}/jmxrmi'
              tags:
                - tag: component
                  value: inventory
              trigger_prototypes:
                - uuid: 7902d81681874aa3acf33d90316f9864
                  expression: 'last(/Apache ActiveMQ by JMX/jmx[{#JMXOBJ},BrokerVersion],#1)<>last(/Apache ActiveMQ by JMX/jmx[{#JMXOBJ},BrokerVersion],#2) and length(last(/Apache ActiveMQ by JMX/jmx[{#JMXOBJ},BrokerVersion]))>0'
                  name: 'Apache ActiveMQ: Broker {#JMXBROKERNAME}: Version has been changed'
                  event_name: 'Apache ActiveMQ: Broker {#JMXBROKERNAME}: Version has changed (new version: {ITEM.VALUE})'
                  priority: INFO
                  description: 'The Broker {#JMXBROKERNAME} version has changed. Acknowledge to close the problem manually.'
                  manual_close: 'YES'
                  tags:
                    - tag: scope
                      value: notice
            - uuid: 85c19ccb8b6a4242a8ba699e76836427
              name: 'Broker {#JMXBROKERNAME}: Memory limit'
              type: JMX
              key: 'jmx[{#JMXOBJ},MemoryLimit]'
              units: B
              username: '{$ACTIVEMQ.USER}'
              password: '{$ACTIVEMQ.PASSWORD}'
              description: 'Memory limit, in bytes, used for holding undelivered messages before paging to temporary storage.'
              preprocessing:
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              jmx_endpoint: 'service:jmx:rmi:///jndi/rmi://{HOST.CONN}:{HOST.PORT}/jmxrmi'
              tags:
                - tag: component
                  value: memory
            - uuid: 5e2a5638adf6405087014bfcfc8ffc93
              name: 'Broker {#JMXBROKERNAME}: Memory usage in percents'
              type: JMX
              key: 'jmx[{#JMXOBJ}, MemoryPercentUsage]'
              units: '%'
              username: '{$ACTIVEMQ.USER}'
              password: '{$ACTIVEMQ.PASSWORD}'
              description: 'Percent of memory limit used.'
              jmx_endpoint: 'service:jmx:rmi:///jndi/rmi://{HOST.CONN}:{HOST.PORT}/jmxrmi'
              tags:
                - tag: component
                  value: memory
              trigger_prototypes:
                - uuid: e805b8cca9744940affc3bdd234a7587
                  expression: 'min(/Apache ActiveMQ by JMX/jmx[{#JMXOBJ}, MemoryPercentUsage],{$ACTIVEMQ.MEM.TIME:"{#JMXBROKERNAME}"})>{$ACTIVEMQ.MEM.MAX.HIGH:"{#JMXBROKERNAME}"}'
                  name: 'Apache ActiveMQ: Broker {#JMXBROKERNAME}: Memory usage is too high'
                  event_name: 'Apache ActiveMQ: Broker {#JMXBROKERNAME}: Memory usage is too high (over {$ACTIVEMQ.MEM.MAX.HIGH:"{#JMXBROKERNAME}"}%)'
                  priority: HIGH
                  tags:
                    - tag: scope
                      value: performance
                - uuid: 3e741e339fff422fae67b5333faa1e20
                  expression: 'min(/Apache ActiveMQ by JMX/jmx[{#JMXOBJ}, MemoryPercentUsage],{$ACTIVEMQ.MEM.TIME:"{#JMXBROKERNAME}"})>{$ACTIVEMQ.MEM.MAX.WARN:"{#JMXBROKERNAME}"}'
                  name: 'Apache ActiveMQ: Broker {#JMXBROKERNAME}: Memory usage is too high'
                  event_name: 'Apache ActiveMQ: Broker {#JMXBROKERNAME}: Memory usage is too high (over {$ACTIVEMQ.MEM.MAX.WARN:"{#JMXBROKERNAME}"}%)'
                  priority: AVERAGE
                  dependencies:
                    - name: 'Apache ActiveMQ: Broker {#JMXBROKERNAME}: Memory usage is too high'
                      expression: 'min(/Apache ActiveMQ by JMX/jmx[{#JMXOBJ}, MemoryPercentUsage],{$ACTIVEMQ.MEM.TIME:"{#JMXBROKERNAME}"})>{$ACTIVEMQ.MEM.MAX.HIGH:"{#JMXBROKERNAME}"}'
                  tags:
                    - tag: scope
                      value: performance
            - uuid: 78806476b5cb4ce48f8ca8dbd173c7c3
              name: 'Broker {#JMXBROKERNAME}: Storage limit'
              type: JMX
              key: 'jmx[{#JMXOBJ},StoreLimit]'
              units: B
              username: '{$ACTIVEMQ.USER}'
              password: '{$ACTIVEMQ.PASSWORD}'
              description: 'Disk limit, in bytes, used for persistent messages before producers are blocked.'
              preprocessing:
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              jmx_endpoint: 'service:jmx:rmi:///jndi/rmi://{HOST.CONN}:{HOST.PORT}/jmxrmi'
              tags:
                - tag: component
                  value: storage
            - uuid: fc4c79543a6f4b7b9c22f11b61b644c9
              name: 'Broker {#JMXBROKERNAME}: Storage usage in percents'
              type: JMX
              key: 'jmx[{#JMXOBJ},StorePercentUsage]'
              units: '%'
              username: '{$ACTIVEMQ.USER}'
              password: '{$ACTIVEMQ.PASSWORD}'
              description: 'Percent of store limit used.'
              jmx_endpoint: 'service:jmx:rmi:///jndi/rmi://{HOST.CONN}:{HOST.PORT}/jmxrmi'
              tags:
                - tag: component
                  value: storage
              trigger_prototypes:
                - uuid: 2e1c9f92c87f446ebab68ac638c713c5
                  expression: 'min(/Apache ActiveMQ by JMX/jmx[{#JMXOBJ},StorePercentUsage],{$ACTIVEMQ.STORE.TIME:"{#JMXBROKERNAME}"})>{$ACTIVEMQ.STORE.MAX.HIGH:"{#JMXBROKERNAME}"}'
                  name: 'Apache ActiveMQ: Broker {#JMXBROKERNAME}: Storage usage is too high'
                  event_name: 'Apache ActiveMQ: Broker {#JMXBROKERNAME}: Storage usage is too high (over {$ACTIVEMQ.STORE.MAX.HIGH:"{#JMXBROKERNAME}"}%)'
                  priority: HIGH
                  tags:
                    - tag: scope
                      value: capacity
                - uuid: 271b33edce84439a91d6a253f45e5bf6
                  expression: 'min(/Apache ActiveMQ by JMX/jmx[{#JMXOBJ},StorePercentUsage],{$ACTIVEMQ.STORE.TIME:"{#JMXBROKERNAME}"})>{$ACTIVEMQ.STORE.MAX.WARN:"{#JMXBROKERNAME}"}'
                  name: 'Apache ActiveMQ: Broker {#JMXBROKERNAME}: Storage usage is too high'
                  event_name: 'Apache ActiveMQ: Broker {#JMXBROKERNAME}: Storage usage is too high (over {$ACTIVEMQ.STORE.MAX.WARN:"{#JMXBROKERNAME}"}%)'
                  priority: AVERAGE
                  dependencies:
                    - name: 'Apache ActiveMQ: Broker {#JMXBROKERNAME}: Storage usage is too high'
                      expression: 'min(/Apache ActiveMQ by JMX/jmx[{#JMXOBJ},StorePercentUsage],{$ACTIVEMQ.STORE.TIME:"{#JMXBROKERNAME}"})>{$ACTIVEMQ.STORE.MAX.HIGH:"{#JMXBROKERNAME}"}'
                  tags:
                    - tag: scope
                      value: capacity
            - uuid: 09db80ee80ea47189142130d35a8e1c2
              name: 'Broker {#JMXBROKERNAME}: Temp limit'
              type: JMX
              key: 'jmx[{#JMXOBJ},TempLimit]'
              units: B
              username: '{$ACTIVEMQ.USER}'
              password: '{$ACTIVEMQ.PASSWORD}'
              description: 'Disk limit, in bytes, used for non-persistent messages and temporary data before producers are blocked.'
              preprocessing:
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              jmx_endpoint: 'service:jmx:rmi:///jndi/rmi://{HOST.CONN}:{HOST.PORT}/jmxrmi'
              tags:
                - tag: component
                  value: storage
            - uuid: 95354144839e4d22a82c4e9a1fab83d9
              name: 'Broker {#JMXBROKERNAME}: Temp usage in percents'
              type: JMX
              key: 'jmx[{#JMXOBJ},TempPercentUsage]'
              units: '%'
              username: '{$ACTIVEMQ.USER}'
              password: '{$ACTIVEMQ.PASSWORD}'
              description: 'Percent of temp limit used.'
              jmx_endpoint: 'service:jmx:rmi:///jndi/rmi://{HOST.CONN}:{HOST.PORT}/jmxrmi'
              tags:
                - tag: component
                  value: storage
              trigger_prototypes:
                - uuid: 422252a81e3e4261bbd7f331f48c6257
                  expression: 'min(/Apache ActiveMQ by JMX/jmx[{#JMXOBJ},TempPercentUsage],{$ACTIVEMQ.TEMP.TIME:"{#JMXBROKERNAME}"})>{$ACTIVEMQ.TEMP.MAX.HIGH}'
                  name: 'Apache ActiveMQ: Broker {#JMXBROKERNAME}: Temp usage is too high'
                  event_name: 'Apache ActiveMQ: Broker {#JMXBROKERNAME}: Temp usage is too high (over {$ACTIVEMQ.TEMP.MAX.WARN:"{#JMXBROKERNAME}"}%)'
                  priority: HIGH
                  tags:
                    - tag: scope
                      value: capacity
                - uuid: acb8f6e0762f48c2bd4c03f2a55b2f44
                  expression: 'min(/Apache ActiveMQ by JMX/jmx[{#JMXOBJ},TempPercentUsage],{$ACTIVEMQ.TEMP.TIME:"{#JMXBROKERNAME}"})>{$ACTIVEMQ.TEMP.MAX.WARN}'
                  name: 'Apache ActiveMQ: Broker {#JMXBROKERNAME}: Temp usage is too high'
                  event_name: 'Apache ActiveMQ: Broker {#JMXBROKERNAME}: Temp usage is too high (over {$ACTIVEMQ.TEMP.MAX.WARN:"{#JMXBROKERNAME}"}%)'
                  priority: AVERAGE
                  dependencies:
                    - name: 'Apache ActiveMQ: Broker {#JMXBROKERNAME}: Temp usage is too high'
                      expression: 'min(/Apache ActiveMQ by JMX/jmx[{#JMXOBJ},TempPercentUsage],{$ACTIVEMQ.TEMP.TIME:"{#JMXBROKERNAME}"})>{$ACTIVEMQ.TEMP.MAX.HIGH}'
                  tags:
                    - tag: scope
                      value: capacity
            - uuid: 64ab04e456804e10a6c78c3190807506
              name: 'Broker {#JMXBROKERNAME}: Consumers count total'
              type: JMX
              key: 'jmx[{#JMXOBJ},TotalConsumerCount]'
              username: '{$ACTIVEMQ.USER}'
              password: '{$ACTIVEMQ.PASSWORD}'
              description: 'Number of consumers attached to this broker.'
              jmx_endpoint: 'service:jmx:rmi:///jndi/rmi://{HOST.CONN}:{HOST.PORT}/jmxrmi'
              tags:
                - tag: component
                  value: broker
              trigger_prototypes:
                - uuid: 6906f0a1ef804da4a1203ca9d96ab8a0
                  expression: 'max(/Apache ActiveMQ by JMX/jmx[{#JMXOBJ},TotalConsumerCount],{$ACTIVEMQ.BROKER.CONSUMERS.MIN.TIME:"{#JMXBROKERNAME}"})<{$ACTIVEMQ.BROKER.CONSUMERS.MIN.HIGH:"{#JMXBROKERNAME}"}'
                  name: 'Apache ActiveMQ: Broker {#JMXBROKERNAME}: Consumers count is too low'
                  event_name: 'Apache ActiveMQ: Broker {#JMXBROKERNAME}: Consumers count is too low (below {$ACTIVEMQ.BROKER.CONSUMERS.MIN.HIGH:"{#JMXBROKERNAME}"} for {$ACTIVEMQ.BROKER.CONSUMERS.MIN.TIME:"{#JMXBROKERNAME}"})'
                  priority: HIGH
                  tags:
                    - tag: scope
                      value: notice
            - uuid: 48bc7dab4a1a40d8a823e880018cf8e7
              name: 'Broker {#JMXBROKERNAME}: Messages dequeue rate'
              type: JMX
              key: 'jmx[{#JMXOBJ},TotalDequeueCount]'
              units: messages/sec
              username: '{$ACTIVEMQ.USER}'
              password: '{$ACTIVEMQ.PASSWORD}'
              description: 'Rate of messages that have been delivered by the broker and acknowledged by consumers.'
              preprocessing:
                - type: CHANGE_PER_SECOND
              jmx_endpoint: 'service:jmx:rmi:///jndi/rmi://{HOST.CONN}:{HOST.PORT}/jmxrmi'
              tags:
                - tag: component
                  value: broker
            - uuid: a462499eecbd443e931a9aa831240f65
              name: 'Broker {#JMXBROKERNAME}: Messages enqueue rate'
              type: JMX
              key: 'jmx[{#JMXOBJ},TotalEnqueueCount]'
              units: messages/sec
              username: '{$ACTIVEMQ.USER}'
              password: '{$ACTIVEMQ.PASSWORD}'
              description: 'Rate of messages that have been sent to the broker.'
              preprocessing:
                - type: CHANGE_PER_SECOND
              jmx_endpoint: 'service:jmx:rmi:///jndi/rmi://{HOST.CONN}:{HOST.PORT}/jmxrmi'
              tags:
                - tag: component
                  value: broker
              trigger_prototypes:
                - uuid: a3ab7bca031c45059418fa82a3c67369
                  expression: 'avg(/Apache ActiveMQ by JMX/jmx[{#JMXOBJ},TotalEnqueueCount],{$ACTIVEMQ.MSG.RATE.WARN.TIME:"{#JMXBROKERNAME}"})>avg(/Apache ActiveMQ by JMX/jmx[{#JMXOBJ},TotalEnqueueCount],{$ACTIVEMQ.MSG.RATE.WARN.TIME:"{#JMXBROKERNAME}"})'
                  name: 'Apache ActiveMQ: Broker {#JMXBROKERNAME}: Message enqueue rate is higher than dequeue rate'
                  event_name: 'Apache ActiveMQ: Broker {#JMXBROKERNAME}: Message enqueue rate is higher than dequeue rate for {$ACTIVEMQ.MSG.RATE.WARN.TIME:"{#JMXBROKERNAME}"}'
                  priority: AVERAGE
                  description: 'Enqueue rate is higher than dequeue rate. It may indicate performance problems.'
                  tags:
                    - tag: scope
                      value: performance
            - uuid: 2453d8221cec4e1ead6622c001ac9a8c
              name: 'Broker {#JMXBROKERNAME}: Producers count total'
              type: JMX
              key: 'jmx[{#JMXOBJ},TotalProducerCount]'
              username: '{$ACTIVEMQ.USER}'
              password: '{$ACTIVEMQ.PASSWORD}'
              description: 'Number of producers attached to this broker.'
              jmx_endpoint: 'service:jmx:rmi:///jndi/rmi://{HOST.CONN}:{HOST.PORT}/jmxrmi'
              tags:
                - tag: component
                  value: broker
              trigger_prototypes:
                - uuid: 2ee6ad72a98143b59d8d1136fffdbe50
                  expression: 'max(/Apache ActiveMQ by JMX/jmx[{#JMXOBJ},TotalProducerCount],{$ACTIVEMQ.BROKER.PRODUCERS.MIN.TIME:"{#JMXBROKERNAME}"})<{$ACTIVEMQ.BROKER.PRODUCERS.MIN.HIGH:"{#JMXBROKERNAME}"}'
                  name: 'Apache ActiveMQ: Broker {#JMXBROKERNAME}: Producers count is too low'
                  event_name: 'Apache ActiveMQ: Broker {#JMXBROKERNAME}: Producers count is too low (below {$ACTIVEMQ.BROKER.PRODUCERS.MIN.HIGH:"{#JMXBROKERNAME}"} for {$ACTIVEMQ.BROKER.PRODUCERS.MIN.TIME:"{#JMXBROKERNAME}"})'
                  priority: HIGH
                  tags:
                    - tag: scope
                      value: notice
            - uuid: a46d7281cb234ccaadacbb7d311cbd39
              name: 'Broker {#JMXBROKERNAME}: Uptime'
              type: JMX
              key: 'jmx[{#JMXOBJ},UptimeMillis]'
              units: s
              username: '{$ACTIVEMQ.USER}'
              password: '{$ACTIVEMQ.PASSWORD}'
              description: 'The uptime of the broker.'
              preprocessing:
                - type: MULTIPLIER
                  parameters:
                    - '0.001'
              jmx_endpoint: 'service:jmx:rmi:///jndi/rmi://{HOST.CONN}:{HOST.PORT}/jmxrmi'
              tags:
                - tag: component
                  value: system
              trigger_prototypes:
                - uuid: 6abb3813bb52465aa4a5f4bebfe999c3
                  expression: 'last(/Apache ActiveMQ by JMX/jmx[{#JMXOBJ},UptimeMillis])<10m'
                  name: 'Apache ActiveMQ: Broker {#JMXBROKERNAME}: Broker has been restarted'
                  event_name: 'Apache ActiveMQ: Broker {#JMXBROKERNAME}: Broker has been restarted (uptime < 10m)'
                  priority: INFO
                  description: 'Uptime is less than 10 minutes.'
                  manual_close: 'YES'
                  tags:
                    - tag: scope
                      value: notice
          graph_prototypes:
            - uuid: 465b9319e0dc4728a2733c69521e9e81
              name: 'Broker {#JMXBROKERNAME}: Messages rate'
              graph_items:
                - drawtype: GRADIENT_LINE
                  color: 199C0D
                  item:
                    host: 'Apache ActiveMQ by JMX'
                    key: 'jmx[{#JMXOBJ},TotalEnqueueCount]'
                - sortorder: '1'
                  drawtype: GRADIENT_LINE
                  color: F63100
                  item:
                    host: 'Apache ActiveMQ by JMX'
                    key: 'jmx[{#JMXOBJ},TotalDequeueCount]'
            - uuid: 9cdb5b2bed724f45a305a8434d28c105
              name: 'Broker {#JMXBROKERNAME}: Producers and consumers'
              graph_items:
                - drawtype: GRADIENT_LINE
                  color: 199C0D
                  item:
                    host: 'Apache ActiveMQ by JMX'
                    key: 'jmx[{#JMXOBJ},TotalProducerCount]'
                - sortorder: '1'
                  drawtype: GRADIENT_LINE
                  color: F63100
                  item:
                    host: 'Apache ActiveMQ by JMX'
                    key: 'jmx[{#JMXOBJ},TotalConsumerCount]'
            - uuid: 6b018bbe9d154d2d865b7922eaa7ae28
              name: 'Broker {#JMXBROKERNAME}: Resources usage'
              graph_items:
                - drawtype: GRADIENT_LINE
                  color: 199C0D
                  item:
                    host: 'Apache ActiveMQ by JMX'
                    key: 'jmx[{#JMXOBJ}, MemoryPercentUsage]'
                - sortorder: '1'
                  drawtype: GRADIENT_LINE
                  color: F63100
                  item:
                    host: 'Apache ActiveMQ by JMX'
                    key: 'jmx[{#JMXOBJ},StorePercentUsage]'
                - sortorder: '2'
                  drawtype: GRADIENT_LINE
                  color: 00611C
                  item:
                    host: 'Apache ActiveMQ by JMX'
                    key: 'jmx[{#JMXOBJ},TempPercentUsage]'
          jmx_endpoint: 'service:jmx:rmi:///jndi/rmi://{HOST.CONN}:{HOST.PORT}/jmxrmi'
        - uuid: 14432547793d42d2b75c7b08fcbb3545
          name: 'Destinations discovery'
          type: JMX
          key: 'jmx.discovery[beans,"org.apache.activemq:type=Broker,brokerName=*,destinationType=*,destinationName=*"]'
          delay: 1h
          username: '{$ACTIVEMQ.USER}'
          password: '{$ACTIVEMQ.PASSWORD}'
          filter:
            evaltype: FORMULA
            formula: 'A and B'
            conditions:
              - macro: '{#JMXDESTINATIONNAME}'
                value: '{$ACTIVEMQ.LLD.FILTER.DESTINATION.MATCHES}'
                formulaid: A
              - macro: '{#JMXDESTINATIONNAME}'
                value: '{$ACTIVEMQ.LLD.FILTER.DESTINATION.NOT_MATCHES}'
                operator: NOT_MATCHES_REGEX
                formulaid: B
          description: 'Discovery of destinations'
          item_prototypes:
            - uuid: fd8129c9a66043d896a70c91c8b0d471
              name: '{#JMXBROKERNAME}: {#JMXDESTINATIONTYPE} {#JMXDESTINATIONNAME}: Consumers count total on {#JMXBROKERNAME}'
              type: JMX
              key: 'jmx["org.apache.activemq:type=Broker,brokerName={#JMXBROKERNAME}",{$ACTIVEMQ.TOTAL.CONSUMERS.COUNT: "{#JMXDESTINATIONNAME}"}]'
              username: '{$ACTIVEMQ.USER}'
              password: '{$ACTIVEMQ.PASSWORD}'
              description: 'Number of consumers attached to the broker of this destination. Used to suppress destination''s triggers when the count of consumers on the broker is lower than threshold.'
              preprocessing:
                - type: IN_RANGE
                  parameters:
                    - '0'
                    - '{$ACTIVEMQ.BROKER.CONSUMERS.MIN.HIGH}'
                  error_handler: CUSTOM_VALUE
                  error_handler_params: '{$ACTIVEMQ.BROKER.CONSUMERS.MIN.HIGH}'
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3h
              jmx_endpoint: 'service:jmx:rmi:///jndi/rmi://{HOST.CONN}:{HOST.PORT}/jmxrmi'
              tags:
                - tag: component
                  value: destination
            - uuid: 99f2094b02f848e785e40296958c5450
              name: '{#JMXBROKERNAME}: {#JMXDESTINATIONTYPE} {#JMXDESTINATIONNAME}: Producers count total on {#JMXBROKERNAME}'
              type: JMX
              key: 'jmx["org.apache.activemq:type=Broker,brokerName={#JMXBROKERNAME}",{$ACTIVEMQ.TOTAL.PRODUCERS.COUNT: "{#JMXDESTINATIONNAME}"}]'
              username: '{$ACTIVEMQ.USER}'
              password: '{$ACTIVEMQ.PASSWORD}'
              description: 'Number of producers attached to the broker of this destination. Used to suppress destination''s triggers when the count of producers on the broker is lower than threshold.'
              preprocessing:
                - type: IN_RANGE
                  parameters:
                    - '0'
                    - '{$ACTIVEMQ.BROKER.PRODUCERS.MIN.HIGH}'
                  error_handler: CUSTOM_VALUE
                  error_handler_params: '{$ACTIVEMQ.BROKER.PRODUCERS.MIN.HIGH}'
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3h
              jmx_endpoint: 'service:jmx:rmi:///jndi/rmi://{HOST.CONN}:{HOST.PORT}/jmxrmi'
              tags:
                - tag: component
                  value: destination
            - uuid: 5e93e53a0c2d49a49d421ded87b6b1f8
              name: '{#JMXBROKERNAME}: {#JMXDESTINATIONTYPE} {#JMXDESTINATIONNAME}: Consumers count'
              type: JMX
              key: 'jmx[{#JMXOBJ},ConsumerCount]'
              username: '{$ACTIVEMQ.USER}'
              password: '{$ACTIVEMQ.PASSWORD}'
              description: 'Number of consumers attached to this destination.'
              jmx_endpoint: 'service:jmx:rmi:///jndi/rmi://{HOST.CONN}:{HOST.PORT}/jmxrmi'
              tags:
                - tag: component
                  value: destination
            - uuid: 3536ec77069a434e854415f0a3270e67
              name: '{#JMXBROKERNAME}: {#JMXDESTINATIONTYPE} {#JMXDESTINATIONNAME}: Messages dequeue rate'
              type: JMX
              key: 'jmx[{#JMXOBJ},DequeueCount]'
              units: messages/sec
              username: '{$ACTIVEMQ.USER}'
              password: '{$ACTIVEMQ.PASSWORD}'
              description: 'Rate of messages that has been acknowledged (and removed) from the destination.'
              preprocessing:
                - type: CHANGE_PER_SECOND
              jmx_endpoint: 'service:jmx:rmi:///jndi/rmi://{HOST.CONN}:{HOST.PORT}/jmxrmi'
              tags:
                - tag: component
                  value: destination
            - uuid: a6dacc8c4d1f4724bf49c63449992035
              name: '{#JMXBROKERNAME}: {#JMXDESTINATIONTYPE} {#JMXDESTINATIONNAME}: Messages enqueue rate'
              type: JMX
              key: 'jmx[{#JMXOBJ},EnqueueCount]'
              units: messages/sec
              username: '{$ACTIVEMQ.USER}'
              password: '{$ACTIVEMQ.PASSWORD}'
              description: 'Rate of messages that have been sent to the destination.'
              preprocessing:
                - type: CHANGE_PER_SECOND
              jmx_endpoint: 'service:jmx:rmi:///jndi/rmi://{HOST.CONN}:{HOST.PORT}/jmxrmi'
              tags:
                - tag: component
                  value: destination
            - uuid: 1c4ea913a9564d74b31ef82314203a15
              name: '{#JMXBROKERNAME}: {#JMXDESTINATIONTYPE} {#JMXDESTINATIONNAME}: Expired messages count'
              type: JMX
              key: 'jmx[{#JMXOBJ},ExpiredCount]'
              username: '{$ACTIVEMQ.USER}'
              password: '{$ACTIVEMQ.PASSWORD}'
              description: 'Number of messages that have been expired.'
              preprocessing:
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3h
              jmx_endpoint: 'service:jmx:rmi:///jndi/rmi://{HOST.CONN}:{HOST.PORT}/jmxrmi'
              tags:
                - tag: component
                  value: destination
              trigger_prototypes:
                - uuid: a498405c5b764c1ea9f0e151adf94ed7
                  expression: 'last(/Apache ActiveMQ by JMX/jmx[{#JMXOBJ},ExpiredCount])>{$ACTIVEMQ.EXPIRED.WARN:"{#JMXDESTINATIONNAME}"}'
                  name: 'Apache ActiveMQ: {#JMXBROKERNAME}: {#JMXDESTINATIONTYPE} {#JMXDESTINATIONNAME}: Expired messages count is high'
                  event_name: 'Apache ActiveMQ: {#JMXBROKERNAME}: {#JMXDESTINATIONTYPE} {#JMXDESTINATIONNAME}: Expired messages count higher than {$ACTIVEMQ.EXPIRED.WARN:"{#JMXDESTINATIONNAME}"}'
                  priority: AVERAGE
                  description: 'This metric represents the number of messages that expired before they could be delivered. If you expect all messages to be delivered and acknowledged within a certain amount of time, you can set an expiration for each message, and investigate if your ExpiredCount metric rises above zero.'
                  tags:
                    - tag: scope
                      value: performance
            - uuid: 158fac5a1b3c4f07a4004a733f9b6995
              name: '{#JMXBROKERNAME}: {#JMXDESTINATIONTYPE} {#JMXDESTINATIONNAME}: Memory usage in percents'
              type: JMX
              key: 'jmx[{#JMXOBJ},MemoryPercentUsage]'
              units: '%'
              username: '{$ACTIVEMQ.USER}'
              password: '{$ACTIVEMQ.PASSWORD}'
              description: 'The percentage of the memory limit used.'
              jmx_endpoint: 'service:jmx:rmi:///jndi/rmi://{HOST.CONN}:{HOST.PORT}/jmxrmi'
              tags:
                - tag: component
                  value: memory
              trigger_prototypes:
                - uuid: 197ab32730a84f79ba1b1e827a10e175
                  expression: 'last(/Apache ActiveMQ by JMX/jmx[{#JMXOBJ},MemoryPercentUsage])>{$ACTIVEMQ.MEM.MAX.HIGH:"{#JMXDESTINATIONNAME}"}'
                  name: 'Apache ActiveMQ: {#JMXBROKERNAME}: {#JMXDESTINATIONTYPE} {#JMXDESTINATIONNAME}: Memory usage is too high'
                  event_name: 'Apache ActiveMQ: {#JMXBROKERNAME}: {#JMXDESTINATIONTYPE} {#JMXDESTINATIONNAME}: Memory usage is too high (over {$ACTIVEMQ.MEM.MAX.HIGH:"{#JMXDESTINATIONNAME}"}%)'
                  priority: HIGH
                  tags:
                    - tag: scope
                      value: performance
                - uuid: 1e4e3a969b434c6d972251f8c9b3f2a7
                  expression: 'last(/Apache ActiveMQ by JMX/jmx[{#JMXOBJ},MemoryPercentUsage])>{$ACTIVEMQ.MEM.MAX.WARN:"{#JMXDESTINATIONNAME}"}'
                  name: 'Apache ActiveMQ: {#JMXBROKERNAME}: {#JMXDESTINATIONTYPE} {#JMXDESTINATIONNAME}: Memory usage is too high'
                  event_name: 'Apache ActiveMQ: {#JMXBROKERNAME}: {#JMXDESTINATIONTYPE} {#JMXDESTINATIONNAME}: Memory usage is too high (over {$ACTIVEMQ.MEM.MAX.WARN:"{#JMXDESTINATIONNAME}"}%)'
                  priority: AVERAGE
                  tags:
                    - tag: scope
                      value: performance
            - uuid: 82ee74872f6e46efbf16ae0705bcf2a6
              name: '{#JMXBROKERNAME}: {#JMXDESTINATIONTYPE} {#JMXDESTINATIONNAME}: Producers count'
              type: JMX
              key: 'jmx[{#JMXOBJ},ProducerCount]'
              username: '{$ACTIVEMQ.USER}'
              password: '{$ACTIVEMQ.PASSWORD}'
              description: 'Number of producers attached to this destination.'
              jmx_endpoint: 'service:jmx:rmi:///jndi/rmi://{HOST.CONN}:{HOST.PORT}/jmxrmi'
              tags:
                - tag: component
                  value: destination
            - uuid: fdc1e26fbe6545d3bdfc86f6f8c91b8b
              name: '{#JMXBROKERNAME}: {#JMXDESTINATIONTYPE} {#JMXDESTINATIONNAME}: Queue size'
              type: JMX
              key: 'jmx[{#JMXOBJ},QueueSize]'
              username: '{$ACTIVEMQ.USER}'
              password: '{$ACTIVEMQ.PASSWORD}'
              description: 'Number of messages on this destination, including any that have been dispatched but not acknowledged.'
              jmx_endpoint: 'service:jmx:rmi:///jndi/rmi://{HOST.CONN}:{HOST.PORT}/jmxrmi'
              tags:
                - tag: component
                  value: destination
              trigger_prototypes:
                - uuid: f1c49943152c407088e3bf288b650b41
                  expression: 'min(/Apache ActiveMQ by JMX/jmx[{#JMXOBJ},QueueSize],{$ACTIVEMQ.QUEUE.TIME:"{#JMXDESTINATIONNAME}"})>{$ACTIVEMQ.QUEUE.WARN:"{#JMXDESTINATIONNAME}"} and {$ACTIVEMQ.QUEUE.ENABLED:"{#JMXDESTINATIONNAME}"}=1'
                  name: 'Apache ActiveMQ: {#JMXBROKERNAME}: {#JMXDESTINATIONTYPE} {#JMXDESTINATIONNAME}: Queue size is high'
                  event_name: 'Apache ActiveMQ: {#JMXBROKERNAME}: {#JMXDESTINATIONTYPE} {#JMXDESTINATIONNAME}: Queue size higher than {$ACTIVEMQ.QUEUE.WARN:"{#JMXDESTINATIONNAME}"} for {$ACTIVEMQ.QUEUE.TIME:"{#JMXDESTINATIONNAME}"}'
                  priority: AVERAGE
                  description: 'Queue size is higher than threshold. It may indicate performance problems.'
                  tags:
                    - tag: scope
                      value: performance
          trigger_prototypes:
            - uuid: c366d4b329c0471386566d6795c5787f
              expression: 'max(/Apache ActiveMQ by JMX/jmx[{#JMXOBJ},ConsumerCount],{$ACTIVEMQ.DESTINATION.CONSUMERS.MIN.TIME:"{#JMXDESTINATIONNAME}"})<{$ACTIVEMQ.DESTINATION.CONSUMERS.MIN.HIGH:"{#JMXDESTINATIONNAME}"} and last(/Apache ActiveMQ by JMX/jmx["org.apache.activemq:type=Broker,brokerName={#JMXBROKERNAME}",{$ACTIVEMQ.TOTAL.CONSUMERS.COUNT: "{#JMXDESTINATIONNAME}"}])>{$ACTIVEMQ.BROKER.CONSUMERS.MIN.HIGH:"{#JMXBROKERNAME}"}'
              recovery_mode: RECOVERY_EXPRESSION
              recovery_expression: 'min(/Apache ActiveMQ by JMX/jmx[{#JMXOBJ},ConsumerCount],{$ACTIVEMQ.DESTINATION.CONSUMERS.MIN.TIME:"{#JMXDESTINATIONNAME}"})>={$ACTIVEMQ.DESTINATION.CONSUMERS.MIN.HIGH:"{#JMXDESTINATIONNAME}"}'
              name: 'Apache ActiveMQ: {#JMXBROKERNAME}: {#JMXDESTINATIONTYPE} {#JMXDESTINATIONNAME}: Consumers count is too low'
              event_name: 'Apache ActiveMQ: {#JMXBROKERNAME}: {#JMXDESTINATIONTYPE} {#JMXDESTINATIONNAME}: Consumers count is too low (below {$ACTIVEMQ.DESTINATION.CONSUMERS.MIN.HIGH:"{#JMXDESTINATIONNAME}"} for {$ACTIVEMQ.DESTINATION.CONSUMERS.MIN.TIME:"{#JMXDESTINATIONNAME}"})'
              priority: AVERAGE
              manual_close: 'YES'
              tags:
                - tag: scope
                  value: notice
            - uuid: 344a0b83a5444d009aa56e97c1c0171b
              expression: 'avg(/Apache ActiveMQ by JMX/jmx[{#JMXOBJ},EnqueueCount],{$ACTIVEMQ.MSG.RATE.WARN.TIME:"{#JMXDESTINATIONNAME}"})>avg(/Apache ActiveMQ by JMX/jmx[{#JMXOBJ},DequeueCount],{$ACTIVEMQ.MSG.RATE.WARN.TIME:"{#JMXDESTINATIONNAME}"})'
              name: 'Apache ActiveMQ: {#JMXBROKERNAME}: {#JMXDESTINATIONTYPE} {#JMXDESTINATIONNAME}: Message enqueue rate is higher than dequeue rate'
              event_name: 'Apache ActiveMQ: {#JMXBROKERNAME}: {#JMXDESTINATIONTYPE} {#JMXDESTINATIONNAME}: Message enqueue rate is higher than dequeue rate for {$ACTIVEMQ.MSG.RATE.WARN.TIME:"{#JMXDESTINATIONNAME}"}'
              priority: AVERAGE
              description: 'Enqueue rate is higher than dequeue rate. It may indicate performance problems.'
              tags:
                - tag: scope
                  value: notice
            - uuid: 725d0270554e4fe59d138becfa3e6377
              expression: 'max(/Apache ActiveMQ by JMX/jmx[{#JMXOBJ},ProducerCount],{$ACTIVEMQ.DESTINATION.PRODUCERS.MIN.TIME:"{#JMXDESTINATIONNAME}"})<{$ACTIVEMQ.DESTINATION.PRODUCERS.MIN.HIGH:"{#JMXDESTINATIONNAME}"} and last(/Apache ActiveMQ by JMX/jmx["org.apache.activemq:type=Broker,brokerName={#JMXBROKERNAME}",{$ACTIVEMQ.TOTAL.PRODUCERS.COUNT: "{#JMXDESTINATIONNAME}"}])>{$ACTIVEMQ.BROKER.PRODUCERS.MIN.HIGH:"{#JMXBROKERNAME}"}'
              recovery_mode: RECOVERY_EXPRESSION
              recovery_expression: 'min(/Apache ActiveMQ by JMX/jmx[{#JMXOBJ},ProducerCount],{$ACTIVEMQ.DESTINATION.PRODUCERS.MIN.TIME:"{#JMXDESTINATIONNAME}"})>={$ACTIVEMQ.DESTINATION.PRODUCERS.MIN.HIGH:"{#JMXDESTINATIONNAME}"}'
              name: 'Apache ActiveMQ: {#JMXBROKERNAME}: {#JMXDESTINATIONTYPE} {#JMXDESTINATIONNAME}: Producers count is too low'
              event_name: 'Apache ActiveMQ: {#JMXBROKERNAME}: {#JMXDESTINATIONTYPE} {#JMXDESTINATIONNAME}: Producers count is too low (below {$ACTIVEMQ.DESTINATION.PRODUCERS.MIN.HIGH:"{#JMXDESTINATIONNAME}"} for {$ACTIVEMQ.DESTINATION.PRODUCERS.MIN.TIME:"{#JMXDESTINATIONNAME}"})'
              priority: AVERAGE
              manual_close: 'YES'
              tags:
                - tag: scope
                  value: notice
          graph_prototypes:
            - uuid: 006f397fbb664f9981b9228808870239
              name: '{#JMXBROKERNAME}: {#JMXDESTINATIONTYPE} {#JMXDESTINATIONNAME}: Memory usage'
              graph_items:
                - drawtype: GRADIENT_LINE
                  color: 199C0D
                  item:
                    host: 'Apache ActiveMQ by JMX'
                    key: 'jmx[{#JMXOBJ},MemoryPercentUsage]'
            - uuid: 1c9a999ec2b94942ad10f408b470b1a2
              name: '{#JMXBROKERNAME}: {#JMXDESTINATIONTYPE} {#JMXDESTINATIONNAME}: Messages rate'
              graph_items:
                - drawtype: GRADIENT_LINE
                  color: 199C0D
                  item:
                    host: 'Apache ActiveMQ by JMX'
                    key: 'jmx[{#JMXOBJ},EnqueueCount]'
                - sortorder: '1'
                  drawtype: GRADIENT_LINE
                  color: F63100
                  item:
                    host: 'Apache ActiveMQ by JMX'
                    key: 'jmx[{#JMXOBJ},DequeueCount]'
            - uuid: 0854230a67bc4d29b3b3dc2cb7eeaefa
              name: '{#JMXBROKERNAME}: {#JMXDESTINATIONTYPE} {#JMXDESTINATIONNAME}: Producers and consumers'
              graph_items:
                - drawtype: GRADIENT_LINE
                  color: 199C0D
                  item:
                    host: 'Apache ActiveMQ by JMX'
                    key: 'jmx[{#JMXOBJ},ProducerCount]'
                - sortorder: '1'
                  drawtype: GRADIENT_LINE
                  color: F63100
                  item:
                    host: 'Apache ActiveMQ by JMX'
                    key: 'jmx[{#JMXOBJ},ConsumerCount]'
          jmx_endpoint: 'service:jmx:rmi:///jndi/rmi://{HOST.CONN}:{HOST.PORT}/jmxrmi'
      tags:
        - tag: class
          value: software
        - tag: subclass
          value: messaging
        - tag: target
          value: apache-activemq
      macros:
        - macro: '{$ACTIVEMQ.BROKER.CONSUMERS.MIN.HIGH}'
          value: '1'
          description: 'Minimum amount of consumers for broker. Can be used with broker name as context.'
          config:
            type: TEXT
            priority: '23'
            section_name: Thresholds
            label: 'Min consumers (broker)'
            description: 'Minimum amount of consumers for broker. Can be used with broker name as context.'
        - macro: '{$ACTIVEMQ.BROKER.CONSUMERS.MIN.TIME}'
          value: 5m
          description: 'Time during which there may be no consumers on destination. Can be used with broker name as context.'
          config:
            type: TEXT
            priority: '22'
            section_name: Thresholds
            label: 'No consumers time (broker)'
            description: 'Time during which there may be no consumers on destination. Can be used with broker name as context.'
        - macro: '{$ACTIVEMQ.BROKER.PRODUCERS.MIN.HIGH}'
          value: '1'
          description: 'Minimum amount of producers for broker. Can be used with broker name as context.'
          config:
            type: TEXT
            priority: '25'
            section_name: Thresholds
            label: 'Min producers (broker)'
            description: 'Minimum amount of producers for broker. Can be used with broker name as context.'
        - macro: '{$ACTIVEMQ.BROKER.PRODUCERS.MIN.TIME}'
          value: 5m
          description: 'Time during which there may be no producers on broker. Can be used with broker name as context.'
          config:
            type: TEXT
            priority: '24'
            section_name: Thresholds
            label: 'No producers time (broker)'
            description: 'Time during which there may be no producers on broker. Can be used with broker name as context.'
        - macro: '{$ACTIVEMQ.DESTINATION.CONSUMERS.MIN.HIGH}'
          value: '1'
          description: 'Minimum amount of consumers for destination. Can be used with destination name as context.'
          config:
            type: TEXT
            priority: '19'
            section_name: Thresholds
            label: 'Min consumers (destination)'
            description: 'Minimum amount of consumers for destination. Can be used with destination name as context.'
        - macro: '{$ACTIVEMQ.DESTINATION.CONSUMERS.MIN.TIME}'
          value: 10m
          description: 'Time during which there may be no consumers in destination. Can be used with destination name as context.'
          config:
            type: TEXT
            priority: '18'
            section_name: Thresholds
            label: 'No consumers time (destination)'
            description: 'Time during which there may be no consumers in destination. Can be used with destination name as context.'
        - macro: '{$ACTIVEMQ.DESTINATION.PRODUCERS.MIN.HIGH}'
          value: '1'
          description: 'Minimum amount of producers for destination. Can be used with destination name as context.'
          config:
            type: TEXT
            priority: '21'
            section_name: Thresholds
            label: 'Min producers (destination)'
            description: 'Minimum amount of producers for destination. Can be used with destination name as context.'
        - macro: '{$ACTIVEMQ.DESTINATION.PRODUCERS.MIN.TIME}'
          value: 10m
          description: 'Time during which there may be no producers on destination. Can be used with destination name as context.'
          config:
            type: TEXT
            priority: '20'
            section_name: Thresholds
            label: 'No producers time (destination)'
            description: 'Time during which there may be no producers on destination. Can be used with destination name as context.'
        - macro: '{$ACTIVEMQ.EXPIRED.WARN}'
          value: '0'
          description: 'Threshold for expired messages count. Can be used with destination name as context.'
          config:
            type: TEXT
            priority: '31'
            section_name: Thresholds
            label: 'Expired messages threshold'
            description: 'Threshold for expired messages count. Can be used with destination name as context.'
        - macro: '{$ACTIVEMQ.LLD.FILTER.BROKER.MATCHES}'
          value: '.*'
          description: 'Filter of discoverable discovered brokers'
          config:
            type: TEXT
            priority: '4'
            section_name: Filters
            label: 'Brokers filter (include)'
            description: 'Filter of discoverable discovered brokers'
        - macro: '{$ACTIVEMQ.LLD.FILTER.BROKER.NOT_MATCHES}'
          value: 'CHANGE IF NEEDED'
          description: 'Filter to exclude discovered brokers'
          config:
            type: TEXT
            priority: '5'
            section_name: Filters
            label: 'Brokers filter (exclude)'
            description: 'Filter to exclude discovered brokers'
        - macro: '{$ACTIVEMQ.LLD.FILTER.DESTINATION.MATCHES}'
          value: '.*'
          description: 'Filter of discoverable discovered destinations'
          config:
            type: TEXT
            priority: '6'
            section_name: Filters
            label: 'Destinations filter (include)'
            description: 'Filter of discoverable discovered destinations'
        - macro: '{$ACTIVEMQ.LLD.FILTER.DESTINATION.NOT_MATCHES}'
          value: 'CHANGE IF NEEDED'
          description: 'Filter to exclude discovered destinations'
          config:
            type: TEXT
            priority: '7'
            section_name: Filters
            label: 'Destinations filter (exclude)'
            description: 'Filter to exclude discovered destinations'
        - macro: '{$ACTIVEMQ.MEM.MAX.HIGH}'
          value: '90'
          description: 'Memory threshold for HIGH trigger. Can be used with destination or broker name as context.'
          config:
            type: TEXT
            priority: '10'
            section_name: Thresholds
            label: 'Memory threshold high'
            description: 'Memory threshold for HIGH trigger. Can be used with destination or broker name as context.'
        - macro: '{$ACTIVEMQ.MEM.MAX.WARN}'
          value: '75'
          description: 'Memory threshold for AVERAGE trigger. Can be used with destination or broker name as context.'
          config:
            type: TEXT
            priority: '9'
            section_name: Thresholds
            label: 'Memory threshold average'
            description: 'Memory threshold for AVERAGE trigger. Can be used with destination or broker name as context.'
        - macro: '{$ACTIVEMQ.MEM.TIME}'
          value: 5m
          description: 'Time during which the metric can be above the threshold. Can be used with destination or broker name as context.'
          config:
            type: TEXT
            priority: '11'
            section_name: Thresholds
            label: 'Memory metric duration above threshold'
            description: 'Time during which the metric can be above the threshold. Can be used with destination or broker name as context.'
        - macro: '{$ACTIVEMQ.MSG.RATE.WARN.TIME}'
          value: 15m
          description: 'The time for message enqueue/dequeue rate. Can be used with destination or broker name as context.'
          config:
            type: TEXT
            priority: '8'
            section_name: Thresholds
            label: 'Message rate time window'
            description: 'The time for message enqueue/dequeue rate. Can be used with destination or broker name as context.'
        - macro: '{$ACTIVEMQ.PASSWORD}'
          value: activemq
          description: 'Password for JMX'
          config:
            type: TEXT
            priority: '2'
            label: 'JMX password'
            description: 'Password for JMX'
            required: 'YES'
        - macro: '{$ACTIVEMQ.PORT}'
          value: '1099'
          description: 'Port for JMX'
          config:
            type: TEXT
            priority: '3'
            label: 'JMX port'
            description: 'Port for JMX'
        - macro: '{$ACTIVEMQ.QUEUE.ENABLED}'
          value: '1'
          description: 'Use this to disable alerting for specific destination. 1 = enabled, 0 = disabled. Can be used with destination name as context.'
          config:
            type: TEXT
            priority: '30'
            section_name: Other
            label: 'Destination alert enabled'
            description: 'Use this to disable alerting for specific destination. 1 = enabled, 0 = disabled. Can be used with destination name as context.'
        - macro: '{$ACTIVEMQ.QUEUE.TIME}'
          value: 10m
          description: 'Time during which the QueueSize can be higher than threshold. Can be used with destination name as context.'
          config:
            type: TEXT
            priority: '28'
            section_name: Thresholds
            label: 'Queue size duration above threshold'
            description: 'Time during which the QueueSize can be higher than threshold. Can be used with destination name as context.'
        - macro: '{$ACTIVEMQ.QUEUE.WARN}'
          value: '100'
          description: 'Threshold for QueueSize. Can be used with destination name as context.'
          config:
            type: TEXT
            priority: '29'
            section_name: Thresholds
            label: 'Queue size threshold'
            description: 'Threshold for QueueSize. Can be used with destination name as context.'
        - macro: '{$ACTIVEMQ.STORE.MAX.HIGH}'
          value: '90'
          description: 'Storage threshold for HIGH trigger. Can be used with broker name as context.'
          config:
            type: TEXT
            priority: '14'
            section_name: Thresholds
            label: 'Storage threshold high'
            description: 'Storage threshold for HIGH trigger. Can be used with broker name as context.'
        - macro: '{$ACTIVEMQ.STORE.MAX.WARN}'
          value: '75'
          description: 'Storage threshold for AVERAGE trigger. Can be used with broker name as context.'
          config:
            type: TEXT
            priority: '12'
            section_name: Thresholds
            label: 'Storage threshold average'
            description: 'Storage threshold for AVERAGE trigger. Can be used with broker name as context.'
        - macro: '{$ACTIVEMQ.STORE.TIME}'
          value: 5m
          description: 'Time during which the metric can be above the threshold. Can be used with destination or broker name as context.'
          config:
            type: TEXT
            priority: '13'
            section_name: Thresholds
            label: 'Storage metric duration above threshold'
            description: 'Time during which the metric can be above the threshold. Can be used with destination or broker name as context.'
        - macro: '{$ACTIVEMQ.TEMP.MAX.HIGH}'
          value: '90'
          description: 'Temp threshold for HIGH trigger. Can be used with broker name as context.'
          config:
            type: TEXT
            priority: '16'
            section_name: Thresholds
            label: 'Temperature threshold high'
            description: 'Temp threshold for HIGH trigger. Can be used with broker name as context.'
        - macro: '{$ACTIVEMQ.TEMP.MAX.WARN}'
          value: '75'
          description: 'Temp threshold for AVERAGE trigger. Can be used with broker name as context.'
          config:
            type: TEXT
            priority: '15'
            section_name: Thresholds
            label: 'Temperature threshold average'
            description: 'Temp threshold for AVERAGE trigger. Can be used with broker name as context.'
        - macro: '{$ACTIVEMQ.TEMP.TIME}'
          value: 5m
          description: 'Time during which the metric can be above the threshold. Can be used with destination or broker name as context.'
          config:
            type: TEXT
            priority: '17'
            section_name: Thresholds
            label: 'Temperature metric duration above threshold'
            description: 'Time during which the metric can be above the threshold. Can be used with destination or broker name as context.'
        - macro: '{$ACTIVEMQ.TOTAL.CONSUMERS.COUNT}'
          value: TotalConsumerCount
          description: 'Attribute for TotalConsumerCount per destination. Used to suppress destination''s triggers when the count of consumers on the broker is lower than threshold.'
          config:
            type: TEXT
            priority: '26'
            section_name: Thresholds
            label: 'Suppress triggers by consumer count'
            description: 'Attribute for TotalConsumerCount per destination. Used to suppress destination''s triggers when the count of consumers on the broker is lower than threshold.'
        - macro: '{$ACTIVEMQ.TOTAL.PRODUCERS.COUNT}'
          value: TotalProducerCount
          description: 'Attribute for TotalProducerCount per destination. Used to suppress destination''s triggers when the count of consumers on the broker is lower than threshold.'
          config:
            type: TEXT
            priority: '27'
            section_name: Thresholds
            label: 'Suppress triggers by producer count'
            description: 'Attribute for TotalProducerCount per destination. Used to suppress destination''s triggers when the count of consumers on the broker is lower than threshold.'
        - macro: '{$ACTIVEMQ.USER}'
          value: admin
          description: 'User for JMX'
          config:
            type: TEXT
            priority: '1'
            label: 'JMX user'
            description: 'User for JMX'
            required: 'YES'
      dashboards:
        - uuid: 292193a9f5fc4a40a78aa304a6ceb536
          name: 'Apache ActiveMQ: Overview'
          pages:
            - name: General
              widgets:
                - type: graphprototype
                  width: '36'
                  height: '15'
                  fields:
                    - type: INTEGER
                      name: columns
                      value: '1'
                    - type: GRAPH_PROTOTYPE
                      name: graphid.0
                      value:
                        host: 'Apache ActiveMQ by JMX'
                        name: '{#JMXBROKERNAME}: {#JMXDESTINATIONTYPE} {#JMXDESTINATIONNAME}: Memory usage'
                    - type: STRING
                      name: reference
                      value: AAAAA
                    - type: INTEGER
                      name: rows
                      value: '3'
                - type: graphprototype
                  x: '36'
                  width: '36'
                  height: '15'
                  fields:
                    - type: INTEGER
                      name: columns
                      value: '1'
                    - type: GRAPH_PROTOTYPE
                      name: graphid.0
                      value:
                        host: 'Apache ActiveMQ by JMX'
                        name: 'Broker {#JMXBROKERNAME}: Resources usage'
                    - type: STRING
                      name: reference
                      value: AAAAB
                    - type: INTEGER
                      name: rows
                      value: '3'
    - uuid: 86702e8bc514434e8c914d50c206cb94
      template: 'Apache by HTTP'
      name: 'Apache by HTTP'
      description: |
        This template is designed for the effortless deployment of Apache monitoring by Zabbix via HTTP and doesn't require any external scripts.
        
        The template collects metrics by polling 'mod_status' with HTTP agent remotely.
        
        Setup:
        
        1. See the setup instructions for mod_status:
        https://httpd.apache.org/docs/current/mod/mod_status.html
        
        Check the availability of the module with this command line:
        httpd -M 2>/dev/null | grep status_module
        
        This is an example configuration of the Apache web server:
        
        <Location "/server-status">
          SetHandler server-status
          Require host example.com
        </Location>
        
        2. Set the hostname or IP address of the Apache status page host in the '{$APACHE.STATUS.HOST}' macro. You can also change the status page port in the '{$APACHE.STATUS.PORT}' macro and status page path in the '{$APACHE.STATUS.PATH}' macro if necessary.
        
        You can discuss this template or leave feedback on our forum https://www.zabbix.com/forum/zabbix-suggestions-and-feedback/384764-discussion-thread-for-official-zabbix-template-apache
        
        Generated by official Zabbix template tool "Templator"
      wizard_ready: 'YES'
      readme: |
        ## Overview
        
        This template is designed for the effortless deployment of Apache monitoring by Zabbix via HTTP and doesn't require any external scripts.
        
        The template collects metrics by polling [`mod_status`](https://httpd.apache.org/docs/current/mod/mod_status.html) with HTTP agent remotely:
        
        ```text
        127.0.0.1
        ServerVersion: Apache/2.4.41 (Unix)
        ServerMPM: event
        Server Built: Aug 14 2019 00:35:10
        CurrentTime: Friday, 16-Aug-2019 12:38:40 UTC
        RestartTime: Wednesday, 14-Aug-2019 07:58:26 UTC
        ParentServerConfigGeneration: 1
        ParentServerMPMGeneration: 0
        ServerUptimeSeconds: 189613
        ServerUptime: 2 days 4 hours 40 minutes 13 seconds
        Load1: 4.60
        Load5: 1.20
        Load15: 0.47
        Total Accesses: 27860
        Total kBytes: 33011
        Total Duration: 54118
        CPUUser: 18.02
        CPUSystem: 31.76
        CPUChildrenUser: 0
        CPUChildrenSystem: 0
        CPULoad: .0262535
        Uptime: 189613
        ReqPerSec: .146931
        BytesPerSec: 178.275
        BytesPerReq: 1213.33
        DurationPerReq: 1.9425
        BusyWorkers: 7
        IdleWorkers: 93
        Processes: 4
        Stopping: 0
        BusyWorkers: 7
        IdleWorkers: 93
        ConnsTotal: 13
        ConnsAsyncWriting: 0
        ConnsAsyncKeepAlive: 5
        ConnsAsyncClosing: 0
        Scoreboard: ...
        ```
        
        ## Setup
        
        1. See the setup instructions for [`mod_status`](https://httpd.apache.org/docs/current/mod/mod_status.html).
        
        Check the availability of the module with this command line:
        `httpd -M 2>/dev/null | grep status_module`
        
        This is an example configuration of the Apache web server:
        
        ```text
        <Location "/server-status">
          SetHandler server-status
          Require host example.com
        </Location>
        ```
        
        2. Set the hostname or IP address of the Apache status page host in the `Apache status host` host wizard configuration field. You can also change the status page port in the `Apache status page port` field and status page path in the `Apache status page path` field if necessary.
      vendor:
        name: Zabbix
        version: 8.0-0
      groups:
        - name: Templates/Applications
      items:
        - uuid: b9fe6f0bbe174e9f81af84a3bc0b0e7c
          name: 'Total bytes'
          type: DEPENDENT
          key: apache.bytes
          value_type: FLOAT
          units: B
          description: 'The total bytes served.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$["Total kBytes"]'
            - type: MULTIPLIER
              parameters:
                - '1024'
          master_item:
            key: apache.get_status
          tags:
            - tag: component
              value: network
        - uuid: b36010be10874cf188eeacc81f2c366f
          name: 'Bytes per second'
          type: DEPENDENT
          key: apache.bytes.rate
          value_type: FLOAT
          units: Bps
          description: |
            It is calculated as a rate of change for total bytes statistics.
            `BytesPerSec` is not used, as it counts the average since the last Apache server start.
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$["Total kBytes"]'
            - type: MULTIPLIER
              parameters:
                - '1024'
            - type: CHANGE_PER_SECOND
          master_item:
            key: apache.get_status
          tags:
            - tag: component
              value: network
        - uuid: e61be8ad92004100aca55fcedd2a3807
          name: 'Get status'
          type: HTTP_AGENT
          key: apache.get_status
          history: 1h
          value_type: TEXT
          description: |
            Getting data from a machine-readable version of the Apache status page.
            For more information see Apache Module [mod_status](https://httpd.apache.org/docs/current/mod/mod_status.html).
          preprocessing:
            - type: JAVASCRIPT
              parameters:
                - |
                  var lines = value.split('\n');
                  var output = {},
                  	workers = {
                  		'_': 0, 'S': 0, 'R': 0, 'W': 0,
                  		'K': 0, 'D': 0, 'C': 0, 'L': 0,
                  		'G': 0, 'I': 0, '.': 0
                  	};
                  
                  for (var i = 0; i < lines.length; i++) {
                  	var line = lines[i].match(/([A-z0-9 ]+): (.*)/);
                  
                  	if (line !== null) {
                  		output[line[1]] = isNaN(line[2]) ? line[2] : Number(line[2]);
                  	}
                  }
                  
                  output.ServerUptimeSeconds = output.ServerUptimeSeconds || output.Uptime;
                  output.ServerVersion = output.ServerVersion || output.Server;
                  
                  if (typeof output.Scoreboard === 'string') {
                  	for (var i = 0; i < output.Scoreboard.length; i++) {
                  		var char = output.Scoreboard[i];
                  
                  		workers[char]++;
                  	}
                  }
                  
                  output.Workers = {
                  	waiting: workers['_'], starting: workers['S'], reading: workers['R'],
                  	sending: workers['W'], keepalive: workers['K'], dnslookup: workers['D'],
                  	closing: workers['C'], logging: workers['L'], finishing: workers['G'],
                  	cleanup: workers['I'], slot: workers['.']
                  };
                  
                  return JSON.stringify(output);
          url: '{$APACHE.STATUS.SCHEME}://{$APACHE.STATUS.HOST}:{$APACHE.STATUS.PORT}/{$APACHE.STATUS.PATH}'
          retrieve_mode: BOTH
          tags:
            - tag: component
              value: raw
          triggers:
            - uuid: db396445cc5042f89f31dc12cb99c32e
              expression: 'nodata(/Apache by HTTP/apache.get_status,30m)=1'
              name: 'Apache: Failed to fetch status page'
              event_name: 'Apache: Failed to fetch status page (or no data for 30m)'
              priority: WARNING
              description: 'Zabbix has not received any data for items for the last 30 minutes.'
              manual_close: 'YES'
              dependencies:
                - name: 'Apache: Service is down'
                  expression: 'last(/Apache by HTTP/net.tcp.service[http,"{$APACHE.STATUS.HOST}","{$APACHE.STATUS.PORT}"])=0'
              tags:
                - tag: scope
                  value: availability
        - uuid: 5fb5101de70a43fab50d55f418462255
          name: 'Total requests'
          type: DEPENDENT
          key: apache.requests
          description: 'The total number of the Apache server accesses.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$["Total Accesses"]'
          master_item:
            key: apache.get_status
          tags:
            - tag: component
              value: network
        - uuid: ee15f4958040459da53251cc3561ed39
          name: 'Requests per second'
          type: DEPENDENT
          key: apache.requests.rate
          value_type: FLOAT
          description: |
            It is calculated as a rate of change for the "Total requests" statistics.
            `ReqPerSec` is not used, as it counts the average since the last Apache server start.
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$["Total Accesses"]'
            - type: CHANGE_PER_SECOND
          master_item:
            key: apache.get_status
          tags:
            - tag: component
              value: network
        - uuid: 3dd8ba505d584b028c7ac08d8b959eb3
          name: Uptime
          type: DEPENDENT
          key: apache.uptime
          units: uptime
          description: 'The service uptime expressed in seconds.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.ServerUptimeSeconds
          master_item:
            key: apache.get_status
          tags:
            - tag: component
              value: system
          triggers:
            - uuid: 76cfa6ebf39f4c8fbd8fde9e0f36d3ed
              expression: 'last(/Apache by HTTP/apache.uptime)<10m'
              name: 'Apache: Service has been restarted'
              event_name: 'Apache: Service has been restarted (uptime < 10m)'
              priority: INFO
              description: 'Uptime is less than 10 minutes.'
              manual_close: 'YES'
              tags:
                - tag: scope
                  value: notice
        - uuid: fe0de2eb1478482f99b38c13bd20564c
          name: Version
          type: DEPENDENT
          key: apache.version
          value_type: CHAR
          description: 'The Apache service version.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.ServerVersion
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1d
          master_item:
            key: apache.get_status
          tags:
            - tag: component
              value: system
          triggers:
            - uuid: 5296d69af0704d0e8a07398f0b4c9685
              expression: 'last(/Apache by HTTP/apache.version,#1)<>last(/Apache by HTTP/apache.version,#2) and length(last(/Apache by HTTP/apache.version))>0'
              name: 'Apache: Version has changed'
              event_name: 'Apache: Version has changed (new version: {ITEM.VALUE})'
              priority: INFO
              description: 'Apache version has changed. Acknowledge to close the problem manually.'
              manual_close: 'YES'
              tags:
                - tag: scope
                  value: notice
        - uuid: f74ffb92e30e48958b5b82f7dfbe5147
          name: 'Workers idle cleanup'
          type: DEPENDENT
          key: apache.workers.cleanup
          description: 'The number of workers in cleanup state.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.Workers.cleanup
          master_item:
            key: apache.get_status
          tags:
            - tag: component
              value: system
        - uuid: d664bee9a330480bbaee7273b871a8d3
          name: 'Workers closing connection'
          type: DEPENDENT
          key: apache.workers.closing
          description: 'The number of workers in closing state.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.Workers.closing
          master_item:
            key: apache.get_status
          tags:
            - tag: component
              value: system
        - uuid: a6fb3444585749be998ec840cd8e4511
          name: 'Workers DNS lookup'
          type: DEPENDENT
          key: apache.workers.dnslookup
          description: 'The number of workers in `dnslookup` state.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.Workers.dnslookup
          master_item:
            key: apache.get_status
          tags:
            - tag: component
              value: system
        - uuid: fcf771f2a9b64a81a37db679f0494ed3
          name: 'Workers finishing'
          type: DEPENDENT
          key: apache.workers.finishing
          description: 'The number of workers in finishing state.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.Workers.finishing
          master_item:
            key: apache.get_status
          tags:
            - tag: component
              value: system
        - uuid: cb81a6a77395444283bc5e065fcbfc2e
          name: 'Workers keepalive (read)'
          type: DEPENDENT
          key: apache.workers.keepalive
          description: 'The number of workers in `keepalive` state.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.Workers.keepalive
          master_item:
            key: apache.get_status
          tags:
            - tag: component
              value: system
        - uuid: 7fc0002a279b4541af569a03c1aca2ac
          name: 'Workers logging'
          type: DEPENDENT
          key: apache.workers.logging
          description: 'The number of workers in logging state.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.Workers.logging
          master_item:
            key: apache.get_status
          tags:
            - tag: component
              value: system
        - uuid: 78b0bd7d8bec49549fc003d460af9177
          name: 'Workers reading request'
          type: DEPENDENT
          key: apache.workers.reading
          description: 'The number of workers in reading state.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.Workers.reading
          master_item:
            key: apache.get_status
          tags:
            - tag: component
              value: system
        - uuid: 379ac66397b94463ad17b24fbd20c615
          name: 'Workers sending reply'
          type: DEPENDENT
          key: apache.workers.sending
          description: 'The number of workers in sending state.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.Workers.sending
          master_item:
            key: apache.get_status
          tags:
            - tag: component
              value: system
        - uuid: 1c90055e02a244fc8d18e73b23daa0f1
          name: 'Workers slot with no current process'
          type: DEPENDENT
          key: apache.workers.slot
          description: 'The number of slots with no current process.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.Workers.slot
          master_item:
            key: apache.get_status
          tags:
            - tag: component
              value: system
        - uuid: ae21ea113e8840349aff81ab582d92b4
          name: 'Workers starting up'
          type: DEPENDENT
          key: apache.workers.starting
          description: 'The number of workers in starting state.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.Workers.starting
          master_item:
            key: apache.get_status
          tags:
            - tag: component
              value: system
        - uuid: be1a05a6eab84b64ac4d51c966ea91e8
          name: 'Workers waiting for connection'
          type: DEPENDENT
          key: apache.workers.waiting
          description: 'The number of workers in waiting state.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.Workers.waiting
          master_item:
            key: apache.get_status
          tags:
            - tag: component
              value: system
        - uuid: 1752b9bcf7b34abbaf105f5261638271
          name: 'Total workers busy'
          type: DEPENDENT
          key: apache.workers_total.busy
          description: 'The total number of busy worker threads/processes.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.BusyWorkers
          master_item:
            key: apache.get_status
          tags:
            - tag: component
              value: system
        - uuid: b1b1c86a12964ae2813c63481e464ec7
          name: 'Total workers idle'
          type: DEPENDENT
          key: apache.workers_total.idle
          description: 'The total number of idle worker threads/processes.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.IdleWorkers
          master_item:
            key: apache.get_status
          tags:
            - tag: component
              value: system
        - uuid: 5039d11bc3964d6e9928a0a46dd0b402
          name: 'Service response time'
          type: SIMPLE
          key: 'net.tcp.service.perf[http,"{$APACHE.STATUS.HOST}","{$APACHE.STATUS.PORT}"]'
          value_type: FLOAT
          units: s
          tags:
            - tag: component
              value: application
            - tag: component
              value: health
          triggers:
            - uuid: ffbb564032c7462eb0bb9b4c2f700559
              expression: 'min(/Apache by HTTP/net.tcp.service.perf[http,"{$APACHE.STATUS.HOST}","{$APACHE.STATUS.PORT}"],5m)>{$APACHE.RESPONSE_TIME.MAX.WARN}'
              name: 'Apache: Service response time is too high'
              event_name: 'Apache: Service response time is too high (over {$APACHE.RESPONSE_TIME.MAX.WARN}s for 5m)'
              priority: WARNING
              manual_close: 'YES'
              dependencies:
                - name: 'Apache: Service is down'
                  expression: 'last(/Apache by HTTP/net.tcp.service[http,"{$APACHE.STATUS.HOST}","{$APACHE.STATUS.PORT}"])=0'
              tags:
                - tag: scope
                  value: performance
        - uuid: fb65918695094026838e2b9e4ca00402
          name: 'Service ping'
          type: SIMPLE
          key: 'net.tcp.service[http,"{$APACHE.STATUS.HOST}","{$APACHE.STATUS.PORT}"]'
          valuemap:
            name: 'Service state'
          preprocessing:
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 10m
          tags:
            - tag: component
              value: application
            - tag: component
              value: health
          triggers:
            - uuid: afe2fde35d054333adc8369a0f9af778
              expression: 'last(/Apache by HTTP/net.tcp.service[http,"{$APACHE.STATUS.HOST}","{$APACHE.STATUS.PORT}"])=0'
              name: 'Apache: Service is down'
              priority: AVERAGE
              manual_close: 'YES'
              tags:
                - tag: scope
                  value: availability
      discovery_rules:
        - uuid: eee8abd3174d426092e8bca9b3ba982e
          name: 'Event MPM discovery'
          type: DEPENDENT
          key: apache.mpm.event.discovery
          description: |
            The discovery of additional metrics if the event Multi-Processing Module (MPM) is used.
            For more details see [Apache MPM event](https://httpd.apache.org/docs/current/mod/event.html).
          item_prototypes:
            - uuid: f52700379f9a4ee8b378a2eb9caea070
              name: 'Bytes per request'
              type: DEPENDENT
              key: 'apache.bytes[per_request{#SINGLETON}]'
              value_type: FLOAT
              units: B
              description: 'The average number of client requests per second.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.BytesPerReq
              master_item:
                key: apache.get_status
              tags:
                - tag: component
                  value: connection
            - uuid: 062d7c941f0c468d8b63fa76ae0610f6
              name: 'Connections async closing'
              type: DEPENDENT
              key: 'apache.connections[async_closing{#SINGLETON}]'
              description: 'The number of asynchronous connections in closing state (applicable only to the event MPM).'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.ConnsAsyncClosing
              master_item:
                key: apache.get_status
              tags:
                - tag: component
                  value: connection
            - uuid: 6cb8b255ad8343a48e622912bc298366
              name: 'Connections async keepalive'
              type: DEPENDENT
              key: 'apache.connections[async_keep_alive{#SINGLETON}]'
              description: 'The number of asynchronous connections in keepalive state (applicable only to the event MPM).'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.ConnsAsyncKeepAlive
              master_item:
                key: apache.get_status
              tags:
                - tag: component
                  value: connection
            - uuid: 997b3452aac24ad6afbad775d649c727
              name: 'Connections async writing'
              type: DEPENDENT
              key: 'apache.connections[async_writing{#SINGLETON}]'
              description: 'The number of asynchronous connections in writing state (applicable only to the event MPM).'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.ConnsAsyncWriting
              master_item:
                key: apache.get_status
              tags:
                - tag: component
                  value: connection
            - uuid: 31cb044eed904ca19150921fe36f3285
              name: 'Connections total'
              type: DEPENDENT
              key: 'apache.connections[total{#SINGLETON}]'
              description: 'The number of total connections.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.ConnsTotal
              master_item:
                key: apache.get_status
              tags:
                - tag: component
                  value: connection
            - uuid: 34555340f3ad4b878504df188f54a9c9
              name: 'Number of async processes'
              type: DEPENDENT
              key: 'apache.process[num{#SINGLETON}]'
              description: 'The number of asynchronous processes.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.Processes
              master_item:
                key: apache.get_status
              tags:
                - tag: component
                  value: system
          graph_prototypes:
            - uuid: 066b53ed2244414ca3090498eb035c27
              name: 'Apache: Current async connections{#SINGLETON}'
              graph_items:
                - color: 199C0D
                  item:
                    host: 'Apache by HTTP'
                    key: 'apache.connections[async_closing{#SINGLETON}]'
                - sortorder: '1'
                  color: F63100
                  item:
                    host: 'Apache by HTTP'
                    key: 'apache.connections[async_keep_alive{#SINGLETON}]'
                - sortorder: '2'
                  color: 00611C
                  item:
                    host: 'Apache by HTTP'
                    key: 'apache.connections[async_writing{#SINGLETON}]'
                - sortorder: '3'
                  drawtype: BOLD_LINE
                  color: F7941D
                  item:
                    host: 'Apache by HTTP'
                    key: 'apache.connections[total{#SINGLETON}]'
            - uuid: dbaa0c2468cc40fca977fb382d19cb78
              name: 'Apache: Current async processes{#SINGLETON}'
              graph_items:
                - drawtype: GRADIENT_LINE
                  color: 199C0D
                  item:
                    host: 'Apache by HTTP'
                    key: 'apache.process[num{#SINGLETON}]'
          master_item:
            key: apache.get_status
          preprocessing:
            - type: JAVASCRIPT
              parameters:
                - |
                  return JSON.stringify(JSON.parse(value).ServerMPM === 'event'
                  	? [{'{#SINGLETON}': ''}] : []);
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 3h
      tags:
        - tag: class
          value: software
        - tag: subclass
          value: webserver
        - tag: target
          value: apache
      macros:
        - macro: '{$APACHE.RESPONSE_TIME.MAX.WARN}'
          value: '10'
          description: 'The maximum Apache response time expressed in seconds for a trigger expression.'
          config:
            type: TEXT
            priority: '5'
            section_name: Other
            label: 'Maximum Apache response time'
            description: 'Maximum Apache response time expressed in seconds for a trigger expression. No less than 0.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$APACHE.STATUS.HOST}'
          description: 'The hostname or IP address of the Apache status page host.'
          config:
            type: TEXT
            priority: '1'
            label: 'Apache status host'
            description: 'Hostname or IP address of the Apache status page host.'
            required: 'YES'
        - macro: '{$APACHE.STATUS.PATH}'
          value: 'server-status?auto'
          description: 'The URL path of the Apache status page.'
          config:
            type: TEXT
            priority: '3'
            label: 'Apache status page path'
            description: 'URL path of the Apache status page.'
            required: 'YES'
        - macro: '{$APACHE.STATUS.PORT}'
          value: '80'
          description: 'The port of the Apache status page.'
          config:
            type: TEXT
            priority: '2'
            label: 'Apache status page port'
            description: 'In the range from 1 to 65535 inclusive.'
            required: 'YES'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$APACHE.STATUS.SCHEME}'
          value: http
          description: 'The request scheme, which may be either HTTP or HTTPS.'
          config:
            type: LIST
            priority: '4'
            label: 'Request scheme'
            description: 'Request scheme, which may be either HTTP or HTTPS.'
            options:
              - value: http
                text: HTTP
              - value: https
                text: HTTPS
      dashboards:
        - uuid: a328c9e713424465a8e1adec7322b0dc
          name: 'Apache performance'
          pages:
            - name: General
              widgets:
                - type: graph
                  width: '72'
                  height: '7'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Apache by HTTP'
                        name: 'Apache: Worker states'
                    - type: STRING
                      name: reference
                      value: AAAAA
                - type: graph
                  'y': '7'
                  width: '36'
                  height: '5'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Apache by HTTP'
                        name: 'Apache: Requests per second'
                    - type: STRING
                      name: reference
                      value: AAAAB
                - type: graphprototype
                  'y': '12'
                  width: '36'
                  height: '5'
                  fields:
                    - type: INTEGER
                      name: columns
                      value: '1'
                    - type: GRAPH_PROTOTYPE
                      name: graphid.0
                      value:
                        host: 'Apache by HTTP'
                        name: 'Apache: Current async connections{#SINGLETON}'
                    - type: STRING
                      name: reference
                      value: AAAAD
                - type: graph
                  x: '36'
                  'y': '7'
                  width: '36'
                  height: '5'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Apache by HTTP'
                        name: 'Apache: Workers total'
                    - type: STRING
                      name: reference
                      value: AAAAC
                - type: graphprototype
                  x: '36'
                  'y': '12'
                  width: '36'
                  height: '5'
                  fields:
                    - type: INTEGER
                      name: columns
                      value: '1'
                    - type: GRAPH_PROTOTYPE
                      name: graphid.0
                      value:
                        host: 'Apache by HTTP'
                        name: 'Apache: Current async processes{#SINGLETON}'
                    - type: STRING
                      name: reference
                      value: AAAAE
      valuemaps:
        - uuid: a5d1f911fb264bd4bc087ea582626d7f
          name: 'Service state'
          mappings:
            - value: '0'
              newvalue: Down
            - value: '1'
              newvalue: Up
    - uuid: dce23cdaef364e139efa580d8a304ffe
      template: 'AWS Cost Explorer by HTTP'
      name: 'AWS Cost Explorer by HTTP'
      description: |
        The template gets AWS Cost Explorer metrics and uses the script item to make HTTP requests to the Cost Explorer API.
        The Cost Explorer API can access the historical data over up to 12 months and the data for current month.
        Don't forget to read the README.md for the correct setup of the template.
        
        You can discuss this template or leave feedback on our forum https://www.zabbix.com/forum/zabbix-suggestions-and-feedback.
        
        Generated by official Zabbix template tool "Templator"
      wizard_ready: 'YES'
      readme: |
        ## Overview
        
        The template to monitor AWS Cost Explorer by HTTP via Zabbix, which works without any external scripts.
        Most of the metrics are collected in one go, thanks to Zabbix bulk data collection.
        
        **Note:** This template uses the Cost Explorer API calls to list and retrieve metrics.
        For more information, please refer to the [Cost Explorer pricing](https://aws.amazon.com/aws-cost-management/aws-cost-explorer/pricing/) page.
        
        
        ## Setup
        
        Before using the template, you need to create an IAM policy for the Zabbix role in your AWS account with the necessary permissions.
        
        * [IAM policies for AWS Cost Management](https://docs.aws.amazon.com/cost-management/latest/userguide/billing-permissions-ref.html)
        
        ### Required Permissions
        Add the following required permissions to your Zabbix IAM policy in order to collect metrics.
        
        ```json
        {
            "Version": "2012-10-17",
            "Statement": [
                {
                    "Action": [
                        "ce:GetDimensionValues",
                        "ce:GetCostAndUsage"
                    ],
                    "Effect": "Allow",
                    "Resource": "*"
                }
            ]
        }
        ```
        
        ### Access Key Authorization
        
        If you are using access key authorization, you need to generate an access key and secret key for an IAM user with the necessary permissions:
        
        1. Create an IAM user with programmatic access.
        2. Attach the required policy to the IAM user.
        3. Generate an access key and secret key.
        4. Use the generated credentials in the host wizard configuration fields `Access key ID` and `Secret access key`.
        
        ### Assume Role Authorization
        For using assume role authorization, add the appropriate permissions to the role you are using:
        
        ```json
        {
            "Version": "2012-10-17",
            "Statement": [
                {
                    "Effect": "Allow",
                    "Action": "sts:AssumeRole",
                    "Resource": "arn:aws:iam::{Account}:user/{UserName}"
                },
                {
                    "Effect": "Allow",
                    "Action": [
                        "ce:GetDimensionValues",
                        "ce:GetCostAndUsage"
                    ],
                    "Resource": "*"
                }
            ]
        }
        ```
        
        #### Trust Relationships for Assume Role Authorization
        Next, add a principal to the trust relationships of the role you are using:
        
        ```json
        {
          "Version": "2012-10-17",
          "Statement": [
            {
              "Effect": "Allow",
              "Principal": {
                "AWS": "arn:aws:iam::{Account}:user/{UserName}"
              },
              "Action": "sts:AssumeRole"
            }
          ]
        }
        ```
        Set the following fields: `Access key ID`, `Secret access key`, `STS Region`, `ARN assume role`.
        
        ### Role-Based Authorization
        If you are using role-based authorization, add the appropriate permissions:
        
        ```json
        {
            "Version": "2012-10-17",
            "Statement": [
                {
                    "Effect": "Allow",
                    "Action": "iam:PassRole",
                    "Resource": "arn:aws:iam::<<--account-id-->>:role/<<--role_name-->>"
                },
                {
                    "Effect": "Allow",
                    "Action": [
                        "ce:GetDimensionValues",
                        "ce:GetCostAndUsage",
                        "ec2:AssociateIamInstanceProfile",
                        "ec2:ReplaceIamInstanceProfileAssociation"
                    ],
                    "Resource": "*"
                }
            ]
        }
        ```
        
        #### Trust Relationships for Role-Based Authorization
        Next, add a principal to the trust relationships of the role you are using:
        
        ```json
        {
            "Version": "2012-10-17",
            "Statement": [
                {
                    "Effect": "Allow",
                    "Principal": {
                        "Service": [
                            "ec2.amazonaws.com"
                        ]
                    },
                    "Action": [
                        "sts:AssumeRole"
                    ]
                }
            ]
        }
        ```
        
        **Note**: Using role-based authorization is only possible when you use a Zabbix server or proxy inside AWS.
        
        Choose a method of authorization (field of `Authorization method`).
        
        For more information about managing access keys, see the [official documentation](https://docs.aws.amazon.com/general/latest/gr/aws-sec-cred-types.html#access-keys-and-secret-access-keys).
        
        Additional information about metrics and used API methods:
        
        * [Describe AWS Cost Explore API actions](https://docs.aws.amazon.com/aws-cost-management/latest/APIReference/API_Operations.html).
      vendor:
        name: Zabbix
        version: 8.0-4
      groups:
        - name: Templates/Cloud
      items:
        - uuid: 5bfda2617dfc43edbe524a5c44b39f18
          name: 'Get daily costs'
          type: SCRIPT
          key: aws.get.daily.costs
          delay: 0s;h/6
          history: '0'
          value_type: TEXT
          params: |
            var AWS = {
            	params: {},
            	metadata: 'http://169.254.169.254/latest/',
            
            	getRoleBaseCredentials: function () {
            		AWS.params['auth_type'] = 'role_base';
            		var request = new HttpRequest();
            		if (typeof AWS.params.proxy !== 'undefined' && AWS.params.proxy !== '') {
            			request.setProxy(AWS.params.proxy);
            		}
            		request.addHeader('X-aws-ec2-metadata-token-ttl-seconds: 21600');
            		var token = request.put(AWS.metadata + 'api/token');
            
            		if (request.getStatus() !== 200 || token === null || token === '') {
            			throw 'Error getting IMDSv2 session token.';
            		}
            		request.addHeader('X-aws-ec2-metadata-token: ' + token);
            		var IamRoleName = request.get(AWS.metadata + 'meta-data/iam/security-credentials');
            
            		if (request.getStatus() !== 200 || IamRoleName === null || IamRoleName === '') {
            			throw 'Error getting security credentials from instance metadata. Role not found.';
            		}
            
            		credentials = request.get(AWS.metadata + 'meta-data/iam/security-credentials/' + encodeURI(IamRoleName));
            
            		if (request.getStatus() !== 200 || credentials === null || credentials === '') {
            			throw 'Error getting security credentials from instance metadata.';
            		}
            
            		try {
            			credentials = JSON.parse(credentials);
            		}
            		catch (error) {
            			throw 'Failed to parse response received from instance metadata. Check debug log for more information.';
            		}
            
            		['AccessKeyId', 'SecretAccessKey', 'Token'].forEach(function (field) {
            			if (typeof credentials !== 'object' || typeof credentials[field] === 'undefined' || credentials[field] === '') {
            				throw 'Required credentials are not set: "' + field + '".';
            			};
            			AWS.params[field] = credentials[field];
            		});
            	},
            
            	setParams: function (params) {
            		AWS.params['proxy'] = params.proxy;
            		switch (AWS.getField(params, 'auth_type')) {
            			case 'role_base':
            				AWS.getRoleBaseCredentials();
            				break;
            			case 'assume_role':
            				if (typeof params.metadata_auth === 'undefined' || params.metadata_auth === '' || (params.metadata_auth !== 'true' && params.metadata_auth !== 'false')) {
            					throw 'Required param metadata_auth for assume_role is not set or has invalid value: "' + params.metadata_auth + '". Expected "true" or "false".';
            				}
            				if (params.metadata_auth === 'true') {
            					AWS.getRoleBaseCredentials();
            					AWS.params['SessionToken'] = AWS.params['Token'];
            					AWS.params['auth_type'] = 'assume_role_metadata';
            
            					['sts_region', 'role_arn'].forEach(function (field) {
            						if (typeof params !== 'object' || typeof params[field] === 'undefined' || params[field] === '') {
            							throw 'Required param is not set: "' + field + '".';
            						}
            						AWS.params[field] = params[field];
            					});
            				}
            
            				if (params.metadata_auth === 'false') {
            					AWS.params['auth_type'] = 'assume_role';
            
            					['AccessKeyId', 'SecretAccessKey', 'sts_region', 'role_arn'].forEach(function (field) {
            						if (typeof params !== 'object' || typeof params[field] === 'undefined' || params[field] === '') {
            							throw 'Required param is not set: "' + field + '".';
            						}
            						AWS.params[field] = params[field];
            					});
            				}
            
            				const role_arn_regex = /role\/(.+)$/;
            				const match = AWS.params.role_arn.match(role_arn_regex);
            				if (!match) {
            					throw 'Invalid role ARN format.';
            				}
            
            				const payload = {
            					'Action': 'AssumeRole',
            					'Version': '2011-06-15',
            					'RoleArn': AWS.params.role_arn,
            					'RoleSessionName': match[1] + 'Session',
            				};
            
            				credentials = AWS.getField(AWS.request('POST', AWS.params.sts_region, 'sts', AWS.prepareParams(payload), ''), 'AssumeRoleResponse.AssumeRoleResult.Credentials');
            
            				['AccessKeyId', 'SecretAccessKey', 'SessionToken'].forEach(function (field) {
            					if (typeof credentials !== 'object' || typeof credentials[field] === 'undefined' || credentials[field] === '') {
            						throw 'Required credentials are not set: "' + field + '".';
            					};
            					AWS.params[field] = credentials[field];
            				});
            				break;
            			default:
            				AWS.params['auth_type'] = 'access_key';
            				['AccessKeyId', 'SecretAccessKey'].forEach(function (field) {
            					if (typeof params !== 'object' || typeof params[field] === 'undefined' || params[field] === '') {
            						throw 'Required param is not set: "' + field + '".';
            					}
            					AWS.params[field] = params[field];
            				});
            		}
            		['region'].forEach(function (field) {
            			if (typeof params !== 'object' || typeof params[field] === 'undefined' || params[field] === '') {
            				throw 'Required param is not set: "' + field + '".';
            			}
            			AWS.params[field] = params[field];
            		});
            
            		today = new Date();
            		AWS.params.end_date = today.toDateString();
            		today.setDate(today.getDate() - 1);
            		AWS.params.start_time = today.toDateString();
            	},
            
            	sign: function (key, message) {
            		var hex = hmac('sha256', key, message);
            
            		if ((hex.length % 2) === 1) {
            			throw 'Invalid length of a hex string!';
            		}
            
            		var result = new Int8Array(hex.length / 2);
            		for (var i = 0, b = 0; i < hex.length; i += 2, b++) {
            			result[b] = parseInt(hex.substring(i, i + 2), 16);
            		}
            
            		return result;
            	},
            
            	prepareParams: function (params) {
            		var result = [];
            
            		Object.keys(params).sort().forEach(function (key) {
            			if (typeof params[key] !== 'object') {
            				result.push(key + '=' + encodeURIComponent(params[key]));
            			}
            			else {
            				result.push(prepareObject(key, params[key]));
            			}
            		});
            
            		return result.join('&');
            	},
            
            	getField: function (data, path) {
            		var steps = path.split('.');
            		for (var i = 0; i < steps.length; i++) {
            			var step = steps[i];
            			if (typeof data !== 'object' || typeof data[step] === 'undefined') {
            				throw 'Required field was not found: ' + path;
            			}
            			data = data[step];
            		}
            
            		return data;
            
            	},
            
            	request: function (method, region, service, params, data, target) {
            		if (typeof data === 'undefined' || data === null) {
            			data = '';
            		}
            		else {
            			data = JSON.stringify(data);
            		}
            
            		var amzdate = (new Date()).toISOString().replace(/\.\d+Z/, 'Z').replace(/[-:]/g, ''),
            			date = amzdate.replace(/T\d+Z/, ''),
            			canonical_uri = '/',
            			host = service + '.' + region + '.amazonaws.com',
            			canonical_headers = 'content-encoding:amz-1.0\n' + 'host:' + host + '\n' + 'x-amz-date:' + amzdate + '\n',
            			signed_headers = 'content-encoding;host;x-amz-date',
            			canonical_request = method + '\n' + canonical_uri + '\n' + params + '\n' + canonical_headers + '\n' + signed_headers + '\n' + sha256(data),
            			credential_scope = date + '/' + region + '/' + service + '/' + 'aws4_request',
            			request_string = 'AWS4-HMAC-SHA256' + '\n' + amzdate + '\n' + credential_scope + '\n' + sha256(canonical_request),
            			key = AWS.sign('AWS4' + AWS.params.SecretAccessKey, date),
            			key = AWS.sign(key, region),
            			key = AWS.sign(key, service),
            			key = AWS.sign(key, 'aws4_request'),
            			request = new HttpRequest(),
            			url = 'https://' + host + canonical_uri + '?' + params;
            
            		if (typeof AWS.params.proxy !== 'undefined' && AWS.params.proxy !== '') {
            			request.setProxy(AWS.params.proxy);
            		}
            		request.addHeader('x-amz-date: ' + amzdate);
            		request.addHeader('x-amz-content-sha256:' + sha256(data));
            		request.addHeader('Accept: application/json');
            		request.addHeader('Content-Type: application/x-amz-json-1.1');
            		request.addHeader('Content-Encoding: amz-1.0');
            		request.addHeader('X-Amz-Target: ' + target);
            		request.addHeader('Authorization: ' + 'AWS4-HMAC-SHA256 Credential=' + AWS.params.AccessKeyId + '/' + credential_scope + ', ' + 'SignedHeaders=' + signed_headers + ', ' + 'Signature=' + hmac('sha256', key, request_string));
            		if (AWS.params.auth_type === 'role_base' || AWS.params.auth_type === 'assume_role_metadata' || (AWS.params.auth_type === 'assume_role' & !params.includes('AssumeRole'))) {
            			request.addHeader('X-Amz-Security-Token: ' + (AWS.params.auth_type === 'role_base' ? AWS.params.Token : AWS.params.SessionToken));
            		}
            
            		Zabbix.log(4, '[ AWS Billing ] Sending request: ' + url);
            		response = request.post(url, data);
            		Zabbix.log(4, '[ AWS Billing ] Received response with the status code ' + request.getStatus() + ': ' + response);
            
            		if (request.getStatus() !== 200) {
            			throw 'Request failed with the status code ' + request.getStatus() + ': ' + response;
            		}
            
            		try {
            			response = JSON.parse(response);
            		}
            		catch (error) {
            			throw 'Failed to parse the response received from AWS API. Check debug log for more information.';
            		}
            
            		return response;
            	},
            
            	getCostAndUsage: function () {
            		var body_raw_cost = {
            
            			'TimePeriod': {
            				'Start': AWS.params.start_time,
            				'End': AWS.params.end_date
            			},
            			'Granularity': 'DAILY',
            			'GroupBy': [
            				{
            					'Type': 'DIMENSION',
            					'Key': 'SERVICE'
            				}
            			],
            			'Metrics': ['BlendedCost']
            		};
            
            		return AWS.getField(AWS.request('POST', AWS.params.region, 'ce', '', body_raw_cost, 'AWSInsightsIndexService.GetCostAndUsage'), 'ResultsByTime');
            
            	}
            
            };
            
            try {
            	AWS.setParams(JSON.parse(value));
            
            	return JSON.stringify(AWS.getCostAndUsage());
            
            }
            catch (error) {
            	error += (String(error).endsWith('.')) ? '' : '.';
            	Zabbix.log(3, '[ AWS Billing ] ERROR: ' + error);
            
            	return JSON.stringify({ 'error': error });
            }
          description: 'Get raw data on the daily costs by service.'
          preprocessing:
            - type: CHECK_NOT_SUPPORTED
              parameters:
                - '-1'
          timeout: 15s
          parameters:
            - name: AccessKeyId
              value: '{$AWS.ACCESS.KEY.ID}'
            - name: auth_type
              value: '{$AWS.AUTH_TYPE}'
            - name: metadata_auth
              value: '{$AWS.ASSUME.ROLE.AUTH.METADATA}'
            - name: proxy
              value: '{$AWS.PROXY}'
            - name: region
              value: '{$AWS.BILLING.REGION}'
            - name: role_arn
              value: '{$AWS.ASSUME.ROLE.ARN}'
            - name: SecretAccessKey
              value: '{$AWS.SECRET.ACCESS.KEY}'
            - name: sts_region
              value: '{$AWS.STS.REGION}'
          tags:
            - tag: component
              value: raw
        - uuid: 7139ce562d3c439e9686ad5b17ed0f1c
          name: 'Get monthly costs'
          type: SCRIPT
          key: aws.get.monthly.costs
          delay: 0s;h9
          history: '0'
          value_type: TEXT
          params: |
            var AWS = {
            	params: {},
            	metadata: 'http://169.254.169.254/latest/',
            
            	getRoleBaseCredentials: function () {
            		AWS.params['auth_type'] = 'role_base';
            		var request = new HttpRequest();
            		if (typeof AWS.params.proxy !== 'undefined' && AWS.params.proxy !== '') {
            			request.setProxy(AWS.params.proxy);
            		}
            		request.addHeader('X-aws-ec2-metadata-token-ttl-seconds: 21600');
            		var token = request.put(AWS.metadata + 'api/token');
            
            		if (request.getStatus() !== 200 || token === null || token === '') {
            			throw 'Error getting IMDSv2 session token.';
            		}
            		request.addHeader('X-aws-ec2-metadata-token: ' + token);
            		var IamRoleName = request.get(AWS.metadata + 'meta-data/iam/security-credentials');
            
            		if (request.getStatus() !== 200 || IamRoleName === null || IamRoleName === '') {
            			throw 'Error getting security credentials from instance metadata. Role not found.';
            		}
            
            		credentials = request.get(AWS.metadata + 'meta-data/iam/security-credentials/' + encodeURI(IamRoleName));
            
            		if (request.getStatus() !== 200 || credentials === null || credentials === '') {
            			throw 'Error getting security credentials from instance metadata.';
            		}
            
            		try {
            			credentials = JSON.parse(credentials);
            		}
            		catch (error) {
            			throw 'Failed to parse response received from instance metadata. Check debug log for more information.';
            		}
            
            		['AccessKeyId', 'SecretAccessKey', 'Token'].forEach(function (field) {
            			if (typeof credentials !== 'object' || typeof credentials[field] === 'undefined' || credentials[field] === '') {
            				throw 'Required credentials are not set: "' + field + '".';
            			};
            			AWS.params[field] = credentials[field];
            		});
            	},
            
            	setParams: function (params) {
            		AWS.params['proxy'] = params.proxy;
            		switch (AWS.getField(params, 'auth_type')) {
            			case 'role_base':
            				AWS.getRoleBaseCredentials();
            				break;
            			case 'assume_role':
            				if (typeof params.metadata_auth === 'undefined' || params.metadata_auth === '' || (params.metadata_auth !== 'true' && params.metadata_auth !== 'false')) {
            					throw 'Required param metadata_auth for assume_role is not set or has invalid value: "' + params.metadata_auth + '". Expected "true" or "false".';
            				}
            				if (params.metadata_auth === 'true') {
            					AWS.getRoleBaseCredentials();
            					AWS.params['SessionToken'] = AWS.params['Token'];
            					AWS.params['auth_type'] = 'assume_role_metadata';
            
            					['sts_region', 'role_arn'].forEach(function (field) {
            						if (typeof params !== 'object' || typeof params[field] === 'undefined' || params[field] === '') {
            							throw 'Required param is not set: "' + field + '".';
            						}
            						AWS.params[field] = params[field];
            					});
            				}
            
            				if (params.metadata_auth === 'false') {
            					AWS.params['auth_type'] = 'assume_role';
            
            					['AccessKeyId', 'SecretAccessKey', 'sts_region', 'role_arn'].forEach(function (field) {
            						if (typeof params !== 'object' || typeof params[field] === 'undefined' || params[field] === '') {
            							throw 'Required param is not set: "' + field + '".';
            						}
            						AWS.params[field] = params[field];
            					});
            				}
            
            				const role_arn_regex = /role\/(.+)$/;
            				const match = AWS.params.role_arn.match(role_arn_regex);
            				if (!match) {
            					throw 'Invalid role ARN format.';
            				}
            
            				const payload = {
            					'Action': 'AssumeRole',
            					'Version': '2011-06-15',
            					'RoleArn': AWS.params.role_arn,
            					'RoleSessionName': match[1] + 'Session',
            				};
            
            				credentials = AWS.getField(AWS.request('POST', AWS.params.sts_region, 'sts', AWS.prepareParams(payload), ''), 'AssumeRoleResponse.AssumeRoleResult.Credentials');
            
            				['AccessKeyId', 'SecretAccessKey', 'SessionToken'].forEach(function (field) {
            					if (typeof credentials !== 'object' || typeof credentials[field] === 'undefined' || credentials[field] === '') {
            						throw 'Required credentials are not set: "' + field + '".';
            					};
            					AWS.params[field] = credentials[field];
            				});
            				break;
            			default:
            				AWS.params['auth_type'] = 'access_key';
            				['AccessKeyId', 'SecretAccessKey'].forEach(function (field) {
            					if (typeof params !== 'object' || typeof params[field] === 'undefined' || params[field] === '') {
            						throw 'Required param is not set: "' + field + '".';
            					}
            					AWS.params[field] = params[field];
            				});
            		}
            		['region', 'month'].forEach(function (field) {
            			if (typeof params !== 'object' || typeof params[field] === 'undefined' || params[field] === '') {
            				throw 'Required param is not set: "' + field + '".';
            			}
            			AWS.params[field] = params[field];
            		});
            
            		today = new Date();
            		AWS.params.end_date = today.toDateString();
            		month = today.getMonth();
            		today.setMonth(month - params.month);
            		AWS.params.start_time = new Date(today.getFullYear(), today.getMonth()).toDateString();
            	},
            
            	sign: function (key, message) {
            		var hex = hmac('sha256', key, message);
            
            		if ((hex.length % 2) === 1) {
            			throw 'Invalid length of a hex string!';
            		}
            
            		var result = new Int8Array(hex.length / 2);
            		for (var i = 0, b = 0; i < hex.length; i += 2, b++) {
            			result[b] = parseInt(hex.substring(i, i + 2), 16);
            		}
            
            		return result;
            	},
            
            	prepareParams: function (params) {
            		var result = [];
            
            		Object.keys(params).sort().forEach(function (key) {
            			if (typeof params[key] !== 'object') {
            				result.push(key + '=' + encodeURIComponent(params[key]));
            			}
            			else {
            				result.push(prepareObject(key, params[key]));
            			}
            		});
            
            		return result.join('&');
            	},
            
            	getField: function (data, path) {
            		var steps = path.split('.');
            		for (var i = 0; i < steps.length; i++) {
            			var step = steps[i];
            			if (typeof data !== 'object' || typeof data[step] === 'undefined') {
            				throw 'Required field was not found: ' + path;
            			}
            			data = data[step];
            		}
            
            		return data;
            
            	},
            
            	request: function (method, region, service, params, data, target) {
            		if (typeof data === 'undefined' || data === null) {
            			data = '';
            		}
            		else {
            			data = JSON.stringify(data);
            		}
            
            		var amzdate = (new Date()).toISOString().replace(/\.\d+Z/, 'Z').replace(/[-:]/g, ''),
            			date = amzdate.replace(/T\d+Z/, ''),
            			canonical_uri = '/',
            			host = service + '.' + region + '.amazonaws.com',
            			canonical_headers = 'content-encoding:amz-1.0\n' + 'host:' + host + '\n' + 'x-amz-date:' + amzdate + '\n',
            			signed_headers = 'content-encoding;host;x-amz-date',
            			canonical_request = method + '\n' + canonical_uri + '\n' + params + '\n' + canonical_headers + '\n' + signed_headers + '\n' + sha256(data),
            			credential_scope = date + '/' + region + '/' + service + '/' + 'aws4_request',
            			request_string = 'AWS4-HMAC-SHA256' + '\n' + amzdate + '\n' + credential_scope + '\n' + sha256(canonical_request),
            			key = AWS.sign('AWS4' + AWS.params.SecretAccessKey, date),
            			key = AWS.sign(key, region),
            			key = AWS.sign(key, service),
            			key = AWS.sign(key, 'aws4_request'),
            			request = new HttpRequest(),
            			url = 'https://' + host + canonical_uri + '?' + params;
            
            		if (typeof AWS.params.proxy !== 'undefined' && AWS.params.proxy !== '') {
            			request.setProxy(AWS.params.proxy);
            		}
            		request.addHeader('x-amz-date: ' + amzdate);
            		request.addHeader('x-amz-content-sha256:' + sha256(data));
            		request.addHeader('Accept: application/json');
            		request.addHeader('Content-Type: application/x-amz-json-1.1');
            		request.addHeader('Content-Encoding: amz-1.0');
            		request.addHeader('X-Amz-Target: ' + target);
            		request.addHeader('Authorization: ' + 'AWS4-HMAC-SHA256 Credential=' + AWS.params.AccessKeyId + '/' + credential_scope + ', ' + 'SignedHeaders=' + signed_headers + ', ' + 'Signature=' + hmac('sha256', key, request_string));
            		if (AWS.params.auth_type === 'role_base' || AWS.params.auth_type === 'assume_role_metadata' || (AWS.params.auth_type === 'assume_role' & !params.includes('AssumeRole'))) {
            			request.addHeader('X-Amz-Security-Token: ' + (AWS.params.auth_type === 'role_base' ? AWS.params.Token : AWS.params.SessionToken));
            		}
            
            		Zabbix.log(4, '[ AWS Billing ] Sending request: ' + url);
            		response = request.post(url, data);
            		Zabbix.log(4, '[ AWS Billing ] Received response with the status code ' + request.getStatus() + ': ' + response);
            
            		if (request.getStatus() !== 200) {
            			throw 'Request failed with the status code ' + request.getStatus() + ': ' + response;
            		}
            
            		try {
            			response = JSON.parse(response);
            		}
            		catch (error) {
            			throw 'Failed to parse the response received from AWS API. Check debug log for more information.';
            		}
            
            		return response;
            	},
            
            	getCostMonth: function () {
            		var body_raw_cost = {
            			'TimePeriod': {
            				'Start': AWS.params.start_time,
            				'End': AWS.params.end_date
            			},
            			'Granularity': 'MONTHLY',
            			'Metrics': ['BlendedCost']
            		};
            		result = AWS.getField(AWS.request('POST', AWS.params.region, 'ce', '', body_raw_cost, 'AWSInsightsIndexService.GetCostAndUsage'), 'ResultsByTime');
            
            		return result.map(function (data) {
            			return {
            				'amount': AWS.getField(data, 'Total.BlendedCost.Amount'),
            				'unit': AWS.getField(data, 'Total.BlendedCost.Unit'),
            				'month': AWS.getField(data, 'TimePeriod.Start').slice(0, 7)
            			};
            		});
            	},
            
            	getCostMonthService: function () {
            		var body_raw_cost = {
            			'TimePeriod': {
            				'Start': AWS.params.start_time,
            				'End': AWS.params.end_date
            			},
            			'GroupBy': [
            				{
            					'Type': 'DIMENSION',
            					'Key': 'SERVICE'
            				}
            			],
            			'Granularity': 'MONTHLY',
            			'Metrics': ['BlendedCost']
            		};
            		MetricData = AWS.getField(AWS.request('POST', AWS.params.region, 'ce', '', body_raw_cost, 'AWSInsightsIndexService.GetCostAndUsage'), 'ResultsByTime');
            		var services = [];
            		MetricData.forEach(function (data) {
            			month = AWS.getField(data, 'TimePeriod.Start').slice(0, 7);
            			groups = AWS.getField(data, 'Groups');
            			groups.forEach(function (group) {
            				group.month = month;
            				services.push(group);
            			})
            		});
            
            		return services;
            	}
            
            };
            
            try {
            	AWS.setParams(JSON.parse(value));
            
            	monthly_costs = AWS.getCostMonth();
            	monthly_service_costs = AWS.getCostMonthService();
            
            	return JSON.stringify({ monthly_costs, monthly_service_costs });
            
            }
            catch (error) {
            	error += (String(error).endsWith('.')) ? '' : '.';
            	Zabbix.log(3, '[ AWS Billing ] ERROR: ' + error);
            
            	return JSON.stringify({ 'error': error });
            }
          description: 'Get raw data on the monthly costs by service.'
          preprocessing:
            - type: CHECK_NOT_SUPPORTED
              parameters:
                - '-1'
          timeout: 15s
          parameters:
            - name: AccessKeyId
              value: '{$AWS.ACCESS.KEY.ID}'
            - name: auth_type
              value: '{$AWS.AUTH_TYPE}'
            - name: metadata_auth
              value: '{$AWS.ASSUME.ROLE.AUTH.METADATA}'
            - name: month
              value: '{$AWS.BILLING.MONTH}'
            - name: proxy
              value: '{$AWS.PROXY}'
            - name: region
              value: '{$AWS.BILLING.REGION}'
            - name: role_arn
              value: '{$AWS.ASSUME.ROLE.ARN}'
            - name: SecretAccessKey
              value: '{$AWS.SECRET.ACCESS.KEY}'
            - name: sts_region
              value: '{$AWS.STS.REGION}'
          tags:
            - tag: component
              value: raw
      discovery_rules:
        - uuid: 5773c41da90d4a38aff02fccec733741
          name: 'AWS monthly costs by services discovery'
          type: DEPENDENT
          key: aws.cost.service.monthly.discovery
          filter:
            evaltype: AND
            conditions:
              - macro: '{#AWS.BILLING.SERVICE.NAME}'
                value: '{$AWS.BILLING.LLD.FILTER.SERVICE.MATCHES}'
              - macro: '{#AWS.BILLING.SERVICE.NAME}'
                value: '{$AWS.BILLING.LLD.FILTER.SERVICE.NOT_MATCHES}'
                operator: NOT_MATCHES_REGEX
          description: 'Discovery of monthly costs by services.'
          item_prototypes:
            - uuid: d01ee8df0e204f1a857b8188df47402a
              name: '[{#AWS.BILLING.SERVICE.NAME}]: Month [{#AWS.BILLING.MONTH}] Blended cost'
              type: DEPENDENT
              key: 'aws.monthly.service.cost["{#AWS.BILLING.SERVICE.NAME}", "{#AWS.BILLING.MONTH}"]'
              value_type: FLOAT
              units: '!{#AWS.BILLING.UNIT}'
              description: 'The monthly cost by service {#AWS.BILLING.SERVICE.NAME}.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.monthly_service_costs.[?(@.month == "{#AWS.BILLING.MONTH}")]'
                  error_handler: DISCARD_VALUE
                - type: JSONPATH
                  parameters:
                    - '$.[?(@.Keys =~ "{#AWS.BILLING.SERVICE.NAME}")]..Metrics.BlendedCost.Amount.first()'
                  error_handler: DISCARD_VALUE
              master_item:
                key: aws.get.monthly.costs
              tags:
                - tag: component
                  value: billing
                - tag: month
                  value: '{#AWS.BILLING.MONTH}'
                - tag: service
                  value: '{#AWS.BILLING.SERVICE.NAME}'
          graph_prototypes:
            - uuid: b267e0ae08d34a7dae730848577aea68
              name: 'AWS Cost: [{#AWS.BILLING.SERVICE.NAME}]: Month [{#AWS.BILLING.MONTH}] Blended cost'
              graph_items:
                - drawtype: GRADIENT_LINE
                  color: 2E7D32
                  item:
                    host: 'AWS Cost Explorer by HTTP'
                    key: 'aws.monthly.service.cost["{#AWS.BILLING.SERVICE.NAME}", "{#AWS.BILLING.MONTH}"]'
          master_item:
            key: aws.get.monthly.costs
          lld_macro_paths:
            - lld_macro: '{#AWS.BILLING.MONTH}'
              path: $..month.first()
            - lld_macro: '{#AWS.BILLING.SERVICE.NAME}'
              path: $..Keys.first().first()
            - lld_macro: '{#AWS.BILLING.UNIT}'
              path: $..Metrics.BlendedCost.Unit.first()
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.monthly_service_costs
        - uuid: 6e65d15251ea4355ac41ed7956f9e5b0
          name: 'AWS daily costs by services discovery'
          type: DEPENDENT
          key: aws.daily.services.costs.discovery
          filter:
            evaltype: AND
            conditions:
              - macro: '{#AWS.BILLING.SERVICE.NAME}'
                value: '{$AWS.BILLING.LLD.FILTER.SERVICE.MATCHES}'
              - macro: '{#AWS.BILLING.SERVICE.NAME}'
                value: '{$AWS.BILLING.LLD.FILTER.SERVICE.NOT_MATCHES}'
                operator: NOT_MATCHES_REGEX
          description: 'Discovery of daily blended costs by services.'
          item_prototypes:
            - uuid: b6e121c3a1eb49858e942beab12660e2
              name: 'Service [{#AWS.BILLING.SERVICE.NAME}]: Blended daily cost'
              type: DEPENDENT
              key: 'aws.daily.service.cost["{#AWS.BILLING.SERVICE.NAME}"]'
              value_type: FLOAT
              units: '!{#AWS.BILLING.UNIT}'
              description: 'The daily blended cost of the {#AWS.BILLING.SERVICE.NAME} service for the previous day.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$..Groups..[?(@.Keys =~ "{#AWS.BILLING.SERVICE.NAME}")]..Metrics.BlendedCost.Amount.first()'
                  error_handler: DISCARD_VALUE
              master_item:
                key: aws.get.daily.costs
              tags:
                - tag: component
                  value: billing
                - tag: service
                  value: '{#AWS.BILLING.SERVICE.NAME}'
          graph_prototypes:
            - uuid: 71646982ab55405dbc10f200e8050c93
              name: 'AWS Cost: Service [{#AWS.BILLING.SERVICE.NAME}]: Blended daily cost'
              graph_items:
                - drawtype: GRADIENT_LINE
                  color: 2E7D32
                  item:
                    host: 'AWS Cost Explorer by HTTP'
                    key: 'aws.daily.service.cost["{#AWS.BILLING.SERVICE.NAME}"]'
          master_item:
            key: aws.get.daily.costs
          lld_macro_paths:
            - lld_macro: '{#AWS.BILLING.SERVICE.NAME}'
              path: $..Keys.first().first()
            - lld_macro: '{#AWS.BILLING.UNIT}'
              path: $..Metrics.BlendedCost.Unit.first()
          preprocessing:
            - type: JSONPATH
              parameters:
                - $..Groups.first()
        - uuid: b554f00ba68e4ea391f7c7d029efde4f
          name: 'AWS monthly costs discovery'
          type: DEPENDENT
          key: aws.monthly.cost.discovery
          description: 'Discovery of monthly costs.'
          item_prototypes:
            - uuid: aaf85a53d1804c858fc20189f0483bad
              name: '[{#AWS.BILLING.MONTH}]: Blended cost per month'
              type: DEPENDENT
              key: 'aws.monthly.cost["{#AWS.BILLING.MONTH}"]'
              value_type: FLOAT
              units: '!{#AWS.BILLING.UNIT}'
              description: 'The blended cost by month {#AWS.BILLING.MONTH}.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.monthly_costs.[?(@.month == "{#AWS.BILLING.MONTH}")].amount.first()'
                  error_handler: DISCARD_VALUE
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3h
              master_item:
                key: aws.get.monthly.costs
              tags:
                - tag: component
                  value: billing
                - tag: month
                  value: '{#AWS.BILLING.MONTH}'
          graph_prototypes:
            - uuid: 3e01a98ed70149e3a6a083bb103aa496
              name: 'AWS Cost: [{#AWS.BILLING.MONTH}]: Monthly blended cost'
              graph_items:
                - drawtype: GRADIENT_LINE
                  color: 2E7D32
                  item:
                    host: 'AWS Cost Explorer by HTTP'
                    key: 'aws.monthly.cost["{#AWS.BILLING.MONTH}"]'
          master_item:
            key: aws.get.monthly.costs
          lld_macro_paths:
            - lld_macro: '{#AWS.BILLING.MONTH}'
              path: $..month.first()
            - lld_macro: '{#AWS.BILLING.UNIT}'
              path: $..unit.first()
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.monthly_costs
      tags:
        - tag: class
          value: cloud
        - tag: target
          value: aws
        - tag: target
          value: cost
      macros:
        - macro: '{$AWS.ACCESS.KEY.ID}'
          description: 'Access key ID.'
          config:
            type: TEXT
            priority: '3'
            label: 'Access key ID'
            description: 'Access keys are long-term credentials for an IAM user.'
        - macro: '{$AWS.ASSUME.ROLE.ARN}'
          description: 'ARN assume role; add when using the `assume_role` authorization method.'
          config:
            type: TEXT
            priority: '5'
            label: 'ARN assume role'
            description: 'The ARN of the role to assume when using the assume_role method.'
        - macro: '{$AWS.ASSUME.ROLE.AUTH.METADATA}'
          value: 'false'
          description: 'Add when using the `assume_role` through instance metadata or environment authorization method. Possible values: `false`, `true`.'
          config:
            type: LIST
            priority: '2'
            label: 'Assume Role Metadata Authorization'
            description: 'Chose `True` when use instance metadata service to retrieve role credentials.'
            options:
              - value: 'false'
                text: 'False'
              - value: 'true'
                text: 'True'
        - macro: '{$AWS.AUTH_TYPE}'
          value: access_key
          description: 'Authorization method. Possible values: `access_key`, `assume_role`, `role_base`.'
          config:
            type: LIST
            priority: '1'
            label: 'Authorization method'
            description: 'Authorization method used to access AWS.'
            required: 'YES'
            options:
              - value: access_key
                text: 'Access key'
              - value: assume_role
                text: AssumeRole
              - value: role_base
                text: 'Role-based access'
        - macro: '{$AWS.BILLING.LLD.FILTER.SERVICE.MATCHES}'
          value: '.*'
          description: 'Filter of discoverable discovered billing service by name.'
          config:
            type: TEXT
            priority: '10'
            section_name: Filters
            label: 'Service Filter (Matches)'
            description: 'A regex pattern to include services in discovery.'
        - macro: '{$AWS.BILLING.LLD.FILTER.SERVICE.NOT_MATCHES}'
          value: CHANGE_IF_NEEDED
          description: 'Filter to exclude discovered billing service by name.'
          config:
            type: TEXT
            priority: '11'
            section_name: Filters
            label: 'Service Filter (Not Matches)'
            description: 'A regex pattern to exclude services from discovery.'
        - macro: '{$AWS.BILLING.MONTH}'
          value: '11'
          description: 'Months to get historical data from AWS Cost Explore API, no more than 12 months.'
          config:
            type: TEXT
            priority: '9'
            label: 'Billing Month'
            description: 'The number of months to retrieve historical billing data (maximum 12). In the range from 1 to 12 inclusive.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$AWS.BILLING.REGION}'
          value: us-east-1
          description: 'Amazon Billing region code.'
          config:
            type: TEXT
            priority: '8'
            label: 'Billing Region'
            description: 'The AWS region for billing data retrieval.'
        - macro: '{$AWS.PROXY}'
          description: 'Sets HTTP proxy value. If this macro is empty, then no proxy is used.'
          config:
            type: TEXT
            priority: '6'
            section_name: Other
            label: 'HTTP Proxy'
            description: 'HTTP proxy to use for requests.'
        - macro: '{$AWS.SECRET.ACCESS.KEY}'
          type: SECRET_TEXT
          description: 'Secret access key.'
          config:
            type: TEXT
            priority: '4'
            label: 'Secret access key'
            description: 'Secret access key can be retrieved only at the time you create it.'
        - macro: '{$AWS.STS.REGION}'
          value: us-east-1
          description: 'Region used in assume role request.'
          config:
            type: TEXT
            priority: '7'
            label: 'STS Region'
            description: 'The AWS region for the assume role request.'
      dashboards:
        - uuid: e1e4edbf129142b4b27a9471db1ed8e2
          name: 'Overview AWS Costs'
          pages:
            - name: 'Monthly costs'
              widgets:
                - type: graphprototype
                  width: '72'
                  height: '25'
                  fields:
                    - type: GRAPH_PROTOTYPE
                      name: graphid.0
                      value:
                        host: 'AWS Cost Explorer by HTTP'
                        name: 'AWS Cost: [{#AWS.BILLING.MONTH}]: Monthly blended cost'
                    - type: STRING
                      name: reference
                      value: AAAAA
                    - type: INTEGER
                      name: rows
                      value: '6'
            - name: 'Monthly costs by service'
              widgets:
                - type: graphprototype
                  width: '72'
                  height: '25'
                  fields:
                    - type: GRAPH_PROTOTYPE
                      name: graphid.0
                      value:
                        host: 'AWS Cost Explorer by HTTP'
                        name: 'AWS Cost: [{#AWS.BILLING.SERVICE.NAME}]: Month [{#AWS.BILLING.MONTH}] Blended cost'
                    - type: STRING
                      name: reference
                      value: AAAAB
                    - type: INTEGER
                      name: rows
                      value: '6'
            - name: 'Daily costs by service'
              widgets:
                - type: graphprototype
                  width: '72'
                  height: '20'
                  fields:
                    - type: GRAPH_PROTOTYPE
                      name: graphid.0
                      value:
                        host: 'AWS Cost Explorer by HTTP'
                        name: 'AWS Cost: Service [{#AWS.BILLING.SERVICE.NAME}]: Blended daily cost'
                    - type: STRING
                      name: reference
                      value: AAAAC
                    - type: INTEGER
                      name: rows
                      value: '5'
    - uuid: c0263df8d8c14d30b24afcf45a6a354f
      template: 'Azure Cost Management by HTTP'
      name: 'Azure Cost Management by HTTP'
      description: |
        This template is designed to monitor Microsoft Cost Management by HTTP.
        It works without any external scripts and uses the script item.
        
        Setup:
          1. Create an Azure service principal via the Azure command-line interface (Azure CLI) for your subscription.
            `az ad sp create-for-rbac --name zabbix --role reader --scope /subscriptions/<subscription_id>`
            See https://docs.microsoft.com/en-us/cli/azure/create-an-azure-service-principal-azure-cli for more details.
          2. Link the template to a host.
          3. Configure the macros: {$AZURE.APP.ID}, {$AZURE.PASSWORD}, {$AZURE.TENANT.ID}, {$AZURE.SUBSCRIPTION.ID}.
        
        You can discuss this template or leave feedback on our forum https://www.zabbix.com/forum/zabbix-suggestions-and-feedback/.
        
        Generated by official Zabbix template tool "Templator"
      wizard_ready: 'YES'
      readme: |
        ## Overview
        
        This template is designed to monitor Microsoft Cost Management by HTTP.
        It works without any external scripts and uses the script item.
        
        ## Setup
        
        1. Create an Azure service principal via the Azure command-line interface (Azure CLI) for your subscription.
        
              `az ad sp create-for-rbac --name zabbix --role reader --scope /subscriptions/<subscription_id>`
        
        > See [Azure documentation](https://docs.microsoft.com/en-us/cli/azure/create-an-azure-service-principal-azure-cli) for more details.
        
        2. Link the template to a host.
        3. Configure the host wizard configuration fields: `Azure App ID`, `Azure password`, `Azure tenant ID`, `Azure subscription ID`.
      vendor:
        name: Zabbix
        version: 8.0-2
      groups:
        - name: Templates/Cloud
      items:
        - uuid: f50c96da86654a25b937756cc7f7010e
          name: 'Get daily costs'
          type: SCRIPT
          key: azure.get.daily.costs
          delay: 0s;h/5m/30
          history: '0'
          value_type: TEXT
          params: |
            var AzureCost = {
            	params: {},
            	token: null,
            
            	setParams: function (params) {
            		['app_id', 'password', 'tenant_id', 'subscription_id'].forEach(function (field) {
            			if (typeof params !== 'object' || typeof params[field] === 'undefined' || params[field] === '') {
            				throw 'Required param is not set: ' + field + '.';
            			}
            		});
            		AzureCost.params = params;
            	},
            
            	login: function () {
            		var response,
            			login = new HttpRequest();
            
            		if (typeof AzureCost.params.proxy !== 'undefined' && AzureCost.params.proxy !== '') {
            			login.setProxy(AzureCost.params.proxy);
            		}
            
            		login.addHeader('Content-Type: application/x-www-form-urlencoded');
            		response = login.post(
            			'https://login.microsoftonline.com/' + encodeURIComponent(AzureCost.params.tenant_id) + '/oauth2/token',
            			'grant_type=client_credentials&resource=' + encodeURIComponent('https://management.azure.com/') + '&client_id=' + encodeURIComponent(AzureCost.params.app_id) + '&client_secret=' + encodeURIComponent(AzureCost.params.password)
            		);
            
            		if (login.getStatus() !== 200) {
            			throw 'Login failed with status code ' + login.getStatus() + ': ' + response;
            		}
            		try {
            			response = JSON.parse(response);
            		}
            		catch (error) {
            			throw 'Failed to parse login session response.';
            		}
            		if (!response.hasOwnProperty('access_token')) {
            			throw 'Authentication response does not contain access token.';
            		}
            
            		AzureCost.token = response['access_token'];
            	},
            
            	request: function (url, body) {
            		if (typeof body === 'undefined' || body === null) {
            			body = '';
            		}
            		var response,
            			headers,
            			regex = /-retry-after":"(\d+)"/,
            			ratelimit,
            			request = new HttpRequest();
            
            		if (typeof AzureCost.params.proxy !== 'undefined' && AzureCost.params.proxy !== '') {
            			request.setProxy(AzureCost.params.proxy);
            		}
            		if (!AzureCost.token) {
            			throw 'Request does not contain access token.';
            		}
            		request.addHeader('Accept: application/json');
            		request.addHeader('Content-Type: application/json');
            		request.addHeader('Authorization: Bearer ' + AzureCost.token);
            
            		Zabbix.log(4, '[ AzureCost ] request url: ' + url);
            
            		response = request.post(url, body);
            		headers = JSON.stringify(request.getHeaders());
            
            		if (headers.match(regex) !== null && request.getStatus() === 429) {
            			ratelimit = headers.match(regex)[1];
            			Zabbix.log(4, '[ AzureCost ] Microsoft Cost Management have rate limit requests per 1 minute, retrying after ' + ratelimit + ' seconds');
            			Zabbix.sleep(ratelimit * 1010);
            			response = request.post(url, body);
            		}
            		if (request.getStatus() !== 200) {
            			throw 'Request failed with status code ' + request.getStatus() + ': ' + response;
            		}
            
            		try {
            			return JSON.parse(response);
            		}
            		catch (error) {
            			throw 'Failed to parse response received from API.';
            		}
            	},
            
            	getField: function (data, path) {
            		var steps = path.split('.');
            		for (var i = 0; i < steps.length; i++) {
            			var step = steps[i];
            			if (typeof data !== 'object' || typeof data[step] === 'undefined') {
            				throw 'Required field was not found: ' + path;
            			}
            			data = data[step];
            		}
            
            		return data;
            	},
            
            	getCost: function () {
            		var metricData = {},
            			today = new Date(),
            			start_date = new Date(today);
            		start_date.setDate(today.getDate() - 1);
            
            		bodyRawCost = {
            			type: 'Usage',
            			'timeframe': 'Custom',
            			'timePeriod': {
            				'from': start_date,
            				'to': start_date
            			},
            			dataset: {
            				granularity: 'Daily',
            				aggregation: {
            					totalCost: {
            						name: 'PreTaxCost',
            						function: 'Sum'
            					}
            				},
            				grouping: [
            					{
            						type: 'Dimension',
            						name: 'Meter',
            					},
            					{
            						type: 'Dimension',
            						name: 'MeterSubcategory',
            					},
            					{
            						type: 'Dimension',
            						name: 'ResourceGroup',
            					},
            					{
            						type: 'Dimension',
            						name: 'ServiceName',
            					},
            					{
            						type: 'Dimension',
            						name: 'ResourceLocation',
            					}
            				]
            			}
            		};
            		metricData = AzureCost.request('https://management.azure.com/subscriptions/' + AzureCost.params.subscription_id + '/providers/Microsoft.CostManagement/query?api-version=2023-11-01', JSON.stringify(bodyRawCost));
            
            		var columns = AzureCost.getField(metricData, 'properties.columns');
            
            		return transformedData = {
            			data: AzureCost.getField(metricData, 'properties.rows').map(function (row) {
            				rowData = {};
            				columns.forEach(function (column, i) {
            					columnName = columns[i].name;
            					columnType = columns[i].type;
            					cellValue = row[i];
            					rowData[columnName] = column.type === "Number" ? cellValue.toString() : cellValue;
            				});
            				rowData.UsageDate = rowData.UsageDate.replace(/(\d{4})(\d{2})(\d{2})/, "$1-$2-$3");
            
            				return rowData;
            			})
            		};
            	}
            };
            
            try {
            	AzureCost.setParams(JSON.parse(value));
            	AzureCost.login();
            
            	return JSON.stringify(AzureCost.getCost());
            }
            catch (error) {
            	error += (String(error).endsWith('.')) ? '' : '.';
            	Zabbix.log(3, '[ AzureCost ] ERROR: ' + error);
            
            	return JSON.stringify({ 'error': error });
            }
          description: 'The result of API requests is expressed in the JSON.'
          timeout: '{$AZURE.DATA.TIMEOUT}'
          parameters:
            - name: app_id
              value: '{$AZURE.APP.ID}'
            - name: password
              value: '{$AZURE.PASSWORD}'
            - name: proxy
              value: '{$AZURE.PROXY}'
            - name: subscription_id
              value: '{$AZURE.SUBSCRIPTION.ID}'
            - name: tenant_id
              value: '{$AZURE.TENANT.ID}'
          tags:
            - tag: component
              value: raw
        - uuid: dc9824169b414303a75c5d98421bd6f8
          name: 'Azure Cost: Get daily costs errors'
          type: DEPENDENT
          key: azure.get.daily.costs.errors
          value_type: TEXT
          description: 'A list of errors from API requests.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.error
              error_handler: CUSTOM_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.get.daily.costs
          tags:
            - tag: component
              value: raw
          triggers:
            - uuid: 503b3d5d008e4ad7b11384a3bd0c991c
              expression: 'length(last(/Azure Cost Management by HTTP/azure.get.daily.costs.errors))>0'
              name: 'Azure Cost: There are errors in requests to API'
              event_name: 'Azure Cost: Error in daily costs requests to API'
              opdata: '{ITEM.LASTVALUE1}'
              priority: AVERAGE
              description: 'Zabbix has received errors in response to API requests.'
              tags:
                - tag: scope
                  value: availability
        - uuid: bbf6a0b136464d76a535ca016dcb8ae1
          name: 'Get monthly costs'
          type: SCRIPT
          key: azure.get.monthly.costs
          delay: 0s;h/12
          history: '0'
          value_type: TEXT
          params: |
            var AzureCost = {
            	params: {},
            	token: null,
            
            	setParams: function (params) {
            		['app_id', 'password', 'tenant_id', 'subscription_id', 'month'].forEach(function (field) {
            			if (typeof params !== 'object' || typeof params[field] === 'undefined' || params[field] === '') {
            				throw 'Required param is not set: ' + field + '.';
            			}
            		});
            		AzureCost.params = params;
            
            		today = new Date();
            		AzureCost.params.end_date = today.toISOString();
            		month = today.getMonth();
            		today.setMonth(month - params.month);
            		AzureCost.params.start_time = new Date(today.getFullYear(), today.getMonth()).toISOString();
            	},
            
            	login: function () {
            		var response,
            			login = new HttpRequest();
            
            		if (typeof AzureCost.params.proxy !== 'undefined' && AzureCost.params.proxy !== '') {
            			login.setProxy(AzureCost.params.proxy);
            		}
            
            		login.addHeader('Content-Type: application/x-www-form-urlencoded');
            		response = login.post(
            			'https://login.microsoftonline.com/' + encodeURIComponent(AzureCost.params.tenant_id) + '/oauth2/token',
            			'grant_type=client_credentials&resource=' + encodeURIComponent('https://management.azure.com/') + '&client_id=' + encodeURIComponent(AzureCost.params.app_id) + '&client_secret=' + encodeURIComponent(AzureCost.params.password)
            		);
            
            		if (login.getStatus() !== 200) {
            			throw 'Login failed with status code ' + login.getStatus() + ': ' + response;
            		}
            		try {
            			response = JSON.parse(response);
            		}
            		catch (error) {
            			throw 'Failed to parse login session response.';
            		}
            		if (!response.hasOwnProperty('access_token')) {
            			throw 'Authentication response does not contain access token.';
            		}
            
            		AzureCost.token = response['access_token'];
            	},
            
            	request: function (url, body) {
            		if (typeof body === 'undefined' || body === null) {
            			body = '';
            		}
            		var response,
            			headers,
            			regex = /-retry-after":"(\d+)"/,
            			ratelimit,
            			request = new HttpRequest();
            
            		if (typeof AzureCost.params.proxy !== 'undefined' && AzureCost.params.proxy !== '') {
            			request.setProxy(AzureCost.params.proxy);
            		}
            		if (!AzureCost.token) {
            			throw 'Request does not contain access token.';
            		}
            		request.addHeader('Accept: application/json');
            		request.addHeader('Content-Type: application/json');
            		request.addHeader('Authorization: Bearer ' + AzureCost.token);
            
            		Zabbix.log(4, '[ AzureCost ] request url: ' + url);
            
            		response = request.post(url, body);
            		headers = JSON.stringify(request.getHeaders());
            
            		if (headers.match(regex) !== null && request.getStatus() === 429) {
            			ratelimit = headers.match(regex)[1];
            			Zabbix.log(4, '[ AzureCost ] Microsoft Cost Management have rate limit requests per 1 minute, retrying after ' + ratelimit + ' seconds');
            			Zabbix.sleep(ratelimit * 1010);
            			response = request.post(url, body);
            		}
            		if (request.getStatus() !== 200) {
            			throw 'Request failed with status code ' + request.getStatus() + ': ' + response;
            		}
            
            		try {
            			return JSON.parse(response);
            		}
            		catch (error) {
            			throw 'Failed to parse response received from API.';
            		}
            	},
            
            	getField: function (data, path) {
            		var steps = path.split('.');
            		for (var i = 0; i < steps.length; i++) {
            			var step = steps[i];
            			if (typeof data !== 'object' || typeof data[step] === 'undefined') {
            				throw 'Required field was not found: ' + path;
            			}
            			data = data[step];
            		}
            
            		return data;
            	},
            
            	getCost: function (grouping) {
            		var metricData = {},
            			bodyRawCost = {
            				type: 'Usage',
            				timeframe: 'Custom',
            				timePeriod: {
            					from: AzureCost.params.start_time,
            					to: AzureCost.params.end_date
            				},
            				dataset: {
            					aggregation: {
            						totalCost: {
            							name: 'PreTaxCost',
            							function: 'Sum'
            						}
            					},
            					grouping: [
            						{
            							type: 'Dimension',
            							name: 'BillingMonth'
            						},
            						{
            							type: 'Dimension',
            							name: grouping
            						},
            					]
            				}
            			};
            
            		metricData = AzureCost.request('https://management.azure.com/subscriptions/' + AzureCost.params.subscription_id + '/providers/Microsoft.CostManagement/query?api-version=2023-11-01', JSON.stringify(bodyRawCost));
            
            		var columns = AzureCost.getField(metricData, 'properties.columns');
            
            		return transformedData = {
            			data: AzureCost.getField(metricData, 'properties.rows').map(function (row) {
            				rowData = {};
            				columns.forEach(function (column, i) {
            					columnName = columns[i].name;
            					cellValue = row[i];
            					rowData[columnName] = column.type === "Number" ? cellValue.toString() : cellValue;
            				});
            				rowData.BillingMonth = rowData.BillingMonth.slice(0, 7);
            
            				return rowData;
            			})
            		};
            	}
            };
            
            try {
            	AzureCost.setParams(JSON.parse(value));
            	AzureCost.login();
            
            	serviceCost = AzureCost.getCost('ServiceName');
            	resourceGroupCost = AzureCost.getCost('ResourceGroup');
            	resourceLocationCost = AzureCost.getCost('ResourceLocation');
            	monthCost = AzureCost.getCost('SubscriptionId');
            
            	return JSON.stringify({ resourceGroupCost, resourceLocationCost, serviceCost, monthCost });
            }
            catch (error) {
            	error += (String(error).endsWith('.')) ? '' : '.';
            	Zabbix.log(3, '[ AzureCost ] ERROR: ' + error);
            
            	return JSON.stringify({ 'error': error });
            }
          description: 'The result of API requests is expressed in the JSON.'
          timeout: '{$AZURE.DATA.TIMEOUT}'
          parameters:
            - name: app_id
              value: '{$AZURE.APP.ID}'
            - name: month
              value: '{$AZURE.BILLING.MONTH}'
            - name: password
              value: '{$AZURE.PASSWORD}'
            - name: proxy
              value: '{$AZURE.PROXY}'
            - name: subscription_id
              value: '{$AZURE.SUBSCRIPTION.ID}'
            - name: tenant_id
              value: '{$AZURE.TENANT.ID}'
          tags:
            - tag: component
              value: raw
        - uuid: 30dae868261844f39c811cdba93628eb
          name: 'Azure Cost: Get monthly costs errors'
          type: DEPENDENT
          key: azure.get.monthly.costs.errors
          value_type: TEXT
          description: 'A list of errors from API requests.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.error
              error_handler: CUSTOM_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: azure.get.monthly.costs
          tags:
            - tag: component
              value: raw
          triggers:
            - uuid: 2ea11e17fd734dee80219e22a8073e01
              expression: 'length(last(/Azure Cost Management by HTTP/azure.get.monthly.costs.errors))>0'
              name: 'Azure Cost: There are errors in requests to API'
              event_name: 'Azure Cost: Error in monthly costs requests to API'
              opdata: '{ITEM.LASTVALUE1}'
              priority: AVERAGE
              description: 'Zabbix has received errors in response to API requests.'
              tags:
                - tag: scope
                  value: availability
      discovery_rules:
        - uuid: 1220188c7a1c4df8b75e9021c4515149
          name: 'Azure daily costs by services discovery'
          type: DEPENDENT
          key: azure.daily.services.costs.discovery
          filter:
            evaltype: AND
            conditions:
              - macro: '{#AZURE.RESOURCE.GROUP}'
                value: '{$AZURE.LLD.FILTER.RESOURCE.GROUP.MATCHES}'
              - macro: '{#AZURE.RESOURCE.GROUP}'
                value: '{$AZURE.LLD.FILTER.RESOURCE.GROUP.NOT_MATCHES}'
                operator: NOT_MATCHES_REGEX
              - macro: '{#AZURE.RESOURCE.LOCATION}'
                value: '{$AZURE.LLD.FILTER.RESOURCE.LOCATION.MATCHES}'
              - macro: '{#AZURE.RESOURCE.LOCATION}'
                value: '{$AZURE.LLD.FILTER.RESOURCE.LOCATION.NOT_MATCHES}'
                operator: NOT_MATCHES_REGEX
              - macro: '{#AZURE.SERVICE.NAME}'
                value: '{$AZURE.LLD.FILTER.SERVICE.MATCHES}'
              - macro: '{#AZURE.SERVICE.NAME}'
                value: '{$AZURE.LLD.FILTER.SERVICE.NOT_MATCHES}'
                operator: NOT_MATCHES_REGEX
          description: 'Discovery of daily costs by services.'
          item_prototypes:
            - uuid: 848ccd4cec2c4902990aa25f90f502a8
              name: 'Service ["{#AZURE.SERVICE.NAME}"]: Meter ["{#AZURE.BILLING.METER}"]: Subcategory ["{#AZURE.BILLING.METER.SUBCATEGORY}"] daily cost'
              type: DEPENDENT
              key: 'azure.daily.cost["{#AZURE.SERVICE.NAME}", "{#AZURE.BILLING.METER}", "{#AZURE.BILLING.METER.SUBCATEGORY}","{#AZURE.RESOURCE.GROUP}"]'
              value_type: FLOAT
              units: '!{#AZURE.BILLING.UNIT}'
              description: 'The daily cost by service {#AZURE.SERVICE.NAME}, meter {#AZURE.BILLING.METER}, subcategory {#AZURE.BILLING.METER.SUBCATEGORY}.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.data.[?(@.ServiceName == "{#AZURE.SERVICE.NAME}" && @.Meter == "{#AZURE.BILLING.METER}" && @.MeterSubcategory == "{#AZURE.BILLING.METER.SUBCATEGORY}")].PreTaxCost.first()'
                  error_handler: DISCARD_VALUE
              master_item:
                key: azure.get.daily.costs
              tags:
                - tag: component
                  value: cost
                - tag: location
                  value: '{#AZURE.RESOURCE.LOCATION}'
                - tag: meter
                  value: '{#AZURE.BILLING.METER}'
                - tag: resource-group
                  value: '{#AZURE.RESOURCE.GROUP}'
                - tag: service
                  value: '{#AZURE.SERVICE.NAME}'
          graph_prototypes:
            - uuid: 2a1e03e65b1c40cba783493871e245d5
              name: 'Daily Cost: "{#AZURE.SERVICE.NAME}","{#AZURE.BILLING.METER}","{#AZURE.BILLING.METER.SUBCATEGORY}","{#AZURE.RESOURCE.GROUP}"'
              graph_items:
                - drawtype: GRADIENT_LINE
                  color: 2E7D32
                  item:
                    host: 'Azure Cost Management by HTTP'
                    key: 'azure.daily.cost["{#AZURE.SERVICE.NAME}", "{#AZURE.BILLING.METER}", "{#AZURE.BILLING.METER.SUBCATEGORY}","{#AZURE.RESOURCE.GROUP}"]'
          master_item:
            key: azure.get.daily.costs
          lld_macro_paths:
            - lld_macro: '{#AZURE.BILLING.METER.SUBCATEGORY}'
              path: $.MeterSubcategory
            - lld_macro: '{#AZURE.BILLING.METER}'
              path: $.Meter
            - lld_macro: '{#AZURE.BILLING.UNIT}'
              path: $.Currency
            - lld_macro: '{#AZURE.RESOURCE.GROUP}'
              path: $.ResourceGroup
            - lld_macro: '{#AZURE.RESOURCE.LOCATION}'
              path: $.ResourceLocation
            - lld_macro: '{#AZURE.SERVICE.NAME}'
              path: $.ServiceName
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.data
              error_handler: DISCARD_VALUE
        - uuid: 9c65b60a8e1840dd81367aefe6b0de18
          name: 'Azure monthly costs discovery'
          type: DEPENDENT
          key: azure.monthly.costs.discovery
          description: 'Discovery of monthly costs.'
          item_prototypes:
            - uuid: f91a60d2c1124eb6b297539b0a115c66
              name: 'Month ["{#AZURE.BILLING.MONTH}"] cost'
              type: DEPENDENT
              key: 'azure.monthly.cost["{#AZURE.BILLING.MONTH}"]'
              value_type: FLOAT
              units: '!{#AZURE.BILLING.UNIT}'
              description: 'The monthly cost.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.monthCost.data.[?(@.BillingMonth == "{#AZURE.BILLING.MONTH}")].PreTaxCost.sum()'
                  error_handler: DISCARD_VALUE
              master_item:
                key: azure.get.monthly.costs
              tags:
                - tag: component
                  value: cost
                - tag: month
                  value: '{#AZURE.BILLING.MONTH}'
          graph_prototypes:
            - uuid: 347342d3d0cc478bab33036872570cdb
              name: 'Azure Cost: Month ["{#AZURE.BILLING.MONTH}"] cost'
              graph_items:
                - drawtype: GRADIENT_LINE
                  color: 2E7D32
                  item:
                    host: 'Azure Cost Management by HTTP'
                    key: 'azure.monthly.cost["{#AZURE.BILLING.MONTH}"]'
          master_item:
            key: azure.get.monthly.costs
          lld_macro_paths:
            - lld_macro: '{#AZURE.BILLING.MONTH}'
              path: $.BillingMonth
            - lld_macro: '{#AZURE.BILLING.UNIT}'
              path: $.Currency
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.monthCost.data
              error_handler: DISCARD_VALUE
        - uuid: e9a4bf192feb4472aedd40ba2371d286
          name: 'Azure monthly costs by location discovery'
          type: DEPENDENT
          key: azure.monthly.location.costs.discovery
          filter:
            evaltype: AND
            conditions:
              - macro: '{#AZURE.RESOURCE.LOCATION}'
                value: '{$AZURE.LLD.FILTER.RESOURCE.LOCATION.MATCHES}'
              - macro: '{#AZURE.RESOURCE.LOCATION}'
                value: '{$AZURE.LLD.FILTER.RESOURCE.LOCATION.NOT_MATCHES}'
                operator: NOT_MATCHES_REGEX
          description: 'Discovery of monthly costs by location.'
          item_prototypes:
            - uuid: 7fb097f81a8445acaa6b17bdc4daaaa6
              name: 'Location: ["{#AZURE.RESOURCE.LOCATION}"]: Month ["{#AZURE.BILLING.MONTH}"] cost'
              type: DEPENDENT
              key: 'azure.monthly.location.cost["{#AZURE.RESOURCE.LOCATION}", "{#AZURE.BILLING.MONTH}"]'
              value_type: FLOAT
              units: '!{#AZURE.BILLING.UNIT}'
              description: 'The monthly cost by location {#AZURE.RESOURCE.LOCATION}.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.resourceLocationCost.data.[?(@.BillingMonth == "{#AZURE.BILLING.MONTH}")]'
                  error_handler: DISCARD_VALUE
                - type: JSONPATH
                  parameters:
                    - '$.[?(@.ResourceLocation == "{#AZURE.RESOURCE.LOCATION}")].PreTaxCost.sum()'
                  error_handler: DISCARD_VALUE
              master_item:
                key: azure.get.monthly.costs
              tags:
                - tag: component
                  value: cost
                - tag: location
                  value: '{#AZURE.RESOURCE.LOCATION}'
                - tag: month
                  value: '{#AZURE.BILLING.MONTH}'
          graph_prototypes:
            - uuid: e3df27afabb147d3ae07e1a2fa36e89a
              name: 'Azure Cost: ["{#AZURE.RESOURCE.LOCATION}"]: Month ["{#AZURE.BILLING.MONTH}"] cost'
              graph_items:
                - drawtype: GRADIENT_LINE
                  color: 2E7D32
                  item:
                    host: 'Azure Cost Management by HTTP'
                    key: 'azure.monthly.location.cost["{#AZURE.RESOURCE.LOCATION}", "{#AZURE.BILLING.MONTH}"]'
          master_item:
            key: azure.get.monthly.costs
          lld_macro_paths:
            - lld_macro: '{#AZURE.BILLING.MONTH}'
              path: $.BillingMonth
            - lld_macro: '{#AZURE.BILLING.UNIT}'
              path: $.Currency
            - lld_macro: '{#AZURE.RESOURCE.LOCATION}'
              path: $.ResourceLocation
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.resourceLocationCost.data
              error_handler: DISCARD_VALUE
        - uuid: 4dfa3b60721e463d97f2f820106f816d
          name: 'Azure monthly costs by resource group discovery'
          type: DEPENDENT
          key: azure.monthly.resource.group.costs.discovery
          filter:
            evaltype: AND
            conditions:
              - macro: '{#AZURE.RESOURCE.GROUP}'
                value: '{$AZURE.LLD.FILTER.RESOURCE.GROUP.MATCHES}'
              - macro: '{#AZURE.RESOURCE.GROUP}'
                value: '{$AZURE.LLD.FILTER.RESOURCE.GROUP.NOT_MATCHES}'
                operator: NOT_MATCHES_REGEX
          description: 'Discovery of monthly costs by resource group.'
          item_prototypes:
            - uuid: 9a5ed573ac374c08abf81f2b7296f260
              name: 'Resource group: ["{#AZURE.RESOURCE.GROUP}"]: Month ["{#AZURE.BILLING.MONTH}"] cost'
              type: DEPENDENT
              key: 'azure.monthly.resource.group.cost["{#AZURE.RESOURCE.GROUP}", "{#AZURE.BILLING.MONTH}"]'
              value_type: FLOAT
              units: '!{#AZURE.BILLING.UNIT}'
              description: 'The monthly cost by resource group {#AZURE.RESOURCE.GROUP}.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.resourceGroupCost.data.[?(@.BillingMonth == "{#AZURE.BILLING.MONTH}")]'
                  error_handler: DISCARD_VALUE
                - type: JSONPATH
                  parameters:
                    - '$.[?(@.ResourceGroup == "{#AZURE.RESOURCE.GROUP}")].PreTaxCost.sum()'
                  error_handler: DISCARD_VALUE
              master_item:
                key: azure.get.monthly.costs
              tags:
                - tag: component
                  value: cost
                - tag: month
                  value: '{#AZURE.BILLING.MONTH}'
                - tag: resource-group
                  value: '{#AZURE.RESOURCE.GROUP}'
          graph_prototypes:
            - uuid: fab17244d2c648e089c57c99615af537
              name: 'Azure Cost: ["{#AZURE.RESOURCE.GROUP}"]: Month ["{#AZURE.BILLING.MONTH}"] cost'
              graph_items:
                - drawtype: GRADIENT_LINE
                  color: 2E7D32
                  item:
                    host: 'Azure Cost Management by HTTP'
                    key: 'azure.monthly.resource.group.cost["{#AZURE.RESOURCE.GROUP}", "{#AZURE.BILLING.MONTH}"]'
          master_item:
            key: azure.get.monthly.costs
          lld_macro_paths:
            - lld_macro: '{#AZURE.BILLING.MONTH}'
              path: $.BillingMonth
            - lld_macro: '{#AZURE.BILLING.UNIT}'
              path: $.Currency
            - lld_macro: '{#AZURE.RESOURCE.GROUP}'
              path: $.ResourceGroup
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.resourceGroupCost.data
              error_handler: DISCARD_VALUE
        - uuid: b9b024a7e42540f0b8387af77367b15c
          name: 'Azure monthly costs by services discovery'
          type: DEPENDENT
          key: azure.monthly.services.costs.discovery
          filter:
            evaltype: AND
            conditions:
              - macro: '{#AZURE.SERVICE.NAME}'
                value: '{$AZURE.LLD.FILTER.SERVICE.MATCHES}'
              - macro: '{#AZURE.SERVICE.NAME}'
                value: '{$AZURE.LLD.FILTER.SERVICE.NOT_MATCHES}'
                operator: NOT_MATCHES_REGEX
          description: 'Discovery of monthly costs by services.'
          item_prototypes:
            - uuid: dbad6436c70e41268e3b59c2a7f0e2a2
              name: 'Service ["{#AZURE.SERVICE.NAME}"]: Month ["{#AZURE.BILLING.MONTH}"] cost'
              type: DEPENDENT
              key: 'azure.monthly.service.cost["{#AZURE.SERVICE.NAME}", "{#AZURE.BILLING.MONTH}"]'
              value_type: FLOAT
              units: '!{#AZURE.BILLING.UNIT}'
              description: 'The monthly cost by service {#AZURE.SERVICE.NAME}.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.serviceCost.data.[?(@.BillingMonth == "{#AZURE.BILLING.MONTH}")]'
                  error_handler: DISCARD_VALUE
                - type: JSONPATH
                  parameters:
                    - '$.[?(@.ServiceName == "{#AZURE.SERVICE.NAME}")].PreTaxCost.sum()'
                  error_handler: DISCARD_VALUE
              master_item:
                key: azure.get.monthly.costs
              tags:
                - tag: component
                  value: cost
                - tag: month
                  value: '{#AZURE.BILLING.MONTH}'
                - tag: service
                  value: '{#AZURE.SERVICE.NAME}'
          graph_prototypes:
            - uuid: 31f1e30f99ed426d81b48411cc7ffd7f
              name: 'Azure Cost: ["{#AZURE.SERVICE.NAME}"]: Month ["{#AZURE.BILLING.MONTH}"] cost'
              graph_items:
                - drawtype: GRADIENT_LINE
                  color: 2E7D32
                  item:
                    host: 'Azure Cost Management by HTTP'
                    key: 'azure.monthly.service.cost["{#AZURE.SERVICE.NAME}", "{#AZURE.BILLING.MONTH}"]'
          master_item:
            key: azure.get.monthly.costs
          lld_macro_paths:
            - lld_macro: '{#AZURE.BILLING.MONTH}'
              path: $.BillingMonth
            - lld_macro: '{#AZURE.BILLING.UNIT}'
              path: $.Currency
            - lld_macro: '{#AZURE.SERVICE.NAME}'
              path: $.ServiceName
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.serviceCost.data
              error_handler: DISCARD_VALUE
      tags:
        - tag: class
          value: cloud
        - tag: target
          value: azure
        - tag: target
          value: cost
      macros:
        - macro: '{$AZURE.APP.ID}'
          description: 'The App ID of Microsoft Azure.'
          config:
            type: TEXT
            priority: '3'
            label: 'Azure App ID'
            description: 'Microsoft Azure App ID.'
            required: 'YES'
        - macro: '{$AZURE.BILLING.MONTH}'
          value: '11'
          description: 'Months to get historical data from Azure Cost Management API, no more than 11 (plus current month). The time period for pulling the data cannot exceed 1 year.'
          config:
            type: TEXT
            priority: '5'
            label: 'Billing months'
            description: 'Months to get historical data from Azure Cost Management API, no more than 11 (plus current month). In the range from 0 to 11 inclusive.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$AZURE.DATA.TIMEOUT}'
          value: 60s
          description: 'API response timeout.'
          config:
            type: TEXT
            priority: '12'
            section_name: Other
            label: 'API timeout'
            description: 'API response timeout, in seconds.'
        - macro: '{$AZURE.LLD.FILTER.RESOURCE.GROUP.MATCHES}'
          value: '.*'
          description: 'Filter of discoverable resource groups by name.'
          config:
            type: TEXT
            priority: '10'
            section_name: Filters
            label: 'Include resource groups filter'
            description: 'Regex string to include discoverable resource groups by name.'
        - macro: '{$AZURE.LLD.FILTER.RESOURCE.GROUP.NOT_MATCHES}'
          value: CHANGE_IF_NEEDED
          description: 'Filter to exclude discovered resource groups by name.'
          config:
            type: TEXT
            priority: '11'
            section_name: Filters
            label: 'Exclude locations filter'
            description: 'Regex string to exclude discovered resource groups by name.'
        - macro: '{$AZURE.LLD.FILTER.RESOURCE.LOCATION.MATCHES}'
          value: '.*'
          description: 'Filter of discoverable locations by name.'
          config:
            type: TEXT
            priority: '8'
            section_name: Filters
            label: 'Include locations filter'
            description: 'Regex string to include discoverable locations by name.'
        - macro: '{$AZURE.LLD.FILTER.RESOURCE.LOCATION.NOT_MATCHES}'
          value: CHANGE_IF_NEEDED
          description: 'Filter to exclude discovered locations by name.'
          config:
            type: TEXT
            priority: '9'
            section_name: Filters
            label: 'Exclude locations filter'
            description: 'Regex string to exclude discovered locations by name.'
        - macro: '{$AZURE.LLD.FILTER.SERVICE.MATCHES}'
          value: '.*'
          description: 'Filter of discoverable services by name.'
          config:
            type: TEXT
            priority: '6'
            section_name: Filters
            label: 'Include services filter'
            description: 'Regex string to include discovered services by name.'
        - macro: '{$AZURE.LLD.FILTER.SERVICE.NOT_MATCHES}'
          value: CHANGE_IF_NEEDED
          description: 'Filter to exclude discovered services by name.'
          config:
            type: TEXT
            priority: '7'
            section_name: Filters
            label: 'Exclude services filter'
            description: 'Regex string to exclude discovered services by name.'
        - macro: '{$AZURE.PASSWORD}'
          type: SECRET_TEXT
          description: 'Microsoft Azure password.'
          config:
            type: TEXT
            priority: '4'
            label: 'Azure password'
            description: 'Microsoft Azure password.'
            required: 'YES'
        - macro: '{$AZURE.PROXY}'
          description: 'Sets the HTTP proxy value. If this macro is empty, then no proxy is used.'
          config:
            type: TEXT
            priority: '13'
            section_name: Other
            label: 'HTTP proxy'
            description: 'HTTP proxy to use for requests.'
        - macro: '{$AZURE.SUBSCRIPTION.ID}'
          description: 'Microsoft Azure subscription ID.'
          config:
            type: TEXT
            priority: '1'
            label: 'Azure subscription ID'
            description: 'Microsoft Azure subscription ID.'
            required: 'YES'
        - macro: '{$AZURE.TENANT.ID}'
          description: 'Microsoft Azure tenant ID.'
          config:
            type: TEXT
            priority: '2'
            label: 'Azure tenant ID'
            description: 'Microsoft Azure tenant ID.'
            required: 'YES'
      dashboards:
        - uuid: a1c2ce224f07483b865ce48090338dc4
          name: 'Overview Azure Costs'
          pages:
            - name: 'Monthly costs'
              widgets:
                - type: itemnavigator
                  name: Month
                  width: '20'
                  height: '6'
                  fields:
                    - type: INTEGER
                      name: group_by.0.attribute
                      value: '3'
                    - type: STRING
                      name: group_by.0.tag_name
                      value: month
                    - type: STRING
                      name: items.0
                      value: 'Month ["*"] cost'
                    - type: STRING
                      name: reference
                      value: JZQAJ
                - type: itemnavigator
                  name: Service
                  'y': '6'
                  width: '20'
                  height: '6'
                  fields:
                    - type: INTEGER
                      name: group_by.0.attribute
                      value: '3'
                    - type: STRING
                      name: group_by.0.tag_name
                      value: service
                    - type: INTEGER
                      name: group_by.1.attribute
                      value: '3'
                    - type: STRING
                      name: group_by.1.tag_name
                      value: month
                    - type: STRING
                      name: items.0
                      value: 'Service ["*"]: Month ["*"] cost'
                    - type: STRING
                      name: reference
                      value: AJICL
                    - type: INTEGER
                      name: show_lines
                      value: '200'
                - type: piechart
                  name: 'Month costs'
                  x: '20'
                  width: '32'
                  height: '12'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: draw_type
                      value: '1'
                    - type: STRING
                      name: ds.0.color.0
                      value: 4CAF50
                    - type: INTEGER
                      name: ds.0.dataset_type
                      value: '0'
                    - type: STRING
                      name: ds.0.itemids.0._reference
                      value: JZQAJ._itemid
                    - type: INTEGER
                      name: ds.0.type.0
                      value: '0'
                    - type: STRING
                      name: ds.1.color.0
                      value: 1565C0
                    - type: INTEGER
                      name: ds.1.dataset_type
                      value: '0'
                    - type: STRING
                      name: ds.1.itemids.0._reference
                      value: AJICL._itemid
                    - type: INTEGER
                      name: ds.1.type.0
                      value: '0'
                    - type: STRING
                      name: ds.2.color.0
                      value: '795548'
                    - type: INTEGER
                      name: ds.2.dataset_type
                      value: '0'
                    - type: STRING
                      name: ds.2.itemids.0._reference
                      value: PEIIF._itemid
                    - type: INTEGER
                      name: ds.2.type.0
                      value: '0'
                    - type: STRING
                      name: ds.3.color.0
                      value: E65100
                    - type: INTEGER
                      name: ds.3.dataset_type
                      value: '0'
                    - type: STRING
                      name: ds.3.itemids.0._reference
                      value: JRCGU._itemid
                    - type: INTEGER
                      name: ds.3.type.0
                      value: '0'
                    - type: INTEGER
                      name: legend_lines
                      value: '4'
                    - type: INTEGER
                      name: legend_value
                      value: '1'
                    - type: INTEGER
                      name: space
                      value: '2'
                    - type: INTEGER
                      name: stroke
                      value: '2'
                - type: itemnavigator
                  name: Location
                  x: '52'
                  width: '20'
                  height: '6'
                  fields:
                    - type: INTEGER
                      name: group_by.0.attribute
                      value: '3'
                    - type: STRING
                      name: group_by.0.tag_name
                      value: location
                    - type: INTEGER
                      name: group_by.1.attribute
                      value: '3'
                    - type: STRING
                      name: group_by.1.tag_name
                      value: month
                    - type: STRING
                      name: items.0
                      value: 'Location: ["*"]: Month ["*"] cost'
                    - type: STRING
                      name: reference
                      value: PEIIF
                    - type: INTEGER
                      name: show_lines
                      value: '200'
                - type: itemnavigator
                  name: 'Resource group'
                  x: '52'
                  'y': '6'
                  width: '20'
                  height: '6'
                  fields:
                    - type: INTEGER
                      name: group_by.0.attribute
                      value: '3'
                    - type: STRING
                      name: group_by.0.tag_name
                      value: resource-group
                    - type: INTEGER
                      name: group_by.1.attribute
                      value: '3'
                    - type: STRING
                      name: group_by.1.tag_name
                      value: month
                    - type: STRING
                      name: items.0
                      value: 'Resource group: ["*"]: Month ["*"] cost'
                    - type: STRING
                      name: reference
                      value: JRCGU
                    - type: INTEGER
                      name: show_lines
                      value: '200'
            - name: 'Daily costs by service'
              widgets:
                - type: itemnavigator
                  name: Service
                  width: '25'
                  height: '7'
                  fields:
                    - type: INTEGER
                      name: group_by.0.attribute
                      value: '3'
                    - type: STRING
                      name: group_by.0.tag_name
                      value: service
                    - type: INTEGER
                      name: group_by.1.attribute
                      value: '3'
                    - type: STRING
                      name: group_by.1.tag_name
                      value: resource-group
                    - type: STRING
                      name: items.0
                      value: 'Service ["*"]: Meter ["*"]: Subcategory ["*"] daily cost'
                    - type: STRING
                      name: reference
                      value: TOVAT
                - type: svggraph
                  name: 'Daily cost'
                  x: '25'
                  width: '47'
                  height: '7'
                  hide_header: 'YES'
                  fields:
                    - type: STRING
                      name: ds.0.color.0
                      value: 6A1B9A
                    - type: INTEGER
                      name: ds.0.dataset_type
                      value: '0'
                    - type: STRING
                      name: ds.0.itemids.0._reference
                      value: TOVAT._itemid
                    - type: INTEGER
                      name: ds.0.transparency
                      value: '4'
                    - type: INTEGER
                      name: ds.0.width
                      value: '2'
                    - type: STRING
                      name: reference
                      value: AMNYP
                    - type: INTEGER
                      name: righty
                      value: '0'
    - uuid: 09fb25d089f7467f860895f6e71d3fa2
      template: 'Ceph by Zabbix agent 2'
      name: 'Ceph by Zabbix agent 2'
      description: |
        You can discuss this template or leave feedback on our forum https://www.zabbix.com/forum/zabbix-suggestions-and-feedback/410059-discussion-thread-for-official-zabbix-template-ceph
        
        Generated by official Zabbix template tool "Templator"
      wizard_ready: 'YES'
      readme: |
        ## Overview
        
        The template to monitor Ceph cluster by Zabbix that work without any external scripts.
        Most of the metrics are collected in one go, thanks to Zabbix bulk data collection.
        
        Template `Ceph by Zabbix agent 2` — collects metrics by polling zabbix-agent2.
        
        
        ## Setup
        
        1. Setup and configure zabbix-agent2 compiled with the Ceph monitoring plugin.
        2. Set the `Connection string` such as <protocol(host:port)> or named session.
        3. Set the user name and password in host wizard configuration field (`Username`, `API key`) if you want to override parameters from the Zabbix agent configuration file.
        
        Test availability: `zabbix_get -s ceph-host -k ceph.ping["{$CEPH.CONNSTRING}","{$CEPH.USER}","{$CEPH.API.KEY}"]`
      vendor:
        name: Zabbix
        version: 8.0-1
      groups:
        - name: Templates/Applications
      items:
        - uuid: af3e6faf835f41ef93cbbc44aa57f97e
          name: 'Get df'
          key: 'ceph.df.details["{$CEPH.CONNSTRING}","{$CEPH.USER}","{$CEPH.API.KEY}"]'
          history: '0'
          value_type: TEXT
          tags:
            - tag: component
              value: disk
            - tag: component
              value: raw
        - uuid: 45c9df734d424e6a8d3fea99c4a66246
          name: 'Minimum Mon release version'
          type: DEPENDENT
          key: ceph.min_mon_release_name
          value_type: CHAR
          description: min_mon_release_name
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.min_mon_release_name
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: 'ceph.status["{$CEPH.CONNSTRING}","{$CEPH.USER}","{$CEPH.API.KEY}"]'
          tags:
            - tag: component
              value: monitors
          triggers:
            - uuid: 716f166b3943443aba70a4faed882ffb
              expression: 'last(/Ceph by Zabbix agent 2/ceph.min_mon_release_name,#1)<>last(/Ceph by Zabbix agent 2/ceph.min_mon_release_name,#2) and length(last(/Ceph by Zabbix agent 2/ceph.min_mon_release_name))>0'
              name: 'Ceph: Minimum monitor release version has changed'
              event_name: 'Ceph: Minimum monitor release version has changed (new version: {ITEM.VALUE})'
              priority: INFO
              description: 'A Ceph version has changed. Acknowledge to close the problem manually.'
              manual_close: 'YES'
              tags:
                - tag: scope
                  value: notice
        - uuid: 5d5276504d6c41eebe8e18846edcff45
          name: 'Number of Monitors'
          type: DEPENDENT
          key: ceph.num_mon
          description: 'The number of Monitors configured in a Ceph cluster.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.num_mon
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 30m
          master_item:
            key: 'ceph.status["{$CEPH.CONNSTRING}","{$CEPH.USER}","{$CEPH.API.KEY}"]'
          tags:
            - tag: component
              value: monitors
        - uuid: 09d7a872f35349c6ba7d4a678bf71652
          name: 'Number of OSDs'
          type: DEPENDENT
          key: ceph.num_osd
          description: 'The number of the known storage daemons in a Ceph cluster.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.num_osd
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 10m
          master_item:
            key: 'ceph.status["{$CEPH.CONNSTRING}","{$CEPH.USER}","{$CEPH.API.KEY}"]'
          tags:
            - tag: component
              value: cluster
            - tag: component
              value: osd
        - uuid: 795939e16e70475381e917b213bf6f70
          name: 'Number of OSDs in state: IN'
          type: DEPENDENT
          key: ceph.num_osd_in
          description: 'The total number of the participating storage daemons in a Ceph cluster.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.num_osd_in
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 10m
          master_item:
            key: 'ceph.status["{$CEPH.CONNSTRING}","{$CEPH.USER}","{$CEPH.API.KEY}"]'
          tags:
            - tag: component
              value: cluster
            - tag: component
              value: osd
        - uuid: d2d5caaad2914fb1ba07343956edb5b8
          name: 'Number of OSDs in state: UP'
          type: DEPENDENT
          key: ceph.num_osd_up
          description: 'The total number of the online storage daemons in a Ceph cluster.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.num_osd_up
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 10m
          master_item:
            key: 'ceph.status["{$CEPH.CONNSTRING}","{$CEPH.USER}","{$CEPH.API.KEY}"]'
          tags:
            - tag: component
              value: cluster
            - tag: component
              value: osd
        - uuid: 46ea920b0951408daa5d678f298b1097
          name: 'Number of Placement Groups'
          type: DEPENDENT
          key: ceph.num_pg
          description: 'The total number of Placement Groups in a Ceph cluster.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.num_pg
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 10m
          master_item:
            key: 'ceph.status["{$CEPH.CONNSTRING}","{$CEPH.USER}","{$CEPH.API.KEY}"]'
          tags:
            - tag: component
              value: cluster
            - tag: component
              value: placement-groups
        - uuid: 97fbecc8ee824e658dd95d8115fec5e9
          name: 'Number of Placement Groups in Temporary state'
          type: DEPENDENT
          key: ceph.num_pg_temp
          description: 'The total number of Placement Groups in a *pg_temp* state'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.num_pg_temp
          master_item:
            key: 'ceph.osd.dump["{$CEPH.CONNSTRING}","{$CEPH.USER}","{$CEPH.API.KEY}"]'
          tags:
            - tag: component
              value: placement-groups
        - uuid: b0e36ff76db049ab870fa26c29e5e69c
          name: 'Number of Pools'
          type: DEPENDENT
          key: ceph.num_pools
          description: 'The total number of pools in a Ceph cluster.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.num_pools
          master_item:
            key: 'ceph.df.details["{$CEPH.CONNSTRING}","{$CEPH.USER}","{$CEPH.API.KEY}"]'
          tags:
            - tag: component
              value: cluster
            - tag: component
              value: pools
        - uuid: e7eb1f67d81c4e2ba7c57cfbc81d1a00
          name: 'Get OSD dump'
          key: 'ceph.osd.dump["{$CEPH.CONNSTRING}","{$CEPH.USER}","{$CEPH.API.KEY}"]'
          history: '0'
          value_type: TEXT
          tags:
            - tag: component
              value: osd
            - tag: component
              value: raw
        - uuid: 35b63ca6519e4137bb7655e37ed08e51
          name: 'Get OSD stats'
          key: 'ceph.osd.stats["{$CEPH.CONNSTRING}","{$CEPH.USER}","{$CEPH.API.KEY}"]'
          history: '0'
          value_type: TEXT
          tags:
            - tag: component
              value: osd
            - tag: component
              value: raw
        - uuid: 0d6cffa1f06748738431524667ea8db0
          name: 'Ceph backfill full ratio'
          type: DEPENDENT
          key: ceph.osd_backfillfull_ratio
          value_type: FLOAT
          description: 'The backfill full ratio setting of the Ceph cluster as configured on OSDMap.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.osd_backfillfull_ratio
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 10m
          master_item:
            key: 'ceph.osd.dump["{$CEPH.CONNSTRING}","{$CEPH.USER}","{$CEPH.API.KEY}"]'
          tags:
            - tag: component
              value: cluster
        - uuid: 52c5efe132b8404f8fc4ac995c3d5c2c
          name: 'Ceph OSD avg fill'
          type: DEPENDENT
          key: ceph.osd_fill.avg
          value_type: FLOAT
          units: '%'
          description: 'The average fill of OSDs.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.osd_fill.avg
          master_item:
            key: 'ceph.osd.stats["{$CEPH.CONNSTRING}","{$CEPH.USER}","{$CEPH.API.KEY}"]'
          tags:
            - tag: component
              value: cluster
            - tag: component
              value: osd
        - uuid: 453cebeed3214153ba4e3a5b224c063d
          name: 'Ceph OSD max fill'
          type: DEPENDENT
          key: ceph.osd_fill.max
          value_type: FLOAT
          units: '%'
          description: 'The percentage of the most filled OSD.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.osd_fill.max
          master_item:
            key: 'ceph.osd.stats["{$CEPH.CONNSTRING}","{$CEPH.USER}","{$CEPH.API.KEY}"]'
          tags:
            - tag: component
              value: cluster
            - tag: component
              value: osd
        - uuid: f6efbd37e8104272be131d686a700808
          name: 'Ceph OSD min fill'
          type: DEPENDENT
          key: ceph.osd_fill.min
          value_type: FLOAT
          units: '%'
          description: 'The percentage fill of the minimum filled OSD.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.osd_fill.min
          master_item:
            key: 'ceph.osd.stats["{$CEPH.CONNSTRING}","{$CEPH.USER}","{$CEPH.API.KEY}"]'
          tags:
            - tag: component
              value: cluster
            - tag: component
              value: osd
        - uuid: 532891a1d8934211a016524b136cfb1e
          name: 'Ceph full ratio'
          type: DEPENDENT
          key: ceph.osd_full_ratio
          value_type: FLOAT
          description: 'The full ratio setting of the Ceph cluster as configured on OSDMap.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.osd_full_ratio
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 10m
          master_item:
            key: 'ceph.osd.dump["{$CEPH.CONNSTRING}","{$CEPH.USER}","{$CEPH.API.KEY}"]'
          tags:
            - tag: component
              value: cluster
        - uuid: 074c0881384446ea90e99d355afe4f4f
          name: 'Ceph OSD Apply latency Avg'
          type: DEPENDENT
          key: ceph.osd_latency_apply.avg
          value_type: FLOAT
          units: ms
          description: 'The average apply latency of OSDs.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.osd_latency_apply.avg
          master_item:
            key: 'ceph.osd.stats["{$CEPH.CONNSTRING}","{$CEPH.USER}","{$CEPH.API.KEY}"]'
          tags:
            - tag: component
              value: cluster
            - tag: component
              value: osd
        - uuid: ef0a76f0c16147d1a280e00e66d3806f
          name: 'Ceph OSD Apply latency Max'
          type: DEPENDENT
          key: ceph.osd_latency_apply.max
          value_type: FLOAT
          units: ms
          description: 'The maximum apply latency of OSDs.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.osd_latency_apply.max
          master_item:
            key: 'ceph.osd.stats["{$CEPH.CONNSTRING}","{$CEPH.USER}","{$CEPH.API.KEY}"]'
          tags:
            - tag: component
              value: cluster
            - tag: component
              value: osd
        - uuid: d45ad876b0a04345be347af54211aa69
          name: 'Ceph OSD Apply latency Min'
          type: DEPENDENT
          key: ceph.osd_latency_apply.min
          value_type: FLOAT
          units: ms
          description: 'The minimum apply latency of OSDs.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.osd_latency_apply.min
          master_item:
            key: 'ceph.osd.stats["{$CEPH.CONNSTRING}","{$CEPH.USER}","{$CEPH.API.KEY}"]'
          tags:
            - tag: component
              value: cluster
            - tag: component
              value: osd
        - uuid: 52e1b146c36e4c2e82acf36f1c7d12eb
          name: 'Ceph OSD Commit latency Avg'
          type: DEPENDENT
          key: ceph.osd_latency_commit.avg
          value_type: FLOAT
          units: ms
          description: 'The average commit latency of OSDs.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.osd_latency_commit.avg
          master_item:
            key: 'ceph.osd.stats["{$CEPH.CONNSTRING}","{$CEPH.USER}","{$CEPH.API.KEY}"]'
          tags:
            - tag: component
              value: cluster
            - tag: component
              value: osd
        - uuid: 3027a1dbdd8e4f9bbef8927b92eb8e77
          name: 'Ceph OSD Commit latency Max'
          type: DEPENDENT
          key: ceph.osd_latency_commit.max
          value_type: FLOAT
          units: ms
          description: 'The maximum commit latency of OSDs.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.osd_latency_commit.max
          master_item:
            key: 'ceph.osd.stats["{$CEPH.CONNSTRING}","{$CEPH.USER}","{$CEPH.API.KEY}"]'
          tags:
            - tag: component
              value: cluster
            - tag: component
              value: osd
        - uuid: b9900b84c22843dab4ad335b9642e040
          name: 'Ceph OSD Commit latency Min'
          type: DEPENDENT
          key: ceph.osd_latency_commit.min
          value_type: FLOAT
          units: ms
          description: 'The minimum commit latency of OSDs.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.osd_latency_commit.min
          master_item:
            key: 'ceph.osd.stats["{$CEPH.CONNSTRING}","{$CEPH.USER}","{$CEPH.API.KEY}"]'
          tags:
            - tag: component
              value: cluster
            - tag: component
              value: osd
        - uuid: 477d94bd838d4273a556537de36bb1f6
          name: 'Ceph nearfull ratio'
          type: DEPENDENT
          key: ceph.osd_nearfull_ratio
          value_type: FLOAT
          description: 'The near full ratio setting of the Ceph cluster as configured on OSDMap.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.osd_nearfull_ratio
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 10m
          master_item:
            key: 'ceph.osd.dump["{$CEPH.CONNSTRING}","{$CEPH.USER}","{$CEPH.API.KEY}"]'
          tags:
            - tag: component
              value: cluster
        - uuid: 27ea5688271347bca429d91ace62d4e2
          name: 'Ceph OSD avg PGs'
          type: DEPENDENT
          key: ceph.osd_pgs.avg
          value_type: FLOAT
          description: 'The average amount of Placement Groups on OSDs.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.osd_pgs.avg
          master_item:
            key: 'ceph.osd.stats["{$CEPH.CONNSTRING}","{$CEPH.USER}","{$CEPH.API.KEY}"]'
          tags:
            - tag: component
              value: cluster
            - tag: component
              value: osd
            - tag: component
              value: placement-groups
        - uuid: 4174d7d3190e47ccb55b1e50da4cedc5
          name: 'Ceph OSD max PGs'
          type: DEPENDENT
          key: ceph.osd_pgs.max
          value_type: FLOAT
          description: 'The maximum amount of Placement Groups on OSDs.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.osd_pgs.max
          master_item:
            key: 'ceph.osd.stats["{$CEPH.CONNSTRING}","{$CEPH.USER}","{$CEPH.API.KEY}"]'
          tags:
            - tag: component
              value: cluster
            - tag: component
              value: osd
            - tag: component
              value: placement-groups
        - uuid: 47f56243cd1c430fae217d1a0cbc4a99
          name: 'Ceph OSD min PGs'
          type: DEPENDENT
          key: ceph.osd_pgs.min
          value_type: FLOAT
          description: 'The minimum amount of Placement Groups on OSDs.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.osd_pgs.min
          master_item:
            key: 'ceph.osd.stats["{$CEPH.CONNSTRING}","{$CEPH.USER}","{$CEPH.API.KEY}"]'
          tags:
            - tag: component
              value: cluster
            - tag: component
              value: osd
            - tag: component
              value: placement-groups
        - uuid: 4023ca309692470eab2651f69d49419a
          name: 'Overall cluster status'
          type: DEPENDENT
          key: ceph.overall_status
          description: 'The overall Ceph cluster status, eg 0 - HEALTH_OK, 1 - HEALTH_WARN or 2 - HEALTH_ERR.'
          valuemap:
            name: 'Ceph cluster status'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.overall_status
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 10m
          master_item:
            key: 'ceph.status["{$CEPH.CONNSTRING}","{$CEPH.USER}","{$CEPH.API.KEY}"]'
          tags:
            - tag: component
              value: health
          triggers:
            - uuid: 6ab06350bd8b426681f1b8bddde76a13
              expression: 'last(/Ceph by Zabbix agent 2/ceph.overall_status)=2'
              name: 'Ceph: Cluster in ERROR state'
              priority: AVERAGE
              manual_close: 'YES'
              tags:
                - tag: scope
                  value: availability
            - uuid: 8b6ba1a7ae014e80a5287ffd13b5d8aa
              expression: 'last(/Ceph by Zabbix agent 2/ceph.overall_status)=1'
              recovery_mode: RECOVERY_EXPRESSION
              recovery_expression: 'last(/Ceph by Zabbix agent 2/ceph.overall_status)=0'
              name: 'Ceph: Cluster in WARNING state'
              priority: WARNING
              manual_close: 'YES'
              dependencies:
                - name: 'Ceph: Cluster in ERROR state'
                  expression: 'last(/Ceph by Zabbix agent 2/ceph.overall_status)=2'
              tags:
                - tag: scope
                  value: availability
        - uuid: 9b073153d7474b0abfccb1844d0e6981
          name: 'Number of Placement Groups in Active state'
          type: DEPENDENT
          key: ceph.pg_states.active
          description: 'The total number of Placement Groups in an active state.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.pg_states.active
          master_item:
            key: 'ceph.status["{$CEPH.CONNSTRING}","{$CEPH.USER}","{$CEPH.API.KEY}"]'
          tags:
            - tag: component
              value: placement-groups
        - uuid: 1471a13aaadc48c7a265835abcb93a03
          name: 'Number of Placement Groups in Backfilling state'
          type: DEPENDENT
          key: ceph.pg_states.backfilling
          description: 'The total number of Placement Groups in a backfill state.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.pg_states.backfilling
          master_item:
            key: 'ceph.status["{$CEPH.CONNSTRING}","{$CEPH.USER}","{$CEPH.API.KEY}"]'
          tags:
            - tag: component
              value: placement-groups
        - uuid: 3b44c79e03d4402ba442331593dbdfa3
          name: 'Number of Placement Groups in backfill_toofull state'
          type: DEPENDENT
          key: ceph.pg_states.backfill_toofull
          description: 'The total number of Placement Groups in a *backfill_toofull state*.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.pg_states.backfill_toofull
          master_item:
            key: 'ceph.status["{$CEPH.CONNSTRING}","{$CEPH.USER}","{$CEPH.API.KEY}"]'
          tags:
            - tag: component
              value: placement-groups
        - uuid: ada3f638ee2e48eeb8889526898aed2f
          name: 'Number of Placement Groups in backfill_wait state'
          type: DEPENDENT
          key: ceph.pg_states.backfill_wait
          description: 'The total number of Placement Groups in a *backfill_wait* state.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.pg_states.backfill_wait
          master_item:
            key: 'ceph.status["{$CEPH.CONNSTRING}","{$CEPH.USER}","{$CEPH.API.KEY}"]'
          tags:
            - tag: component
              value: placement-groups
        - uuid: b1af2b88fe424723b97c9aa4eee12d83
          name: 'Number of Placement Groups in Clean state'
          type: DEPENDENT
          key: ceph.pg_states.clean
          description: 'The total number of Placement Groups in a clean state.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.pg_states.clean
          master_item:
            key: 'ceph.status["{$CEPH.CONNSTRING}","{$CEPH.USER}","{$CEPH.API.KEY}"]'
          tags:
            - tag: component
              value: placement-groups
        - uuid: f8acf8f66fbc401799d3515eb3e2ea43
          name: 'Number of Placement Groups in degraded state'
          type: DEPENDENT
          key: ceph.pg_states.degraded
          description: 'The total number of Placement Groups in a degraded state.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.pg_states.degraded
          master_item:
            key: 'ceph.status["{$CEPH.CONNSTRING}","{$CEPH.USER}","{$CEPH.API.KEY}"]'
          tags:
            - tag: component
              value: placement-groups
        - uuid: 79e056b9e3af40eabab0f927fb326491
          name: 'Number of Placement Groups in inconsistent state'
          type: DEPENDENT
          key: ceph.pg_states.inconsistent
          description: 'The total number of Placement Groups in an inconsistent state.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.pg_states.inconsistent
          master_item:
            key: 'ceph.status["{$CEPH.CONNSTRING}","{$CEPH.USER}","{$CEPH.API.KEY}"]'
          tags:
            - tag: component
              value: placement-groups
        - uuid: 9ddef3d2e7df43eda7d2835ceac19d32
          name: 'Number of Placement Groups in Peering state'
          type: DEPENDENT
          key: ceph.pg_states.peering
          description: 'The total number of Placement Groups in a peering state.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.pg_states.peering
          master_item:
            key: 'ceph.status["{$CEPH.CONNSTRING}","{$CEPH.USER}","{$CEPH.API.KEY}"]'
          tags:
            - tag: component
              value: placement-groups
        - uuid: 573461fc94e84f96b8ae6f6d89916424
          name: 'Number of Placement Groups in recovering state'
          type: DEPENDENT
          key: ceph.pg_states.recovering
          description: 'The total number of Placement Groups in a recovering state.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.pg_states.recovering
          master_item:
            key: 'ceph.status["{$CEPH.CONNSTRING}","{$CEPH.USER}","{$CEPH.API.KEY}"]'
          tags:
            - tag: component
              value: placement-groups
        - uuid: c150a9414fee40acaa65d532fd110c4e
          name: 'Number of Placement Groups in recovery_wait state'
          type: DEPENDENT
          key: ceph.pg_states.recovery_wait
          description: 'The total number of Placement Groups in a *recovery_wait* state.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.pg_states.recovery_wait
          master_item:
            key: 'ceph.status["{$CEPH.CONNSTRING}","{$CEPH.USER}","{$CEPH.API.KEY}"]'
          tags:
            - tag: component
              value: placement-groups
        - uuid: bac3270faf854267a466eaa6a4acad91
          name: 'Number of Placement Groups in remapped state'
          type: DEPENDENT
          key: ceph.pg_states.remapped
          description: 'The total number of Placement Groups in a remapped state.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.pg_states.remapped
          master_item:
            key: 'ceph.status["{$CEPH.CONNSTRING}","{$CEPH.USER}","{$CEPH.API.KEY}"]'
          tags:
            - tag: component
              value: placement-groups
        - uuid: 8a0117845436492d951e96b46eb67e1c
          name: 'Number of Placement Groups in Scrubbing state'
          type: DEPENDENT
          key: ceph.pg_states.scrubbing
          description: 'The total number of Placement Groups in a scrubbing state.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.pg_states.scrubbing
          master_item:
            key: 'ceph.status["{$CEPH.CONNSTRING}","{$CEPH.USER}","{$CEPH.API.KEY}"]'
          tags:
            - tag: component
              value: placement-groups
        - uuid: 4998e4542ed746f08f82ecf53b553c36
          name: 'Number of Placement Groups in Undersized state'
          type: DEPENDENT
          key: ceph.pg_states.undersized
          description: 'The total number of Placement Groups in an undersized state.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.pg_states.undersized
          master_item:
            key: 'ceph.status["{$CEPH.CONNSTRING}","{$CEPH.USER}","{$CEPH.API.KEY}"]'
          tags:
            - tag: component
              value: placement-groups
        - uuid: c922613c5ffb4f689c01f13143633ec3
          name: 'Number of Placement Groups in Unknown state'
          type: DEPENDENT
          key: ceph.pg_states.unknown
          description: 'The total number of Placement Groups in an unknown state.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.pg_states.unknown
          master_item:
            key: 'ceph.status["{$CEPH.CONNSTRING}","{$CEPH.USER}","{$CEPH.API.KEY}"]'
          tags:
            - tag: component
              value: placement-groups
        - uuid: 911e8a654ca44e7ca56b8010ac7381c8
          name: Ping
          key: 'ceph.ping["{$CEPH.CONNSTRING}","{$CEPH.USER}","{$CEPH.API.KEY}"]'
          valuemap:
            name: 'Service state'
          preprocessing:
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 30m
          tags:
            - tag: component
              value: application
            - tag: component
              value: health
          triggers:
            - uuid: 9ffc9a5c3d1c47d288c665c8be7d2fbb
              expression: 'last(/Ceph by Zabbix agent 2/ceph.ping["{$CEPH.CONNSTRING}","{$CEPH.USER}","{$CEPH.API.KEY}"])=0'
              name: 'Ceph: Can not connect to cluster'
              priority: AVERAGE
              description: 'The connection to the Ceph RESTful module is broken (if there is any error presented including *AUTH* and the configuration issues).'
              tags:
                - tag: scope
                  value: availability
        - uuid: 89d7df2ebfbc4aa88b4ff4de44dc4b8b
          name: 'Ceph Read bandwidth'
          type: DEPENDENT
          key: ceph.rd_bytes.rate
          value_type: FLOAT
          units: Bps
          description: 'The global read bytes per second.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.rd_bytes
            - type: CHANGE_PER_SECOND
          master_item:
            key: 'ceph.df.details["{$CEPH.CONNSTRING}","{$CEPH.USER}","{$CEPH.API.KEY}"]'
          tags:
            - tag: component
              value: cluster
            - tag: component
              value: disk
        - uuid: 8a35a37de63746498291993d4f3fc1cc
          name: 'Ceph Read operations per sec'
          type: DEPENDENT
          key: ceph.rd_ops.rate
          value_type: FLOAT
          units: ops
          description: 'The global read operations per second.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.rd_ops
            - type: CHANGE_PER_SECOND
          master_item:
            key: 'ceph.df.details["{$CEPH.CONNSTRING}","{$CEPH.USER}","{$CEPH.API.KEY}"]'
          tags:
            - tag: component
              value: cluster
            - tag: component
              value: disk
        - uuid: 8b43d105f9d64a3a94196f3f3bc7eac3
          name: 'Get overall cluster status'
          key: 'ceph.status["{$CEPH.CONNSTRING}","{$CEPH.USER}","{$CEPH.API.KEY}"]'
          history: '0'
          value_type: TEXT
          tags:
            - tag: component
              value: raw
        - uuid: 5e400c932acf4ad498e17daca0ad4943
          name: 'Total bytes available'
          type: DEPENDENT
          key: ceph.total_avail_bytes
          units: B
          description: 'The total bytes available in a Ceph cluster.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.total_avail_bytes
          master_item:
            key: 'ceph.df.details["{$CEPH.CONNSTRING}","{$CEPH.USER}","{$CEPH.API.KEY}"]'
          tags:
            - tag: component
              value: cluster
            - tag: component
              value: disk
        - uuid: c4b1a31efb5f47518cc5dd6082f3a42b
          name: 'Total bytes'
          type: DEPENDENT
          key: ceph.total_bytes
          units: B
          description: 'The total (RAW) capacity of a Ceph cluster in bytes.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.total_bytes
          master_item:
            key: 'ceph.df.details["{$CEPH.CONNSTRING}","{$CEPH.USER}","{$CEPH.API.KEY}"]'
          tags:
            - tag: component
              value: cluster
            - tag: component
              value: disk
        - uuid: d3910275462b43dba1fa8022a398ed1c
          name: 'Total number of objects'
          type: DEPENDENT
          key: ceph.total_objects
          description: 'The total number of objects in a Ceph cluster.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.total_objects
          master_item:
            key: 'ceph.df.details["{$CEPH.CONNSTRING}","{$CEPH.USER}","{$CEPH.API.KEY}"]'
          tags:
            - tag: component
              value: cluster
        - uuid: 6ad8e289eef349ab8ebfd4cc92a35c18
          name: 'Total bytes used'
          type: DEPENDENT
          key: ceph.total_used_bytes
          units: B
          description: 'The total bytes used in a Ceph cluster.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.total_used_bytes
          master_item:
            key: 'ceph.df.details["{$CEPH.CONNSTRING}","{$CEPH.USER}","{$CEPH.API.KEY}"]'
          tags:
            - tag: component
              value: cluster
            - tag: component
              value: disk
        - uuid: 51e100668e5344d29afd50dc9b9eabc9
          name: 'Ceph Write bandwidth'
          type: DEPENDENT
          key: ceph.wr_bytes.rate
          value_type: FLOAT
          units: Bps
          description: 'The global write bytes per second.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.wr_bytes
            - type: CHANGE_PER_SECOND
          master_item:
            key: 'ceph.df.details["{$CEPH.CONNSTRING}","{$CEPH.USER}","{$CEPH.API.KEY}"]'
          tags:
            - tag: component
              value: cluster
            - tag: component
              value: disk
        - uuid: 0a7203defa7147f7b975b404e6706b60
          name: 'Ceph Write operations per sec'
          type: DEPENDENT
          key: ceph.wr_ops.rate
          value_type: FLOAT
          units: ops
          description: 'The global write operations per second.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.wr_ops
            - type: CHANGE_PER_SECOND
          master_item:
            key: 'ceph.df.details["{$CEPH.CONNSTRING}","{$CEPH.USER}","{$CEPH.API.KEY}"]'
          tags:
            - tag: component
              value: cluster
            - tag: component
              value: disk
      discovery_rules:
        - uuid: 374557a43a824d938e9a8e656151e0c9
          name: OSD
          key: 'ceph.osd.discovery["{$CEPH.CONNSTRING}","{$CEPH.USER}","{$CEPH.API.KEY}"]'
          delay: 1h
          item_prototypes:
            - uuid: 4f7a72a5c4c14b9da63ddbae9e2ebf5f
              name: '[osd.{#OSDNAME}] OSD fill'
              type: DEPENDENT
              key: 'ceph.osd[{#OSDNAME},fill]'
              value_type: FLOAT
              units: '%'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.osds.{#OSDNAME}.osd_fill'
                  error_handler: DISCARD_VALUE
              master_item:
                key: 'ceph.osd.stats["{$CEPH.CONNSTRING}","{$CEPH.USER}","{$CEPH.API.KEY}"]'
              tags:
                - tag: class
                  value: '{#CLASS}'
                - tag: component
                  value: osd
                - tag: host
                  value: '{#HOST}'
                - tag: osd
                  value: '{#OSDNAME}'
            - uuid: fc2518ca8b9341d8befc6f9b1cbd4b79
              name: '[osd.{#OSDNAME}] OSD in'
              type: DEPENDENT
              key: 'ceph.osd[{#OSDNAME},in]'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.osds.{#OSDNAME}.in'
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 10m
              master_item:
                key: 'ceph.osd.dump["{$CEPH.CONNSTRING}","{$CEPH.USER}","{$CEPH.API.KEY}"]'
              tags:
                - tag: class
                  value: '{#CLASS}'
                - tag: component
                  value: osd
                - tag: host
                  value: '{#HOST}'
                - tag: osd
                  value: '{#OSDNAME}'
            - uuid: 2eb6a0d999d14906a4737ed32834ccc7
              name: '[osd.{#OSDNAME}] OSD latency apply'
              type: DEPENDENT
              key: 'ceph.osd[{#OSDNAME},latency_apply]'
              value_type: FLOAT
              units: ms
              description: 'The time taken to flush an update to disks.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.osds.{#OSDNAME}.osd_latency_apply'
                  error_handler: DISCARD_VALUE
              master_item:
                key: 'ceph.osd.stats["{$CEPH.CONNSTRING}","{$CEPH.USER}","{$CEPH.API.KEY}"]'
              tags:
                - tag: class
                  value: '{#CLASS}'
                - tag: component
                  value: osd
                - tag: host
                  value: '{#HOST}'
                - tag: osd
                  value: '{#OSDNAME}'
            - uuid: 14f392b369504f10b7e068522ac4a086
              name: '[osd.{#OSDNAME}] OSD latency commit'
              type: DEPENDENT
              key: 'ceph.osd[{#OSDNAME},latency_commit]'
              value_type: FLOAT
              units: ms
              description: 'The time taken to commit an operation to the journal.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.osds.{#OSDNAME}.osd_latency_commit'
                  error_handler: DISCARD_VALUE
              master_item:
                key: 'ceph.osd.stats["{$CEPH.CONNSTRING}","{$CEPH.USER}","{$CEPH.API.KEY}"]'
              tags:
                - tag: class
                  value: '{#CLASS}'
                - tag: component
                  value: osd
                - tag: host
                  value: '{#HOST}'
                - tag: osd
                  value: '{#OSDNAME}'
            - uuid: 63234342c0bd49e6b1f8737bf595851f
              name: '[osd.{#OSDNAME}] OSD PGs'
              type: DEPENDENT
              key: 'ceph.osd[{#OSDNAME},num_pgs]'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.osds.{#OSDNAME}.num_pgs'
                  error_handler: DISCARD_VALUE
              master_item:
                key: 'ceph.osd.stats["{$CEPH.CONNSTRING}","{$CEPH.USER}","{$CEPH.API.KEY}"]'
              tags:
                - tag: class
                  value: '{#CLASS}'
                - tag: component
                  value: osd
                - tag: host
                  value: '{#HOST}'
                - tag: osd
                  value: '{#OSDNAME}'
            - uuid: 12c20b2fbf10466bba7e1097c014e968
              name: '[osd.{#OSDNAME}] OSD up'
              type: DEPENDENT
              key: 'ceph.osd[{#OSDNAME},up]'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.osds.{#OSDNAME}.up'
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 10m
              master_item:
                key: 'ceph.osd.dump["{$CEPH.CONNSTRING}","{$CEPH.USER}","{$CEPH.API.KEY}"]'
              tags:
                - tag: class
                  value: '{#CLASS}'
                - tag: component
                  value: osd
                - tag: host
                  value: '{#HOST}'
                - tag: osd
                  value: '{#OSDNAME}'
              trigger_prototypes:
                - uuid: 21535bb935b44b3aa073542db3cc7827
                  expression: 'last(/Ceph by Zabbix agent 2/ceph.osd[{#OSDNAME},up]) = 0'
                  name: 'Ceph: OSD osd.{#OSDNAME} is down'
                  priority: AVERAGE
                  description: |
                    OSD osd.{#OSDNAME} is marked "down" in the *osdmap*.
                    The OSD daemon may have been stopped, or peer OSDs may be unable to reach the OSD over the network.
                  tags:
                    - tag: scope
                      value: availability
          trigger_prototypes:
            - uuid: cd04e8d542a04bdf89abad7ee4719e75
              expression: 'min(/Ceph by Zabbix agent 2/ceph.osd[{#OSDNAME},fill],15m) > last(/Ceph by Zabbix agent 2/ceph.osd_nearfull_ratio)*100'
              name: 'Ceph: Ceph OSD osd.{#OSDNAME} is near full'
              priority: WARNING
              dependencies:
                - name: 'Ceph: OSD osd.{#OSDNAME} is full'
                  expression: 'min(/Ceph by Zabbix agent 2/ceph.osd[{#OSDNAME},fill],15m) > last(/Ceph by Zabbix agent 2/ceph.osd_full_ratio)*100'
              tags:
                - tag: scope
                  value: capacity
            - uuid: 5d7a028166584c29b959914ce904a713
              expression: 'min(/Ceph by Zabbix agent 2/ceph.osd[{#OSDNAME},fill],15m) > last(/Ceph by Zabbix agent 2/ceph.osd_full_ratio)*100'
              name: 'Ceph: OSD osd.{#OSDNAME} is full'
              priority: AVERAGE
              tags:
                - tag: scope
                  value: capacity
          graph_prototypes:
            - uuid: c88d53bfa7b8456aa70b4d7a2cb63ef5
              name: 'Ceph: [osd.{#OSDNAME}] OSD latency'
              graph_items:
                - color: 199C0D
                  item:
                    host: 'Ceph by Zabbix agent 2'
                    key: 'ceph.osd[{#OSDNAME},latency_apply]'
                - sortorder: '1'
                  color: F63100
                  item:
                    host: 'Ceph by Zabbix agent 2'
                    key: 'ceph.osd[{#OSDNAME},latency_commit]'
        - uuid: fb6b4d27f46e4160ad978244aa845d0e
          name: Pool
          key: 'ceph.pool.discovery["{$CEPH.CONNSTRING}","{$CEPH.USER}","{$CEPH.API.KEY}"]'
          delay: 1h
          item_prototypes:
            - uuid: 1090dc09ce79458e9471863fcb973460
              name: '[{#POOLNAME}] Pool Used'
              type: DEPENDENT
              key: 'ceph.pool["{#POOLNAME}",bytes_used]'
              units: B
              description: 'The total bytes used in a pool.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.pools["{#POOLNAME}"].bytes_used'
              master_item:
                key: 'ceph.df.details["{$CEPH.CONNSTRING}","{$CEPH.USER}","{$CEPH.API.KEY}"]'
              tags:
                - tag: component
                  value: pools
                - tag: crushrule
                  value: '{#CRUSHRULE}'
                - tag: pool
                  value: '{#POOLNAME}'
            - uuid: 4e49ce8a11084dd287f89b076cc70535
              name: '[{#POOLNAME}] Max available'
              type: DEPENDENT
              key: 'ceph.pool["{#POOLNAME}",max_avail]'
              units: B
              description: 'The maximum available space in the given pool.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.pools["{#POOLNAME}"].max_avail'
              master_item:
                key: 'ceph.df.details["{$CEPH.CONNSTRING}","{$CEPH.USER}","{$CEPH.API.KEY}"]'
              tags:
                - tag: component
                  value: pools
                - tag: crushrule
                  value: '{#CRUSHRULE}'
                - tag: pool
                  value: '{#POOLNAME}'
            - uuid: 5c7bd85f9d944215acaced87b0eb216f
              name: '[{#POOLNAME}] Pool objects'
              type: DEPENDENT
              key: 'ceph.pool["{#POOLNAME}",objects]'
              description: 'The number of objects in the pool.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.pools["{#POOLNAME}"].objects'
              master_item:
                key: 'ceph.df.details["{$CEPH.CONNSTRING}","{$CEPH.USER}","{$CEPH.API.KEY}"]'
              tags:
                - tag: component
                  value: pools
                - tag: crushrule
                  value: '{#CRUSHRULE}'
                - tag: pool
                  value: '{#POOLNAME}'
            - uuid: eda166ae6c4c46cf8c01c2b928f07ec5
              name: '[{#POOLNAME}] Pool Percent Used'
              type: DEPENDENT
              key: 'ceph.pool["{#POOLNAME}",percent_used]'
              value_type: FLOAT
              units: '%'
              description: 'The percentage of the storage used per pool.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.pools["{#POOLNAME}"].percent_used'
              master_item:
                key: 'ceph.df.details["{$CEPH.CONNSTRING}","{$CEPH.USER}","{$CEPH.API.KEY}"]'
              tags:
                - tag: component
                  value: pools
                - tag: crushrule
                  value: '{#CRUSHRULE}'
                - tag: pool
                  value: '{#POOLNAME}'
            - uuid: 5311f1a539284c5483458e1820496be3
              name: '[{#POOLNAME}] Pool Read bandwidth'
              type: DEPENDENT
              key: 'ceph.pool["{#POOLNAME}",rd_bytes.rate]'
              value_type: FLOAT
              units: Bps
              description: 'The read rate per pool (bytes per second).'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.pools["{#POOLNAME}"].rd_bytes'
                - type: CHANGE_PER_SECOND
              master_item:
                key: 'ceph.df.details["{$CEPH.CONNSTRING}","{$CEPH.USER}","{$CEPH.API.KEY}"]'
              tags:
                - tag: component
                  value: pools
                - tag: crushrule
                  value: '{#CRUSHRULE}'
                - tag: pool
                  value: '{#POOLNAME}'
            - uuid: 76871b86d66d4307a83e813a8d9fc1b0
              name: '[{#POOLNAME}] Pool Read operations'
              type: DEPENDENT
              key: 'ceph.pool["{#POOLNAME}",rd_ops.rate]'
              value_type: FLOAT
              units: ops
              description: 'The read rate per pool (operations per second).'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.pools["{#POOLNAME}"].rd_ops'
                - type: CHANGE_PER_SECOND
              master_item:
                key: 'ceph.df.details["{$CEPH.CONNSTRING}","{$CEPH.USER}","{$CEPH.API.KEY}"]'
              tags:
                - tag: component
                  value: pools
                - tag: crushrule
                  value: '{#CRUSHRULE}'
                - tag: pool
                  value: '{#POOLNAME}'
            - uuid: 4c053bbaaf6946bcaf5288cc154d6fdd
              name: '[{#POOLNAME}] Pool RAW Used'
              type: DEPENDENT
              key: 'ceph.pool["{#POOLNAME}",stored_raw]'
              units: B
              description: 'Bytes used in pool including the copies made.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.pools["{#POOLNAME}"].stored_raw'
              master_item:
                key: 'ceph.df.details["{$CEPH.CONNSTRING}","{$CEPH.USER}","{$CEPH.API.KEY}"]'
              tags:
                - tag: component
                  value: pools
                - tag: crushrule
                  value: '{#CRUSHRULE}'
                - tag: pool
                  value: '{#POOLNAME}'
            - uuid: 955353da182243e29d326b3b2807286a
              name: '[{#POOLNAME}] Pool Write bandwidth'
              type: DEPENDENT
              key: 'ceph.pool["{#POOLNAME}",wr_bytes.rate]'
              value_type: FLOAT
              units: Bps
              description: 'The write rate per pool (bytes per second).'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.pools["{#POOLNAME}"].wr_bytes'
                - type: CHANGE_PER_SECOND
              master_item:
                key: 'ceph.df.details["{$CEPH.CONNSTRING}","{$CEPH.USER}","{$CEPH.API.KEY}"]'
              tags:
                - tag: component
                  value: pools
                - tag: crushrule
                  value: '{#CRUSHRULE}'
                - tag: pool
                  value: '{#POOLNAME}'
            - uuid: acb3081d772444dab060a055fb3f4304
              name: '[{#POOLNAME}] Pool Write operations'
              type: DEPENDENT
              key: 'ceph.pool["{#POOLNAME}",wr_ops.rate]'
              value_type: FLOAT
              units: ops
              description: 'The write rate per pool (operations per second).'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.pools["{#POOLNAME}"].wr_ops'
                - type: CHANGE_PER_SECOND
              master_item:
                key: 'ceph.df.details["{$CEPH.CONNSTRING}","{$CEPH.USER}","{$CEPH.API.KEY}"]'
              tags:
                - tag: component
                  value: pools
                - tag: crushrule
                  value: '{#CRUSHRULE}'
                - tag: pool
                  value: '{#POOLNAME}'
          graph_prototypes:
            - uuid: 1a469f2c99214b1ba7fe3a7520e43439
              name: 'Ceph: [{#POOLNAME}] Pool bandwidth'
              graph_items:
                - color: 199C0D
                  item:
                    host: 'Ceph by Zabbix agent 2'
                    key: 'ceph.pool["{#POOLNAME}",rd_bytes.rate]'
                - sortorder: '1'
                  color: F63100
                  item:
                    host: 'Ceph by Zabbix agent 2'
                    key: 'ceph.pool["{#POOLNAME}",wr_bytes.rate]'
            - uuid: 7870932ea335481db1c23224dfb33f60
              name: 'Ceph: [{#POOLNAME}] Pool I/O'
              graph_items:
                - color: 199C0D
                  item:
                    host: 'Ceph by Zabbix agent 2'
                    key: 'ceph.pool["{#POOLNAME}",rd_ops.rate]'
                - sortorder: '1'
                  color: F63100
                  item:
                    host: 'Ceph by Zabbix agent 2'
                    key: 'ceph.pool["{#POOLNAME}",wr_ops.rate]'
            - uuid: 3da48042fdaa4c01825c3eea7ab5af6b
              name: 'Ceph: [{#POOLNAME}] Pool Usage'
              graph_items:
                - color: 199C0D
                  item:
                    host: 'Ceph by Zabbix agent 2'
                    key: 'ceph.pool["{#POOLNAME}",bytes_used]'
                - sortorder: '1'
                  color: F63100
                  item:
                    host: 'Ceph by Zabbix agent 2'
                    key: 'ceph.pool["{#POOLNAME}",max_avail]'
                - sortorder: '2'
                  color: 00611C
                  item:
                    host: 'Ceph by Zabbix agent 2'
                    key: 'ceph.pool["{#POOLNAME}",stored_raw]'
      tags:
        - tag: class
          value: software
        - tag: target
          value: ceph
      macros:
        - macro: '{$CEPH.API.KEY}'
          value: zabbix_pass
          config:
            type: TEXT
            priority: '2'
            label: 'API key'
            required: 'YES'
        - macro: '{$CEPH.CONNSTRING}'
          value: 'https://localhost:8003'
          config:
            type: TEXT
            priority: '3'
            label: 'Connection string'
            required: 'YES'
        - macro: '{$CEPH.USER}'
          value: zabbix
          config:
            type: TEXT
            priority: '1'
            label: Username
            required: 'YES'
      valuemaps:
        - uuid: 2a4b2a8c55ba48b2a815e4123c9ea7fa
          name: 'Ceph cluster status'
          mappings:
            - value: '0'
              newvalue: HEALTH_OK
            - value: '1'
              newvalue: HEALTH_WARN
            - value: '2'
              newvalue: HEALTH_ERR
        - uuid: 22fe6d6c74454775994f07fc05d7bafd
          name: 'Service state'
          mappings:
            - value: '0'
              newvalue: Down
            - value: '1'
              newvalue: Up
    - uuid: 1bb42fbdb9054645a62ff81f14ba3b99
      template: 'Cisco IOS prior to 12.0_3_T by SNMP'
      name: 'Cisco IOS prior to 12.0_3_T by SNMP'
      description: |
        Cisco IOS Software releases prior to 12.0(3)T
        
        MIBs used:
        HOST-RESOURCES-MIB
        SNMPv2-MIB
        OLD-CISCO-CPU-MIB
        CISCO-ENVMON-MIB
        CISCO-MEMORY-POOL-MIB
        ENTITY-MIB
        
        Generated by official Zabbix template tool "Templator"
      wizard_ready: 'YES'
      vendor:
        name: Zabbix
        version: 8.0-2
      groups:
        - name: 'Templates/Network devices'
      items:
        - uuid: bf6d81068770410a929c127d8e7d76c1
          name: 'ICMP ping'
          type: SIMPLE
          key: icmpping
          description: |
            The host accessibility by ICMP ping.
            
            0 - ICMP ping fails;
            1 - ICMP ping successful.
          valuemap:
            name: 'Service state'
          tags:
            - tag: component
              value: health
            - tag: component
              value: network
          triggers:
            - uuid: fd317d3e8d3d45bf97322b8578f30c04
              expression: 'max(/Cisco IOS prior to 12.0_3_T by SNMP/icmpping,#3)=0'
              name: 'Cisco IOS: Unavailable by ICMP ping'
              priority: HIGH
              description: 'Last three attempts returned timeout. Please check device connectivity.'
              tags:
                - tag: scope
                  value: availability
        - uuid: 2af7b5f79fc44d7d992b0bf6277c12bb
          name: 'ICMP loss'
          type: SIMPLE
          key: icmppingloss
          value_type: FLOAT
          units: '%'
          description: 'The percentage of lost packets.'
          tags:
            - tag: component
              value: health
            - tag: component
              value: network
          triggers:
            - uuid: 3576c96601ef40abbeedbde11768141a
              expression: 'min(/Cisco IOS prior to 12.0_3_T by SNMP/icmppingloss,5m)>{$ICMP_LOSS_WARN} and min(/Cisco IOS prior to 12.0_3_T by SNMP/icmppingloss,5m)<100'
              name: 'Cisco IOS: High ICMP ping loss'
              opdata: 'Loss: {ITEM.LASTVALUE1}'
              priority: WARNING
              description: 'ICMP packets loss detected.'
              dependencies:
                - name: 'Cisco IOS: Unavailable by ICMP ping'
                  expression: 'max(/Cisco IOS prior to 12.0_3_T by SNMP/icmpping,#3)=0'
              tags:
                - tag: scope
                  value: availability
                - tag: scope
                  value: performance
        - uuid: 1afa1e8ca21c430598845806bbf0e7a2
          name: 'ICMP response time'
          type: SIMPLE
          key: icmppingsec
          value_type: FLOAT
          units: s
          description: 'The ICMP ping response time (in seconds).'
          tags:
            - tag: component
              value: health
            - tag: component
              value: network
          triggers:
            - uuid: 2941d30058b14d52bd9a723889c8be26
              expression: 'avg(/Cisco IOS prior to 12.0_3_T by SNMP/icmppingsec,5m)>{$ICMP_RESPONSE_TIME_WARN}'
              name: 'Cisco IOS: High ICMP ping response time'
              opdata: 'Value: {ITEM.LASTVALUE1}'
              priority: WARNING
              description: 'Average ICMP response time is too high.'
              dependencies:
                - name: 'Cisco IOS: High ICMP ping loss'
                  expression: 'min(/Cisco IOS prior to 12.0_3_T by SNMP/icmppingloss,5m)>{$ICMP_LOSS_WARN} and min(/Cisco IOS prior to 12.0_3_T by SNMP/icmppingloss,5m)<100'
                - name: 'Cisco IOS: Unavailable by ICMP ping'
                  expression: 'max(/Cisco IOS prior to 12.0_3_T by SNMP/icmpping,#3)=0'
              tags:
                - tag: scope
                  value: availability
                - tag: scope
                  value: performance
        - uuid: c5cabdb91f004235b481de453db637c6
          name: 'Cisco IOS: SNMP walk fans'
          type: SNMP_AGENT
          snmp_oid: 'walk[1.3.6.1.4.1.9.9.13.1.4.1.2,1.3.6.1.4.1.9.9.13.1.4.1.3]'
          key: sensor.fans.walk
          history: '0'
          value_type: TEXT
          description: 'Discovering system fans.'
          tags:
            - tag: component
              value: raw
        - uuid: cdb1b03725624ea18071a197b7e7f21e
          name: 'Cisco IOS: SNMP walk PSUs'
          type: SNMP_AGENT
          snmp_oid: 'walk[1.3.6.1.4.1.9.9.13.1.5.1.2,1.3.6.1.4.1.9.9.13.1.5.1.3]'
          key: sensor.psu.walk
          history: '0'
          value_type: TEXT
          description: 'The table of power supply status maintained by the environmental monitor card.'
          tags:
            - tag: component
              value: raw
        - uuid: 9620c1de761246e1806fda680ede7bba
          name: 'Cisco IOS: SNMP walk temperature sensors'
          type: SNMP_AGENT
          snmp_oid: 'walk[1.3.6.1.4.1.9.9.13.1.3.1.2,1.3.6.1.4.1.9.9.13.1.3.1.3,1.3.6.1.4.1.9.9.13.1.3.1.6]'
          key: sensor.temp.walk
          history: '0'
          value_type: TEXT
          description: 'Discovery of ciscoEnvMonTemperatureTable (ciscoEnvMonTemperatureDescr), a table of ambient temperature status maintained by the environmental monitor.'
          tags:
            - tag: component
              value: raw
        - uuid: 53eb0288c9e54490942cedd4ce5f376e
          name: 'SNMP traps (fallback)'
          type: SNMP_TRAP
          key: snmptrap.fallback
          value_type: LOG
          description: 'The item is used to collect all SNMP traps unmatched by other snmptrap items'
          logtimefmt: 'hh:mm:sszyyyy/MM/dd'
          tags:
            - tag: component
              value: network
        - uuid: bba5be8b3fa54bfbb354b7a2c20fd353
          name: 'System contact details'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.2.1.1.4.0]'
          key: 'system.contact[sysContact.0]'
          delay: 15m
          value_type: CHAR
          description: |
            MIB: SNMPv2-MIB
            The textual identification of the contact person for this managed node, together with information on how to contact this person. If no contact information is known, the value is the zero-length string.
          inventory_link: CONTACT
          preprocessing:
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 12h
          tags:
            - tag: component
              value: system
        - uuid: 693b0c779f574d869f47b44c4b3ecd58
          name: 'CPU utilization'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.9.2.1.58]'
          key: 'system.cpu.util[avgBusy5]'
          delay: 5m
          value_type: FLOAT
          units: '%'
          description: |
            MIB: OLD-CISCO-CPU-MIB
            5 minute exponentially-decayed moving average of the CPU busy percentage.
            Reference: http://www.cisco.com/c/en/us/support/docs/ip/simple-network-management-protocol-snmp/15215-collect-cpu-util-snmp.html
          tags:
            - tag: component
              value: cpu
          triggers:
            - uuid: 74773fc279864e7daf89cffe9cb2067c
              expression: 'min(/Cisco IOS prior to 12.0_3_T by SNMP/system.cpu.util[avgBusy5],5m)>{$CPU.UTIL.CRIT}'
              name: 'Cisco IOS: High CPU utilization'
              event_name: 'Cisco IOS: 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: 495b26e876a04819a02cf22eaba04e0b
          name: 'System description'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.2.1.1.1.0]'
          key: 'system.descr[sysDescr.0]'
          delay: 15m
          value_type: CHAR
          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: b5121a382d0245f0906bba4530a82ac4
          name: 'Hardware model name'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.2.1.47.1.1.1.1.13.1]'
          key: system.hw.model
          delay: 1h
          value_type: CHAR
          description: 'MIB: ENTITY-MIB'
          inventory_link: MODEL
          preprocessing:
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1d
          tags:
            - tag: component
              value: system
        - uuid: 5934a35b54464f66ab19152ca393b882
          name: 'Hardware serial number'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.2.1.47.1.1.1.1.11.1]'
          key: system.hw.serialnumber
          delay: 1h
          value_type: CHAR
          description: 'MIB: ENTITY-MIB'
          inventory_link: SERIALNO_A
          preprocessing:
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1d
          tags:
            - tag: component
              value: system
          triggers:
            - uuid: d53c0d22a67544cf8a2fcd2c8de4d4eb
              expression: 'last(/Cisco IOS prior to 12.0_3_T by SNMP/system.hw.serialnumber,#1)<>last(/Cisco IOS prior to 12.0_3_T by SNMP/system.hw.serialnumber,#2) and length(last(/Cisco IOS prior to 12.0_3_T by SNMP/system.hw.serialnumber))>0'
              name: 'Cisco IOS: Device has been replaced'
              event_name: 'Cisco IOS: 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
        - uuid: 3b92777596e2442991618e5feb47567c
          name: 'Cisco IOS: SNMP walk entity serial numbers'
          type: SNMP_AGENT
          snmp_oid: 'walk[1.3.6.1.2.1.47.1.1.1.1.5,1.3.6.1.2.1.47.1.1.1.1.7,1.3.6.1.2.1.47.1.1.1.1.11]'
          key: system.hw.serialnumber.walk
          history: '0'
          value_type: TEXT
          description: |
            MIB: ENTITY-MIB
            Entity Serial Numbers Discovery.
          tags:
            - tag: component
              value: raw
        - uuid: 732ccfd809b44d7fa923c54e6577851d
          name: 'Uptime (hardware)'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.2.1.25.1.1.0]'
          key: 'system.hw.uptime[hrSystemUptime.0]'
          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: 30df666e80bd4875ac761306781061da
          name: 'System location'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.2.1.1.6.0]'
          key: 'system.location[sysLocation.0]'
          delay: 15m
          value_type: CHAR
          description: |
            MIB: SNMPv2-MIB
            Physical location of the node (e.g., `equipment room`, `3rd floor`). If not provided, the value is a zero-length string.
          inventory_link: LOCATION
          preprocessing:
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 12h
          tags:
            - tag: component
              value: system
        - uuid: 2e55e75a7baa4195b012e750bac90dcb
          name: 'System name'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.2.1.1.5.0]'
          key: system.name
          delay: 15m
          value_type: CHAR
          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.
          inventory_link: NAME
          preprocessing:
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 12h
          tags:
            - tag: component
              value: system
          triggers:
            - uuid: 33b42b1aa448408fa3fb5aadf7375cf8
              expression: 'last(/Cisco IOS prior to 12.0_3_T by SNMP/system.name,#1)<>last(/Cisco IOS prior to 12.0_3_T by SNMP/system.name,#2) and length(last(/Cisco IOS prior to 12.0_3_T by SNMP/system.name))>0'
              name: 'Cisco IOS: System name has changed'
              event_name: 'Cisco IOS: System name has changed (new name: {ITEM.VALUE})'
              priority: INFO
              description: 'The name of the system has changed. Acknowledge to close the problem manually.'
              manual_close: 'YES'
              tags:
                - tag: scope
                  value: notice
                - tag: scope
                  value: security
        - uuid: 7ecd28b73c0f43a98c3a58467b1cbdc7
          name: 'Uptime (network)'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.2.1.1.3.0]'
          key: 'system.net.uptime[sysUpTime.0]'
          delay: 30s
          trends: '0'
          units: uptime
          description: |
            MIB: SNMPv2-MIB
            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: cc6e5a6e4f604b639815d9397264c6af
          name: 'System object ID'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.2.1.1.2.0]'
          key: 'system.objectid[sysObjectID.0]'
          delay: 15m
          value_type: CHAR
          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: 70ef7ce7561640b7bc6b5d30235c0ecc
          name: 'Operating system'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.2.1.1.1.0]'
          key: 'system.sw.os[sysDescr.0]'
          delay: 1h
          value_type: CHAR
          description: 'MIB: SNMPv2-MIB'
          inventory_link: OS
          preprocessing:
            - type: REGEX
              parameters:
                - 'Version (.+), RELEASE'
                - \1
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1d
          tags:
            - tag: component
              value: os
          triggers:
            - uuid: abe57415ff574b878a2ce2a318be86ee
              expression: 'last(/Cisco IOS prior to 12.0_3_T by SNMP/system.sw.os[sysDescr.0],#1)<>last(/Cisco IOS prior to 12.0_3_T by SNMP/system.sw.os[sysDescr.0],#2) and length(last(/Cisco IOS prior to 12.0_3_T by SNMP/system.sw.os[sysDescr.0]))>0'
              name: 'Cisco IOS: Operating system description has changed'
              priority: INFO
              description: 'The description of the operating system has changed. Possible reasons are that the system has been updated or replaced. Acknowledge to close the problem manually.'
              manual_close: 'YES'
              dependencies:
                - name: 'Cisco IOS: System name has changed'
                  expression: 'last(/Cisco IOS prior to 12.0_3_T by SNMP/system.name,#1)<>last(/Cisco IOS prior to 12.0_3_T by SNMP/system.name,#2) and length(last(/Cisco IOS prior to 12.0_3_T by SNMP/system.name))>0'
              tags:
                - tag: scope
                  value: notice
        - uuid: 011212452fb0421aa913ceee4f59d17b
          name: 'Cisco IOS: SNMP walk memory'
          type: SNMP_AGENT
          snmp_oid: 'walk[1.3.6.1.4.1.9.9.48.1.1.1.2,1.3.6.1.4.1.9.9.48.1.1.1.5,1.3.6.1.4.1.9.9.48.1.1.1.6]'
          key: vm.memory.walk
          history: '0'
          value_type: TEXT
          description: |
            MIB: CISCO-MEMORY-POOL-MIB
            Discovery of ciscoMemoryPoolTable, a table of memory pool monitoring entries.
            http://www.cisco.com/c/en/us/support/docs/ip/simple-network-management-protocol-snmp/15216-contiguous-memory.html.
          tags:
            - tag: component
              value: raw
        - uuid: 5a156e9ca10c49bbb87cf3de1b686cff
          name: 'SNMP agent availability'
          type: INTERNAL
          key: 'zabbix[host,snmp,available]'
          description: |
            Availability of SNMP checks on the host. The value of this item corresponds to availability icons in the host list.
            Possible values:
            0 - not available
            1 - available
            2 - unknown
          valuemap:
            name: zabbix.host.available
          tags:
            - tag: component
              value: health
            - tag: component
              value: network
          triggers:
            - uuid: 86d8603903504287b07a25530c8eda2b
              expression: 'max(/Cisco IOS prior to 12.0_3_T by SNMP/zabbix[host,snmp,available],{$SNMP.TIMEOUT})=0'
              name: 'Cisco IOS: 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.'
              dependencies:
                - name: 'Cisco IOS: Unavailable by ICMP ping'
                  expression: 'max(/Cisco IOS prior to 12.0_3_T by SNMP/icmpping,#3)=0'
              tags:
                - tag: scope
                  value: availability
      discovery_rules:
        - uuid: fbeef9c16d9d45b7a5c50f530a697f76
          name: 'Entity Serial Numbers Discovery'
          type: DEPENDENT
          key: entity_sn.discovery
          filter:
            evaltype: AND
            conditions:
              - macro: '{#ENT_CLASS}'
                value: ^3$
              - macro: '{#ENT_SN}'
                value: .+
          item_prototypes:
            - uuid: 1993495d289d407e85c24f4986819ab8
              name: '{#ENT_NAME}: Hardware serial number'
              type: DEPENDENT
              key: 'system.hw.serialnumber[entPhysicalSerialNum.{#SNMPINDEX}]'
              value_type: CHAR
              description: 'MIB: ENTITY-MIB'
              preprocessing:
                - type: SNMP_WALK_VALUE
                  parameters:
                    - '1.3.6.1.2.1.47.1.1.1.1.11.{#SNMPINDEX}'
                    - '0'
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1d
              master_item:
                key: system.hw.serialnumber.walk
              tags:
                - tag: component
                  value: system
              trigger_prototypes:
                - uuid: e8c328ad70a146219a8ae62f101cfc00
                  expression: 'last(/Cisco IOS prior to 12.0_3_T by SNMP/system.hw.serialnumber[entPhysicalSerialNum.{#SNMPINDEX}],#1)<>last(/Cisco IOS prior to 12.0_3_T by SNMP/system.hw.serialnumber[entPhysicalSerialNum.{#SNMPINDEX}],#2) and length(last(/Cisco IOS prior to 12.0_3_T by SNMP/system.hw.serialnumber[entPhysicalSerialNum.{#SNMPINDEX}]))>0'
                  name: 'Cisco IOS: {#ENT_NAME}: Device has been replaced'
                  event_name: 'Cisco IOS: {#ENT_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
          master_item:
            key: system.hw.serialnumber.walk
          preprocessing:
            - type: SNMP_WALK_TO_JSON
              parameters:
                - '{#ENT_CLASS}'
                - 1.3.6.1.2.1.47.1.1.1.1.5
                - '0'
                - '{#ENT_NAME}'
                - 1.3.6.1.2.1.47.1.1.1.1.7
                - '0'
                - '{#ENT_SN}'
                - 1.3.6.1.2.1.47.1.1.1.1.11
                - '0'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
        - uuid: 109cd000cd044e4096bf98dbf57b72d1
          name: 'FAN Discovery'
          type: DEPENDENT
          key: fan.discovery
          description: 'The table of fan status maintained by the environmental monitor.'
          item_prototypes:
            - uuid: 7008cccccf2647918bce95bb0a6193df
              name: '{#SENSOR_INFO}: Fan status'
              type: DEPENDENT
              key: 'sensor.fan.status[ciscoEnvMonFanState.{#SNMPINDEX}]'
              trends: '0'
              description: 'MIB: CISCO-ENVMON-MIB'
              valuemap:
                name: 'CISCO-ENVMON-MIB::CiscoEnvMonState'
              preprocessing:
                - type: SNMP_WALK_VALUE
                  parameters:
                    - '1.3.6.1.4.1.9.9.13.1.4.1.3.{#SNMPINDEX}'
                    - '0'
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3m
              master_item:
                key: sensor.fans.walk
              tags:
                - tag: component
                  value: fan
              trigger_prototypes:
                - uuid: ddd7015dd3204514beea29edc45c3cd4
                  expression: 'count(/Cisco IOS prior to 12.0_3_T by SNMP/sensor.fan.status[ciscoEnvMonFanState.{#SNMPINDEX}],#1,"eq","{$FAN_CRIT_STATUS:\"critical\"}")=1 or count(/Cisco IOS prior to 12.0_3_T by SNMP/sensor.fan.status[ciscoEnvMonFanState.{#SNMPINDEX}],#1,"eq","{$FAN_CRIT_STATUS:\"shutdown\"}")=1'
                  name: 'Cisco IOS: {#SENSOR_INFO}: Fan is in critical state'
                  opdata: 'Current state: {ITEM.LASTVALUE1}'
                  priority: AVERAGE
                  description: 'Please check the fan unit'
                  tags:
                    - tag: scope
                      value: availability
                    - tag: scope
                      value: performance
                - uuid: 4eb7ea3405d74740a12095a07d91d48f
                  expression: 'count(/Cisco IOS prior to 12.0_3_T by SNMP/sensor.fan.status[ciscoEnvMonFanState.{#SNMPINDEX}],#1,"eq","{$FAN_WARN_STATUS:\"warning\"}")=1 or count(/Cisco IOS prior to 12.0_3_T by SNMP/sensor.fan.status[ciscoEnvMonFanState.{#SNMPINDEX}],#1,"eq","{$FAN_WARN_STATUS:\"notFunctioning\"}")=1'
                  name: 'Cisco IOS: {#SENSOR_INFO}: Fan is in warning state'
                  opdata: 'Current state: {ITEM.LASTVALUE1}'
                  priority: WARNING
                  description: 'Please check the fan unit'
                  dependencies:
                    - name: 'Cisco IOS: {#SENSOR_INFO}: Fan is in critical state'
                      expression: 'count(/Cisco IOS prior to 12.0_3_T by SNMP/sensor.fan.status[ciscoEnvMonFanState.{#SNMPINDEX}],#1,"eq","{$FAN_CRIT_STATUS:\"critical\"}")=1 or count(/Cisco IOS prior to 12.0_3_T by SNMP/sensor.fan.status[ciscoEnvMonFanState.{#SNMPINDEX}],#1,"eq","{$FAN_CRIT_STATUS:\"shutdown\"}")=1'
                  tags:
                    - tag: scope
                      value: availability
                    - tag: scope
                      value: performance
          master_item:
            key: sensor.fans.walk
          preprocessing:
            - type: SNMP_WALK_TO_JSON
              parameters:
                - '{#SENSOR_INFO}'
                - 1.3.6.1.4.1.9.9.13.1.4.1.2
                - '0'
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
        - uuid: 727adcf658d141ff9e45744107a58c38
          name: 'Memory Discovery'
          type: DEPENDENT
          key: memory.discovery
          description: |
            Discovery of ciscoMemoryPoolTable, a table of memory pool monitoring entries.
            http://www.cisco.com/c/en/us/support/docs/ip/simple-network-management-protocol-snmp/15216-contiguous-memory.html
          item_prototypes:
            - uuid: e0df9d6e31384da4af18ab191e467814
              name: '{#SNMPVALUE}: Free memory'
              type: DEPENDENT
              key: 'vm.memory.free[ciscoMemoryPoolFree.{#SNMPINDEX}]'
              units: B
              description: |
                MIB: CISCO-MEMORY-POOL-MIB
                Indicates the number of bytes from the memory pool that are currently unused on the managed device. Note that the sum of ciscoMemoryPoolUsed and ciscoMemoryPoolFree is the total amount of memory in the pool
                Reference: http://www.cisco.com/c/en/us/support/docs/ip/simple-network-management-protocol-snmp/15216-contiguous-memory.html
              preprocessing:
                - type: SNMP_WALK_VALUE
                  parameters:
                    - '1.3.6.1.4.1.9.9.48.1.1.1.6.{#SNMPINDEX}'
                    - '0'
              master_item:
                key: vm.memory.walk
              tags:
                - tag: component
                  value: memory
            - uuid: 25471f4acc4348bf978792fcfaff6acc
              name: '{#SNMPVALUE}: Used memory'
              type: DEPENDENT
              key: 'vm.memory.used[ciscoMemoryPoolUsed.{#SNMPINDEX}]'
              units: B
              description: |
                MIB: CISCO-MEMORY-POOL-MIB
                Indicates the number of bytes from the memory pool that are currently in use by applications on the managed device.
                Reference: http://www.cisco.com/c/en/us/support/docs/ip/simple-network-management-protocol-snmp/15216-contiguous-memory.html
              preprocessing:
                - type: SNMP_WALK_VALUE
                  parameters:
                    - '1.3.6.1.4.1.9.9.48.1.1.1.5.{#SNMPINDEX}'
                    - '0'
              master_item:
                key: vm.memory.walk
              tags:
                - tag: component
                  value: memory
            - uuid: 9a03c1b1c6ae42e5ab1886c172b2e3ac
              name: '{#SNMPVALUE}: Memory utilization'
              type: CALCULATED
              key: 'vm.memory.util[vm.memory.util.{#SNMPINDEX}]'
              value_type: FLOAT
              units: '%'
              params: 'last(//vm.memory.used[ciscoMemoryPoolUsed.{#SNMPINDEX}])/(last(//vm.memory.free[ciscoMemoryPoolFree.{#SNMPINDEX}])+last(//vm.memory.used[ciscoMemoryPoolUsed.{#SNMPINDEX}]))*100'
              description: 'Memory utilization in %.'
              tags:
                - tag: component
                  value: memory
              trigger_prototypes:
                - uuid: 8793ba7767cc415a80a6a206aaf01f11
                  expression: 'min(/Cisco IOS prior to 12.0_3_T by SNMP/vm.memory.util[vm.memory.util.{#SNMPINDEX}],5m)>{$MEMORY.UTIL.MAX}'
                  name: 'Cisco IOS: {#SNMPVALUE}: High memory utilization'
                  event_name: 'Cisco IOS: {#SNMPVALUE}: High memory utilization (>{$MEMORY.UTIL.MAX}% for 5m)'
                  priority: AVERAGE
                  description: 'The system is running out of free memory.'
                  tags:
                    - tag: scope
                      value: capacity
                    - tag: scope
                      value: performance
          graph_prototypes:
            - uuid: dd0520d162fe4230900d33472944677f
              name: '{#SNMPVALUE}: Memory utilization'
              ymin_type_1: FIXED
              ymax_type_1: FIXED
              graph_items:
                - drawtype: GRADIENT_LINE
                  color: 199C0D
                  item:
                    host: 'Cisco IOS prior to 12.0_3_T by SNMP'
                    key: 'vm.memory.util[vm.memory.util.{#SNMPINDEX}]'
          master_item:
            key: vm.memory.walk
          preprocessing:
            - type: SNMP_WALK_TO_JSON
              parameters:
                - '{#SNMPVALUE}'
                - 1.3.6.1.4.1.9.9.48.1.1.1.2
                - '0'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
        - uuid: 5e67e9c84ac54dea866893207a42d3e3
          name: 'PSU Discovery'
          type: DEPENDENT
          key: psu.discovery
          description: 'The table of power supply status maintained by the environmental monitor card.'
          item_prototypes:
            - uuid: d05d99a68e3540d09d64b8bab5d63004
              name: '{#SENSOR_INFO}: Power supply status'
              type: DEPENDENT
              key: 'sensor.psu.status[ciscoEnvMonSupplyState.{#SNMPINDEX}]'
              trends: '0'
              description: 'MIB: CISCO-ENVMON-MIB'
              valuemap:
                name: 'CISCO-ENVMON-MIB::CiscoEnvMonState'
              preprocessing:
                - type: SNMP_WALK_VALUE
                  parameters:
                    - '1.3.6.1.4.1.9.9.13.1.5.1.3.{#SNMPINDEX}'
                    - '0'
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3m
              master_item:
                key: sensor.psu.walk
              tags:
                - tag: component
                  value: power
              trigger_prototypes:
                - uuid: fc4b6f155d3646c3bb8b27d35c18604b
                  expression: 'count(/Cisco IOS prior to 12.0_3_T by SNMP/sensor.psu.status[ciscoEnvMonSupplyState.{#SNMPINDEX}],#1,"eq","{$PSU_CRIT_STATUS:\"critical\"}")=1 or count(/Cisco IOS prior to 12.0_3_T by SNMP/sensor.psu.status[ciscoEnvMonSupplyState.{#SNMPINDEX}],#1,"eq","{$PSU_CRIT_STATUS:\"shutdown\"}")=1'
                  name: 'Cisco IOS: {#SENSOR_INFO}: Power supply is in critical state'
                  opdata: 'Current state: {ITEM.LASTVALUE1}'
                  priority: AVERAGE
                  description: 'Please check the power supply unit for errors'
                  tags:
                    - tag: scope
                      value: availability
                    - tag: scope
                      value: performance
                - uuid: 58e9514d75f84c989b052cfd76ceed4a
                  expression: 'count(/Cisco IOS prior to 12.0_3_T by SNMP/sensor.psu.status[ciscoEnvMonSupplyState.{#SNMPINDEX}],#1,"eq","{$PSU_WARN_STATUS:\"warning\"}")=1 or count(/Cisco IOS prior to 12.0_3_T by SNMP/sensor.psu.status[ciscoEnvMonSupplyState.{#SNMPINDEX}],#1,"eq","{$PSU_WARN_STATUS:\"notFunctioning\"}")=1'
                  name: 'Cisco IOS: {#SENSOR_INFO}: Power supply is in warning state'
                  opdata: 'Current state: {ITEM.LASTVALUE1}'
                  priority: WARNING
                  description: 'Please check the power supply unit for errors'
                  dependencies:
                    - name: 'Cisco IOS: {#SENSOR_INFO}: Power supply is in critical state'
                      expression: 'count(/Cisco IOS prior to 12.0_3_T by SNMP/sensor.psu.status[ciscoEnvMonSupplyState.{#SNMPINDEX}],#1,"eq","{$PSU_CRIT_STATUS:\"critical\"}")=1 or count(/Cisco IOS prior to 12.0_3_T by SNMP/sensor.psu.status[ciscoEnvMonSupplyState.{#SNMPINDEX}],#1,"eq","{$PSU_CRIT_STATUS:\"shutdown\"}")=1'
                  tags:
                    - tag: scope
                      value: availability
                    - tag: scope
                      value: performance
          master_item:
            key: sensor.psu.walk
          preprocessing:
            - type: SNMP_WALK_TO_JSON
              parameters:
                - '{#SENSOR_INFO}'
                - 1.3.6.1.4.1.9.9.13.1.5.1.2
                - '0'
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
        - uuid: 73d10f48886443248f7d2d9167fcfee5
          name: 'Temperature Discovery'
          type: DEPENDENT
          key: temperature.discovery
          description: |
            Discovery of ciscoEnvMonTemperatureTable (ciscoEnvMonTemperatureDescr), a table of ambient temperature status
            maintained by the environmental monitor.
          item_prototypes:
            - uuid: a12075ae5b834eeeb742fed6f7afc39d
              name: '{#SNMPVALUE}: Temperature status'
              type: DEPENDENT
              key: 'sensor.temp.status[ciscoEnvMonTemperatureState.{#SNMPINDEX}]'
              trends: '0'
              description: |
                MIB: CISCO-ENVMON-MIB
                The current state of the test point being instrumented.
              valuemap:
                name: 'CISCO-ENVMON-MIB::CiscoEnvMonState'
              preprocessing:
                - type: SNMP_WALK_VALUE
                  parameters:
                    - '1.3.6.1.4.1.9.9.13.1.3.1.6.{#SNMPINDEX}'
                    - '0'
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3m
              master_item:
                key: sensor.temp.walk
              tags:
                - tag: component
                  value: temperature
            - uuid: ea0d56dd49104257ba6c14ce3bdb753a
              name: '{#SNMPVALUE}: Temperature'
              type: DEPENDENT
              key: 'sensor.temp.value[ciscoEnvMonTemperatureValue.{#SNMPINDEX}]'
              value_type: FLOAT
              units: °C
              description: |
                MIB: CISCO-ENVMON-MIB
                The current measurement of the test point being instrumented.
              preprocessing:
                - type: SNMP_WALK_VALUE
                  parameters:
                    - '1.3.6.1.4.1.9.9.13.1.3.1.3.{#SNMPINDEX}'
                    - '0'
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3m
              master_item:
                key: sensor.temp.walk
              tags:
                - tag: component
                  value: temperature
              trigger_prototypes:
                - uuid: 716dee103c9f4e9da5f83d6cc338617d
                  expression: 'avg(/Cisco IOS prior to 12.0_3_T by SNMP/sensor.temp.value[ciscoEnvMonTemperatureValue.{#SNMPINDEX}],5m)<{$TEMP_CRIT_LOW:"{#SNMPVALUE}"}'
                  recovery_mode: RECOVERY_EXPRESSION
                  recovery_expression: 'min(/Cisco IOS prior to 12.0_3_T by SNMP/sensor.temp.value[ciscoEnvMonTemperatureValue.{#SNMPINDEX}],5m)>{$TEMP_CRIT_LOW:"{#SNMPVALUE}"}+3'
                  name: 'Cisco IOS: {#SNMPVALUE}: Temperature is too low'
                  event_name: 'Cisco IOS: {#SNMPVALUE}: Temperature is too low: <{$TEMP_CRIT_LOW:"{#SNMPVALUE}"}'
                  opdata: 'Current value: {ITEM.LASTVALUE1}'
                  priority: AVERAGE
                  tags:
                    - tag: scope
                      value: availability
                    - tag: scope
                      value: performance
          trigger_prototypes:
            - uuid: 82fa9473dc7d49d4a3a230ef6238cd2c
              expression: |
                avg(/Cisco IOS prior to 12.0_3_T by SNMP/sensor.temp.value[ciscoEnvMonTemperatureValue.{#SNMPINDEX}],5m)>{$TEMP_CRIT:"{#SNMPVALUE}"}
                or
                last(/Cisco IOS prior to 12.0_3_T by SNMP/sensor.temp.status[ciscoEnvMonTemperatureState.{#SNMPINDEX}])={$TEMP_CRIT_STATUS}
                or
                last(/Cisco IOS prior to 12.0_3_T by SNMP/sensor.temp.status[ciscoEnvMonTemperatureState.{#SNMPINDEX}])={$TEMP_DISASTER_STATUS}
              recovery_mode: RECOVERY_EXPRESSION
              recovery_expression: 'max(/Cisco IOS prior to 12.0_3_T by SNMP/sensor.temp.value[ciscoEnvMonTemperatureValue.{#SNMPINDEX}],5m)<{$TEMP_CRIT:"{#SNMPVALUE}"}-3'
              name: 'Cisco IOS: {#SNMPVALUE}: Temperature is above critical threshold'
              event_name: 'Cisco IOS: {#SNMPVALUE}: Temperature is above critical threshold: >{$TEMP_CRIT:"{#SNMPVALUE}"}'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: HIGH
              description: 'This trigger uses temperature sensor values as well as temperature sensor status if available'
              tags:
                - tag: scope
                  value: availability
                - tag: scope
                  value: performance
            - uuid: a0199088767f43c0990f5ac8793267b1
              expression: |
                avg(/Cisco IOS prior to 12.0_3_T by SNMP/sensor.temp.value[ciscoEnvMonTemperatureValue.{#SNMPINDEX}],5m)>{$TEMP_WARN:"{#SNMPVALUE}"}
                or
                last(/Cisco IOS prior to 12.0_3_T by SNMP/sensor.temp.status[ciscoEnvMonTemperatureState.{#SNMPINDEX}])={$TEMP_WARN_STATUS}
              recovery_mode: RECOVERY_EXPRESSION
              recovery_expression: 'max(/Cisco IOS prior to 12.0_3_T by SNMP/sensor.temp.value[ciscoEnvMonTemperatureValue.{#SNMPINDEX}],5m)<{$TEMP_WARN:"{#SNMPVALUE}"}-3'
              name: 'Cisco IOS: {#SNMPVALUE}: Temperature is above warning threshold'
              event_name: 'Cisco IOS: {#SNMPVALUE}: Temperature is above warning threshold: >{$TEMP_WARN:"{#SNMPVALUE}"}'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: WARNING
              description: 'This trigger uses temperature sensor values as well as temperature sensor status if available'
              dependencies:
                - name: 'Cisco IOS: {#SNMPVALUE}: Temperature is above critical threshold'
                  expression: |
                    avg(/Cisco IOS prior to 12.0_3_T by SNMP/sensor.temp.value[ciscoEnvMonTemperatureValue.{#SNMPINDEX}],5m)>{$TEMP_CRIT:"{#SNMPVALUE}"}
                    or
                    last(/Cisco IOS prior to 12.0_3_T by SNMP/sensor.temp.status[ciscoEnvMonTemperatureState.{#SNMPINDEX}])={$TEMP_CRIT_STATUS}
                    or
                    last(/Cisco IOS prior to 12.0_3_T by SNMP/sensor.temp.status[ciscoEnvMonTemperatureState.{#SNMPINDEX}])={$TEMP_DISASTER_STATUS}
                  recovery_expression: 'max(/Cisco IOS prior to 12.0_3_T by SNMP/sensor.temp.value[ciscoEnvMonTemperatureValue.{#SNMPINDEX}],5m)<{$TEMP_CRIT:"{#SNMPVALUE}"}-3'
              tags:
                - tag: scope
                  value: availability
                - tag: scope
                  value: performance
          master_item:
            key: sensor.temp.walk
          preprocessing:
            - type: SNMP_WALK_TO_JSON
              parameters:
                - '{#SNMPVALUE}'
                - 1.3.6.1.4.1.9.9.13.1.3.1.2
                - '0'
              error_handler: DISCARD_VALUE
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
      tags:
        - tag: class
          value: network
        - tag: target
          value: cisco
        - tag: target
          value: cisco-prior
        - tag: target
          value: cisco-prior-12.0-3-t
      macros:
        - macro: '{$CPU.UTIL.CRIT}'
          value: '90'
          config:
            type: TEXT
            priority: '2'
            section_name: Thresholds
            label: 'Threshold for CPU utilization (critical)'
            description: 'In the range from 0 to 100 inclusive.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$FAN_CRIT_STATUS:"critical"}'
          value: '3'
          description: 'Value indicating the FAN status for the critical condition.'
          config:
            type: TEXT
            priority: '16'
            section_name: Other
            label: 'Value of FAN status for state of `critical`'
            description: 'Value indicating the FAN status for the critical condition.'
        - macro: '{$FAN_CRIT_STATUS:"shutdown"}'
          value: '4'
          description: 'Value indicating the FAN status for the shutdown condition.'
          config:
            type: TEXT
            priority: '17'
            section_name: Other
            label: 'Value of FAN status for state of `shutdown`'
            description: 'Value indicating the FAN status for the shutdown condition.'
        - macro: '{$FAN_WARN_STATUS:"notFunctioning"}'
          value: '6'
          description: 'Value indicating the FAN status for the not-functioning condition.'
          config:
            type: TEXT
            priority: '18'
            section_name: Other
            label: 'Value of FAN status for state of `notFunctioning`'
            description: 'Value indicating the FAN status for the not-functioning condition.'
        - macro: '{$FAN_WARN_STATUS:"warning"}'
          value: '2'
          description: 'Value indicating the FAN status for the warning condition.'
          config:
            type: TEXT
            priority: '15'
            section_name: Other
            label: 'Value of FAN status for state of `warning`'
            description: 'Value indicating the FAN status for the warning condition.'
        - macro: '{$ICMP_LOSS_WARN}'
          value: '20'
          description: 'Warning threshold of ICMP packet loss in %.'
          config:
            type: TEXT
            priority: '20'
            section_name: Thresholds
            label: 'Threshold of ICMP packet loss'
            description: 'Warning threshold of ICMP packet loss in %. In the range from 0 to 100 inclusive.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$ICMP_RESPONSE_TIME_WARN}'
          value: '0.15'
          description: 'Warning threshold of the average ICMP response time in seconds.'
          config:
            type: TEXT
            priority: '21'
            section_name: Thresholds
            label: 'Threshold of the average ICMP response'
            description: 'Warning threshold of the average ICMP response time in seconds. No less than 0.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$MEMORY.UTIL.MAX}'
          value: '90'
          config:
            type: TEXT
            priority: '1'
            section_name: Thresholds
            label: 'Threshold for memory utilization'
            description: 'In the range from 0 to 100 inclusive.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$PSU_CRIT_STATUS:"critical"}'
          value: '3'
          description: 'Value indicating the PSU status for the critical condition.'
          config:
            type: TEXT
            priority: '12'
            section_name: Other
            label: 'Value of PSU status for state of `critical`'
            description: 'Value indicating the PSU status for the critical condition.'
        - macro: '{$PSU_CRIT_STATUS:"shutdown"}'
          value: '4'
          description: 'Value indicating the PSU status for the shutdown condition.'
          config:
            type: TEXT
            priority: '13'
            section_name: Other
            label: 'Value of PSU status for state of `shutdown`'
            description: 'Value indicating the PSU status for the shutdown condition.'
        - macro: '{$PSU_WARN_STATUS:"notFunctioning"}'
          value: '6'
          description: 'Value indicating the PSU status for the not-functioning condition.'
          config:
            type: TEXT
            priority: '14'
            section_name: Other
            label: 'Value of PSU status for state of `notFunctioning`'
            description: 'Value indicating the PSU status for the not-functioning condition.'
        - macro: '{$PSU_WARN_STATUS:"warning"}'
          value: '2'
          description: 'Value indicating the PSU status for the warning condition.'
          config:
            type: TEXT
            priority: '11'
            section_name: Other
            label: 'Value of PSU status for state of `warning`'
            description: 'Value indicating the PSU status for the warning condition.'
        - macro: '{$SNMP.TIMEOUT}'
          value: 5m
          description: 'Time interval for the SNMP availability trigger.'
          config:
            type: TEXT
            priority: '19'
            section_name: Other
            label: 'Time interval'
            description: 'Time interval for the SNMP availability trigger.'
        - macro: '{$TEMP_CRIT}'
          value: '60'
          description: 'Critical threshold for temperature.'
          config:
            type: TEXT
            priority: '5'
            section_name: Thresholds
            label: 'Threshold for temperature (critical)'
            description: 'Critical threshold for temperature.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$TEMP_CRIT:"CPU"}'
          value: '75'
          description: 'Critical threshold for CPU temperature.'
          config:
            type: TEXT
            priority: '7'
            section_name: Thresholds
            label: 'Threshold for CPU temperature (critical)'
            description: 'Critical threshold for CPU temperature.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$TEMP_CRIT_LOW}'
          value: '5'
          description: 'Critical threshold for low temperature.'
          config:
            type: TEXT
            priority: '3'
            section_name: Thresholds
            label: 'Threshold for low temperature (critical)'
            description: 'Critical threshold for low temperature.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$TEMP_CRIT_STATUS}'
          value: '3'
          description: 'Value indicating the state when the temperature is in critical condition.'
          config:
            type: TEXT
            priority: '9'
            section_name: Other
            label: 'Value for state of `Temperature is critical`'
            description: 'Value indicating the state when the temperature is in critical condition.'
        - macro: '{$TEMP_DISASTER_STATUS}'
          value: '4'
          description: 'Value indicating the state when the temperature is in disaster condition.'
          config:
            type: TEXT
            priority: '10'
            section_name: Other
            label: 'Value for state of `Temperature is disaster`'
            description: 'Value indicating the state when the temperature is in disaster condition.'
        - macro: '{$TEMP_WARN}'
          value: '50'
          description: 'Warning threshold for temperature.'
          config:
            type: TEXT
            priority: '4'
            section_name: Thresholds
            label: 'Threshold for temperature (warning)'
            description: 'Warning threshold for temperature.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$TEMP_WARN:"CPU"}'
          value: '70'
          description: 'Warning threshold for CPU temperature.'
          config:
            type: TEXT
            priority: '6'
            section_name: Thresholds
            label: 'Threshold for CPU temperature (warning)'
            description: 'Warning threshold for CPU temperature.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$TEMP_WARN_STATUS}'
          value: '2'
          description: 'Value indicating the state when the temperature is in the warning condition.'
          config:
            type: TEXT
            priority: '8'
            section_name: Other
            label: 'Value for state of `Temperature is warning`'
            description: 'Value indicating the state when the temperature is in the warning condition.'
      valuemaps:
        - uuid: 0e5588b6aa714283b436031ff8ebc93a
          name: 'CISCO-ENVMON-MIB::CiscoEnvMonState'
          mappings:
            - value: '1'
              newvalue: normal
            - value: '2'
              newvalue: warning
            - value: '3'
              newvalue: critical
            - value: '4'
              newvalue: shutdown
            - value: '5'
              newvalue: notPresent
            - value: '6'
              newvalue: notFunctioning
        - uuid: 9fc9d3c2eb254de996d9c4a61ba58671
          name: 'Service state'
          mappings:
            - value: '0'
              newvalue: Down
            - value: '1'
              newvalue: Up
        - uuid: bb13061dd5b542f9b0f5921e75866679
          name: zabbix.host.available
          mappings:
            - value: '0'
              newvalue: 'not available'
            - value: '1'
              newvalue: available
            - value: '2'
              newvalue: unknown
    - uuid: 24b64f6d22b446dabecc86ee3f199004
      template: 'Control-M enterprise manager by HTTP'
      name: 'Control-M enterprise manager by HTTP'
      description: |
        This template is designed to get metrics from the Control-M Enterprise Manager using the Control-M Automation API with HTTP agent.
        
        This template monitors active Service Level Agreement (SLA) services, discovers Control-M servers using Low Level Discovery and also creates host prototypes for them in conjunction with the `Control-M server by HTTP` template.
        
        To use this template, macros `{$API.TOKEN}` and `{$API.URI.ENDPOINT}` need to be set.
        
        > See [Zabbix template operation](https://www.zabbix.com/documentation/8.0/manual/config/templates_out_of_the_box/http) for basic instructions.
        
        Generated by official Zabbix template tool "Templator"
      wizard_ready: 'YES'
      readme: |
        ## Overview
        
        The template to monitor Control-M by Zabbix that work without any external scripts.
        
        
        ## Setup
        
        This template is intended to be used on Control-M Enterprise Manager instances. 
        
        It monitors:
        * active SLA services;
        * discovers Control-M servers using Low Level Discovery;
        * creates host prototypes for discovered servers with the `Control-M server by HTTP` template.
        
        To use this template, you must set host wizard configuration fields: **API token** and **API endpoint URL**. 
        
        To access the API token, use one of the following Control-M interfaces:
        
        > [Control-M WEB user interface](https://documents.bmc.com/supportu/controlm-saas/en-US/Documentation/Creating_an_API_Token.htm);
        
        > [Control-M command line interface tool CTM](https://docs.bmc.com/docs/saas-api/authentication-service-941879068.html).
        
        `API endpoint URL` - is the Control-M Automation API endpoint for the API requests, including your server IP, or DNS address, Automation API port and path.
        
        For example, `https://monitored.controlm.instance:8443/automation-api`.
      vendor:
        name: Zabbix
        version: 8.0-1
      groups:
        - name: Templates/Applications
      items:
        - uuid: 7d9ed576aeb045798b78414c89f3e597
          name: 'Get Control-M servers'
          type: HTTP_AGENT
          key: controlm.servers
          delay: 10m
          history: '0'
          value_type: TEXT
          description: 'Gets a list of servers.'
          url: '{$API.URI.ENDPOINT}/config/servers'
          headers:
            - name: x-api-key
              value: '{$API.TOKEN}'
          tags:
            - tag: component
              value: raw
        - uuid: 2bd2c27b8dc74656a00f6d2006399388
          name: 'Get SLA services'
          type: HTTP_AGENT
          key: controlm.services
          history: '0'
          value_type: TEXT
          description: 'Gets all the SLA active services.'
          url: '{$API.URI.ENDPOINT}/run/services/sla'
          headers:
            - name: x-api-key
              value: '{$API.TOKEN}'
          tags:
            - tag: component
              value: raw
      discovery_rules:
        - uuid: 388824178c264d51be116a693c2640de
          name: 'Server discovery'
          type: DEPENDENT
          key: controlm.server.discovery
          description: 'Discovers the Control-M servers.'
          host_prototypes:
            - uuid: 1ade45fcbb9e407ca32542564b12f2b1
              host: '{#SERVER.NAME}'
              name: 'Control-M server [{#SERVER.NAME}]'
              group_links:
                - group:
                    name: Applications
              group_prototypes:
                - name: 'Control-M/{#SERVER.NAME}'
              templates:
                - name: 'Control-M server by HTTP'
              macros:
                - macro: '{$SERVER.NAME}'
                  value: '{#SERVER.NAME}'
          master_item:
            key: controlm.servers
          lld_macro_paths:
            - lld_macro: '{#SERVER.NAME}'
              path: $.name
          preprocessing:
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 2h
        - uuid: 567e5e0553c84ce2a9200d14dfc76593
          name: 'SLA services discovery'
          type: DEPENDENT
          key: controlm.services.discovery
          lifetime: 1d
          description: 'Discovers the SLA services in the Control-M environment.'
          item_prototypes:
            - uuid: 9daecffe0dfd402fb7300d484c2e9b80
              name: 'Service [{#SERVICE.NAME}, {#SERVICE.JOB}]: jobs ''completed'''
              type: DEPENDENT
              key: 'service.jobs.status[''{#SERVICE.NAME}'',''{#SERVICE.JOB}'',completed]'
              description: 'Gets the number of jobs in the state - `completed`.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.statusByJobs.completed
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: 'service.stats[''{#SERVICE.NAME}'',''{#SERVICE.JOB}'']'
              tags:
                - tag: component
                  value: service
                - tag: service-metric
                  value: jobs-completed
                - tag: service-metric
                  value: jobs-stats
                - tag: service-name
                  value: '{#SERVICE.NAME}'
            - uuid: 27821e573ead422b830b4f9dba5c840f
              name: 'Service [{#SERVICE.NAME}, {#SERVICE.JOB}]: jobs ''error'''
              type: DEPENDENT
              key: 'service.jobs.status[''{#SERVICE.NAME}'',''{#SERVICE.JOB}'',error]'
              description: 'Gets the number of jobs in the state - `error`.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.statusByJobs.error
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: 'service.stats[''{#SERVICE.NAME}'',''{#SERVICE.JOB}'']'
              tags:
                - tag: component
                  value: service
                - tag: service-metric
                  value: jobs-error
                - tag: service-metric
                  value: jobs-stats
                - tag: service-name
                  value: '{#SERVICE.NAME}'
              trigger_prototypes:
                - uuid: c66f281b78e64c1c9c96ade1450eadbb
                  expression: 'last(/Control-M enterprise manager by HTTP/service.jobs.status[''{#SERVICE.NAME}'',''{#SERVICE.JOB}'',error],#1)>0'
                  name: 'Control-M: Service [{#SERVICE.NAME}, {#SERVICE.JOB}]: jobs in ''error'' state'
                  opdata: 'Trigger value ''{ITEM.VALUE}'', Current value ''{ITEM.LASTVALUE}'''
                  priority: AVERAGE
                  description: 'There are services present which are in the state - `error`.'
                  tags:
                    - tag: scope
                      value: availability
            - uuid: fe58d60475bd49f2a4e3f0bfc5ae020f
              name: 'Service [{#SERVICE.NAME}, {#SERVICE.JOB}]: jobs ''executed'''
              type: DEPENDENT
              key: 'service.jobs.status[''{#SERVICE.NAME}'',''{#SERVICE.JOB}'',executed]'
              description: 'Gets the number of jobs in the state - `executed`.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.statusByJobs.executed
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: 'service.stats[''{#SERVICE.NAME}'',''{#SERVICE.JOB}'']'
              tags:
                - tag: component
                  value: service
                - tag: service-metric
                  value: jobs-executed
                - tag: service-metric
                  value: jobs-stats
                - tag: service-name
                  value: '{#SERVICE.NAME}'
            - uuid: 2843e6ba50584b27a66165f0accc5ed5
              name: 'Service [{#SERVICE.NAME}, {#SERVICE.JOB}]: jobs ''waitCondition'''
              type: DEPENDENT
              key: 'service.jobs.status[''{#SERVICE.NAME}'',''{#SERVICE.JOB}'',waitCondition]'
              description: 'Gets the number of jobs in the state - `waitCondition`.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.statusByJobs.waitCondition
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: 'service.stats[''{#SERVICE.NAME}'',''{#SERVICE.JOB}'']'
              tags:
                - tag: component
                  value: service
                - tag: service-metric
                  value: jobs-stats
                - tag: service-metric
                  value: jobs-wait_condition
                - tag: service-name
                  value: '{#SERVICE.NAME}'
            - uuid: 409961fd6fed4f208340dfdb978a2430
              name: 'Service [{#SERVICE.NAME}, {#SERVICE.JOB}]: jobs ''waitHost'''
              type: DEPENDENT
              key: 'service.jobs.status[''{#SERVICE.NAME}'',''{#SERVICE.JOB}'',waitHost]'
              description: 'Gets the number of jobs in the state - `waitHost`.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.statusByJobs.waitHost
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: 'service.stats[''{#SERVICE.NAME}'',''{#SERVICE.JOB}'']'
              tags:
                - tag: component
                  value: service
                - tag: service-metric
                  value: jobs-stats
                - tag: service-metric
                  value: jobs-wait_host
                - tag: service-name
                  value: '{#SERVICE.NAME}'
            - uuid: 6ae1bd92bd39446fbbea847088cd37e7
              name: 'Service [{#SERVICE.NAME}, {#SERVICE.JOB}]: jobs ''waitResource'''
              type: DEPENDENT
              key: 'service.jobs.status[''{#SERVICE.NAME}'',''{#SERVICE.JOB}'',waitResource]'
              description: 'Gets the number of jobs in the state - `waitResource`.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.statusByJobs.waitResource
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: 'service.stats[''{#SERVICE.NAME}'',''{#SERVICE.JOB}'']'
              tags:
                - tag: component
                  value: service
                - tag: service-metric
                  value: jobs-stats
                - tag: service-metric
                  value: jobs-wait-resource
                - tag: service-name
                  value: '{#SERVICE.NAME}'
            - uuid: 0299415dfbca4ba6881a890bb9e9658c
              name: 'Service [{#SERVICE.NAME}, {#SERVICE.JOB}]: jobs ''waitWorkload'''
              type: DEPENDENT
              key: 'service.jobs.status[''{#SERVICE.NAME}'',''{#SERVICE.JOB}'',waitWorkload]'
              description: 'Gets the number of jobs in the state - `waitWorkload`.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.statusByJobs.waitWorkload
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: 'service.stats[''{#SERVICE.NAME}'',''{#SERVICE.JOB}'']'
              tags:
                - tag: component
                  value: service
                - tag: service-metric
                  value: jobs-stats
                - tag: service-metric
                  value: jobs-wait_workload
                - tag: service-name
                  value: '{#SERVICE.NAME}'
            - uuid: 72516fca80024f9884efb7dd652f957e
              name: 'Service [{#SERVICE.NAME}, {#SERVICE.JOB}]: stats'
              type: DEPENDENT
              key: 'service.stats[''{#SERVICE.NAME}'',''{#SERVICE.JOB}'']'
              history: '0'
              value_type: TEXT
              description: 'Gets the service statistics.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.activeServices.[?(@.serviceName == ''{#SERVICE.NAME}'')]'
                  error_handler: DISCARD_VALUE
                - type: JSONPATH
                  parameters:
                    - '$.[?(@.serviceJob == ''{#SERVICE.JOB}'')].first()'
                  error_handler: DISCARD_VALUE
              master_item:
                key: controlm.services
              tags:
                - tag: component
                  value: raw
            - uuid: a3f556bfb8d04a70b0c7407cdc458703
              name: 'Service [{#SERVICE.NAME}, {#SERVICE.JOB}]: status'
              type: DEPENDENT
              key: 'service.status[''{#SERVICE.NAME}'',''{#SERVICE.JOB}'']'
              description: 'Gets the service status.'
              valuemap:
                name: 'Control-M service status'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.status
                - type: JAVASCRIPT
                  parameters:
                    - |
                      const idx = [
                      	'Not Ok',
                      	'Ok',
                      	'Completed Ok',
                      	'Ended Late'
                      ].indexOf(value);
                      return idx !== -1 ? idx : 10;
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: 'service.stats[''{#SERVICE.NAME}'',''{#SERVICE.JOB}'']'
              tags:
                - tag: component
                  value: service
                - tag: service-metric
                  value: status
                - tag: service-name
                  value: '{#SERVICE.NAME}'
              trigger_prototypes:
                - uuid: e032410a5384441989538ff6781ef848
                  expression: |
                    last(/Control-M enterprise manager by HTTP/service.status['{#SERVICE.NAME}','{#SERVICE.JOB}'],#1)=0 or
                    last(/Control-M enterprise manager by HTTP/service.status['{#SERVICE.NAME}','{#SERVICE.JOB}'],#1)=10
                  name: 'Control-M: Service [{#SERVICE.NAME}, {#SERVICE.JOB}]: status [{ITEM.VALUE}]'
                  priority: AVERAGE
                  description: 'The service has encountered an issue.'
                  manual_close: 'YES'
                  tags:
                    - tag: scope
                      value: availability
                - uuid: f64b017b0cf9456eb0afdf908cf2258e
                  expression: 'last(/Control-M enterprise manager by HTTP/service.status[''{#SERVICE.NAME}'',''{#SERVICE.JOB}''],#1)=3'
                  name: 'Control-M: Service [{#SERVICE.NAME}, {#SERVICE.JOB}]: status [{ITEM.VALUE}]'
                  priority: WARNING
                  description: 'The service has finished its job late.'
                  manual_close: 'YES'
                  tags:
                    - tag: scope
                      value: availability
          graph_prototypes:
            - uuid: 53190fc52e094018926ca5351198aace
              name: 'Service [{#SERVICE.NAME}, {#SERVICE.JOB}]: jobs statuses'
              graph_items:
                - drawtype: DASHED_LINE
                  color: 29235c
                  item:
                    host: 'Control-M enterprise manager by HTTP'
                    key: 'service.jobs.status[''{#SERVICE.NAME}'',''{#SERVICE.JOB}'',executed]'
                - sortorder: '1'
                  drawtype: DASHED_LINE
                  color: 7e286e
                  item:
                    host: 'Control-M enterprise manager by HTTP'
                    key: 'service.jobs.status[''{#SERVICE.NAME}'',''{#SERVICE.JOB}'',waitCondition]'
                - sortorder: '2'
                  drawtype: DASHED_LINE
                  color: c73464
                  item:
                    host: 'Control-M enterprise manager by HTTP'
                    key: 'service.jobs.status[''{#SERVICE.NAME}'',''{#SERVICE.JOB}'',waitResource]'
                - sortorder: '3'
                  drawtype: DASHED_LINE
                  color: f66343
                  item:
                    host: 'Control-M enterprise manager by HTTP'
                    key: 'service.jobs.status[''{#SERVICE.NAME}'',''{#SERVICE.JOB}'',waitHost]'
                - sortorder: '4'
                  drawtype: DASHED_LINE
                  color: ffa600
                  item:
                    host: 'Control-M enterprise manager by HTTP'
                    key: 'service.jobs.status[''{#SERVICE.NAME}'',''{#SERVICE.JOB}'',waitWorkload]'
                - sortorder: '5'
                  color: 00FF00
                  yaxisside: RIGHT
                  item:
                    host: 'Control-M enterprise manager by HTTP'
                    key: 'service.jobs.status[''{#SERVICE.NAME}'',''{#SERVICE.JOB}'',completed]'
                - sortorder: '6'
                  color: FF0000
                  item:
                    host: 'Control-M enterprise manager by HTTP'
                    key: 'service.jobs.status[''{#SERVICE.NAME}'',''{#SERVICE.JOB}'',error]'
          master_item:
            key: controlm.services
          lld_macro_paths:
            - lld_macro: '{#SERVICE.JOB}'
              path: $.serviceJob
            - lld_macro: '{#SERVICE.NAME}'
              path: $.serviceName
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.activeServices
              error_handler: CUSTOM_VALUE
              error_handler_params: '[]'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
      tags:
        - tag: class
          value: software
        - tag: subclass
          value: automation
        - tag: subclass
          value: logging
        - tag: target
          value: controlm
      macros:
        - macro: '{$API.TOKEN}'
          type: SECRET_TEXT
          description: 'A token to use for API connections.'
          config:
            type: TEXT
            priority: '2'
            label: 'API token'
            description: 'A token to use for API connections.'
            required: 'YES'
        - macro: '{$API.URI.ENDPOINT}'
          description: 'The API endpoint is a URI - for example, `https://monitored.controlm.instance:8443/automation-api`.'
          config:
            type: TEXT
            priority: '1'
            label: 'API endpoint URL'
            description: 'The API endpoint is a URI - for example, `https://monitored.controlm.instance:8443/automation-api`.'
            required: 'YES'
      valuemaps:
        - uuid: 54213ae65be64878988c9145d8ae86e4
          name: 'Control-M service status'
          mappings:
            - value: '0'
              newvalue: 'Not Ok'
            - value: '1'
              newvalue: Ok
            - value: '2'
              newvalue: 'Completed Ok'
            - value: '3'
              newvalue: 'Ended Late'
            - value: '10'
              newvalue: Unknown
    - uuid: c077d6c381904e94a4df88136588b551
      template: 'Control-M server by HTTP'
      name: 'Control-M server by HTTP'
      description: |
        This template is designed to get metrics from the Control-M server using the Control-M Automation API with HTTP agent.
        
        This template monitors server statistics, discovers jobs and agents using Low Level Discovery.
        
        To use this template, macros `{$API.TOKEN}`, `{$API.URI.ENDPOINT}`, and `{$SERVER.NAME}` need to be set.
        
        Generated by official Zabbix template tool "Templator"
      wizard_ready: 'YES'
      readme: |
        ## Overview
        
        This template is designed to get metrics from the Control-M server using the Control-M Automation API with HTTP agent.
        
        This template monitors server statistics, discovers jobs and agents using Low Level Discovery.
        
        To use this template, host wizard configuration field `API token`, `API endpoint URL`, and `Server name` need to be set.
        
        
        ## Setup
        
        This template is primarily intended for using in conjunction with the `Control-M enterprise manager by HTTP` template in order to create host prototypes.
        
        It monitors:
        * server statistics;
        * discovers jobs using Low Level Discovery;
        * discovers agents using Low Level Discovery.
        
        However, if you wish to monitor the Control-M server separately with this template, you must set the following host wizard configuration field: **API token**, **API endpoint URL**, and **Server name**. 
        
        To access the `API token` host wizard configuration field, use one of the following interfaces:
        
        > [Control-M WEB user interface](https://documents.bmc.com/supportu/controlm-saas/en-US/Documentation/Creating_an_API_Token.htm);
        
        > [Control-M command line interface tool CTM](https://docs.bmc.com/docs/saas-api/authentication-service-941879068.html).
        
        `API endpoint URL` - is the Control-M Automation API endpoint for the API requests, including your server IP, or DNS address, the Automation API port and path.
        
        For example, `https://monitored.controlm.instance:8443/automation-api`.
        
        `Server name` - is the name of the Control-M server to be monitored.
      vendor:
        name: Zabbix
        version: 8.0-1
      groups:
        - name: Templates/Applications
      items:
        - uuid: 94e45567531543119d6e36b4463684c7
          name: 'Get agents'
          type: HTTP_AGENT
          key: controlm.agents
          history: '0'
          value_type: TEXT
          description: 'Gets agents for the server.'
          url: '{$API.URI.ENDPOINT}/config/server/{$SERVER.NAME}/agents'
          headers:
            - name: x-api-key
              value: '{$API.TOKEN}'
          tags:
            - tag: component
              value: raw
        - uuid: 1f60be3e3fe543d697047ffcad7b0a7f
          name: 'Get jobs'
          type: HTTP_AGENT
          key: controlm.jobs
          history: '0'
          value_type: TEXT
          description: 'Gets the status of jobs.'
          url: '{$API.URI.ENDPOINT}/run/jobs/status'
          query_fields:
            - name: ctm
              value: '{$SERVER.NAME}'
          headers:
            - name: x-api-key
              value: '{$API.TOKEN}'
          tags:
            - tag: component
              value: raw
        - uuid: 7ae147724e374857a9a28b604e7af014
          name: 'Jobs statistics'
          type: DEPENDENT
          key: controlm.jobs.statistics
          history: '0'
          value_type: TEXT
          description: 'Gets the statistics of jobs.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$.[''returned'', ''total'']'
          master_item:
            key: controlm.jobs
          tags:
            - tag: component
              value: raw
        - uuid: aa085872149047f681f974e672e0c72c
          name: 'Jobs returned'
          type: DEPENDENT
          key: controlm.jobs.statistics.returned
          description: 'Gets the count of returned jobs.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$.[0]'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: controlm.jobs.statistics
          tags:
            - tag: component
              value: job
        - uuid: 8219b115bd5246b6bbb38c7a3b74dfaa
          name: 'Jobs total'
          type: DEPENDENT
          key: controlm.jobs.statistics.total
          description: 'Gets the count of total jobs.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$.[1]'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: controlm.jobs.statistics
          tags:
            - tag: component
              value: job
        - uuid: 67ca527f452b43aab2e3171e49f96194
          name: 'Get Control-M server stats'
          type: HTTP_AGENT
          key: controlm.server.stats
          history: '0'
          value_type: TEXT
          description: 'Gets the statistics of the server.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$.[?(@.name == ''{$SERVER.NAME}'')].first()'
              error_handler: CUSTOM_ERROR
              error_handler_params: 'Could not get server stats.'
          url: '{$API.URI.ENDPOINT}/config/servers'
          headers:
            - name: x-api-key
              value: '{$API.TOKEN}'
          tags:
            - tag: component
              value: raw
        - uuid: 101afc0212e9410b8954bd1c939aea99
          name: 'Server message'
          type: DEPENDENT
          key: server.message
          value_type: TEXT
          description: 'Gets the metric of the server message.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.message
              error_handler: CUSTOM_ERROR
              error_handler_params: 'Could not get server message.'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: controlm.server.stats
          tags:
            - tag: component
              value: server
          triggers:
            - uuid: 406307967abf4218bebd9428dd8ecb8b
              expression: 'last(/Control-M server by HTTP/server.message,#1)="Disconnected"'
              name: 'Control-M: Server disconnected'
              opdata: 'Triggered message: {ITEM.VALUE}, Current message: {ITEM.LASTVALUE1}'
              priority: HIGH
              description: 'The server is disconnected.'
              tags:
                - tag: scope
                  value: availability
            - uuid: 1d7387fe4cd7462c81daa529b58d0e34
              expression: |
                last(/Control-M server by HTTP/server.message,#1)<>"Connected" and
                last(/Control-M server by HTTP/server.message,#1)<>"Disconnected" and
                last(/Control-M server by HTTP/server.message,#1)<>""
              name: 'Control-M: Server error'
              opdata: 'Triggered message: {ITEM.VALUE}, Current message: {ITEM.LASTVALUE1}'
              priority: HIGH
              description: 'The server has encountered an error.'
              tags:
                - tag: scope
                  value: availability
        - uuid: b37f0aa295be421ab5e7262135930fcd
          name: 'Server state'
          type: DEPENDENT
          key: server.state
          description: 'Gets the metric of the server state.'
          valuemap:
            name: 'Control-M server status'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.state
              error_handler: CUSTOM_ERROR
              error_handler_params: 'Could not get server state.'
            - type: JAVASCRIPT
              parameters:
                - |
                  const idx = [
                  	'Down',
                  	'Up',
                  ].indexOf(value);
                  return idx !== -1 ? idx : 10;
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: controlm.server.stats
          tags:
            - tag: component
              value: server
          triggers:
            - uuid: d9f5b1f636ec477c932159fd1c5baf16
              expression: |
                last(/Control-M server by HTTP/server.state)=0 or
                last(/Control-M server by HTTP/server.state)=10
              name: 'Control-M: Server is down'
              opdata: 'Current state: {ITEM.LASTVALUE1}'
              priority: HIGH
              description: 'The server is down.'
              tags:
                - tag: scope
                  value: availability
        - uuid: 2c7ba283ea2d4f2d91d0fa7d33551501
          name: 'Server version'
          type: DEPENDENT
          key: server.version
          value_type: TEXT
          description: 'Gets the metric of the server version.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.version
              error_handler: CUSTOM_ERROR
              error_handler_params: 'Could not get server version.'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: controlm.server.stats
          tags:
            - tag: component
              value: server
          triggers:
            - uuid: 14cdf1016ab24e5c8b03626fac5af263
              expression: |
                last(/Control-M server by HTTP/server.version,#1)<>last(/Control-M server by HTTP/server.version,#2) and
                length(last(/Control-M server by HTTP/server.version))>0
              recovery_mode: NONE
              name: 'Control-M: Server version has changed'
              opdata: 'Old version: {ITEM.VALUE}, Current version: {ITEM.LASTVALUE1}'
              priority: INFO
              description: 'The server version has changed. Acknowledge to close the problem manually.'
              manual_close: 'YES'
              tags:
                - tag: scope
                  value: notice
      discovery_rules:
        - uuid: 8d44e49d41d1469ba0ad6ad356b056f4
          name: 'Agent discovery'
          type: DEPENDENT
          key: controlm.agent.discovery
          description: 'Discovers agents on the server.'
          item_prototypes:
            - uuid: b451e6ac1f7a4b819714ee69c4833190
              name: 'Agent [{#AGENT.NAME}]: stats'
              type: DEPENDENT
              key: 'agent.stats[''{#AGENT.NAME}'']'
              history: '0'
              value_type: TEXT
              description: 'Gets the statistics of an agent.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.agents.[?(@.nodeid == ''{#AGENT.NAME}'')].first()'
                  error_handler: DISCARD_VALUE
              master_item:
                key: controlm.agents
              tags:
                - tag: component
                  value: raw
            - uuid: f72163e7e68d4bb4b2b8fcf3b9afd730
              name: 'Agent [{#AGENT.NAME}]: status'
              type: DEPENDENT
              key: 'agent.status[''{#AGENT.NAME}'']'
              description: 'Gets the status of an agent.'
              valuemap:
                name: 'Control-M agent status'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.status
                - type: JAVASCRIPT
                  parameters:
                    - |
                      const idx = [
                      	'Available',
                      	'Unavailable',
                      	'Disabled',
                      	'Disable',
                      	'Discovering',
                      ].indexOf(value);
                      return idx !== -1 ? idx : 10;
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: 'agent.stats[''{#AGENT.NAME}'']'
              tags:
                - tag: agent-metric
                  value: status
                - tag: agent-name
                  value: '{#AGENT.NAME}'
                - tag: component
                  value: agent
              trigger_prototypes:
                - uuid: 22e12e397ad942889895590c28ce3d75
                  expression: |
                    last(/Control-M server by HTTP/agent.status['{#AGENT.NAME}'],#1)=1 or
                    last(/Control-M server by HTTP/agent.status['{#AGENT.NAME}'],#1)=10
                  name: 'Control-M: Agent [{#AGENT.NAME}]: status [{ITEM.VALUE}]'
                  priority: AVERAGE
                  description: 'The agent has encountered an issue.'
                  manual_close: 'YES'
                  tags:
                    - tag: scope
                      value: availability
                - uuid: d7cb3729522c4e5bab9eec4341bbab08
                  expression: |
                    last(/Control-M server by HTTP/agent.status['{#AGENT.NAME}'],#1)=2 or
                    last(/Control-M server by HTTP/agent.status['{#AGENT.NAME}'],#1)=3
                  name: 'Control-M: Agent [{#AGENT.NAME}}: status disabled'
                  priority: INFO
                  description: 'The agent is disabled.'
                  manual_close: 'YES'
                  tags:
                    - tag: scope
                      value: availability
            - uuid: 98e355d74fe9449eaf28272765865434
              name: 'Agent [{#AGENT.NAME}]: version'
              type: DEPENDENT
              key: 'agent.version[''{#AGENT.NAME}'']'
              value_type: TEXT
              description: 'Gets the version number of an agent.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.version
                  error_handler: CUSTOM_VALUE
                  error_handler_params: Unknown
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: 'agent.stats[''{#AGENT.NAME}'']'
              tags:
                - tag: agent-metric
                  value: version
                - tag: agent-name
                  value: '{#AGENT.NAME}'
                - tag: component
                  value: agent
              trigger_prototypes:
                - uuid: 7c494429411b4ede997a7881e52d9b46
                  expression: 'last(/Control-M server by HTTP/agent.version[''{#AGENT.NAME}''],#1)="Unknown"'
                  name: 'Control-M: Agent [{#AGENT.NAME}]: unknown version'
                  priority: WARNING
                  description: 'The agent version is unknown.'
                  manual_close: 'YES'
                  tags:
                    - tag: scope
                      value: notice
                - uuid: e67a46b5c61c43e6b42a966f3d68a581
                  expression: 'last(/Control-M server by HTTP/agent.version[''{#AGENT.NAME}''],#1)<>last(/Control-M server by HTTP/agent.version[''{#AGENT.NAME}''],#2)'
                  recovery_mode: NONE
                  name: 'Control-M: Agent [{#AGENT.NAME}]: version has changed'
                  opdata: 'Old version: {ITEM.VALUE}, Current version: {ITEM.LASTVALUE1}'
                  priority: INFO
                  description: 'The agent version has changed. Acknowledge to close the problem manually.'
                  manual_close: 'YES'
                  tags:
                    - tag: scope
                      value: notice
          master_item:
            key: controlm.agents
          lld_macro_paths:
            - lld_macro: '{#AGENT.NAME}'
              path: $.nodeid
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.agents
              error_handler: CUSTOM_VALUE
              error_handler_params: '[]'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
        - uuid: 279c680e12f6443a9b096bec45f9bce4
          name: 'Jobs discovery'
          type: DEPENDENT
          key: controlm.jobs.discovery
          lifetime: 1d
          description: 'Discovers jobs on the server.'
          item_prototypes:
            - uuid: bbeb9ab5bcb04f8da802d1a63f098107
              name: 'Job [{#JOB.ID}]: held status'
              type: DEPENDENT
              key: 'job.held[''{#JOB.ID}'']'
              description: 'Gets the held status of a job.'
              valuemap:
                name: 'Control-M true-false'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.held
                - type: JAVASCRIPT
                  parameters:
                    - |
                      const idx = [
                      	'false',
                      	'true',
                      ].indexOf(value);
                      return idx !== -1 ? idx : 10;
              master_item:
                key: 'job.stats[''{#JOB.ID}'']'
              tags:
                - tag: component
                  value: job
                - tag: job-metric
                  value: held
                - tag: job-name
                  value: '{#JOB.ID}'
            - uuid: 2759dacfd8da46e1ad9811093c8897ee
              name: 'Job [{#JOB.ID}]: number of runs'
              type: DEPENDENT
              key: 'job.numberOfRuns[''{#JOB.ID}'']'
              description: 'Gets the number of runs for a job.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.numberOfRuns
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: 'job.stats[''{#JOB.ID}'']'
              tags:
                - tag: component
                  value: job
                - tag: job-metric
                  value: runs
                - tag: job-name
                  value: '{#JOB.ID}'
            - uuid: c73c160f2b8e47c8891d7e22b3a1d1bc
              name: 'Job [{#JOB.ID}]: stats'
              type: DEPENDENT
              key: 'job.stats[''{#JOB.ID}'']'
              history: '0'
              value_type: TEXT
              description: 'Gets the statistics of a job.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.statuses.[?(@.jobId == ''{#JOB.ID}'')].first()'
                  error_handler: DISCARD_VALUE
              master_item:
                key: controlm.jobs
              tags:
                - tag: component
                  value: raw
            - uuid: 1348caa83bc94650ba49231bac41aa18
              name: 'Job [{#JOB.ID}]: status'
              type: DEPENDENT
              key: 'job.status[''{#JOB.ID}'']'
              description: 'Gets the status of a job.'
              valuemap:
                name: 'Control-M job status'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.status
                - type: JAVASCRIPT
                  parameters:
                    - |
                      const idx = [
                      	'Ended OK',
                      	'Ended Not OK',
                      	'Wait User',
                      	'Wait Resource',
                      	'Wait Host',
                      	'Wait Workload',
                      	'Wait Condition',
                      	'Executing'
                      ].indexOf(value);
                      return idx !== -1 ? idx : 10;
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: 'job.stats[''{#JOB.ID}'']'
              tags:
                - tag: component
                  value: job
                - tag: job-metric
                  value: status
                - tag: job-name
                  value: '{#JOB.ID}'
              trigger_prototypes:
                - uuid: beec4281ad0f4ca7aa5f3020b116fdfd
                  expression: |
                    last(/Control-M server by HTTP/job.status['{#JOB.ID}'],#1)=1 or
                    last(/Control-M server by HTTP/job.status['{#JOB.ID}'],#1)=10
                  name: 'Control-M: Job [{#JOB.ID}]: status [{ITEM.VALUE}]'
                  priority: WARNING
                  description: 'The job has encountered an issue.'
                  manual_close: 'YES'
                  tags:
                    - tag: scope
                      value: availability
            - uuid: 4ec3c06e6ff04e919a7a0f21fa490a25
              name: 'Job [{#JOB.ID}]: type'
              type: DEPENDENT
              key: 'job.type[''{#JOB.ID}'']'
              description: 'Gets the job type.'
              valuemap:
                name: 'Control-M job type'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.type
                - type: JAVASCRIPT
                  parameters:
                    - |
                      const idx = [
                      	'Command',
                      	'Script',
                      	'File Transfer',
                      	'File Watcher',
                      	'Database',
                      	'Hadoop',
                      	'Dummy',
                      	'Folder',
                      	'Job'
                      ].indexOf(value);
                      return idx !== -1 ? idx : 10;
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              master_item:
                key: 'job.stats[''{#JOB.ID}'']'
              tags:
                - tag: component
                  value: job
                - tag: job-metric
                  value: type
                - tag: job-name
                  value: '{#JOB.ID}'
          master_item:
            key: controlm.jobs
          lld_macro_paths:
            - lld_macro: '{#JOB.ID}'
              path: $.jobId
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.statuses
              error_handler: CUSTOM_VALUE
              error_handler_params: '[]'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
      tags:
        - tag: class
          value: software
        - tag: subclass
          value: automation
        - tag: subclass
          value: logging
        - tag: target
          value: controlm
      macros:
        - macro: '{$API.TOKEN}'
          type: SECRET_TEXT
          description: 'A token to use for API connections.'
          config:
            type: TEXT
            priority: '3'
            label: 'API token'
            description: 'A token to use for API connections.'
            required: 'YES'
        - macro: '{$API.URI.ENDPOINT}'
          description: 'The API endpoint is a URI - for example, `https://monitored.controlm.instance:8443/automation-api`.'
          config:
            type: TEXT
            priority: '2'
            label: 'API endpoint URL'
            description: 'The API endpoint is a URI - for example, `https://monitored.controlm.instance:8443/automation-api`.'
            required: 'YES'
        - macro: '{$SERVER.NAME}'
          description: 'The name of the Control-M server.'
          config:
            type: TEXT
            priority: '1'
            label: 'Server name'
            description: 'The name of the Control-M server.'
            required: 'YES'
      dashboards:
        - uuid: f12c2c57e08a4af19e83dd7b1c867d59
          name: 'Control-M Overview'
          pages:
            - widgets:
                - type: graph
                  width: '36'
                  height: '5'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Control-M server by HTTP'
                        name: 'Control-M: Jobs statistics'
                    - type: STRING
                      name: reference
                      value: AAAAA
                - type: graph
                  x: '36'
                  width: '36'
                  height: '5'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Control-M server by HTTP'
                        name: 'Control-M: Server state'
                    - type: STRING
                      name: reference
                      value: AAAAB
      valuemaps:
        - uuid: 55b997715e1e4a4cb5272874b975b43a
          name: 'Control-M agent status'
          mappings:
            - value: '0'
              newvalue: Available
            - value: '1'
              newvalue: Unavailable
            - value: '2'
              newvalue: Disabled
            - value: '3'
              newvalue: Disable
            - value: '4'
              newvalue: Discovering
            - value: '10'
              newvalue: Unknown
        - uuid: 14b119c7f4a940ea91a8df8c4b114eca
          name: 'Control-M job status'
          mappings:
            - value: '0'
              newvalue: 'Ended OK'
            - value: '1'
              newvalue: 'Ended Not OK'
            - value: '2'
              newvalue: 'Wait User'
            - value: '3'
              newvalue: 'Wait Resource'
            - value: '4'
              newvalue: 'Wait Host'
            - value: '5'
              newvalue: 'Wait Workload'
            - value: '6'
              newvalue: 'Wait Condition'
            - value: '7'
              newvalue: Executing
            - value: '10'
              newvalue: Unknown
        - uuid: d6b4e3c8d5934bf08aeb19c8a2f52de4
          name: 'Control-M job type'
          mappings:
            - value: '0'
              newvalue: Command
            - value: '1'
              newvalue: Script
            - value: '2'
              newvalue: 'File Transfer'
            - value: '3'
              newvalue: 'File Watcher'
            - value: '4'
              newvalue: Database
            - value: '5'
              newvalue: Hadoop
            - value: '6'
              newvalue: Dummy
            - value: '7'
              newvalue: Folder
            - value: '8'
              newvalue: Job
            - value: '10'
              newvalue: Unknown
        - uuid: f0e3072f0cc44236802ea58f13ebb3ae
          name: 'Control-M server status'
          mappings:
            - value: '0'
              newvalue: Down
            - value: '1'
              newvalue: Up
            - value: '10'
              newvalue: Unknown
        - uuid: 37a4770c51184c5e9a8d1306625babf3
          name: 'Control-M true-false'
          mappings:
            - value: '0'
              newvalue: 'false'
            - value: '1'
              newvalue: 'true'
            - value: '10'
              newvalue: Unknown
    - uuid: a525b86c57da4d34853ff249b8b1f099
      template: 'Domain RDAP by HTTP'
      name: 'Domain RDAP by HTTP'
      description: |
        Monitor domain registration and related information using RDAP (Registration Data Access Protocol) over HTTP.
        
        Generated by official Zabbix template tool "Templator"
      wizard_ready: 'YES'
      readme: |
        ## Overview
        
        This template monitors domain registration and related information using RDAP (Registration Data Access Protocol) over HTTP. It retrieves data such as expiration dates, registrar information, status, and more for the specified domains. The template also includes low-level discovery (LLD) rules to automatically discover additional information like notices and entities associated with each domain.
        
        ## Setup
        
        Set values for the `parameters` according to your monitoring requirements.
        * `Domains`. **Required**. Enter one or more domains, separated by commas (e.g., example.com,test.net).
        * `Check interval for TLD registration data`. (Optional) TLD data does not change frequently. The default value of 12h (12 hours) or even 1d (1 day) is optimal to reduce the load on the Zabbix server and external RDAP services.
        * `Check interval for domain registration data`. (Optional) Use 1h as the standard. Checking too frequently may cause rate-limiting by RDAP services.
        
        ### Notes
        * Accepts seconds or time unit with suffix (e.g., 30s, 1m, 2h, 1d) and, optionally, one or more custom intervals, all separated by semicolons.
      vendor:
        name: Zabbix
        version: 8.0-0
      groups:
        - name: Templates/Applications
      items:
        - uuid: 5c8826ceba6242378a1a85ff21ba4669
          name: 'Get registration data for domains'
          type: SCRIPT
          key: rdap.domain.info
          delay: '{$RDAP.INTERVAL.TLD.CHECK}'
          history: '0'
          value_type: TEXT
          params: |
            
            var RDAP = {
            	params: {},
            	iana_dns_bootstrap_url: 'https://data.iana.org/rdap/dns.json',
            	services: [],
            
            	setParams: function (params) {
            		RDAP.params['proxy'] = params.proxy;
            		RDAP.getServiceUrls();
            		['domains', 'enable_additional_info'].forEach(function (field) {
            			if (typeof params !== 'object' || typeof params[field] === 'undefined' || params[field] === '') {
            				throw 'Required param is not set: "' + field + '".';
            			}
            			RDAP.params[field] = params[field];
            		});
            	},
            
            	getField: function (data, path, debug_info) {
            		var steps = path.split('.');
            
            		for (var i = 0; i < steps.length; i++) {
            			var step = steps[i];
            
            			if (typeof data !== 'object' || data === null || typeof data[step] === 'undefined') {
            				var error_message = 'Field not found: ' + path;
            
            				if (typeof debug_info !== 'undefined') {
            					error_message += ' (' + debug_info + ')';
            				}
            				throw error_message;
            			}
            			data = data[step];
            		}
            
            		return data;
            	},
            
            	getServiceUrls: function () {
            		var request = new HttpRequest();
            
            		if (typeof RDAP.params.proxy !== 'undefined' && RDAP.params.proxy !== '') {
            			request.setProxy(RDAP.params.proxy);
            		}
            
            		var response = request.get(RDAP.iana_dns_bootstrap_url);
            
            		if (request.getStatus() !== 200) {
            			throw 'Failed to retrieve IANA RDAP bootstrap data' + request.getStatus() + ': ' + response;
            		}
            
            		try {
            			response = JSON.parse(response);
            		} catch (error) {
            			throw 'Failed to parse IANA RDAP bootstrap data: ' + error;
            		}
            
            		RDAP.services = RDAP.getField(response, 'services', 'IANA RDAP bootstrap data');
            
            		if (!Array.isArray(RDAP.services) || RDAP.services.length === 0) {
            			throw 'No RDAP services found in IANA RDAP bootstrap data.';
            		}
            	},
            
            	findRdapServer: function (tld) {
            
            		for (var i = 0; i < RDAP.services.length; i++) {
            			var service = RDAP.services[i],
            				tlds = service[0] || [],
            				urls = service[1] || [''];
            			if (tlds.indexOf(tld) !== -1) {
            				return urls[0];
            			}
            		}
            		Zabbix.log(3, '[ RDAP ] No RDAP server found for domain: ' + tld);
            
            		return '';
            	},
            
            	discoverDomainRdap: function () {
            		var lld_data = [],
            			domains = RDAP.params['domains'].split(',');
            
            		for (var i = 0; i < domains.length; i++) {
            			var domain = domains[i].trim();
            
            			if (domain.endsWith('.')) {
            				domain = domain.slice(0, -1);
            			}
            
            			if (domain === '') {
            				continue;
            			}
            
            			var tld = domain.split('.').pop().toLowerCase(),
            				rdap_server = RDAP.findRdapServer(tld);
            
            			if (rdap_server !== '' && !rdap_server.endsWith('/')) {
            				rdap_server += '/';
            			}
            
            			lld_data.push({
            				'{#DOMAIN}': domain,
            				'{#TLD}': tld,
            				'{#RDAP_SERVER}': rdap_server,
            				'{#LLD.ADDITIONAL.INFO.ENABLED}': RDAP.params['enable_additional_info']
            			});
            		}
            
            		return lld_data;
            	}
            };
            
            try {
            	RDAP.setParams(JSON.parse(value));
            
            	return JSON.stringify({
            		data: RDAP.discoverDomainRdap(),
            		error: ''
            	});
            
            } catch (error) {
            	error += (String(error).endsWith('.')) ? '' : '.';
            	Zabbix.log(3, '[ RDAP ] ERROR: ' + error);
            
            	return JSON.stringify({
            		data: [],
            		error: error
            	});
            }
          description: 'Get registration data for domains using RDAP protocol over HTTP.'
          timeout: 30s
          parameters:
            - name: domains
              value: '{$RDAP.DOMAINS}'
            - name: enable_additional_info
              value: '{$RDAP.LLD.ADDITIONAL.INFO.ENABLED}'
          tags:
            - tag: component
              value: raw
        - uuid: 41257fcc5ac646779be2ebce750679e9
          name: 'Error retrieving registration data for domains'
          type: DEPENDENT
          key: rdap.domain.info.error
          value_type: TEXT
          description: 'Error message when retrieving registration data for domains.'
          preprocessing:
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1d
            - type: JSONPATH
              parameters:
                - $.error
              error_handler: CUSTOM_VALUE
              error_handler_params: 'Error retrieving registration data.'
          master_item:
            key: rdap.domain.info
          tags:
            - tag: component
              value: error
            - tag: component
              value: system
          triggers:
            - uuid: 460618aa9f5f4832a60d105b94cf320c
              expression: 'last(/Domain RDAP by HTTP/rdap.domain.info.error)<>""'
              name: 'RDAP: Error retrieving registration data for domains'
              opdata: 'Retrieving registration data failed. Error: {ITEM.VALUE}'
              priority: HIGH
              tags:
                - tag: scope
                  value: notice
      discovery_rules:
        - uuid: a6f433cb96e641b0ae459a38926eac2e
          name: 'Discovery entities for domain [{#DOMAIN}]'
          type: DEPENDENT
          key: 'rdap.domain.entities.discovery[{#DOMAIN}]'
          description: 'Discover entities for domain `{#DOMAIN}`.'
          item_prototypes:
            - uuid: e206793ce1674fefa27334566c1bea91
              name: '[{#DOMAIN}]: {#ENTITY_VCARD_NAME}'
              type: SCRIPT
              key: 'rdap.domain.entity.vcard.entry[{#DOMAIN},{#ENTITY_VCARD_KEY}]'
              delay: '{$RDAP.INTERVAL.DOMAIN.CHECK}'
              value_type: TEXT
              params: 'return ''{#ENTITY_VCARD_VALUE}'';'
              description: 'Information about entity `{#ENTITY_ROLE} {#ENTITY_SUB_ROLE}`.'
              preprocessing:
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1d
              tags:
                - tag: component
                  value: entity
                - tag: component
                  value: system
                - tag: domain
                  value: '{#DOMAIN}'
                - tag: role
                  value: '{#ENTITY_ROLE}'
                - tag: subrole
                  value: '{#ENTITY_SUB_ROLE}'
          parent_discovery_rule:
            key: rdap.domain.with.rdap.discovery
          master_item:
            key: 'rdap.domain.data[{#DOMAIN}]'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.lld_entities
              error_handler: CUSTOM_VALUE
              error_handler_params: '[]'
        - uuid: 5c14da924e3443c6b255b87f684d2e5a
          name: 'Discovery notices for domain [{#DOMAIN}]'
          type: DEPENDENT
          key: 'rdap.domain.notices.discovery[{#DOMAIN}]'
          description: 'Discover notices for domain `{#DOMAIN}`.'
          item_prototypes:
            - uuid: 9d33ba74c2be44bba340b398d6679799
              name: '[{#DOMAIN}]: Notice [{#NOTICE_TITLE}]'
              type: SCRIPT
              key: 'rdap.domain.notice.title[{#DOMAIN},{#NOTICE_TITLE}]'
              delay: '{$RDAP.INTERVAL.DOMAIN.CHECK}'
              value_type: TEXT
              params: 'return ''{#NOTICE_LINKS}'';'
              description: '{#NOTICE_DESCRIPTION}'
              preprocessing:
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1d
              tags:
                - tag: component
                  value: notice
                - tag: component
                  value: system
                - tag: domain
                  value: '{#DOMAIN}'
          parent_discovery_rule:
            key: rdap.domain.with.rdap.discovery
          master_item:
            key: 'rdap.domain.data[{#DOMAIN}]'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.lld_notices
              error_handler: CUSTOM_VALUE
              error_handler_params: '[]'
        - uuid: d1f3f4e2f3b14f8eaed3f4c6e2b5a7c1
          name: 'Discovery domains with RDAP server'
          type: DEPENDENT
          key: rdap.domain.with.rdap.discovery
          description: 'Discover domains using RDAP protocol over HTTP.'
          item_prototypes:
            - uuid: 3e6efaa0c85a4cabb175d162e2c39e57
              name: '[{#DOMAIN}]: Authority RDAP server'
              type: DEPENDENT
              key: 'rdap.domain.authority[{#DOMAIN}]'
              value_type: TEXT
              discover: NO_DISCOVER
              description: 'Authority RDAP server for `{#TLD}` domain.'
              preprocessing:
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1d
                - type: JSONPATH
                  parameters:
                    - '$.data[?(@.domain=="{#DOMAIN}")].rdap_server.first()'
                  error_handler: CUSTOM_VALUE
              master_item:
                key: rdap.domain.info
              tags:
                - tag: component
                  value: system
                - tag: domain
                  value: '{#DOMAIN}'
              trigger_prototypes:
                - uuid: 6d04d884bae84663abd5459dbfaa0035
                  expression: 'last(/Domain RDAP by HTTP/rdap.domain.authority[{#DOMAIN}])=""'
                  name: 'RDAP: [{#DOMAIN}] authority RDAP server not found'
                  discover: NO_DISCOVER
                  priority: WARNING
                  description: |
                    The domain is not registered, there's a typo in your query, 
                    or the initial bootstrap service is unable to locate 
                    the correct server to direct the request to.
                  tags:
                    - tag: scope
                      value: notice
            - uuid: f62bbd29cecd47b7ab3f251367f9ddf6
              name: '[{#DOMAIN}]: Last changed'
              type: DEPENDENT
              key: 'rdap.domain.changed[{#DOMAIN}]'
              units: unixtime
              description: 'Last changed date for domain `{#DOMAIN}`.'
              preprocessing:
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1d
                - type: JSONPATH
                  parameters:
                    - '$.events[?(@.eventAction=="last changed")].eventDate.first()'
                  error_handler: DISCARD_VALUE
                - type: JAVASCRIPT
                  parameters:
                    - 'return Math.floor(Date.parse(value) / 1000);'
              master_item:
                key: 'rdap.domain.data[{#DOMAIN}]'
              tags:
                - tag: component
                  value: system
                - tag: domain
                  value: '{#DOMAIN}'
              trigger_prototypes:
                - uuid: bd8c5df907854cea9aa4042e0a179553
                  expression: '(now() - last(/Domain RDAP by HTTP/rdap.domain.changed[{#DOMAIN}])) < 604800'
                  name: 'RDAP: [{#DOMAIN}] was changed recently'
                  opdata: 'Last changed date: {ITEM.LASTVALUE}'
                  priority: INFO
                  description: 'Domain `{#DOMAIN}` was changed in the last 7 days. Acknowledge to close the problem manually.'
                  manual_close: 'YES'
                  tags:
                    - tag: scope
                      value: notice
            - uuid: bff6beaac1f6473d985588e2b22f44cc
              name: '[{#DOMAIN}]: Get data'
              type: HTTP_AGENT
              key: 'rdap.domain.data[{#DOMAIN}]'
              delay: '{$RDAP.INTERVAL.DOMAIN.CHECK}'
              history: '0'
              value_type: TEXT
              description: 'Get registration data for domain `{#DOMAIN}` using RDAP protocol over HTTP.'
              preprocessing:
                - type: CHECK_NOT_SUPPORTED
                  parameters:
                    - '-1'
                  error_handler: CUSTOM_VALUE
                  error_handler_params: '{"status": ["Error get data"], "lld_notices": [], "lld_entities": []}'
                - type: CHECK_JSON_ERROR
                  parameters:
                    - $.errorCode
                  error_handler: CUSTOM_VALUE
                  error_handler_params: '{"status": ["Error get data"], "lld_notices": [], "lld_entities": []}'
                - type: JAVASCRIPT
                  parameters:
                    - |
                      function getField(data, path, default_value) {
                      	var steps = path.split('.');
                      
                      	for (var i = 0; i < steps.length; i++) {
                      		var step = steps[i];
                      
                      		if (typeof data !== 'object' || data === null || typeof data[step] === 'undefined') {
                      			return default_value;
                      		}
                      		data = data[step];
                      	}
                      
                      	return data;
                      }
                      
                      function getVcardData(vcard) {
                      
                      	var vcard_clear = [getField(vcard, '0', ''), getField(vcard, '3', '')];
                      
                      	for (var j = 0; j < vcard_clear.length; j++) {
                      		if (!Array.isArray(vcard_clear[j])) {
                      			vcard_clear[j] = [vcard_clear[j]];
                      		}
                      
                      		vcard_clear[j] = vcard_clear[j].map(function (el) {
                      			if (Array.isArray(el)) {
                      				el = el.filter(function (el) {
                      					return el.trim() !== '';
                      				});
                      				return el.join(', ');
                      			}
                      
                      			return el.trim();
                      		});
                      
                      		vcard_clear[j] = vcard_clear[j].filter(function (el) {
                      			
                      			return el.trim() !== '';
                      		});
                      
                      		vcard_clear[j] = vcard_clear[j].join(', ');
                      	}
                      
                      	vcard_clear[1] = vcard_clear[1].replace(/[\']/g, '\\\'');
                      
                      	return vcard_clear;
                      }
                      
                      function getEntityData(parent_roles, parent_index, index, entity) {
                      
                      	var roles = getField(entity, 'roles', 'unknown'),
                      		out_vcard_array = [];
                      
                      	if (Array.isArray(roles)) {
                      		roles = roles.join(', ');
                      	}
                      
                      	var vcard_array = getField(entity, 'vcardArray', ['vcard', []]);
                      
                      	vcard_array = vcard_array[1];
                      
                      	for (var j = 0; j < vcard_array.length; j++) {
                      		vcard_array[j] = getVcardData(vcard_array[j]);
                      
                      		if (vcard_array[j][1] === '') {
                      			continue;
                      		}
                      
                      		var final_index = (parent_index === '' ? index : parent_index + ',' + index),
                      			final_roles = (parent_roles === '' ? roles : parent_roles + '-' + roles);
                      
                      		out_vcard_array.push({
                      			'{#ENTITY_VCARD_NAME}': '[' + final_roles + ']: vCard: [' + vcard_array[j][0] + ']',
                      			'{#ENTITY_VCARD_VALUE}': vcard_array[j][1],
                      			'{#ENTITY_VCARD_KEY}': final_index + ',' + j + ',' + vcard_array[j][0],
                      			'{#ENTITY_ROLE}': parent_roles === '' ? roles : parent_roles,
                      			'{#ENTITY_SUB_ROLE}': parent_roles === '' ? '' : roles
                      		});
                      	}
                      
                      	return out_vcard_array;
                      }
                      
                      var input_data = JSON.parse(value);
                      
                      input_data['lld_entities'] = [];
                      input_data['lld_notices'] = [];
                      
                      for (var i = 0; i < getField(input_data, 'entities', []).length; i++) {
                      	var entity = getField(input_data, 'entities.' + i, {}),
                      		entity_data = getEntityData('', '', i, entity);
                      
                      	input_data['lld_entities'] = input_data['lld_entities'].concat(entity_data);
                      
                      	var sub_entities = getField(entity, 'entities', []);
                      
                      	for (var j = 0; j < sub_entities.length; j++) {
                      		var sub_role = getField(entity, 'roles', []).join(', '),
                      			sub_entity_data = getEntityData(sub_role, i, j, sub_entities[j]);
                      
                      		input_data['lld_entities'] = input_data['lld_entities'].concat(sub_entity_data);
                      	}
                      }
                      
                      for (var i = 0; i < getField(input_data, 'notices', []).length; i++) {
                      	var notice = getField(input_data, 'notices.' + i, {});
                      
                      	input_data['lld_notices'].push({
                      		'{#NOTICE_TITLE}': getField(notice, 'title', 'Notice '),
                      		'{#NOTICE_DESCRIPTION}': getField(notice, 'description', ['']).join(', '),
                      		'{#NOTICE_LINKS}': getField(notice, 'links', [{ "href": "" }])[0]['href'],
                      		'{#NOTICE_INDEX}': i
                      	});
                      }
                      
                      return JSON.stringify(input_data);
              timeout: 15s
              url: '{#RDAP_SERVER}domain/{#DOMAIN}'
              status_codes: '200,301,302,403,404,429'
              tags:
                - tag: component
                  value: raw
                - tag: domain
                  value: '{#DOMAIN}'
            - uuid: 099b7d9d612f466a85fed86d38da3daa
              name: '[{#DOMAIN}]: Expiration date'
              type: DEPENDENT
              key: 'rdap.domain.expiration[{#DOMAIN}]'
              units: unixtime
              description: 'Expiration date for domain `{#DOMAIN}`.'
              valuemap:
                name: 'RDAP unknown date'
              preprocessing:
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1d
                - type: JSONPATH
                  parameters:
                    - '$.events[?(@.eventAction=="expiration")].eventDate.first()'
                  error_handler: CUSTOM_VALUE
                  error_handler_params: '1970-01-01T00:00:00Z'
                - type: JAVASCRIPT
                  parameters:
                    - 'return Math.floor(Date.parse(value) / 1000);'
              master_item:
                key: 'rdap.domain.data[{#DOMAIN}]'
              tags:
                - tag: component
                  value: system
                - tag: domain
                  value: '{#DOMAIN}'
            - uuid: 003d8ebc6c6f494bb654bae2762594f8
              name: '[{#DOMAIN}]: Days until expiration'
              type: DEPENDENT
              key: 'rdap.domain.registrar.until[{#DOMAIN}]'
              value_type: FLOAT
              units: '!days'
              description: 'Days until expiration for domain `{#DOMAIN}`.'
              valuemap:
                name: 'RDAP expiration status'
              preprocessing:
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1d
                - type: JAVASCRIPT
                  parameters:
                    - |
                      var days = Math.floor((value - Date.now() / 1000) / 86400);
                      
                      if (days < -365) {
                      	return -2;
                      } else if (days < 0) {
                      	return -1;
                      } else {
                      	return days;
                      }
              master_item:
                key: 'rdap.domain.expiration[{#DOMAIN}]'
              tags:
                - tag: component
                  value: system
                - tag: domain
                  value: '{#DOMAIN}'
              trigger_prototypes:
                - uuid: 5be9a88a65a14df29d374408f5d1238f
                  expression: 'last(/Domain RDAP by HTTP/rdap.domain.registrar.until[{#DOMAIN}]) = -2'
                  name: 'RDAP: [{#DOMAIN}] expiration date is unknown'
                  priority: AVERAGE
                  description: 'Expiration date not found for domain `{#DOMAIN}`.'
                  dependencies:
                    - name: 'RDAP: [{#DOMAIN}] not exist'
                      expression: 'last(/Domain RDAP by HTTP/rdap.domain.status[{#DOMAIN}])="Error get data"'
                  tags:
                    - tag: scope
                      value: notice
                - uuid: 3a4f5e6d7c8b4a9ea0b1c2d3e4f5a6b7
                  expression: 'last(/Domain RDAP by HTTP/rdap.domain.registrar.until[{#DOMAIN}]) = -1'
                  name: 'RDAP: [{#DOMAIN}] is expired'
                  opdata: 'Expiration date: {ITEM.LASTVALUE}'
                  priority: HIGH
                  description: 'Domain `{#DOMAIN}` expiration date is in the past.'
                  dependencies:
                    - name: 'RDAP: [{#DOMAIN}] expiration date is unknown'
                      expression: 'last(/Domain RDAP by HTTP/rdap.domain.registrar.until[{#DOMAIN}]) = -2'
                  tags:
                    - tag: scope
                      value: notice
                - uuid: ebf8c3228395461bb50ea8fe3158e513
                  expression: 'last(/Domain RDAP by HTTP/rdap.domain.registrar.until[{#DOMAIN}]) < {$RDAP.EXPIRATION.WARNING.DAYS:"{#DOMAIN}"}'
                  name: 'RDAP: [{#DOMAIN}] will expire soon'
                  opdata: 'Expiration date: {ITEM.LASTVALUE}'
                  priority: HIGH
                  description: 'Until domain `{#DOMAIN}` expiration left is less than {$RDAP.EXPIRATION.WARNING.DAYS:"{#DOMAIN}"} days.'
                  dependencies:
                    - name: 'RDAP: [{#DOMAIN}] expiration date is unknown'
                      expression: 'last(/Domain RDAP by HTTP/rdap.domain.registrar.until[{#DOMAIN}]) = -2'
                    - name: 'RDAP: [{#DOMAIN}] is expired'
                      expression: 'last(/Domain RDAP by HTTP/rdap.domain.registrar.until[{#DOMAIN}]) = -1'
                  tags:
                    - tag: scope
                      value: notice
            - uuid: 602bca3920f045158710327c133cb45d
              name: '[{#DOMAIN}]: Registrar'
              type: DEPENDENT
              key: 'rdap.domain.registrar[{#DOMAIN}]'
              units: unixtime
              description: 'Registrar for domain `{#DOMAIN}`.'
              preprocessing:
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1d
                - type: JSONPATH
                  parameters:
                    - '$.events[?(@.eventAction=="registration")].eventDate.first()'
                  error_handler: DISCARD_VALUE
                - type: JAVASCRIPT
                  parameters:
                    - 'return Math.floor(Date.parse(value) / 1000);'
              master_item:
                key: 'rdap.domain.data[{#DOMAIN}]'
              tags:
                - tag: component
                  value: system
                - tag: domain
                  value: '{#DOMAIN}'
            - uuid: 0b6f1a04068c4927b51cd85326d50184
              name: '[{#DOMAIN}]: Status'
              type: DEPENDENT
              key: 'rdap.domain.status[{#DOMAIN}]'
              value_type: TEXT
              description: 'Status of domain `{#DOMAIN}`.'
              preprocessing:
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1d
                - type: JSONPATH
                  parameters:
                    - $.status
                  error_handler: DISCARD_VALUE
                - type: JAVASCRIPT
                  parameters:
                    - 'return JSON.parse(value).join('', '');'
              master_item:
                key: 'rdap.domain.data[{#DOMAIN}]'
              tags:
                - tag: component
                  value: system
                - tag: domain
                  value: '{#DOMAIN}'
              trigger_prototypes:
                - uuid: 203afdad58a44cfabd5a74836a46886d
                  expression: 'last(/Domain RDAP by HTTP/rdap.domain.status[{#DOMAIN}])="Error get data"'
                  name: 'RDAP: [{#DOMAIN}] not exist'
                  priority: AVERAGE
                  description: 'Status information not found for domain `{#DOMAIN}`. The domain may not be registered or there was an error retrieving the data.'
                  tags:
                    - tag: scope
                      value: notice
                - uuid: aae204ffd0b64225b66516fe95492ece
                  expression: 'length(last(/Domain RDAP by HTTP/rdap.domain.status[{#DOMAIN}]))>0 and change(/Domain RDAP by HTTP/rdap.domain.status[{#DOMAIN}])=1'
                  name: 'RDAP: [{#DOMAIN}] status was changed recently'
                  priority: WARNING
                  description: 'Domain `{#DOMAIN}` was changed recently. Acknowledge to close the problem manually.'
                  manual_close: 'YES'
                  dependencies:
                    - name: 'RDAP: [{#DOMAIN}] not exist'
                      expression: 'last(/Domain RDAP by HTTP/rdap.domain.status[{#DOMAIN}])="Error get data"'
                  tags:
                    - tag: scope
                      value: notice
            - uuid: 8f3e2f3b1a5e4c2b9f4e6d7c8b9a0b1c
              name: '[{#DOMAIN}]: Last update of RDAP data'
              type: DEPENDENT
              key: 'rdap.domain.updated[{#DOMAIN}]'
              units: unixtime
              description: 'Last update date of RDAP data for domain `{#DOMAIN}`.'
              preprocessing:
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1d
                - type: JSONPATH
                  parameters:
                    - '$.events[?(@.eventAction=="last update of RDAP database")].eventDate.first()'
                  error_handler: DISCARD_VALUE
                - type: JAVASCRIPT
                  parameters:
                    - 'return Math.floor(Date.parse(value) / 1000);'
              master_item:
                key: 'rdap.domain.data[{#DOMAIN}]'
              tags:
                - tag: component
                  value: system
                - tag: domain
                  value: '{#DOMAIN}'
              trigger_prototypes:
                - uuid: 66cd46d10af74981ad089ee0d0333931
                  expression: '(now() - last(/Domain RDAP by HTTP/rdap.domain.updated[{#DOMAIN}])) / 86400 > {$RDAP.NOT.UPDATED.WARNING.DAYS:"{#DOMAIN}"}'
                  name: 'RDAP: [{#DOMAIN}] not updated data for {$RDAP.NOT.UPDATED.WARNING.DAYS:"{#DOMAIN}"} days'
                  opdata: 'Last update of RDAP data: {ITEM.LASTVALUE}'
                  priority: INFO
                  description: 'RDAP data for domain `{#DOMAIN}` not updated for {$RDAP.NOT.UPDATED.WARNING.DAYS:"{#DOMAIN}"} days. Acknowledge to close the problem manually.'
                  manual_close: 'YES'
                  tags:
                    - tag: scope
                      value: notice
          master_item:
            key: rdap.domain.info
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.data
          overrides:
            - name: 'Authority server'
              step: '1'
              filter:
                conditions:
                  - macro: '{#RDAP_SERVER}'
                    value: ^$
              operations:
                - operator: REGEXP
                  value: 'Authority RDAP server'
                  discover: DISCOVER
                - operator: REGEXP
                  value: 'Expiration date'
                  discover: NO_DISCOVER
                - operator: REGEXP
                  value: 'Get data'
                  discover: NO_DISCOVER
                - operator: REGEXP
                  value: 'Last changed'
                  discover: NO_DISCOVER
                - operator: REGEXP
                  value: 'Last update of RDAP data'
                  discover: NO_DISCOVER
                - operator: REGEXP
                  value: Registrar
                  discover: NO_DISCOVER
                - operator: REGEXP
                  value: Status
                  discover: NO_DISCOVER
                - operationobject: TRIGGER_PROTOTYPE
                  operator: LIKE
                  value: 'authority RDAP server not found'
                  discover: DISCOVER
                - operationobject: TRIGGER_PROTOTYPE
                  operator: REGEXP
                  value: 'RDAP: * expiration date is unknown'
                  discover: NO_DISCOVER
                - operationobject: TRIGGER_PROTOTYPE
                  operator: REGEXP
                  value: 'RDAP: * is expired'
                  discover: NO_DISCOVER
                - operationobject: TRIGGER_PROTOTYPE
                  operator: REGEXP
                  value: 'RDAP: * not updated data for * days'
                  discover: NO_DISCOVER
                - operationobject: TRIGGER_PROTOTYPE
                  operator: REGEXP
                  value: 'RDAP: * status was changed recently'
                  discover: NO_DISCOVER
                - operationobject: TRIGGER_PROTOTYPE
                  operator: REGEXP
                  value: 'RDAP: * was changed recently'
                  discover: NO_DISCOVER
                - operationobject: TRIGGER_PROTOTYPE
                  operator: REGEXP
                  value: 'RDAP: * will expire soon'
                  discover: NO_DISCOVER
            - name: 'Additional info discovery'
              step: '2'
              filter:
                evaltype: OR
                conditions:
                  - macro: '{#LLD.ADDITIONAL.INFO.ENABLED}'
                    value: ^1$
                    operator: NOT_MATCHES_REGEX
                  - macro: '{#RDAP_SERVER}'
                    value: ^$
              operations:
                - operationobject: LLD_RULE_PROTOTYPE
                  operator: REGEXP
                  value: 'Discovery entities for domain *'
                  discover: NO_DISCOVER
                - operationobject: LLD_RULE_PROTOTYPE
                  operator: REGEXP
                  value: 'Discovery notices for domain *'
                  discover: NO_DISCOVER
      tags:
        - tag: class
          value: network
        - tag: target
          value: rdap
      macros:
        - macro: '{$RDAP.DOMAINS}'
          description: 'List of domains separated by commas.'
          config:
            type: TEXT
            priority: '1'
            label: Domains
            description: 'List of domains to monitor, separated by commas.'
            required: 'YES'
        - macro: '{$RDAP.EXPIRATION.WARNING.DAYS}'
          value: '7'
          description: 'Number of days before expiration to trigger a warning.'
          config:
            type: TEXT
            priority: '3'
            label: 'Expiration warning days'
            description: 'Number of days before a domain''s expiration date to trigger a warning.'
            regex: ^\d+$
        - macro: '{$RDAP.INTERVAL.DOMAIN.CHECK}'
          value: 1h
          description: 'Interval for checking domain registration data.'
          config:
            type: TEXT
            priority: '6'
            label: 'Check interval for domain registration data'
            description: |
              Interval for checking domain registration data using RDAP.
              Accepts seconds or time unit with suffix (e.g., 30s, 1m, 2h, 1d) and, optionally, 
              one or more custom intervals, all separated by semicolons. 
              Custom intervals can be a mix of flexible and scheduling intervals.
        - macro: '{$RDAP.INTERVAL.TLD.CHECK}'
          value: 12h
          description: 'Interval for checking TLD registration data.'
          config:
            type: TEXT
            priority: '5'
            label: 'Check interval for TLD registration data'
            description: |
              Interval for checking TLD registration data using RDAP.
              Accepts seconds or time unit with suffix (e.g., 30s, 1m, 2h, 1d) and, optionally, 
              one or more custom intervals, all separated by semicolons. 
              Custom intervals can be a mix of flexible and scheduling intervals.
        - macro: '{$RDAP.LLD.ADDITIONAL.INFO.ENABLED}'
          value: '1'
          description: 'Enable discovery additional information in LLD (1 - enabled, 0 - disabled).'
          config:
            type: CHECKBOX
            priority: '2'
            label: 'Enable additional info discovery'
            description: 'Enable discovery of additional information such as notices and entities in low-level discovery (LLD).'
            options:
              - checked: '1'
                unchecked: '0'
        - macro: '{$RDAP.NOT.UPDATED.WARNING.DAYS}'
          value: '7'
          description: 'Number of days after last update to trigger a warning.'
          config:
            type: TEXT
            priority: '4'
            label: 'Not updated warning days'
            description: 'Number of days after the last update of RDAP data to trigger a warning.'
            regex: ^\d+$
      dashboards:
        - uuid: 8f39eba3462b479190222e737befca7c
          name: 'RDAP overview'
          display_period: '3600'
          auto_start: 'NO'
          pages:
            - widgets:
                - type: honeycomb
                  width: '40'
                  height: '8'
                  fields:
                    - type: STRING
                      name: items.0
                      value: '[*]: Days until expiration'
                    - type: INTEGER
                      name: maintenance
                      value: '1'
                    - type: STRING
                      name: primary_label
                      value: '{{ITEM.NAME}.regsub("^\[([\S]+)\]: Days until expiration$", "\1")}'
                    - type: STRING
                      name: reference
                      value: ZPTDF
                    - type: INTEGER
                      name: rf_rate
                      value: '900'
                    - type: INTEGER
                      name: secondary_label_decimal_places
                      value: '0'
                    - type: STRING
                      name: thresholds.0.color
                      value: 97AAB3
                    - type: STRING
                      name: thresholds.0.threshold
                      value: '-2'
                    - type: STRING
                      name: thresholds.1.color
                      value: E45959
                    - type: STRING
                      name: thresholds.1.threshold
                      value: '0'
                    - type: STRING
                      name: thresholds.2.color
                      value: FFBF59
                    - type: STRING
                      name: thresholds.2.threshold
                      value: '7'
                    - type: STRING
                      name: thresholds.3.color
                      value: 00C48C
                    - type: STRING
                      name: thresholds.3.threshold
                      value: '30'
                    - type: STRING
                      name: thresholds.4.color
                      value: 00684a
                    - type: STRING
                      name: thresholds.4.threshold
                      value: '500'
                - type: itemnavigator
                  name: Events
                  'y': '8'
                  width: '14'
                  height: '6'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: group_by.0.attribute
                      value: '3'
                    - type: STRING
                      name: group_by.0.tag_name
                      value: domain
                    - type: STRING
                      name: items.0
                      value: '[*]: Expiration date'
                    - type: STRING
                      name: items.1
                      value: '[*]: Last changed'
                    - type: STRING
                      name: items.2
                      value: '[*]: Last update of RDAP data'
                    - type: STRING
                      name: items.3
                      value: '[*]: Registrar'
                    - type: STRING
                      name: reference
                      value: VRFTU
                    - type: INTEGER
                      name: rf_rate
                      value: '0'
                    - type: INTEGER
                      name: show_lines
                      value: '1000'
                - type: item
                  x: '14'
                  'y': '8'
                  width: '22'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: INTEGER
                      name: decimal_size
                      value: '45'
                    - type: STRING
                      name: itemid._reference
                      value: ZPTDF._itemid
                    - type: INTEGER
                      name: rf_rate
                      value: '0'
                    - type: INTEGER
                      name: show.0
                      value: '1'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                    - type: STRING
                      name: thresholds.0.color
                      value: 97AAB3
                    - type: STRING
                      name: thresholds.0.threshold
                      value: '-2'
                    - type: STRING
                      name: thresholds.1.color
                      value: E45959
                    - type: STRING
                      name: thresholds.1.threshold
                      value: '0'
                    - type: STRING
                      name: thresholds.2.color
                      value: FFBF59
                    - type: STRING
                      name: thresholds.2.threshold
                      value: '7'
                    - type: STRING
                      name: thresholds.3.color
                      value: 00C48C
                    - type: STRING
                      name: thresholds.3.threshold
                      value: '30'
                    - type: INTEGER
                      name: units_size
                      value: '25'
                    - type: INTEGER
                      name: value_size
                      value: '35'
                - type: item
                  x: '14'
                  'y': '11'
                  width: '22'
                  height: '3'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: decimal_places
                      value: '0'
                    - type: STRING
                      name: itemid._reference
                      value: VRFTU._itemid
                    - type: INTEGER
                      name: rf_rate
                      value: '0'
                    - type: INTEGER
                      name: show.0
                      value: '2'
                    - type: INTEGER
                      name: show.1
                      value: '1'
                    - type: INTEGER
                      name: value_size
                      value: '35'
                - type: itemnavigator
                  name: 'Entity data'
                  x: '36'
                  'y': '8'
                  width: '15'
                  height: '6'
                  hide_header: 'YES'
                  fields:
                    - type: INTEGER
                      name: group_by.0.attribute
                      value: '3'
                    - type: STRING
                      name: group_by.0.tag_name
                      value: domain
                    - type: INTEGER
                      name: group_by.1.attribute
                      value: '3'
                    - type: STRING
                      name: group_by.1.tag_name
                      value: role
                    - type: INTEGER
                      name: group_by.2.attribute
                      value: '3'
                    - type: STRING
                      name: group_by.2.tag_name
                      value: subrole
                    - type: INTEGER
                      name: item_tags.0.operator
                      value: '1'
                    - type: STRING
                      name: item_tags.0.tag
                      value: component
                    - type: STRING
                      name: item_tags.0.value
                      value: entity
                    - type: STRING
                      name: reference
                      value: MATXD
                    - type: INTEGER
                      name: rf_rate
                      value: '0'
                    - type: INTEGER
                      name: show_lines
                      value: '1000'
                - type: problems
                  x: '40'
                  width: '32'
                  height: '8'
                  fields:
                    - type: STRING
                      name: reference
                      value: XEVSV
                    - type: INTEGER
                      name: rf_rate
                      value: '900'
                    - type: INTEGER
                      name: show
                      value: '3'
                    - type: INTEGER
                      name: show_lines
                      value: '100'
                    - type: INTEGER
                      name: show_timeline
                      value: '0'
                    - type: INTEGER
                      name: sort_triggers
                      value: '15'
                - type: itemcard
                  x: '51'
                  'y': '8'
                  width: '21'
                  height: '6'
                  fields:
                    - type: STRING
                      name: itemid._reference
                      value: MATXD._itemid
                    - type: INTEGER
                      name: rf_rate
                      value: '0'
                    - type: INTEGER
                      name: sections.0
                      value: '0'
                    - type: INTEGER
                      name: sections.1
                      value: '3'
                    - type: INTEGER
                      name: sections.2
                      value: '9'
                    - type: INTEGER
                      name: sections.3
                      value: '7'
      valuemaps:
        - uuid: 2aeb1024e7b94b93b3cac55d2b9ae7bc
          name: 'RDAP expiration status'
          mappings:
            - value: '0'
              newvalue: 'Expire today'
            - type: IN_RANGE
              value: '1 - 7'
              newvalue: 'Expire soon'
            - type: IN_RANGE
              value: '8 - 30'
              newvalue: 'Expires in less than a month'
            - value: '-1'
              newvalue: 'Registration has expired'
            - value: '-2'
              newvalue: Unknown
        - uuid: 2314cc11c34d4a61873b41ab00559b14
          name: 'RDAP unknown date'
          mappings:
            - value: '0'
              newvalue: Unknown
    - uuid: f445dac89ff74deabaae9dcb84815998
      template: 'GitLab by HTTP'
      name: 'GitLab by HTTP'
      description: |
        Get GitLab metrics by HTTP agent from Prometheus metrics endpoint.
        
        To access the metrics, the client IP address must be explicitly allowed. See https://docs.gitlab.com/ee/administration/monitoring/ip_whitelist.html.
        Or second method, using token variable from http://your.gitlab.address/admin/health_check (fill {$GITLAB.HEALTH.TOKEN} macro with variable path like "?token=your_token").
        Don't forget change macros {$GITLAB.URL}.
        Some metrics may not be collected depending on your Gitlab instance version and configuration. See (Gitlab's documentation[)https://docs.gitlab.com/ee/administration/monitoring/prometheus/gitlab_metrics.html] for further information about its metric collection.
        
        You can discuss this template or leave feedback on our forum https://www.zabbix.com/forum/zabbix-suggestions-and-feedback
        
        Generated by official Zabbix template tool "Templator"
      wizard_ready: 'YES'
      readme: |
        ## Overview
        
        This template is designed to monitor GitLab by Zabbix that works without any external scripts.
        Most of the metrics are collected in one go, thanks to Zabbix bulk data collection.
        
        The template `GitLab by HTTP` — collects metrics by an HTTP agent from the GitLab `/-/metrics` endpoint.
        See https://docs.gitlab.com/ee/administration/monitoring/prometheus/gitlab_metrics.html.
        
        
        ## Setup
        
        This template works with self-hosted GitLab instances. Internal service metrics are collected from the GitLab `/-/metrics` endpoint.
        To access metrics following two methods are available:
        1. Explicitly allow monitoring instance IP address in gitlab [whitelist configuration](https://docs.gitlab.com/ee/administration/monitoring/ip_whitelist.html).
        2. Get token from Gitlab `Admin -> Monitoring -> Health check` page: http://your.gitlab.address/admin/health_check; Use this token in host wizard configuration field ` GitLab health check token path` as variable path, like: `?token=your_token`.
        Remember to change the host wizard configuration field `GitLab instance URL`.
        
        
        *NOTE.* Some metrics may not be collected depending on your Gitlab instance version and configuration. See [Gitlab's documentation](https://docs.gitlab.com/ee/administration/monitoring/prometheus/gitlab_metrics.html) for further information about its metric collection.
      vendor:
        name: Zabbix
        version: 8.0-1
      groups:
        - name: Templates/Applications
      items:
        - uuid: 43a26551b0a6460cac3c43138ec5fd33
          name: 'Cache: Misses rate, total'
          type: DEPENDENT
          key: gitlab.cache.misses_total.rate
          value_type: FLOAT
          description: 'The cache read miss count.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.name=="gitlab_cache_misses_total")].value.sum()'
            - type: CHANGE_PER_SECOND
          master_item:
            key: gitlab.get_metrics
          tags:
            - tag: component
              value: cache
        - uuid: 9c507412d4544a37bdad49ba47c48302
          name: 'Cache: Operations rate, total'
          type: DEPENDENT
          key: gitlab.cache.operations_total.rate
          value_type: FLOAT
          description: 'The count of cache operations.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.name=="gitlab_cache_operations_total")].value.sum()'
            - type: CHANGE_PER_SECOND
          master_item:
            key: gitlab.get_metrics
          tags:
            - tag: component
              value: cache
        - uuid: 2d46dc855ca741839cfe1a19e0dc892f
          name: 'Database: Connection pool, busy'
          type: DEPENDENT
          key: gitlab.database.connection_pool_busy
          description: 'Connections to the main database in use where the owner is still alive.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.name=="gitlab_database_connection_pool_busy" && @.labels.class == "ActiveRecord::Base")].value.sum()'
          master_item:
            key: gitlab.get_metrics
          tags:
            - tag: component
              value: database
        - uuid: 6ee7a1d3ab20463d83602b751381d821
          name: 'Database: Connection pool, current'
          type: DEPENDENT
          key: gitlab.database.connection_pool_connections
          description: 'Current connections to the main database in the pool.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.name=="gitlab_database_connection_pool_connections" && @.labels.class == "ActiveRecord::Base")].value.sum()'
          master_item:
            key: gitlab.get_metrics
          tags:
            - tag: component
              value: database
        - uuid: 561a1f54c98d4a2b828fe644961404be
          name: 'Database: Connection pool, dead'
          type: DEPENDENT
          key: gitlab.database.connection_pool_dead
          description: 'Connections to the main database in use where the owner is not alive.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.name=="gitlab_database_connection_pool_dead" && @.labels.class == "ActiveRecord::Base")].value.sum()'
          master_item:
            key: gitlab.get_metrics
          tags:
            - tag: component
              value: database
        - uuid: 3a0b5c8de88b41fa9ebf6f3fca63833e
          name: 'Database: Connection pool, idle'
          type: DEPENDENT
          key: gitlab.database.connection_pool_idle
          description: 'Connections to the main database not in use.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.name=="gitlab_database_connection_pool_idle" && @.labels.class == "ActiveRecord::Base")].value.sum()'
          master_item:
            key: gitlab.get_metrics
          tags:
            - tag: component
              value: database
        - uuid: fd1458232de34981a9a00be820e123f1
          name: 'Database: Connection pool, size'
          type: DEPENDENT
          key: gitlab.database.connection_pool_size
          description: 'Total connection to the main database pool capacity.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.name=="gitlab_database_connection_pool_size" && @.labels.class == "ActiveRecord::Base")].value.sum()'
          master_item:
            key: gitlab.get_metrics
          tags:
            - tag: component
              value: database
        - uuid: 501a2f646ced4207a32a24e900310440
          name: 'Database: Connection pool, waiting'
          type: DEPENDENT
          key: gitlab.database.connection_pool_waiting
          description: 'Threads currently waiting on this queue.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.name=="gitlab_database_connection_pool_waiting" && @.labels.class == "ActiveRecord::Base")].value.sum()'
          master_item:
            key: gitlab.get_metrics
          tags:
            - tag: component
              value: database
        - uuid: 71a5f82d11914b12a86008bfd488fb1e
          name: Version
          type: DEPENDENT
          key: gitlab.deployments.version
          value_type: CHAR
          description: 'Version of the GitLab instance.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.name=="deployments")].labels.version.first()'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 3h
          master_item:
            key: gitlab.get_metrics
          tags:
            - tag: component
              value: application
          triggers:
            - uuid: 88d7ceb3a683436da666e8802b2d29b5
              expression: 'last(/GitLab by HTTP/gitlab.deployments.version,#1)<>last(/GitLab by HTTP/gitlab.deployments.version,#2) and length(last(/GitLab by HTTP/gitlab.deployments.version))>0'
              name: 'GitLab: Version has changed'
              event_name: 'GitLab: Version has changed (new version: {ITEM.VALUE})'
              priority: INFO
              description: 'The GitLab version has changed. Acknowledge to close the problem manually.'
              manual_close: 'YES'
              tags:
                - tag: scope
                  value: notice
        - uuid: 3e409938aba24445a11012bcbf8aa113
          name: 'User CAPTCHA logins failed, total'
          type: DEPENDENT
          key: gitlab.failed_login_captcha_total
          description: 'Counter of failed CAPTCHA attempts during login.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.name=="failed_login_captcha_total")].value.first()'
              error_handler: DISCARD_VALUE
          master_item:
            key: gitlab.get_metrics
          tags:
            - tag: component
              value: sessions
        - uuid: 2aa509b84dc14026b8ff8ed473add2d2
          name: 'Get instance metrics'
          type: HTTP_AGENT
          key: gitlab.get_metrics
          history: '0'
          value_type: TEXT
          preprocessing:
            - type: CHECK_NOT_SUPPORTED
              parameters:
                - '-1'
            - type: PROMETHEUS_TO_JSON
              parameters:
                - ''
          url: '{$GITLAB.URL}/-/metrics{$GITLAB.HEALTH.TOKEN}'
          tags:
            - tag: component
              value: raw
        - uuid: 3ff4d9793af94d339ca225aaf9200554
          name: 'HTTP requests rate, 4xx'
          type: DEPENDENT
          key: gitlab.http.requests.4xx.rate
          value_type: FLOAT
          units: rps
          description: 'Number of handle failures of requests with code 4XX.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.name=="http_requests_total" && @.labels.status =~ ''4..'' )].value.sum()'
              error_handler: DISCARD_VALUE
            - type: CHANGE_PER_SECOND
          master_item:
            key: gitlab.get_metrics
          tags:
            - tag: component
              value: requests
            - tag: http-code
              value: 4xx
        - uuid: d0fa18012d6a4b0ba6620b0ef6cb9aef
          name: 'HTTP requests rate, 5xx'
          type: DEPENDENT
          key: gitlab.http.requests.5xx.rate
          value_type: FLOAT
          units: rps
          description: 'Number of handle failures of requests with HTTP-code 5xx.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.name=="http_requests_total" && @.labels.status =~ ''5..'' )].value.sum()'
              error_handler: DISCARD_VALUE
            - type: CHANGE_PER_SECOND
          master_item:
            key: gitlab.get_metrics
          tags:
            - tag: component
              value: requests
            - tag: http-code
              value: 5xx
          triggers:
            - uuid: 7021e3b0b49a4990a1d8ce356b7ae130
              expression: 'min(/GitLab by HTTP/gitlab.http.requests.5xx.rate,5m)>{$GITLAB.HTTP.FAIL.MAX.WARN}'
              name: 'GitLab: Too many HTTP requests failures'
              event_name: 'GitLab: Too many HTTP requests failures (over {$GITLAB.HTTP.FAIL.MAX.WARN} for 5m)'
              priority: WARNING
              description: '"Too many requests failed on GitLab instance with 5xx HTTP code"'
              tags:
                - tag: scope
                  value: availability
        - uuid: 2d739e4bedb24b50ab6adfdfdeb39da9
          name: 'HTTP requests rate, total'
          type: DEPENDENT
          key: gitlab.http.requests.rate
          value_type: FLOAT
          units: rps
          description: 'Number of requests received into the system.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.name=="http_requests_total")].value.sum()'
            - type: CHANGE_PER_SECOND
          master_item:
            key: gitlab.get_metrics
          tags:
            - tag: component
              value: requests
        - uuid: c48920e302ff4b9ab16f45b67775b440
          name: 'Application server status'
          type: HTTP_AGENT
          key: gitlab.liveness
          description: 'Checks whether the application server is running. This probe is used to know if Rails Controllers are not deadlocked due to a multi-threading.'
          valuemap:
            name: 'GitLab healthcheck'
          preprocessing:
            - type: CHECK_NOT_SUPPORTED
              parameters:
                - '-1'
              error_handler: CUSTOM_VALUE
              error_handler_params: '{"status": "failed"}'
            - type: JSONPATH
              parameters:
                - $.status
            - type: BOOL_TO_DECIMAL
              error_handler: CUSTOM_VALUE
              error_handler_params: '0'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 30m
          url: '{$GITLAB.URL}/-/liveness{$GITLAB.HEALTH.TOKEN}'
          tags:
            - tag: component
              value: health
          triggers:
            - uuid: 2f1eb8d6c89a4d8cbda0e951d3f6a109
              expression: 'last(/GitLab by HTTP/gitlab.liveness)=0'
              name: 'GitLab: Liveness check was failed'
              priority: HIGH
              description: 'The application server is not running or Rails Controllers are deadlocked.'
              tags:
                - tag: scope
                  value: availability
        - uuid: 7ef7142babfd4bc2b5b25be541c0511f
          name: 'Pipelines: Auto DevOps pipelines, total'
          type: DEPENDENT
          key: gitlab.pipeline.auto_devops_completed.total
          description: 'Counter of completed Auto DevOps pipelines.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.name=="auto_devops_pipelines_completed_total")].value.sum()'
              error_handler: DISCARD_VALUE
          master_item:
            key: gitlab.get_metrics
          tags:
            - tag: component
              value: pipelines
        - uuid: 0ffa0a5c108644508252a03469e4f394
          name: 'Pipelines: Auto DevOps pipelines, failed'
          type: DEPENDENT
          key: gitlab.pipeline.auto_devops_completed_total.failed
          description: 'Counter of completed Auto DevOps pipelines with status "failed".'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.name=="auto_devops_pipelines_completed_total" && @.labels.status == "failed")].value.sum()'
              error_handler: DISCARD_VALUE
          master_item:
            key: gitlab.get_metrics
          tags:
            - tag: component
              value: pipelines
        - uuid: f4265a3167a245c4998958106f6ee265
          name: 'Pipelines: Created, total'
          type: DEPENDENT
          key: gitlab.pipeline.created_total
          description: 'Counter of pipelines created.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.name=="pipelines_created_total")].value.sum()'
              error_handler: DISCARD_VALUE
          master_item:
            key: gitlab.get_metrics
          tags:
            - tag: component
              value: pipelines
        - uuid: 23cb22f8f81e461c86f72a92cdfde7a5
          name: 'Pipelines: CI/CD creation duration'
          type: DEPENDENT
          key: gitlab.pipeline.pipeline_creation
          value_type: FLOAT
          units: s
          description: 'The sum of the time in seconds it takes to create a CI/CD pipeline.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.name=="gitlab_ci_pipeline_creation_duration_seconds_sum")].value.first()'
              error_handler: DISCARD_VALUE
          master_item:
            key: gitlab.get_metrics
          tags:
            - tag: component
              value: pipelines
        - uuid: 91c3acbb82524244a1ac400587641ffa
          name: 'Pipelines: Pipelines: CI/CD creation count'
          type: DEPENDENT
          key: gitlab.pipeline.pipeline_creation.count
          value_type: FLOAT
          description: 'The count of the time it takes to create a CI/CD pipeline.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.name=="gitlab_ci_pipeline_creation_duration_seconds_count")].value.first()'
              error_handler: DISCARD_VALUE
          master_item:
            key: gitlab.get_metrics
          tags:
            - tag: component
              value: pipelines
        - uuid: c80453c338814951a9e97d9f37e7d68f
          name: 'Pipelines: Processing events, total'
          type: DEPENDENT
          key: gitlab.pipeline.processing_events_total
          description: 'Total amount of pipeline processing events.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.name=="gitlab_ci_pipeline_processing_events_total")].value.first()'
              error_handler: DISCARD_VALUE
          master_item:
            key: gitlab.get_metrics
          tags:
            - tag: component
              value: pipelines
        - uuid: 794a8d7f474d490c96e714dac810140d
          name: 'Instance readiness check'
          type: HTTP_AGENT
          key: gitlab.readiness
          description: 'The readiness probe checks whether the GitLab instance is ready to accept traffic via Rails Controllers.'
          valuemap:
            name: 'GitLab healthcheck'
          preprocessing:
            - type: CHECK_NOT_SUPPORTED
              parameters:
                - '-1'
              error_handler: CUSTOM_VALUE
              error_handler_params: '{"master_check":[{"status":"failed"}]}'
            - type: JSONPATH
              parameters:
                - '$.master_check[0].status'
            - type: BOOL_TO_DECIMAL
              error_handler: CUSTOM_VALUE
              error_handler_params: '0'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 30m
          url: '{$GITLAB.URL}/-/readiness{$GITLAB.HEALTH.TOKEN}'
          tags:
            - tag: component
              value: health
          triggers:
            - uuid: 11ff325698534dcd8bbaa12c86704069
              expression: 'last(/GitLab by HTTP/gitlab.readiness)=0'
              name: 'GitLab: Gitlab instance is not able to accept traffic'
              priority: HIGH
              dependencies:
                - name: 'GitLab: Liveness check was failed'
                  expression: 'last(/GitLab by HTTP/gitlab.liveness)=0'
              tags:
                - tag: scope
                  value: availability
        - uuid: 173b8d5e108f471fbf4c1267dcb9cc37
          name: 'Redis: Client exceptions rate, cache'
          type: DEPENDENT
          key: gitlab.redis.client_exceptions.cache.rate
          value_type: FLOAT
          description: 'Number of Redis client exceptions per second. (Instance: cache)'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.name=="gitlab_redis_client_exceptions_total" && @.labels.storage == "cache")].value.first()'
              error_handler: DISCARD_VALUE
            - type: CHANGE_PER_SECOND
          master_item:
            key: gitlab.get_metrics
          tags:
            - tag: component
              value: redis
          triggers:
            - uuid: a7e460f174fd4e16b2358fd3867390b4
              expression: 'min(/GitLab by HTTP/gitlab.redis.client_exceptions.cache.rate,5m)>{$GITLAB.REDIS.FAIL.MAX.WARN}'
              name: 'GitLab: Too many Redis cache client exceptions'
              event_name: 'GitLab: Too many Redis cache client exceptions (over {$GITLAB.REDIS.FAIL.MAX.WARN} for 5m)'
              priority: WARNING
              description: '"Too many  Redis client exceptions during the requests to  Redis instance cache."'
              tags:
                - tag: scope
                  value: availability
        - uuid: 0bff591252dc4cc497527afb1f7d96b2
          name: 'Redis: Client exceptions rate, queues'
          type: DEPENDENT
          key: gitlab.redis.client_exceptions.queues.rate
          value_type: FLOAT
          description: 'Number of Redis client exceptions per second. (Instance: queues)'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.name=="gitlab_redis_client_exceptions_total" && @.labels.storage == "queues")].value.first()'
              error_handler: DISCARD_VALUE
            - type: CHANGE_PER_SECOND
          master_item:
            key: gitlab.get_metrics
          tags:
            - tag: component
              value: redis
          triggers:
            - uuid: 36ec79901f324f27992ea68274eedb71
              expression: 'min(/GitLab by HTTP/gitlab.redis.client_exceptions.queues.rate,5m)>{$GITLAB.REDIS.FAIL.MAX.WARN}'
              name: 'GitLab: Too many Redis queues client exceptions'
              event_name: 'GitLab: Too many Redis queues client exceptions (over {$GITLAB.REDIS.FAIL.MAX.WARN} for 5m)'
              priority: WARNING
              description: '"Too many  Redis client exceptions during the requests to  Redis instance queues."'
              tags:
                - tag: scope
                  value: availability
        - uuid: 800b429ea1d044e6a685bc51706f8547
          name: 'Redis: client exceptions rate, shared_state'
          type: DEPENDENT
          key: gitlab.redis.client_exceptions.shared_state.rate
          value_type: FLOAT
          description: 'Number of Redis client exceptions per second. (Instance: shared_state)'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.name=="gitlab_redis_client_exceptions_total" && @.labels.storage == "shared_state")].value.first()'
              error_handler: DISCARD_VALUE
            - type: CHANGE_PER_SECOND
          master_item:
            key: gitlab.get_metrics
          tags:
            - tag: component
              value: redis
          triggers:
            - uuid: b475d6ecbc564f9b8f7fe9b24bcdf013
              expression: 'min(/GitLab by HTTP/gitlab.redis.client_exceptions.shared_state.rate,5m)>{$GITLAB.REDIS.FAIL.MAX.WARN}'
              name: 'GitLab: Too many Redis shared_state client exceptions'
              event_name: 'GitLab: Too many Redis shared_state client exceptions (over {$GITLAB.REDIS.FAIL.MAX.WARN} for 5m)'
              priority: WARNING
              description: '"Too many  Redis client exceptions during the requests to  Redis instance shared_state."'
              tags:
                - tag: scope
                  value: availability
        - uuid: 7dcc638e1c174dd5975f85551211a3ba
          name: 'Redis: Client requests rate, cache'
          type: DEPENDENT
          key: gitlab.redis.client_requests.cache.rate
          value_type: FLOAT
          units: rps
          description: 'Number of Redis client requests per second. (Instance: cache)'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.name=="gitlab_redis_client_requests_total" && @.labels.storage == "cache")].value.first()'
              error_handler: DISCARD_VALUE
            - type: CHANGE_PER_SECOND
          master_item:
            key: gitlab.get_metrics
          tags:
            - tag: component
              value: redis
        - uuid: f613303925db46958d181c379e22f942
          name: 'Redis: Client requests rate, queues'
          type: DEPENDENT
          key: gitlab.redis.client_requests.queues.rate
          value_type: FLOAT
          units: rps
          description: 'Number of Redis client requests per second. (Instance: queues)'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.name=="gitlab_redis_client_requests_total" && @.labels.storage == "queues")].value.first()'
              error_handler: DISCARD_VALUE
            - type: CHANGE_PER_SECOND
          master_item:
            key: gitlab.get_metrics
          tags:
            - tag: component
              value: redis
        - uuid: 3ae46654b46e4c769a7308879bc64890
          name: 'Redis: Client requests rate, shared_state'
          type: DEPENDENT
          key: gitlab.redis.client_requests.shared_state.rate
          value_type: FLOAT
          units: rps
          description: 'Number of Redis client requests per second. (Instance: shared_state)'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.name=="gitlab_redis_client_requests_total" && @.labels.storage == "shared_state")].value.first()'
              error_handler: DISCARD_VALUE
            - type: CHANGE_PER_SECOND
          master_item:
            key: gitlab.get_metrics
          tags:
            - tag: component
              value: redis
        - uuid: 950d48c3b5034e769b2bf6a7110ece02
          name: 'Ruby: File descriptors opened, avg'
          type: DEPENDENT
          key: gitlab.ruby.file_descriptors.avg
          value_type: FLOAT
          description: 'Average number of opened file descriptors.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.name=="ruby_file_descriptors")].value.avg()'
          master_item:
            key: gitlab.get_metrics
          tags:
            - tag: component
              value: fds
        - uuid: 67ed35c3f5f444b2b10fb462838758ac
          name: 'Ruby: File descriptors opened, max'
          type: DEPENDENT
          key: gitlab.ruby.file_descriptors.max
          value_type: FLOAT
          description: 'Maximum number of opened file descriptors.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.name=="ruby_file_descriptors")].value.max()'
          master_item:
            key: gitlab.get_metrics
          tags:
            - tag: component
              value: fds
        - uuid: b1576e2b47bd448293c3e88885bfc87e
          name: 'Ruby: File descriptors opened, min'
          type: DEPENDENT
          key: gitlab.ruby.file_descriptors.min
          value_type: FLOAT
          description: 'Minimum number of opened file descriptors.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.name=="ruby_file_descriptors")].value.min()'
          master_item:
            key: gitlab.get_metrics
          tags:
            - tag: component
              value: fds
        - uuid: 98feff3bfe0d4a9ea88733ae8fef8769
          name: 'Ruby: CPU  usage per second'
          type: DEPENDENT
          key: gitlab.ruby.process_cpu_seconds.rate
          value_type: FLOAT
          units: s
          description: 'Average CPU time util in seconds.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.name=="ruby_process_cpu_seconds_total")].value.avg()'
              error_handler: DISCARD_VALUE
            - type: CHANGE_PER_SECOND
          master_item:
            key: gitlab.get_metrics
          tags:
            - tag: component
              value: cpu
        - uuid: 91ed44c1738745119e892eadb88b417f
          name: 'Ruby: File descriptors, max'
          type: DEPENDENT
          key: gitlab.ruby.process_max_fds
          value_type: FLOAT
          description: 'Maximum number of open file descriptors per process.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.name=="ruby_process_max_fds")].value.avg()'
          master_item:
            key: gitlab.get_metrics
          tags:
            - tag: component
              value: fds
        - uuid: 8de84a159b864ed791c07835aa0ec39a
          name: 'Ruby: RSS memory, avg'
          type: DEPENDENT
          key: gitlab.ruby.process_resident_memory_bytes.avg
          value_type: FLOAT
          units: B
          description: 'Average RSS Memory usage in bytes.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.name=="ruby_process_resident_memory_bytes")].value.avg()'
          master_item:
            key: gitlab.get_metrics
          tags:
            - tag: component
              value: memory
        - uuid: 27285f7d3c344d68b7945edde3cb8ecf
          name: 'Ruby: RSS memory, max'
          type: DEPENDENT
          key: gitlab.ruby.process_resident_memory_bytes.max
          value_type: FLOAT
          units: B
          description: 'Maximum RSS Memory usage in bytes.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.name=="ruby_process_resident_memory_bytes")].value.max()'
          master_item:
            key: gitlab.get_metrics
          tags:
            - tag: component
              value: memory
        - uuid: 0cf8d21bcb8d4fb7880784dc82ba8229
          name: 'Ruby: RSS memory, min'
          type: DEPENDENT
          key: gitlab.ruby.process_resident_memory_bytes.min
          value_type: FLOAT
          units: B
          description: 'Minimum RSS Memory usage in bytes.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.name=="ruby_process_resident_memory_bytes")].value.min()'
          master_item:
            key: gitlab.get_metrics
          tags:
            - tag: component
              value: memory
        - uuid: 68267621a5e14494bf57225e71e05ff4
          name: 'Ruby: First process start time'
          type: DEPENDENT
          key: gitlab.ruby.process_start_time_seconds.first
          units: unixtime
          description: 'Minimum UNIX timestamp of ruby processes start time.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.name=="ruby_process_start_time_seconds")].value.min()'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 3h
          master_item:
            key: gitlab.get_metrics
          tags:
            - tag: component
              value: application
        - uuid: be88084e9b544af68f78c013caf6b59a
          name: 'Ruby: Last process start time'
          type: DEPENDENT
          key: gitlab.ruby.process_start_time_seconds.last
          units: unixtime
          description: 'Maximum UNIX timestamp ruby processes start time.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.name=="ruby_process_start_time_seconds")].value.max()'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 3h
          master_item:
            key: gitlab.get_metrics
          tags:
            - tag: component
              value: application
        - uuid: f23849bd9716444f8bf65d3964e3be15
          name: 'Ruby: Running_threads'
          type: DEPENDENT
          key: gitlab.ruby.threads_running
          description: 'Number of running Ruby threads.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.name=="gitlab_ruby_threads_running_threads")].value.sum()'
          master_item:
            key: gitlab.get_metrics
          tags:
            - tag: component
              value: system
          triggers:
            - uuid: e24496a9499447b2bbdf70f85bbf2113
              expression: 'nodata(/GitLab by HTTP/gitlab.ruby.threads_running,30m)=1'
              name: 'GitLab: Failed to fetch info data'
              event_name: 'GitLab: Failed to fetch info data (or no data for 30m)'
              priority: WARNING
              description: 'Zabbix has not received a metrics data for the last 30 minutes'
              manual_close: 'YES'
              dependencies:
                - name: 'GitLab: Liveness check was failed'
                  expression: 'last(/GitLab by HTTP/gitlab.liveness)=0'
              tags:
                - tag: scope
                  value: availability
        - uuid: 56af56ccc23d44bcb636871229fbcde2
          name: 'User CAPTCHA logins, total'
          type: DEPENDENT
          key: gitlab.successful_login_captcha_total
          description: 'Counter of successful CAPTCHA attempts during login.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.name=="successful_login_captcha_total")].value.first()'
              error_handler: DISCARD_VALUE
          master_item:
            key: gitlab.get_metrics
          tags:
            - tag: component
              value: sessions
        - uuid: 95deb1dc93d34935930b154d1222c8a4
          name: 'Transactions per second'
          type: DEPENDENT
          key: gitlab.transactions.rate
          value_type: FLOAT
          units: rps
          description: 'Transactions per second (gitlab_transaction_* metrics).'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.name=~"gitlab_transaction_.*_count_total")].value.sum()'
              error_handler: DISCARD_VALUE
            - type: CHANGE_PER_SECOND
          master_item:
            key: gitlab.get_metrics
          tags:
            - tag: component
              value: transactions
        - uuid: d1a346edc81d487da115105333e8992d
          name: 'Upload file does not exist'
          type: DEPENDENT
          key: gitlab.upload_file_does_not_exist
          description: 'Number of times an upload record could not find its file.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.name=="upload_file_does_not_exist")].value.first()'
              error_handler: DISCARD_VALUE
          master_item:
            key: gitlab.get_metrics
          tags:
            - tag: component
              value: application
        - uuid: 62c9c5a8886e431bb04c40a8045fe207
          name: 'User logins, total'
          type: DEPENDENT
          key: gitlab.user_session_logins_total
          description: 'Counter of how many users have logged in since GitLab was started or restarted.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.name=="user_session_logins_total")].value.first()'
              error_handler: DISCARD_VALUE
          master_item:
            key: gitlab.get_metrics
          tags:
            - tag: component
              value: sessions
      discovery_rules:
        - uuid: acd3e31daa8f497bb1ce0f91d104d928
          name: 'Puma metrics discovery'
          type: HTTP_AGENT
          key: gitlab.puma.discovery
          delay: 3h
          description: 'Discovery of Puma specific metrics when Puma is used.'
          item_prototypes:
            - uuid: 6b6ebfe9326247c8a57fb8c96125bcee
              name: 'Active connections'
              type: DEPENDENT
              key: 'gitlab.puma.active_connections[{#SINGLETON}]'
              description: 'Number of puma threads processing a request.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$[?(@.name==''puma_active_connections'')].value.sum()'
              master_item:
                key: gitlab.get_metrics
              tags:
                - tag: component
                  value: puma
            - uuid: 14194f273b4e47d98cfdcbefff64cc68
              name: 'Idle threads'
              type: DEPENDENT
              key: 'gitlab.puma.idle_threads[{#SINGLETON}]'
              description: 'The number of spawned puma threads which are not processing a request.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$[?(@.name==''puma_idle_threads'')].value.sum()'
              master_item:
                key: gitlab.get_metrics
              tags:
                - tag: component
                  value: puma
            - uuid: 33a1be2938e24ce2a3fb650efa4f98d6
              name: 'Killer terminations, total'
              type: DEPENDENT
              key: 'gitlab.puma.killer_terminations_total[{#SINGLETON}]'
              description: 'The number of workers terminated by PumaWorkerKiller.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$[?(@.name==''puma_killer_terminations_total'')].value.sum()'
                  error_handler: DISCARD_VALUE
              master_item:
                key: gitlab.get_metrics
              tags:
                - tag: component
                  value: puma
            - uuid: 7d93438afd73422d90b03e78b1c0f998
              name: 'Max threads'
              type: DEPENDENT
              key: 'gitlab.puma.max_threads[{#SINGLETON}]'
              description: 'The maximum number of puma worker threads.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$[?(@.name==''puma_max_threads'')].value.sum()'
              master_item:
                key: gitlab.get_metrics
              tags:
                - tag: component
                  value: puma
            - uuid: fe381c99c2464e95bac63da2df994b8a
              name: 'Pool capacity'
              type: DEPENDENT
              key: 'gitlab.puma.pool_capacity[{#SINGLETON}]'
              description: 'The number of requests the puma worker is capable of taking right now.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$[?(@.name==''puma_pool_capacity'')].value.sum()'
              master_item:
                key: gitlab.get_metrics
              tags:
                - tag: component
                  value: puma
            - uuid: 8c375d8323f9459a8b2a6254b7afed5b
              name: 'Queued connections'
              type: DEPENDENT
              key: 'gitlab.puma.queued_connections[{#SINGLETON}]'
              description: 'The number of connections in that puma worker''s "todo" set waiting for a worker thread.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$[?(@.name==''puma_queued_connections'')].value.sum()'
              master_item:
                key: gitlab.get_metrics
              tags:
                - tag: component
                  value: puma
              trigger_prototypes:
                - uuid: 356c8dc915d84382b3f8dfe45b901f46
                  expression: 'min(/GitLab by HTTP/gitlab.puma.queued_connections[{#SINGLETON}],15m)>{$GITLAB.PUMA.QUEUE.MAX.WARN}'
                  name: 'GitLab: Puma is queueing requests'
                  event_name: 'GitLab: Puma is queueing requests (over {$GITLAB.PUMA.QUEUE.MAX.WARN}% for 15m)'
                  priority: WARNING
                  tags:
                    - tag: scope
                      value: performance
            - uuid: 02b27e8a68884f399a8359ed6967d614
              name: 'Running threads'
              type: DEPENDENT
              key: 'gitlab.puma.running[{#SINGLETON}]'
              description: 'The number of running puma threads.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$[?(@.name==''puma_running'')].value.sum()'
              master_item:
                key: gitlab.get_metrics
              tags:
                - tag: component
                  value: puma
            - uuid: b43e4275dd64427bb6eb4890c556c513
              name: 'Running workers'
              type: DEPENDENT
              key: 'gitlab.puma.running_workers[{#SINGLETON}]'
              description: 'The number of booted puma workers.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$[?(@.name==''puma_running_workers'')].value.sum()'
              master_item:
                key: gitlab.get_metrics
              tags:
                - tag: component
                  value: puma
            - uuid: 0169db2581ba48579edc911cad4b41d7
              name: 'Stale workers'
              type: DEPENDENT
              key: 'gitlab.puma.stale_workers[{#SINGLETON}]'
              description: 'The number of old puma workers.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$[?(@.name==''puma_stale_workers'')].value.sum()'
              master_item:
                key: gitlab.get_metrics
              tags:
                - tag: component
                  value: puma
            - uuid: 19e0149a6de846c7a39b305037469ecb
              name: Workers
              type: DEPENDENT
              key: 'gitlab.puma.workers[{#SINGLETON}]'
              description: 'Total number of puma workers.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$[?(@.name==''puma_workers'')].value.sum()'
              master_item:
                key: gitlab.get_metrics
              tags:
                - tag: component
                  value: puma
          trigger_prototypes:
            - uuid: b69fe81449bd4b6cb6dfddeb333e8898
              expression: 'min(/GitLab by HTTP/gitlab.puma.active_connections[{#SINGLETON}],5m)/last(/GitLab by HTTP/gitlab.puma.max_threads[{#SINGLETON}])*100>{$GITLAB.PUMA.UTILIZATION.MAX.WARN}'
              name: 'GitLab: Puma instance thread utilization is too high'
              event_name: 'GitLab: Puma instance thread utilization is too high (over {$GITLAB.PUMA.UTILIZATION.MAX.WARN}% for 5m)'
              priority: WARNING
              tags:
                - tag: scope
                  value: capacity
          url: '{$GITLAB.URL}/-/metrics{$GITLAB.HEALTH.TOKEN}'
          preprocessing:
            - type: PROMETHEUS_TO_JSON
              parameters:
                - puma_workers
            - type: JAVASCRIPT
              parameters:
                - 'return JSON.stringify(value != "[]" ? [{''{#SINGLETON}'': ''''}] : []);'
        - uuid: 912723d1837641cf9b84996788bd6b54
          name: 'Unicorn metrics discovery'
          type: HTTP_AGENT
          key: gitlab.unicorn.discovery
          delay: 3h
          description: 'DiscoveryUnicorn specific metrics, when Unicorn is used.'
          item_prototypes:
            - uuid: 7461ee7fad7f4597825644b80cce2ec2
              name: 'Unicorn: Active connections'
              type: DEPENDENT
              key: 'gitlab.unicorn.active_connections[{#SINGLETON}]'
              description: 'The number of active Unicorn connections.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$[?(@.name==''unicorn_active_connections'')].value.sum()'
              master_item:
                key: gitlab.get_metrics
              tags:
                - tag: component
                  value: unicorn
            - uuid: 31e0f545c6c6428c8f9f46426cb97ca7
              name: 'Unicorn: Queued connections'
              type: DEPENDENT
              key: 'gitlab.unicorn.queued_connections[{#SINGLETON}]'
              description: 'The number of queued Unicorn connections.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$[?(@.name==''unicorn_queued_connections'')].value.sum()'
              master_item:
                key: gitlab.get_metrics
              tags:
                - tag: component
                  value: unicorn
              trigger_prototypes:
                - uuid: 84142d0996c0420c8b07c7e17d1b9a47
                  expression: 'min(/GitLab by HTTP/gitlab.unicorn.queued_connections[{#SINGLETON}],5m)>{$GITLAB.UNICORN.QUEUE.MAX.WARN}'
                  name: 'GitLab: Unicorn is queueing requests'
                  event_name: 'GitLab: Unicorn is queueing requests (over {$GITLAB.UNICORN.QUEUE.MAX.WARN}% for 5m)'
                  priority: WARNING
                  tags:
                    - tag: scope
                      value: performance
            - uuid: 44a12fd548b742069cae53a78f7f8ab0
              name: 'Unicorn: Workers'
              type: DEPENDENT
              key: 'gitlab.unicorn.unicorn_workers[{#SINGLETON}]'
              description: 'The number of Unicorn workers'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$[?(@.name==''unicorn_workers'')].value.sum()'
              master_item:
                key: gitlab.get_metrics
              tags:
                - tag: component
                  value: unicorn
          trigger_prototypes:
            - uuid: 731bf8eb456c49739a3fcd7aec24c7d7
              expression: 'min(/GitLab by HTTP/gitlab.unicorn.active_connections[{#SINGLETON}],5m)/last(/GitLab by HTTP/gitlab.unicorn.unicorn_workers[{#SINGLETON}])*100>{$GITLAB.UNICORN.UTILIZATION.MAX.WARN}'
              name: 'GitLab: Unicorn worker utilization is too high'
              event_name: 'GitLab: Unicorn worker utilization is too high (over {$GITLAB.UNICORN.UTILIZATION.MAX.WARN}% for 5m)'
              priority: WARNING
              tags:
                - tag: scope
                  value: capacity
          url: '{$GITLAB.URL}/-/metrics{$GITLAB.HEALTH.TOKEN}'
          preprocessing:
            - type: PROMETHEUS_TO_JSON
              parameters:
                - unicorn_workers
              error_handler: DISCARD_VALUE
            - type: JAVASCRIPT
              parameters:
                - 'return JSON.stringify(value != "[]" ? [{''{#SINGLETON}'': ''''}] : []);'
      tags:
        - tag: class
          value: software
        - tag: subclass
          value: communication
        - tag: subclass
          value: development
        - tag: target
          value: gitlab
      macros:
        - macro: '{$GITLAB.HEALTH.TOKEN}'
          description: 'The token path for Gitlab health check. Example `?token=your_token`'
          config:
            type: TEXT
            priority: '2'
            label: 'GitLab health check token path'
            description: 'The token path for Gitlab health check. Example `?token=your_token`'
            required: 'YES'
        - macro: '{$GITLAB.HTTP.FAIL.MAX.WARN}'
          value: '2'
          description: 'The maximum number of HTTP request failures for a trigger expression.'
          config:
            type: TEXT
            priority: '5'
            section_name: Thresholds
            label: 'Max HTTP request failures'
            description: 'The maximum number of HTTP request failures for a trigger expression.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$GITLAB.OPEN.FDS.MAX.WARN}'
          value: '90'
          description: 'The maximum percentage of used file descriptors for a trigger expression.'
          config:
            type: TEXT
            priority: '9'
            section_name: Thresholds
            label: 'Max file descriptors used (%)'
            description: 'The maximum percentage of used file descriptors for a trigger expression. In the range from 0 to 100 inclusive.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$GITLAB.PUMA.QUEUE.MAX.WARN}'
          value: '1'
          description: 'The maximum number of Puma queued requests for a trigger expression.'
          config:
            type: TEXT
            priority: '8'
            section_name: Thresholds
            label: 'Max Puma queued requests'
            description: 'The maximum number of Puma queued requests for a trigger expression.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$GITLAB.PUMA.UTILIZATION.MAX.WARN}'
          value: '90'
          description: 'The maximum percentage of Puma thread utilization for a trigger expression.'
          config:
            type: TEXT
            priority: '4'
            section_name: Thresholds
            label: 'Max Puma thread utilization (%)'
            description: 'The maximum percentage of Puma thread utilization for a trigger expression. In the range from 0 to 100 inclusive.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$GITLAB.REDIS.FAIL.MAX.WARN}'
          value: '2'
          description: 'The maximum number of Redis client exceptions for a trigger expression.'
          config:
            type: TEXT
            priority: '6'
            section_name: Thresholds
            label: 'Max Redis client exceptions'
            description: 'The maximum number of Redis client exceptions for a trigger expression.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$GITLAB.UNICORN.QUEUE.MAX.WARN}'
          value: '1'
          description: 'The maximum number of Unicorn queued requests for a trigger expression.'
          config:
            type: TEXT
            priority: '7'
            section_name: Thresholds
            label: 'Max Unicorn queued requests'
            description: 'The maximum number of Unicorn queued requests for a trigger expression.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$GITLAB.UNICORN.UTILIZATION.MAX.WARN}'
          value: '90'
          description: 'The maximum percentage of Unicorn workers utilization for a trigger expression.'
          config:
            type: TEXT
            priority: '3'
            section_name: Thresholds
            label: 'Max Unicorn workers utilization (%)'
            description: 'The maximum percentage of Unicorn workers utilization for a trigger expression. In the range from 0 to 100 inclusive.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$GITLAB.URL}'
          value: 'http://localhost'
          description: 'URL of a GitLab instance.'
          config:
            type: TEXT
            priority: '1'
            label: 'GitLab instance URL'
            description: 'URL of a GitLab instance.'
            required: 'YES'
      valuemaps:
        - uuid: 3b40391bb8b6472e9c3fd8e1f001fe04
          name: 'GitLab healthcheck'
          mappings:
            - value: '0'
              newvalue: Failed
            - value: '1'
              newvalue: Ok
    - uuid: f1336fd88ab0415a9c02892a71e50032
      template: 'Morningstar SunSaver MPPT by SNMP'
      name: 'Morningstar SunSaver MPPT by SNMP'
      description: |
        MIBs used:
        SUNSAVER-MPPT
        
        Generated by official Zabbix template tool "Templator"
      wizard_ready: 'YES'
      vendor:
        name: Zabbix
        version: 8.0-2
      groups:
        - name: 'Templates/Network devices'
      items:
        - uuid: 9836b1fc81b84a44b2a708291bd5bf1a
          name: 'Array: Sweep Pmax'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.33333.3.57.0]'
          key: 'array.sweep_pmax[arrayMaxPowerSweep.0]'
          value_type: FLOAT
          units: W
          description: |
            MIB: SUNSAVER-MPPT
            Description:Array Open Circuit Voltage
            Scaling Factor:0.0030517578125
            Units:V
            Range:[0.0, 80.0]
            Modbus address:0x002A
          preprocessing:
            - type: MULTIPLIER
              parameters:
                - '0.01509857178'
            - type: REGEX
              parameters:
                - '^(\d+)(\.\d{1,2})?'
                - \1\2
          tags:
            - tag: component
              value: array
        - uuid: 0842746ca41c44128a575113307259e2
          name: 'Array: Sweep Vmp'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.33333.3.56.0]'
          key: 'array.sweep_vmp[arrayVmp.0]'
          value_type: FLOAT
          units: V
          description: |
            MIB: SUNSAVER-MPPT
            Description:Array Max. Power Point Voltage
            Scaling Factor:0.0030517578125
            Units:V
            Range:[0.0, 5000.0]
            Modbus address:0x0028
          preprocessing:
            - type: MULTIPLIER
              parameters:
                - '0.003051757813'
            - type: REGEX
              parameters:
                - '^(\d+)(\.\d{1,2})?'
                - \1\2
          tags:
            - tag: component
              value: array
        - uuid: 0e3371208513416ab1b9afdf2c3b2c08
          name: 'Array: Sweep Voc'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.33333.3.58.0]'
          key: 'array.sweep_voc[arrayVoc.0]'
          value_type: FLOAT
          units: V
          description: |
            MIB: SUNSAVER-MPPT
            Description:Array Open Circuit Voltage
            Scaling Factor:0.0030517578125
            Units:V
            Range:[0.0, 80.0]
            Modbus address:0x002A
          preprocessing:
            - type: MULTIPLIER
              parameters:
                - '0.003051757813'
            - type: REGEX
              parameters:
                - '^(\d+)(\.\d{1,2})?'
                - \1\2
          tags:
            - tag: component
              value: array
        - uuid: da1f347b28dd4fbeb123f228adefb0ed
          name: 'Array: Voltage'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.33333.3.31.0]'
          key: 'array.voltage[arrayVoltage.0]'
          value_type: FLOAT
          units: V
          description: |
            MIB: SUNSAVER-MPPT
            Description:Array Voltage
            Scaling Factor:0.0030517578125
            Units:V
            Range:[0, 80]
            Modbus address:0x0009
          preprocessing:
            - type: MULTIPLIER
              parameters:
                - '0.003051757813'
            - type: REGEX
              parameters:
                - '^(\d+)(\.\d{1,2})?'
                - \1\2
          tags:
            - tag: component
              value: array
        - uuid: f8803a1390b745f08673d4ea998548a9
          name: 'Battery: Battery Voltage discovery'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.33333.3.30.0]'
          key: 'battery.voltage.discovery[batteryVoltage.0]'
          delay: 15m
          history: '0'
          value_type: FLOAT
          units: V
          description: 'MIB: SUNSAVER-MPPT'
          preprocessing:
            - type: MULTIPLIER
              parameters:
                - '0.003051757813'
          tags:
            - tag: component
              value: battery
            - tag: component
              value: discovery
            - tag: component
              value: raw
        - uuid: a36313ef0933403788a42de8a62b4838
          name: 'Battery: Charge Current'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.33333.3.33.0]'
          key: 'charge.current[chargeCurrent.0]'
          value_type: FLOAT
          units: A
          description: |
            MIB: SUNSAVER-MPPT
            Description:Target Regulation Voltage
            Scaling Factor:0.0030517578125
            Units:V
            Range:[0.0, 80.0]
            Modbus address:0x0014
          preprocessing:
            - type: MULTIPLIER
              parameters:
                - '0.002415771484'
            - type: REGEX
              parameters:
                - '^(\d+)(\.\d{1,2})?'
                - \1\2
          tags:
            - tag: component
              value: battery
        - uuid: 4da765c8e26540c190ea07be08b87abc
          name: 'Battery: Charge State'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.33333.3.39.0]'
          key: 'charge.state[chargeState.0]'
          value_type: FLOAT
          description: |
            MIB: SUNSAVER-MPPT
            Description:Control State
            Modbus address:0x0011
            
            0: Start
            1: NightCheck
            2: Disconnect
            3: Night
            4: Fault
            5: BulkMppt
            6: Pwm
            7: Float
            8: Equalize
          valuemap:
            name: 'SunSaver MPPT charge state'
          preprocessing:
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          tags:
            - tag: component
              value: battery
          triggers:
            - uuid: 0362139c66f4464db8c022b9ffce5502
              expression: 'last(/Morningstar SunSaver MPPT by SNMP/charge.state[chargeState.0])={$CHARGE.STATE.CRIT}'
              name: 'Morningstar SunSaver MPPT: Battery: Device charge in critical state'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: HIGH
              tags:
                - tag: scope
                  value: notice
            - uuid: d5439cee53b148ecb4186286c4e93ada
              expression: 'last(/Morningstar SunSaver MPPT by SNMP/charge.state[chargeState.0])={$CHARGE.STATE.WARN}'
              name: 'Morningstar SunSaver MPPT: Battery: Device charge in warning state'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: WARNING
              dependencies:
                - name: 'Morningstar SunSaver MPPT: Battery: Device charge in critical state'
                  expression: 'last(/Morningstar SunSaver MPPT by SNMP/charge.state[chargeState.0])={$CHARGE.STATE.CRIT}'
              tags:
                - tag: scope
                  value: notice
        - uuid: 149545b9154044e3af27b4e9ad809c0e
          name: 'Counter: Charge Amp-hours'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.33333.3.43.0]'
          key: 'counter.charge_amp_hours[ahChargeResettable.0]'
          value_type: FLOAT
          units: Ah
          description: |
            MIB: SUNSAVER-MPPT
            Description:Ah Charge(Resettable)
            Scaling Factor:0.1
            Units:Ah
            Range:[0.0, 4294967294]
            Modbus addresses:H=0x0015 L=0x0016
          preprocessing:
            - type: MULTIPLIER
              parameters:
                - '0.1'
          tags:
            - tag: component
              value: counter
        - uuid: f6d0f89c747b4418ad34c32b5ac9a5b9
          name: 'Counter: Charge KW-hours'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.33333.3.45.0]'
          key: 'counter.charge_kw_hours[kwhCharge.0]'
          units: '!kWh'
          description: 'MIB: SUNSAVER-MPPT'
          tags:
            - tag: component
              value: counter
        - uuid: 28e679eace174d289ca5ccf90f3b9150
          name: 'Counter: Load Amp-hours'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.33333.3.49.0]'
          key: 'counter.load_amp_hours[ahLoadResettable.0]'
          value_type: FLOAT
          units: Ah
          description: |
            MIB: SUNSAVER-MPPT
            Description:Ah Load(Resettable)
            Scaling Factor:0.1
            Units:Ah
            Range:[0.0, 4294967294]
            Modbus addresses:H=0x001D L=0x001E
          preprocessing:
            - type: MULTIPLIER
              parameters:
                - '0.1'
          tags:
            - tag: component
              value: counter
        - uuid: 6491ee507d9a4c099852d33e57df48a9
          name: 'Load: Current'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.33333.3.34.0]'
          key: 'load.current[loadCurrent.0]'
          value_type: FLOAT
          units: A
          description: |
            MIB: SUNSAVER-MPPT
            Description:Load Current
            Scaling Factor:0.002415771484375
            Units:A
            Range:[0, 60]
            Modbus address:0x000C
          preprocessing:
            - type: MULTIPLIER
              parameters:
                - '0.002415771484'
            - type: REGEX
              parameters:
                - '^(\d+)(\.\d{1,2})?'
                - \1\2
          tags:
            - tag: component
              value: load
        - uuid: c5dfef2deee445ec88e2d63dbfbbaf68
          name: 'Load: State'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.33333.3.46.0]'
          key: 'load.state[loadState.0]'
          value_type: FLOAT
          description: |
            MIB: SUNSAVER-MPPT
            Description:Load State
            Modbus address:0x001A
            
            0: Start
            1: Normal
            2: LvdWarning
            3: Lvd
            4: Fault
            5: Disconnect
            6: NormalOff
            7: Override
            8: NotUsed
          valuemap:
            name: 'SunSaver MPPT load state'
          preprocessing:
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          tags:
            - tag: component
              value: load
          triggers:
            - uuid: bbd3a89b012a40daa646ec7113d43e43
              expression: 'last(/Morningstar SunSaver MPPT by SNMP/load.state[loadState.0])={$LOAD.STATE.CRIT:"lvd"} or last(/Morningstar SunSaver MPPT by SNMP/load.state[loadState.0])={$LOAD.STATE.CRIT:"fault"}'
              name: 'Morningstar SunSaver MPPT: Load: Device load in critical state'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: HIGH
              tags:
                - tag: scope
                  value: notice
            - uuid: 8f6967c1b577431c995a3c13f8cdb1c1
              expression: 'last(/Morningstar SunSaver MPPT by SNMP/load.state[loadState.0])={$LOAD.STATE.WARN:"lvdWarning"}  or last(/Morningstar SunSaver MPPT by SNMP/load.state[loadState.0])={$LOAD.STATE.WARN:"override"}'
              name: 'Morningstar SunSaver MPPT: Load: Device load in warning state'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: WARNING
              dependencies:
                - name: 'Morningstar SunSaver MPPT: Load: Device load in critical state'
                  expression: 'last(/Morningstar SunSaver MPPT by SNMP/load.state[loadState.0])={$LOAD.STATE.CRIT:"lvd"} or last(/Morningstar SunSaver MPPT by SNMP/load.state[loadState.0])={$LOAD.STATE.CRIT:"fault"}'
              tags:
                - tag: scope
                  value: notice
        - uuid: a9ca69fcedbb4524a8eb4b92b975008e
          name: 'Load: Voltage'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.33333.3.32.0]'
          key: 'load.voltage[loadVoltage.0]'
          value_type: FLOAT
          units: V
          description: |
            MIB: SUNSAVER-MPPT
            Description:Load Voltage
            Scaling Factor:0.0030517578125
            Units:V
            Range:[0, 80]
            Modbus address:0x000A
          preprocessing:
            - type: MULTIPLIER
              parameters:
                - '0.003051757813'
            - type: REGEX
              parameters:
                - '^(\d+)(\.\d{1,2})?'
                - \1\2
          tags:
            - tag: component
              value: load
        - uuid: 91f2c1893b594e808032eb0140247d7a
          name: 'Status: Alarms'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.33333.3.52.0]'
          key: 'status.alarms[alarms.0]'
          history: 1h
          value_type: TEXT
          description: |
            MIB: SUNSAVER-MPPT
            Description:Alarms
            Modbus addresses:H=0x0023 L=0x0024
          preprocessing:
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
            - type: JAVASCRIPT
              parameters:
                - |
                  var FIELDS = [
                  	'rtsOpen',
                  	'rtsShorted',
                  	'rtsDisconnected',
                  	'heatsinkTempSensorOpen',
                  	'heatsinkTempSensorShorted',
                  	'sspptHot',
                  	'currentLimit',
                  	'currentOffset',
                  	'undefined',
                  	'undefined1',
                  	'uncalibrated',
                  	'rtsMiswire',
                  	'undefined12',
                  	'undefined123',
                  	'systemMiswire',
                  	'mosfetSOpen',
                  	'p12VoltageReferenceOff',
                  	'highVaCurrentLimit',
                  ];
                  
                  var flags = parseInt(value.replace(/\x20/g, ''), 16),
                  	result = [];
                  
                  for (var i = 0, f = 1 << 31 >>> 0, l = FIELDS.length; i < l; i++, f >>>= 1) {
                  	if (flags & f) {
                  		result.push(FIELDS[i]);
                  	}
                  }
                  
                  return result.length ? result.join('\n') : 'No alarms';
          tags:
            - tag: component
              value: status
          triggers:
            - uuid: 86220f6cc9164490b6d80be4a249e749
              expression: 'count(/Morningstar SunSaver MPPT by SNMP/status.alarms[alarms.0],#3,"like","currentLimit")=2'
              name: 'Morningstar SunSaver MPPT: Status: Device has "currentLimit" alarm flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: WARNING
              tags:
                - tag: scope
                  value: notice
            - uuid: 69016ea6a1204435b3ddb8de6b8944dc
              expression: 'count(/Morningstar SunSaver MPPT by SNMP/status.alarms[alarms.0],#3,"like","currentOffset")=2'
              name: 'Morningstar SunSaver MPPT: Status: Device has "currentOffset" alarm flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: WARNING
              tags:
                - tag: scope
                  value: notice
            - uuid: 2c02465ea74e4c63ab783d235c8f1a30
              expression: 'count(/Morningstar SunSaver MPPT by SNMP/status.alarms[alarms.0],#3,"like","heatsinkTempSensorOpen")=2'
              name: 'Morningstar SunSaver MPPT: Status: Device has "heatsinkTempSensorOpen" alarm flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: WARNING
              tags:
                - tag: scope
                  value: notice
            - uuid: 1aa289c68f0b4b44a043281e6df9e462
              expression: 'count(/Morningstar SunSaver MPPT by SNMP/status.alarms[alarms.0],#3,"like","heatsinkTempSensorShorted")=2'
              name: 'Morningstar SunSaver MPPT: Status: Device has "heatsinkTempSensorShorted" alarm flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: WARNING
              tags:
                - tag: scope
                  value: notice
            - uuid: 6d0ce7d6e2cc407ba0f4d989bdd9a141
              expression: 'count(/Morningstar SunSaver MPPT by SNMP/status.alarms[alarms.0],#3,"like","highVaCurrentLimit")=2'
              name: 'Morningstar SunSaver MPPT: Status: Device has "highVaCurrentLimit" alarm flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: WARNING
              tags:
                - tag: scope
                  value: notice
            - uuid: 718a3426363040e1ab82864635444056
              expression: 'count(/Morningstar SunSaver MPPT by SNMP/status.alarms[alarms.0],#3,"like","mosfetSOpen")=2'
              name: 'Morningstar SunSaver MPPT: Status: Device has "mosfetSOpen" alarm flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: WARNING
              tags:
                - tag: scope
                  value: notice
            - uuid: 4eb4df0b4cf04a198190312cdb33538f
              expression: 'count(/Morningstar SunSaver MPPT by SNMP/status.alarms[alarms.0],#3,"like","p12VoltageReferenceOff")=2'
              name: 'Morningstar SunSaver MPPT: Status: Device has "p12VoltageReferenceOff" alarm flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: WARNING
              tags:
                - tag: scope
                  value: notice
            - uuid: e2ac890bb16d4e0798b0410f33c8a860
              expression: 'count(/Morningstar SunSaver MPPT by SNMP/status.alarms[alarms.0],#3,"like","rtsDisconnected")=2'
              name: 'Morningstar SunSaver MPPT: Status: Device has "rtsDisconnected" alarm flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: WARNING
              tags:
                - tag: scope
                  value: notice
            - uuid: 3b02b27bd4674ae3b820730cee8e611a
              expression: 'count(/Morningstar SunSaver MPPT by SNMP/status.alarms[alarms.0],#3,"like","rtsMiswire")=2'
              name: 'Morningstar SunSaver MPPT: Status: Device has "rtsMiswire" alarm flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: WARNING
              tags:
                - tag: scope
                  value: notice
            - uuid: d253c037d5974ee38e888162687b96ef
              expression: 'count(/Morningstar SunSaver MPPT by SNMP/status.alarms[alarms.0],#3,"like","rtsShorted")=2'
              name: 'Morningstar SunSaver MPPT: Status: Device has "rtsShorted" alarm flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: WARNING
              tags:
                - tag: scope
                  value: notice
            - uuid: 1bea0c0e01314dbaa1cfdfa5a0625755
              expression: 'count(/Morningstar SunSaver MPPT by SNMP/status.alarms[alarms.0],#3,"like","sspptHot")=2'
              name: 'Morningstar SunSaver MPPT: Status: Device has "sspptHot" alarm flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: WARNING
              tags:
                - tag: scope
                  value: notice
            - uuid: d28d0e51500a45859ccb6969d9b5493f
              expression: 'count(/Morningstar SunSaver MPPT by SNMP/status.alarms[alarms.0],#3,"like","systemMiswire")=2'
              name: 'Morningstar SunSaver MPPT: Status: Device has "systemMiswire" alarm flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: WARNING
              tags:
                - tag: scope
                  value: notice
            - uuid: 427f75a98d4440a38e40522bccec03bb
              expression: 'count(/Morningstar SunSaver MPPT by SNMP/status.alarms[alarms.0],#3,"like","uncalibrated")=2'
              name: 'Morningstar SunSaver MPPT: Status: Device has "uncalibrated" alarm flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: WARNING
              tags:
                - tag: scope
                  value: notice
        - uuid: f44756455697466cb905aa6ae4d0220d
          name: 'Status: Array Faults'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.33333.3.40.0]'
          key: 'status.array_faults[arrayFaults.0]'
          history: 1h
          value_type: TEXT
          description: |
            MIB: SUNSAVER-MPPT
            Description:Array Faults
            Modbus address:0x0012
          preprocessing:
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
            - type: JAVASCRIPT
              parameters:
                - |
                  var FIELDS = [
                  	'overcurrent',
                  	'mosfetSShorted',
                  	'softwareFault',
                  	'batteryHvd',
                  	'arrayHvd',
                  	'customSettingsEdit',
                  	'rtsShorted',
                  	'rtsNoLongerValid',
                  	'localTempSensorDamaged',
                  ];
                  
                  var flags = parseInt(value.replace(/\x20/g, ''), 16),
                  	result = [];
                  
                  for (var i = 0, f = 1 << 31 >>> 0, l = FIELDS.length; i < l; i++, f >>>= 1) {
                  	if (flags & f) {
                  		result.push(FIELDS[i]);
                  	}
                  }
                  
                  return result.length ? result.join('\n') : 'No faults';
          tags:
            - tag: component
              value: status
          triggers:
            - uuid: 2d8b0bdeb95c49d68771af384d985311
              expression: 'count(/Morningstar SunSaver MPPT by SNMP/status.array_faults[arrayFaults.0],#3,"like","arrayHvd")=2'
              name: 'Morningstar SunSaver MPPT: Status: Device has "arrayHvd" array faults flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: HIGH
              tags:
                - tag: scope
                  value: notice
            - uuid: 2e07c5d51691462ca0961d77ea974bd5
              expression: 'count(/Morningstar SunSaver MPPT by SNMP/status.array_faults[arrayFaults.0],#3,"like","batteryHvd")=2'
              name: 'Morningstar SunSaver MPPT: Status: Device has "batteryHvd" array faults flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: HIGH
              tags:
                - tag: scope
                  value: notice
            - uuid: 65d2cd1ff93f45db9d7f572ee0a8f568
              expression: 'count(/Morningstar SunSaver MPPT by SNMP/status.array_faults[arrayFaults.0],#3,"like","customSettingsEdit")=2'
              name: 'Morningstar SunSaver MPPT: Status: Device has "customSettingsEdit" array faults flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: HIGH
              tags:
                - tag: scope
                  value: notice
            - uuid: fe217d10399044d7b1008f0010691e1e
              expression: 'count(/Morningstar SunSaver MPPT by SNMP/status.array_faults[arrayFaults.0],#3,"like","localTempSensorDamaged")=2'
              name: 'Morningstar SunSaver MPPT: Status: Device has "localTempSensorDamaged" array faults flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: HIGH
              tags:
                - tag: scope
                  value: notice
            - uuid: fa62f9e4f0f84e278938ba18785a1b5f
              expression: 'count(/Morningstar SunSaver MPPT by SNMP/status.array_faults[arrayFaults.0],#3,"like","mosfetSShorted")=2'
              name: 'Morningstar SunSaver MPPT: Status: Device has "mosfetSShorted" array faults flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: HIGH
              tags:
                - tag: scope
                  value: notice
            - uuid: 6f450621a12e46369745b2a0fed018ac
              expression: 'count(/Morningstar SunSaver MPPT by SNMP/status.array_faults[arrayFaults.0],#3,"like","overcurrent")=2'
              name: 'Morningstar SunSaver MPPT: Status: Device has "overcurrent" array faults flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: HIGH
              tags:
                - tag: scope
                  value: notice
            - uuid: 7ea38daa41a94ab3a9c1efc34276b17b
              expression: 'count(/Morningstar SunSaver MPPT by SNMP/status.array_faults[arrayFaults.0],#3,"like","rtsNoLongerValid")=2'
              name: 'Morningstar SunSaver MPPT: Status: Device has "rtsNoLongerValid" array faults flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: HIGH
              tags:
                - tag: scope
                  value: notice
            - uuid: 91edc885c3f140cc85bb6085f06e6820
              expression: 'count(/Morningstar SunSaver MPPT by SNMP/status.array_faults[arrayFaults.0],#3,"like","rtsShorted")=2'
              name: 'Morningstar SunSaver MPPT: Status: Device has "rtsShorted" array faults flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: HIGH
              tags:
                - tag: scope
                  value: notice
            - uuid: cae74543a0da478d80b9302a2431fe4b
              expression: 'count(/Morningstar SunSaver MPPT by SNMP/status.array_faults[arrayFaults.0],#3,"like","softwareFault")=2'
              name: 'Morningstar SunSaver MPPT: Status: Device has "softwareFault" array faults flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: HIGH
              tags:
                - tag: scope
                  value: notice
        - uuid: 76a660b88bb74e90971bdaec703d3c17
          name: 'Status: Uptime (hardware)'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.2.1.25.1.1.0]'
          key: status.hw.uptime
          units: uptime
          description: '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: status
        - uuid: 24762b0c264745548150a4bd5913156f
          name: 'Status: Load Faults'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.33333.3.47.0]'
          key: 'status.load_faults[loadFaults.0]'
          history: 1h
          value_type: TEXT
          description: |
            MIB: SUNSAVER-MPPT
            Description:Array Faults
            Modbus address:0x0012
          preprocessing:
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
            - type: JAVASCRIPT
              parameters:
                - |
                  var FIELDS = [
                  	'externalShortCircuit',
                  	'overcurrent',
                  	'mosfetShorted',
                  	'software',
                  	'loadHvd',
                  	'highTempDisconnect',
                  	'customSettingsEdit',
                  	'unknownLoadFault'
                  ];
                  
                  var flags = parseInt(value.replace(/\x20/g, ''), 16),
                  	result = [];
                  
                  for (var i = 0, f = 1 << 31 >>> 0, l = FIELDS.length; i < l; i++, f >>>= 1) {
                  	if (flags & f) {
                  		result.push(FIELDS[i]);
                  	}
                  }
                  
                  return result.length ? result.join('\n') : 'No faults';
          tags:
            - tag: component
              value: status
          triggers:
            - uuid: d086fbb093344723a4bb5fe928e984ff
              expression: 'count(/Morningstar SunSaver MPPT by SNMP/status.load_faults[loadFaults.0],#3,"like","customSettingsEdit")=2'
              name: 'Morningstar SunSaver MPPT: Status: Device has "customSettingsEdit" load faults flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: HIGH
              tags:
                - tag: scope
                  value: notice
            - uuid: 5743ed062a954330928092fb8574002a
              expression: 'count(/Morningstar SunSaver MPPT by SNMP/status.load_faults[loadFaults.0],#3,"like","externalShortCircuit")=2'
              name: 'Morningstar SunSaver MPPT: Status: Device has "externalShortCircuit" load faults flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: HIGH
              tags:
                - tag: scope
                  value: notice
            - uuid: 354a1512bca5468585a489dd14fc793d
              expression: 'count(/Morningstar SunSaver MPPT by SNMP/status.load_faults[loadFaults.0],#3,"like","highTempDisconnect")=2'
              name: 'Morningstar SunSaver MPPT: Status: Device has "highTempDisconnect" load faults flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: HIGH
              tags:
                - tag: scope
                  value: notice
            - uuid: 3640e470580846ac9e1651cba186d0a3
              expression: 'count(/Morningstar SunSaver MPPT by SNMP/status.load_faults[loadFaults.0],#3,"like","loadHvd")=2'
              name: 'Morningstar SunSaver MPPT: Status: Device has "loadHvd" load faults flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: HIGH
              tags:
                - tag: scope
                  value: notice
            - uuid: d3911d64792e4b88b31cb51a405a1a2e
              expression: 'count(/Morningstar SunSaver MPPT by SNMP/status.load_faults[loadFaults.0],#3,"like","mosfetShorted")=2'
              name: 'Morningstar SunSaver MPPT: Status: Device has "mosfetShorted" load faults flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: HIGH
              tags:
                - tag: scope
                  value: notice
            - uuid: d1bfa4177c0844ec9fc2bc7270c09338
              expression: 'count(/Morningstar SunSaver MPPT by SNMP/status.load_faults[loadFaults.0],#3,"like","overcurrent")=2'
              name: 'Morningstar SunSaver MPPT: Status: Device has "overcurrent" load faults flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: HIGH
              tags:
                - tag: scope
                  value: notice
            - uuid: baaba919b58546f08cdcd1e2791feb27
              expression: 'count(/Morningstar SunSaver MPPT by SNMP/status.load_faults[loadFaults.0],#3,"like","software")=2'
              name: 'Morningstar SunSaver MPPT: Status: Device has "software" load faults flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: HIGH
              tags:
                - tag: scope
                  value: notice
            - uuid: 41e47074c983421a83b1e500d4591188
              expression: 'count(/Morningstar SunSaver MPPT by SNMP/status.load_faults[loadFaults.0],#3,"like","unknownLoadFault")=2'
              name: 'Morningstar SunSaver MPPT: Status: Device has "unknownLoadFault" load faults flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: HIGH
              tags:
                - tag: scope
                  value: notice
        - uuid: 63512390f2a04885bf8d0e19653a72b1
          name: 'Status: Uptime (network)'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.2.1.1.3.0]'
          key: status.net.uptime
          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: status
          triggers:
            - uuid: 72e6e08faed647a98a027bd25b6a7106
              expression: 'nodata(/Morningstar SunSaver MPPT by SNMP/status.net.uptime,5m)=1'
              name: 'Morningstar SunSaver MPPT: Status: Failed to fetch data'
              event_name: 'Morningstar SunSaver MPPT: Status: Failed to fetch data (or no data for 5m)'
              priority: WARNING
              description: 'Zabbix has not received data for items for the last 5 minutes.'
              manual_close: 'YES'
              tags:
                - tag: scope
                  value: availability
        - uuid: 52afa576b83b49e69ec8d379fbc42965
          name: 'Battery: Target Voltage'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.33333.3.42.0]'
          key: 'target.voltage[targetVoltage.0]'
          value_type: FLOAT
          units: V
          description: |
            MIB: SUNSAVER-MPPT
            Description:Target Regulation Voltage
            Scaling Factor:0.0030517578125
            Units:V
            Range:[0.0, 80.0]
            Modbus address:0x0014
          preprocessing:
            - type: MULTIPLIER
              parameters:
                - '0.003051757813'
            - type: REGEX
              parameters:
                - '^(\d+)(\.\d{1,2})?'
                - \1\2
          tags:
            - tag: component
              value: battery
        - uuid: 430cf6fcb9b74943a8ca7f1d9d06fa56
          name: 'Temperature: Ambient'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.33333.3.37.0]'
          key: 'temp.ambient[ambientTemperature.0]'
          value_type: FLOAT
          units: C
          description: |
            MIB: SUNSAVER-MPPT
            Description:Ambient Temperature
            Scaling Factor:1.0
            Units:deg C
            Range:[-128, 127]
            Modbus address:0x000F
          tags:
            - tag: component
              value: temperature
        - uuid: 157faa85ae244950b4a114b95bad6d50
          name: 'Temperature: Battery'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.33333.3.36.0]'
          key: 'temp.battery[batteryTemperature.0]'
          value_type: FLOAT
          units: C
          description: |
            MIB: SUNSAVER-MPPT
            Description:Heatsink Temperature
            Scaling Factor:1.0
            Units:deg C
            Range:[-128, 127]
            Modbus address:0x000D
          tags:
            - tag: component
              value: temperature
          triggers:
            - uuid: cc121c44be05440a82d3344c530456e5
              expression: 'min(/Morningstar SunSaver MPPT by SNMP/temp.battery[batteryTemperature.0],5m)>{$BATTERY.TEMP.MAX.CRIT}'
              name: 'Morningstar SunSaver MPPT: Temperature: Critically high battery temperature'
              event_name: 'Morningstar SunSaver MPPT: Temperature: Critically high battery temperature (over {$BATTERY.TEMP.MAX.CRIT}C for 5m)'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: HIGH
              tags:
                - tag: scope
                  value: notice
            - uuid: 9e0d552b93ae402d98c327420c99d160
              expression: 'max(/Morningstar SunSaver MPPT by SNMP/temp.battery[batteryTemperature.0],5m)<{$BATTERY.TEMP.MIN.CRIT}'
              name: 'Morningstar SunSaver MPPT: Temperature: Critically low battery temperature'
              event_name: 'Morningstar SunSaver MPPT: Temperature: Critically low battery temperature (below {$BATTERY.TEMP.MIN.WARN}C for 5m)'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: HIGH
              tags:
                - tag: scope
                  value: notice
            - uuid: 95b600e280b94949b41422eb60def010
              expression: 'min(/Morningstar SunSaver MPPT by SNMP/temp.battery[batteryTemperature.0],5m)>{$BATTERY.TEMP.MAX.WARN}'
              name: 'Morningstar SunSaver MPPT: Temperature: High battery temperature'
              event_name: 'Morningstar SunSaver MPPT: Temperature: High battery temperature (over {$BATTERY.TEMP.MAX.WARN}C for 5m)'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: WARNING
              dependencies:
                - name: 'Morningstar SunSaver MPPT: Temperature: Critically high battery temperature'
                  expression: 'min(/Morningstar SunSaver MPPT by SNMP/temp.battery[batteryTemperature.0],5m)>{$BATTERY.TEMP.MAX.CRIT}'
              tags:
                - tag: scope
                  value: notice
            - uuid: e351922a0a8c4c53972d9477d47af528
              expression: 'max(/Morningstar SunSaver MPPT by SNMP/temp.battery[batteryTemperature.0],5m)<{$BATTERY.TEMP.MIN.WARN}'
              name: 'Morningstar SunSaver MPPT: Temperature: Low battery temperature'
              event_name: 'Morningstar SunSaver MPPT: Temperature: Low battery temperature (below {$BATTERY.TEMP.MIN.WARN}C for 5m)'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: WARNING
              dependencies:
                - name: 'Morningstar SunSaver MPPT: Temperature: Critically low battery temperature'
                  expression: 'max(/Morningstar SunSaver MPPT by SNMP/temp.battery[batteryTemperature.0],5m)<{$BATTERY.TEMP.MIN.CRIT}'
              tags:
                - tag: scope
                  value: notice
        - uuid: 5f238fe557a7412cad5f3864e407284e
          name: 'Temperature: Heatsink'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.33333.3.35.0]'
          key: 'temp.heatsink[heatsinkTemperature.0]'
          value_type: FLOAT
          units: C
          description: |
            MIB: SUNSAVER-MPPT
            Description:Battery Temperature
            Scaling Factor:1.0
            Units:deg C
            Range:[-128, 127]
            Modbus address:0x000E
          tags:
            - tag: component
              value: temperature
      discovery_rules:
        - uuid: 81b324d81e6549d59cbf14163181fb48
          name: 'Battery voltage discovery'
          type: DEPENDENT
          key: battery.voltage.discovery
          description: 'Discovery for battery voltage triggers'
          item_prototypes:
            - uuid: 903b96b7eb37482da469fc802d3da1b0
              name: 'Battery: Voltage{#SINGLETON}'
              type: SNMP_AGENT
              snmp_oid: 'get[1.3.6.1.4.1.33333.3.30.0]'
              key: 'battery.voltage[batteryVoltage.0{#SINGLETON}]'
              value_type: FLOAT
              units: V
              description: |
                MIB: SUNSAVER-MPPT
                Description:Control State
                Modbus address:0x0011
              preprocessing:
                - type: MULTIPLIER
                  parameters:
                    - '0.003051757813'
                - type: REGEX
                  parameters:
                    - '^(\d+)(\.\d{1,2})?'
                    - \1\2
              tags:
                - tag: component
                  value: battery
              trigger_prototypes:
                - uuid: bf4ad2cee8cf41baafa3d81df5fbe4d3
                  expression: 'min(/Morningstar SunSaver MPPT by SNMP/battery.voltage[batteryVoltage.0{#SINGLETON}],5m)>{#VOLTAGE.MAX.CRIT}'
                  name: 'Morningstar SunSaver MPPT: Battery: Critically high battery voltage'
                  event_name: 'Morningstar SunSaver MPPT: Battery: Critically high battery voltage (over {#VOLTAGE.MAX.CRIT}V for 5m)'
                  opdata: 'Current value: {ITEM.LASTVALUE1}'
                  priority: HIGH
                  tags:
                    - tag: scope
                      value: capacity
                - uuid: 2aedfef9b8764881a4768e6b32793820
                  expression: 'max(/Morningstar SunSaver MPPT by SNMP/battery.voltage[batteryVoltage.0{#SINGLETON}],5m)<{#VOLTAGE.MIN.CRIT}'
                  name: 'Morningstar SunSaver MPPT: Battery: Critically low battery voltage'
                  event_name: 'Morningstar SunSaver MPPT: Battery: Critically low battery voltage (below {#VOLTAGE.MIN.CRIT}V for 5m)'
                  opdata: 'Current value: {ITEM.LASTVALUE1}'
                  priority: HIGH
                  tags:
                    - tag: scope
                      value: capacity
                - uuid: bec4c7a6a1ab44a4adc8e4286b9a41d9
                  expression: 'min(/Morningstar SunSaver MPPT by SNMP/battery.voltage[batteryVoltage.0{#SINGLETON}],5m)>{#VOLTAGE.MAX.WARN}'
                  name: 'Morningstar SunSaver MPPT: Battery: High battery voltage'
                  event_name: 'Morningstar SunSaver MPPT: Battery: High battery voltage (over {#VOLTAGE.MAX.WARN}V for 5m)'
                  opdata: 'Current value: {ITEM.LASTVALUE1}'
                  priority: WARNING
                  dependencies:
                    - name: 'Morningstar SunSaver MPPT: Battery: Critically high battery voltage'
                      expression: 'min(/Morningstar SunSaver MPPT by SNMP/battery.voltage[batteryVoltage.0{#SINGLETON}],5m)>{#VOLTAGE.MAX.CRIT}'
                  tags:
                    - tag: scope
                      value: capacity
                - uuid: c06425d8a0a24b5f80fd0591be61b3f0
                  expression: 'max(/Morningstar SunSaver MPPT by SNMP/battery.voltage[batteryVoltage.0{#SINGLETON}],5m)<{#VOLTAGE.MIN.WARN}'
                  name: 'Morningstar SunSaver MPPT: Battery: Low battery voltage'
                  event_name: 'Morningstar SunSaver MPPT: Battery: Low battery voltage (below {#VOLTAGE.MIN.WARN}V for 5m)'
                  opdata: 'Current value: {ITEM.LASTVALUE1}'
                  priority: WARNING
                  dependencies:
                    - name: 'Morningstar SunSaver MPPT: Battery: Critically low battery voltage'
                      expression: 'max(/Morningstar SunSaver MPPT by SNMP/battery.voltage[batteryVoltage.0{#SINGLETON}],5m)<{#VOLTAGE.MIN.CRIT}'
                  tags:
                    - tag: scope
                      value: capacity
          graph_prototypes:
            - uuid: b3520796c85a45df954633bc5f87d80b
              name: 'Voltage: Battery/Load{#SINGLETON}'
              graph_items:
                - drawtype: GRADIENT_LINE
                  color: 199C0D
                  item:
                    host: 'Morningstar SunSaver MPPT by SNMP'
                    key: 'battery.voltage[batteryVoltage.0{#SINGLETON}]'
                - sortorder: '1'
                  drawtype: GRADIENT_LINE
                  color: F63100
                  item:
                    host: 'Morningstar SunSaver MPPT by SNMP'
                    key: 'load.voltage[loadVoltage.0]'
          master_item:
            key: 'battery.voltage.discovery[batteryVoltage.0]'
          preprocessing:
            - type: JAVASCRIPT
              parameters:
                - |
                  var v_range = [
                  	[[0, 18], [12, 15, 11.5, 15.5]],
                  	[[18, 36], [24, 30, 23, 31]],
                  	[[36, 99], [48, 60, 46, 62]],
                  ],
                  	result = [];
                  
                  for (var idx in v_range) {
                  	if (v_range[idx][0][0] < value && value <= v_range[idx][0][1]) {
                  		result = [{
                  			'{#VOLTAGE.MIN.WARN}': parseInt({$VOLTAGE.MIN.WARN}) || v_range[idx][1][0],
                  			'{#VOLTAGE.MAX.WARN}': parseInt({$VOLTAGE.MAX.WARN}) || v_range[idx][1][1],
                  			'{#VOLTAGE.MIN.CRIT}': parseInt({$VOLTAGE.MIN.CRIT}) || v_range[idx][1][2],
                  			'{#VOLTAGE.MAX.CRIT}': parseInt({$VOLTAGE.MAX.CRIT}) || v_range[idx][1][3],
                  			'{#SINGLETON}': ''
                  		}];
                  		break;
                  	}
                  }
                  
                  return JSON.stringify(result);
      tags:
        - tag: class
          value: hardware
        - tag: class
          value: power
        - tag: subclass
          value: device
        - tag: target
          value: morningstar
      macros:
        - macro: '{$BATTERY.TEMP.MAX.CRIT}'
          value: '60'
          description: 'Battery high temperature critical value'
          config:
            type: TEXT
            priority: '4'
            section_name: Thresholds
            label: 'Battery maximum critical threshold'
            description: 'Battery high temperature critical value'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$BATTERY.TEMP.MAX.WARN}'
          value: '45'
          description: 'Battery high temperature warning value'
          config:
            type: TEXT
            priority: '2'
            section_name: Thresholds
            label: 'Battery maximum warning threshold'
            description: 'Battery high temperature warning value'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$BATTERY.TEMP.MIN.CRIT}'
          value: '-20'
          description: 'Battery low temperature critical value'
          config:
            type: TEXT
            priority: '3'
            section_name: Thresholds
            label: 'Battery minimum critical threshold'
            description: 'Battery low temperature critical value'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$BATTERY.TEMP.MIN.WARN}'
          value: '0'
          description: 'Battery low temperature warning value'
          config:
            type: TEXT
            priority: '1'
            section_name: Thresholds
            label: 'Battery minimum warning threshold'
            description: 'Battery low temperature warning value'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$CHARGE.STATE.CRIT}'
          value: '4'
          description: fault
          config:
            type: TEXT
            priority: '10'
            section_name: Other
            label: 'Charging critical status'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$CHARGE.STATE.WARN}'
          value: '2'
          description: disconnect
          config:
            type: TEXT
            priority: '9'
            section_name: Other
            label: 'Charging warning status'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$LOAD.STATE.CRIT:"fault"}'
          value: '4'
          description: fault
          config:
            type: TEXT
            priority: '15'
            section_name: Other
            label: 'Load status critical (fault)'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$LOAD.STATE.CRIT:"lvd"}'
          value: '3'
          description: lvd
          config:
            type: TEXT
            priority: '14'
            section_name: Other
            label: 'Load status critical (lvd)'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$LOAD.STATE.WARN:"disconnect"}'
          value: '5'
          description: disconnect
          config:
            type: TEXT
            priority: '12'
            section_name: Other
            label: 'Load status warning (disconnect)'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$LOAD.STATE.WARN:"lvdWarning"}'
          value: '2'
          description: lvdWarning
          config:
            type: TEXT
            priority: '11'
            section_name: Other
            label: 'Load status warning (lvdWarning)'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$LOAD.STATE.WARN:"override"}'
          value: '7'
          description: override
          config:
            type: TEXT
            priority: '13'
            section_name: Other
            label: 'Load status warning (override)'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$VOLTAGE.MAX.CRIT}'
          config:
            type: TEXT
            priority: '8'
            section_name: Thresholds
            label: 'Voltage maximum critical threshold'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$VOLTAGE.MAX.WARN}'
          config:
            type: TEXT
            priority: '6'
            section_name: Thresholds
            label: 'Voltage maximum warning threshold'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$VOLTAGE.MIN.CRIT}'
          config:
            type: TEXT
            priority: '7'
            section_name: Thresholds
            label: 'Voltage minimum critical threshold'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$VOLTAGE.MIN.WARN}'
          config:
            type: TEXT
            priority: '5'
            section_name: Thresholds
            label: 'Voltage minimum warning threshold'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
      dashboards:
        - uuid: 154e1f8f24fc4a3080e003a5bdd81ff8
          name: 'Morningstar SunSaver MPPT: Overview'
          pages:
            - widgets:
                - type: graph
                  width: '72'
                  height: '4'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Morningstar SunSaver MPPT by SNMP'
                        name: 'Array: Voltage'
                    - type: STRING
                      name: reference
                      value: AAAAA
                - type: graph
                  'y': '4'
                  width: '72'
                  height: '4'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Morningstar SunSaver MPPT by SNMP'
                        name: 'Current: Charge/Load'
                    - type: STRING
                      name: reference
                      value: AAAAB
                - type: graph
                  'y': '8'
                  width: '72'
                  height: '4'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Morningstar SunSaver MPPT by SNMP'
                        name: 'Temperature: Ambient/Battery/Heatsink'
                    - type: STRING
                      name: reference
                      value: AAAAC
      valuemaps:
        - uuid: b51b9440e801481fbb76f28b4a5431d1
          name: 'SunSaver MPPT charge state'
          mappings:
            - value: '0'
              newvalue: Start
            - value: '1'
              newvalue: NightCheck
            - value: '2'
              newvalue: Disconnect
            - value: '3'
              newvalue: Night
            - value: '4'
              newvalue: Fault
            - value: '5'
              newvalue: BulkMppt
            - value: '6'
              newvalue: Pwm
            - value: '7'
              newvalue: Float
            - value: '8'
              newvalue: Equalize
        - uuid: f21076ed51104b84ba4d78dd74bd1a5b
          name: 'SunSaver MPPT load state'
          mappings:
            - value: '0'
              newvalue: Start
            - value: '1'
              newvalue: Normal
            - value: '2'
              newvalue: LvdWarning
            - value: '3'
              newvalue: Lvd
            - value: '4'
              newvalue: Fault
            - value: '5'
              newvalue: Disconnect
            - value: '6'
              newvalue: NormalOff
            - value: '7'
              newvalue: Override
            - value: '8'
              newvalue: NotUsed
    - uuid: 07b32152c3654e8ead4c1eeae24efa8f
      template: 'Morningstar TriStar MPPT by SNMP'
      name: 'Morningstar TriStar MPPT by SNMP'
      description: |
        MIBs used:
        TRISTAR-MPPT
        
        Generated by official Zabbix template tool "Templator"
      wizard_ready: 'YES'
      vendor:
        name: Zabbix
        version: 8.0-2
      groups:
        - name: 'Templates/Network devices'
      items:
        - uuid: 2c3dcfd83bf946fb9da84f648c1efbac
          name: 'Array: Array Current'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.33333.2.31.0]'
          key: 'array.current[arrayCurrent.0]'
          value_type: FLOAT
          units: A
          description: |
            MIB: TRISTAR-MPPT
            Description:Array Current
            Scaling Factor:0.00244140625
            Units:A
            Range:[-10, 80]
            Modbus address:0x001d
          preprocessing:
            - type: MULTIPLIER
              parameters:
                - '0.00244140625'
            - type: REGEX
              parameters:
                - '^(\d+)(\.\d{1,2})?'
                - \1\2
          tags:
            - tag: component
              value: array
        - uuid: 53c1cccd0262422eb18bb6745adb2369
          name: 'Array: Sweep Pmax'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.33333.2.33.0]'
          key: 'array.sweep_pmax[arrayPmaxLastSweep.0]'
          value_type: FLOAT
          units: W
          description: |
            MIB: TRISTAR-MPPT
            Description:Pmax (last sweep)
            Scaling Factor:0.10986328125
            Units:W
            Range:[-10, 5000]
            Modbus address:0x003c
          preprocessing:
            - type: MULTIPLIER
              parameters:
                - '0.1098632813'
            - type: REGEX
              parameters:
                - '^(\d+)(\.\d{1,2})?'
                - \1\2
          tags:
            - tag: component
              value: array
        - uuid: 2f0bbf8b6d53457283069aaf8e0386ae
          name: 'Array: Sweep Vmp'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.33333.2.34.0]'
          key: 'array.sweep_vmp[arrayVmpLastSweep.0]'
          value_type: FLOAT
          units: V
          description: |
            MIB: TRISTAR-MPPT
            Description:Vmp (last sweep)
            Scaling Factor:0.0054931640625
            Units:V
            Range:[-10, 180.0]
            Modbus address:0x003d
          preprocessing:
            - type: MULTIPLIER
              parameters:
                - '0.005493164063'
            - type: REGEX
              parameters:
                - '^(\d+)(\.\d{1,2})?'
                - \1\2
          tags:
            - tag: component
              value: array
        - uuid: ced0f7c4abb6409399a9e05797841497
          name: 'Array: Sweep Voc'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.33333.2.35.0]'
          key: 'array.sweep_voc[arrayVocLastSweep.0]'
          value_type: FLOAT
          units: V
          description: |
            MIB: TRISTAR-MPPT
            Description:Voc (last sweep)
            Scaling Factor:0.0054931640625
            Units:V
            Range:[-10, 180.0]
            Modbus address:0x003e
          preprocessing:
            - type: MULTIPLIER
              parameters:
                - '0.005493164063'
            - type: REGEX
              parameters:
                - '^(\d+)(\.\d{1,2})?'
                - \1\2
          tags:
            - tag: component
              value: array
        - uuid: 419b9faf88284121a8806c60c8a4550d
          name: 'Array: Voltage'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.33333.2.30.0]'
          key: 'array.voltage[arrayVoltage.0]'
          value_type: FLOAT
          units: V
          description: |
            MIB: TRISTAR-MPPT
            Description:Array Voltage
            Scaling Factor:0.0054931640625
            Units:V
            Range:[-10, 180]
            Modbus address:0x001b
          preprocessing:
            - type: MULTIPLIER
              parameters:
                - '0.005493164063'
            - type: REGEX
              parameters:
                - '^(\d+)(\.\d{1,2})?'
                - \1\2
          tags:
            - tag: component
              value: array
        - uuid: f40795d2c28b4f53ac50399ca6e6f8d6
          name: 'Battery: Battery Voltage discovery'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.33333.2.36.0]'
          key: 'battery.voltage.discovery[batteryVoltage.0]'
          delay: 15m
          history: '0'
          value_type: FLOAT
          units: V
          description: 'MIB: TRISTAR-MPPT'
          preprocessing:
            - type: MULTIPLIER
              parameters:
                - '0.005493164063'
          tags:
            - tag: component
              value: battery
            - tag: component
              value: discovery
            - tag: component
              value: raw
        - uuid: e1646c9847064d53913d9c57d1b59de7
          name: 'Battery: Charge Current'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.33333.2.42.0]'
          key: 'charge.current[batteryCurrent.0]'
          value_type: FLOAT
          units: A
          description: |
            MIB: TRISTAR-MPPT
            Description:Battery Current
            Scaling Factor:0.00244140625
            Units:A
            Range:[-10, 80]
            Modbus address:0x001c
          preprocessing:
            - type: MULTIPLIER
              parameters:
                - '0.00244140625'
            - type: REGEX
              parameters:
                - '^(\d+)(\.\d{1,2})?'
                - \1\2
          tags:
            - tag: component
              value: battery
        - uuid: e70284aa07924a61add98dc516f0429e
          name: 'Battery: Output Power'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.33333.2.44.0]'
          key: 'charge.output_power[ outputPower.0]'
          value_type: FLOAT
          units: W
          description: |
            MIB: TRISTAR-MPPT
            Description:Output Power
            Scaling Factor:0.10986328125
            Units:W
            Range:[-10, 5000]
            Modbus address:0x003a
          preprocessing:
            - type: MULTIPLIER
              parameters:
                - '0.1098632813'
            - type: REGEX
              parameters:
                - '^(\d+)(\.\d{1,2})?'
                - \1\2
          tags:
            - tag: component
              value: battery
        - uuid: 7ad0e0153d6342a5bdd1576b2ad815e3
          name: 'Battery: Charge State'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.33333.2.46.0]'
          key: 'charge.state[chargeState.0]'
          value_type: FLOAT
          description: |
            MIB: TRISTAR-MPPT
            Description:Charge State
            Modbus address:0x0032
            
            0: Start
            1: NightCheck
            2: Disconnect
            3: Night
            4: Fault
            5: Mppt
            6: Absorption
            7: Float
            8: Equalize
            9: Slave
          valuemap:
            name: 'TriStar MPPT charge state'
          preprocessing:
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          tags:
            - tag: component
              value: battery
          triggers:
            - uuid: 6c6371d2476246789d23404e068e5179
              expression: 'last(/Morningstar TriStar MPPT by SNMP/charge.state[chargeState.0])={$CHARGE.STATE.CRIT}'
              name: 'Morningstar TriStar MPPT: Battery: Device charge in critical state'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: HIGH
              tags:
                - tag: scope
                  value: notice
            - uuid: 65bdeac02fed4febae857f571319bf37
              expression: 'last(/Morningstar TriStar MPPT by SNMP/charge.state[chargeState.0])={$CHARGE.STATE.WARN}'
              name: 'Morningstar TriStar MPPT: Battery: Device charge in warning state'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: WARNING
              dependencies:
                - name: 'Morningstar TriStar MPPT: Battery: Device charge in critical state'
                  expression: 'last(/Morningstar TriStar MPPT by SNMP/charge.state[chargeState.0])={$CHARGE.STATE.CRIT}'
              tags:
                - tag: scope
                  value: notice
        - uuid: 48db3379939b4698b8f30ff7118a9a95
          name: 'Counter: Charge Amp-hours'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.33333.2.50.0]'
          key: 'counter.charge_amp_hours[ahChargeResetable.0]'
          value_type: FLOAT
          units: Ah
          description: |
            MIB: TRISTAR-MPPT
            Description:Ah Charge Resettable
            Scaling Factor:0.1
            Units:Ah
            Range:[0.0, 5000]
            Modbus addresses:H=0x0034 L=0x0035
          preprocessing:
            - type: MULTIPLIER
              parameters:
                - '0.1'
          tags:
            - tag: component
              value: counter
        - uuid: f14eb25c426141d1875d5828b5c62c30
          name: 'Counter: Charge KW-hours'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.33333.2.52.0]'
          key: 'counter.charge_kw_hours[kwhChargeResetable.0]'
          units: '!kWh'
          description: |
            MIB: TRISTAR-MPPT
            Description:kWh Charge Resettable
            Scaling Factor:0.1
            Units:kWh
            Range:[0.0, 65535.0]
            Modbus address:0x0038
          tags:
            - tag: component
              value: counter
        - uuid: 5c96236f9623495289b94bd4d63e6faf
          name: 'Status: Alarms'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.33333.2.57.0]'
          key: 'status.alarms[alarms.0]'
          history: 1h
          value_type: TEXT
          description: |
            MIB: TRISTAR-MPPT
            Description:Faults
            Modbus address:0x002c
          preprocessing:
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
            - type: JAVASCRIPT
              parameters:
                - |
                  var FIELDS = [
                  	'rtsOpen',
                  	'rtsShorted',
                  	'rtsDisconnected',
                  	'heatsinkTempSensorOpen',
                  	'heatsinkTempSensorShorted',
                  	'highTemperatureCurrentLimit',
                  	'currentLimit',
                  	'currentOffset',
                  	'batterySense',
                  	'batterySenseDisconnected',
                  	'uncalibrated',
                  	'rtsMiswire',
                  	'highVoltageDisconnect',
                  	'undefined',
                  	'systemMiswire',
                  	'mosfetSOpen',
                  	'p12VoltageReferenceOff',
                  	'highArrayVCurrentLimit',
                  	'maxAdcValueReached',
                  	'controllerWasReset',
                  ];
                  
                  var flags = parseInt(value.replace(/\x20/g, ''), 16),
                  	result = [];
                  
                  for (var i = 0, f = 1 << 31 >>> 0, l = FIELDS.length; i < l; i++, f >>>= 1) {
                  	if (flags & f) {
                  		result.push(FIELDS[i]);
                  	}
                  }
                  
                  return result.length ? result.join('\n') : 'No alarms';
          tags:
            - tag: component
              value: status
          triggers:
            - uuid: b073c972bb64463aaee85c6129fad319
              expression: 'count(/Morningstar TriStar MPPT by SNMP/status.alarms[alarms.0],#3,"like","batterySense")=2'
              name: 'Morningstar TriStar MPPT: Status: Device has "batterySense" alarm flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: WARNING
              tags:
                - tag: scope
                  value: notice
            - uuid: 80a2d0a457024c22b39f0fcd45992e1e
              expression: 'count(/Morningstar TriStar MPPT by SNMP/status.alarms[alarms.0],#3,"like","batterySenseDisconnected")=2'
              name: 'Morningstar TriStar MPPT: Status: Device has "batterySenseDisconnected" alarm flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: WARNING
              tags:
                - tag: scope
                  value: notice
            - uuid: bac1cc54818245f9baa8dc07ddc0f850
              expression: 'count(/Morningstar TriStar MPPT by SNMP/status.alarms[alarms.0],#3,"like","controllerWasReset")=2'
              name: 'Morningstar TriStar MPPT: Status: Device has "controllerWasReset" alarm flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: WARNING
              tags:
                - tag: scope
                  value: notice
            - uuid: 86c2dfb7b0984eaab02f47c58337f468
              expression: 'count(/Morningstar TriStar MPPT by SNMP/status.alarms[alarms.0],#3,"like","currentLimit")=2'
              name: 'Morningstar TriStar MPPT: Status: Device has "currentLimit" alarm flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: WARNING
              tags:
                - tag: scope
                  value: notice
            - uuid: dd000390277a4e848a3236501817addf
              expression: 'count(/Morningstar TriStar MPPT by SNMP/status.alarms[alarms.0],#3,"like","currentOffset")=2'
              name: 'Morningstar TriStar MPPT: Status: Device has "currentOffset" alarm flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: WARNING
              tags:
                - tag: scope
                  value: notice
            - uuid: 650ecb9c06464937a3f797e73a3d756d
              expression: 'count(/Morningstar TriStar MPPT by SNMP/status.alarms[alarms.0],#3,"like","heatsinkTempSensorOpen")=2'
              name: 'Morningstar TriStar MPPT: Status: Device has "heatsinkTempSensorOpen" alarm flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: WARNING
              tags:
                - tag: scope
                  value: notice
            - uuid: 5999a4b6c49a4dabb6350d826b01e646
              expression: 'count(/Morningstar TriStar MPPT by SNMP/status.alarms[alarms.0],#3,"like","heatsinkTempSensorShorted")=2'
              name: 'Morningstar TriStar MPPT: Status: Device has "heatsinkTempSensorShorted" alarm flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: WARNING
              tags:
                - tag: scope
                  value: notice
            - uuid: 7331337c7ffb4933bca3982614657912
              expression: 'count(/Morningstar TriStar MPPT by SNMP/status.alarms[alarms.0],#3,"like","highArrayVCurrentLimit")=2'
              name: 'Morningstar TriStar MPPT: Status: Device has "highArrayVCurrentLimit" alarm flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: WARNING
              tags:
                - tag: scope
                  value: notice
            - uuid: 82a2e0adba7444c6945666fcb9430808
              expression: 'count(/Morningstar TriStar MPPT by SNMP/status.alarms[alarms.0],#3,"like","highTemperatureCurrentLimit")=2'
              name: 'Morningstar TriStar MPPT: Status: Device has "highTemperatureCurrentLimit" alarm flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: WARNING
              tags:
                - tag: scope
                  value: notice
            - uuid: b1f6d22d205e449a811da905e679800f
              expression: 'count(/Morningstar TriStar MPPT by SNMP/status.alarms[alarms.0],#3,"like","highVoltageDisconnect")=2'
              name: 'Morningstar TriStar MPPT: Status: Device has "highVoltageDisconnect" alarm flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: WARNING
              tags:
                - tag: scope
                  value: notice
            - uuid: e3ce50b9b696486f945ee5a4c1a7a753
              expression: 'count(/Morningstar TriStar MPPT by SNMP/status.alarms[alarms.0],#3,"like","maxAdcValueReached")=2'
              name: 'Morningstar TriStar MPPT: Status: Device has "maxAdcValueReached" alarm flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: WARNING
              tags:
                - tag: scope
                  value: notice
            - uuid: 1536cf07556b4cddb62186030a4321ca
              expression: 'count(/Morningstar TriStar MPPT by SNMP/status.alarms[alarms.0],#3,"like","mosfetSOpen")=2'
              name: 'Morningstar TriStar MPPT: Status: Device has "mosfetSOpen" alarm flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: WARNING
              tags:
                - tag: scope
                  value: notice
            - uuid: 136621f032544ea8af5e86a14ec03cb6
              expression: 'count(/Morningstar TriStar MPPT by SNMP/status.alarms[alarms.0],#3,"like","p12VoltageReferenceOff")=2'
              name: 'Morningstar TriStar MPPT: Status: Device has "p12VoltageReferenceOff" alarm flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: WARNING
              tags:
                - tag: scope
                  value: notice
            - uuid: 62ecaaf59a984b2999d13540c5220470
              expression: 'count(/Morningstar TriStar MPPT by SNMP/status.alarms[alarms.0],#3,"like","rtsDisconnected")=2'
              name: 'Morningstar TriStar MPPT: Status: Device has "rtsDisconnected" alarm flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: WARNING
              tags:
                - tag: scope
                  value: notice
            - uuid: 12037d207b3f413198594877cc7a3862
              expression: 'count(/Morningstar TriStar MPPT by SNMP/status.alarms[alarms.0],#3,"like","rtsMiswire")=2'
              name: 'Morningstar TriStar MPPT: Status: Device has "rtsMiswire" alarm flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: WARNING
              tags:
                - tag: scope
                  value: notice
            - uuid: 330f9dfe6ea34b17bcf4cac2c908d78c
              expression: 'count(/Morningstar TriStar MPPT by SNMP/status.alarms[alarms.0],#3,"like","rtsShorted")=2'
              name: 'Morningstar TriStar MPPT: Status: Device has "rtsShorted" alarm flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: WARNING
              tags:
                - tag: scope
                  value: notice
            - uuid: fba13770ff67433489ec95d62b65d4b5
              expression: 'count(/Morningstar TriStar MPPT by SNMP/status.alarms[alarms.0],#3,"like","systemMiswire")=2'
              name: 'Morningstar TriStar MPPT: Status: Device has "systemMiswire" alarm flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: WARNING
              tags:
                - tag: scope
                  value: notice
            - uuid: de6208b4474f4743ad99444fd7eb135d
              expression: 'count(/Morningstar TriStar MPPT by SNMP/status.alarms[alarms.0],#3,"like","uncalibrated")=2'
              name: 'Morningstar TriStar MPPT: Status: Device has "uncalibrated" alarm flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: WARNING
              tags:
                - tag: scope
                  value: notice
        - uuid: 64a01cde330e437499a719237f68fda2
          name: 'Status: Faults'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.33333.2.55.0]'
          key: 'status.faults[faults.0]'
          history: 1h
          value_type: TEXT
          description: |
            MIB: TRISTAR-MPPT
            Description:Faults
            Modbus address:0x002c
          preprocessing:
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
            - type: JAVASCRIPT
              parameters:
                - |
                  var FIELDS = [
                  	'overcurrent',
                  	'fetShort',
                  	'softwareFault',
                  	'batteryHvd',
                  	'arrayHvd',
                  	'dipSwitchChange',
                  	'customSettingsEdit',
                  	'rtsShorted',
                  	'rtsDisconnected',
                  	'eepromRetryLimit',
                  	'fault11Undefined',
                  	'slaveControlTimeout',
                  ];
                  
                  var flags = parseInt(value.replace(/\x20/g, ''), 16),
                  	result = [];
                  
                  for (var i = 0, f = 1 << 31 >>> 0, l = FIELDS.length; i < l; i++, f >>>= 1) {
                  	if (flags & f) {
                  		result.push(FIELDS[i]);
                  	}
                  }
                  
                  return result.length ? result.join('\n') : 'No faults';
          tags:
            - tag: component
              value: status
          triggers:
            - uuid: 2a1b5a65311144d69c03255336f9f15f
              expression: 'count(/Morningstar TriStar MPPT by SNMP/status.faults[faults.0],#3,"like","arrayHvd")=2'
              name: 'Morningstar TriStar MPPT: Status: Device has "arrayHvd" faults flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: HIGH
              tags:
                - tag: scope
                  value: notice
            - uuid: f837f0839967493bb0e38b21000f5e9a
              expression: 'count(/Morningstar TriStar MPPT by SNMP/status.faults[faults.0],#3,"like","batteryHvd")=2'
              name: 'Morningstar TriStar MPPT: Status: Device has "batteryHvd" faults flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: HIGH
              tags:
                - tag: scope
                  value: notice
            - uuid: 05b70b4be5554dd5ac2c65af04d79986
              expression: 'count(/Morningstar TriStar MPPT by SNMP/status.faults[faults.0],#3,"like","customSettingsEdit")=2'
              name: 'Morningstar TriStar MPPT: Status: Device has "customSettingsEdit" faults flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: HIGH
              tags:
                - tag: scope
                  value: notice
            - uuid: 24ecb8842ea84a82b4d05a4e85150c55
              expression: 'count(/Morningstar TriStar MPPT by SNMP/status.faults[faults.0],#3,"like","dipSwitchChange")=2'
              name: 'Morningstar TriStar MPPT: Status: Device has "dipSwitchChange" faults flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: HIGH
              tags:
                - tag: scope
                  value: notice
            - uuid: 008d82bc793b49afa6cd37d038c837fe
              expression: 'count(/Morningstar TriStar MPPT by SNMP/status.faults[faults.0],#3,"like","eepromRetryLimit")=2'
              name: 'Morningstar TriStar MPPT: Status: Device has "eepromRetryLimit" faults flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: HIGH
              tags:
                - tag: scope
                  value: notice
            - uuid: 71dbbf441c234dcfbf014fc043bf5d3a
              expression: 'count(/Morningstar TriStar MPPT by SNMP/status.faults[faults.0],#3,"like","fetShort")=2'
              name: 'Morningstar TriStar MPPT: Status: Device has "fetShort" faults flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: HIGH
              tags:
                - tag: scope
                  value: notice
            - uuid: c100ec68ddaf40e6964ba2598141daa7
              expression: 'count(/Morningstar TriStar MPPT by SNMP/status.faults[faults.0],#3,"like","overcurrent")=2'
              name: 'Morningstar TriStar MPPT: Status: Device has "overcurrent" faults flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: HIGH
              tags:
                - tag: scope
                  value: notice
            - uuid: 435df7ebe3e047ffada64dcf7e69148a
              expression: 'count(/Morningstar TriStar MPPT by SNMP/status.faults[faults.0],#3,"like","rtsDisconnected")=2'
              name: 'Morningstar TriStar MPPT: Status: Device has "rtsDisconnected" faults flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: HIGH
              tags:
                - tag: scope
                  value: notice
            - uuid: 88443c84eaa0415db976e7a5d6c1dec4
              expression: 'count(/Morningstar TriStar MPPT by SNMP/status.faults[faults.0],#3,"like","rtsShorted")=2'
              name: 'Morningstar TriStar MPPT: Status: Device has "rtsShorted" faults flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: HIGH
              tags:
                - tag: scope
                  value: notice
            - uuid: b19111ec08094dbca30a804011b02ed2
              expression: 'count(/Morningstar TriStar MPPT by SNMP/status.faults[faults.0],#3,"like","slaveControlTimeout")=2'
              name: 'Morningstar TriStar MPPT: Status: Device has "slaveControlTimeout" faults flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: HIGH
              tags:
                - tag: scope
                  value: notice
            - uuid: 0d90cab800ad4bbcbf880c157a7a9dae
              expression: 'count(/Morningstar TriStar MPPT by SNMP/status.faults[faults.0],#3,"like","softwareFault")=2'
              name: 'Morningstar TriStar MPPT: Status: Device has "softwareFault" faults flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: HIGH
              tags:
                - tag: scope
                  value: notice
        - uuid: 5e2aebe0ce2044588636be62cde6b6a3
          name: 'Status: Uptime (hardware)'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.2.1.25.1.1.0]'
          key: status.hw.uptime
          units: uptime
          description: '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: status
        - uuid: 5f1e79c9987648c8abb325a507209a07
          name: 'Status: Uptime (network)'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.2.1.1.3.0]'
          key: status.net.uptime
          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: status
          triggers:
            - uuid: db9317cb9a6645d2bd8f4760f7579c17
              expression: 'nodata(/Morningstar TriStar MPPT by SNMP/status.net.uptime,5m)=1'
              name: 'Morningstar TriStar MPPT: Status: Failed to fetch data'
              event_name: 'Morningstar TriStar MPPT: Status: Failed to fetch data (or no data for 5m)'
              priority: WARNING
              description: 'Zabbix has not received data for items for the last 5 minutes.'
              manual_close: 'YES'
              tags:
                - tag: scope
                  value: availability
        - uuid: c46896a6169142b59fc7f534f1981993
          name: 'Battery: Target Voltage'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.33333.2.45.0]'
          key: 'target.voltage[targetRegulationVoltage.0]'
          value_type: FLOAT
          units: V
          description: |
            MIB: TRISTAR-MPPT
            Description:Target Voltage
            Scaling Factor:0.0054931640625
            Units:V
            Range:[-10, 180.0]
            Modbus address:0x0033
          preprocessing:
            - type: MULTIPLIER
              parameters:
                - '0.005493164063'
            - type: REGEX
              parameters:
                - '^(\d+)(\.\d{1,2})?'
                - \1\2
          tags:
            - tag: component
              value: battery
        - uuid: 9aee4500f32a4016be4f137c948b3d67
          name: 'Temperature: Battery'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.33333.2.48.0]'
          key: 'temp.battery[batteryTemperature.0]'
          value_type: FLOAT
          units: C
          description: |
            MIB: TRISTAR-MPPT
            Description:Batt. Temp
            Scaling Factor:1.0
            Units:C
            Range:[-40, 80]
            Modbus address:0x0025
          tags:
            - tag: component
              value: temperature
          triggers:
            - uuid: 5ec1c2e4786048fc889a37a12a2f4ad6
              expression: 'min(/Morningstar TriStar MPPT by SNMP/temp.battery[batteryTemperature.0],5m)>{$BATTERY.TEMP.MAX.CRIT}'
              name: 'Morningstar TriStar MPPT: Temperature: Critically high battery temperature'
              event_name: 'Morningstar TriStar MPPT: Temperature: Critically high battery temperature (over {$BATTERY.TEMP.MAX.CRIT}C for 5m)'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: HIGH
              tags:
                - tag: scope
                  value: notice
            - uuid: 84c059ff133f4f4d8145615c0a98eb50
              expression: 'max(/Morningstar TriStar MPPT by SNMP/temp.battery[batteryTemperature.0],5m)<{$BATTERY.TEMP.MIN.CRIT}'
              name: 'Morningstar TriStar MPPT: Temperature: Critically low battery temperature'
              event_name: 'Morningstar TriStar MPPT: Temperature: Critically low battery temperature (below {$BATTERY.TEMP.MIN.WARN}C for 5m)'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: HIGH
              tags:
                - tag: scope
                  value: notice
            - uuid: 11d2b988cfec425c9ffb082e9c78490d
              expression: 'min(/Morningstar TriStar MPPT by SNMP/temp.battery[batteryTemperature.0],5m)>{$BATTERY.TEMP.MAX.WARN}'
              name: 'Morningstar TriStar MPPT: Temperature: High battery temperature'
              event_name: 'Morningstar TriStar MPPT: Temperature: High battery temperature (over {$BATTERY.TEMP.MAX.WARN}C for 5m)'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: WARNING
              dependencies:
                - name: 'Morningstar TriStar MPPT: Temperature: Critically high battery temperature'
                  expression: 'min(/Morningstar TriStar MPPT by SNMP/temp.battery[batteryTemperature.0],5m)>{$BATTERY.TEMP.MAX.CRIT}'
              tags:
                - tag: scope
                  value: notice
            - uuid: 46122992e8a04c7bb7a8c8037a2da74a
              expression: 'max(/Morningstar TriStar MPPT by SNMP/temp.battery[batteryTemperature.0],5m)<{$BATTERY.TEMP.MIN.WARN}'
              name: 'Morningstar TriStar MPPT: Temperature: Low battery temperature'
              event_name: 'Morningstar TriStar MPPT: Temperature: Low battery temperature (below {$BATTERY.TEMP.MIN.WARN}C for 5m)'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: WARNING
              dependencies:
                - name: 'Morningstar TriStar MPPT: Temperature: Critically low battery temperature'
                  expression: 'max(/Morningstar TriStar MPPT by SNMP/temp.battery[batteryTemperature.0],5m)<{$BATTERY.TEMP.MIN.CRIT}'
              tags:
                - tag: scope
                  value: notice
        - uuid: ffed57b626254db6bcc0df6de51d39fa
          name: 'Temperature: Heatsink'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.33333.2.49.0]'
          key: 'temp.heatsink[heatsinkTemperature.0]'
          value_type: FLOAT
          units: C
          description: |
            MIB: TRISTAR-MPPT
            Description:HS Temp
            Scaling Factor:1.0
            Units:C
            Range:[-40, 80]
            Modbus address:0x0023
          tags:
            - tag: component
              value: temperature
      discovery_rules:
        - uuid: 5c8910a7991240a9b586d0d87ef00d5d
          name: 'Battery voltage discovery'
          type: DEPENDENT
          key: battery.voltage.discovery
          description: 'Discovery for battery voltage triggers'
          item_prototypes:
            - uuid: 763cce63817f471095bdce7a6127b0bf
              name: 'Battery: Voltage{#SINGLETON}'
              type: SNMP_AGENT
              snmp_oid: 'get[1.3.6.1.4.1.33333.2.36.0]'
              key: 'battery.voltage[batteryVoltage.0{#SINGLETON}]'
              value_type: FLOAT
              units: V
              description: |
                MIB: TRISTAR-MPPT
                Description:Battery voltage
                Scaling Factor:0.0054931640625
                Units:V
                Range:[-10, 180.0]
                Modbus address:0x0018
              preprocessing:
                - type: MULTIPLIER
                  parameters:
                    - '0.005493164063'
                - type: REGEX
                  parameters:
                    - '^(\d+)(\.\d{1,2})?'
                    - \1\2
              tags:
                - tag: component
                  value: battery
              trigger_prototypes:
                - uuid: cf9bb1b6e84d4b03b38f13c1c1d4905c
                  expression: 'min(/Morningstar TriStar MPPT by SNMP/battery.voltage[batteryVoltage.0{#SINGLETON}],5m)>{#VOLTAGE.MAX.CRIT}'
                  name: 'Morningstar TriStar MPPT: Battery: Critically high battery voltage'
                  event_name: 'Morningstar TriStar MPPT: Battery: Critically high battery voltage (over {#VOLTAGE.MAX.CRIT}V for 5m)'
                  opdata: 'Current value: {ITEM.LASTVALUE1}'
                  priority: HIGH
                  tags:
                    - tag: scope
                      value: capacity
                - uuid: d977ded736704d748ca49595f3658b89
                  expression: 'max(/Morningstar TriStar MPPT by SNMP/battery.voltage[batteryVoltage.0{#SINGLETON}],5m)<{#VOLTAGE.MIN.CRIT}'
                  name: 'Morningstar TriStar MPPT: Battery: Critically low battery voltage'
                  event_name: 'Morningstar TriStar MPPT: Battery: Critically low battery voltage (below {#VOLTAGE.MIN.CRIT}V for 5m)'
                  opdata: 'Current value: {ITEM.LASTVALUE1}'
                  priority: HIGH
                  tags:
                    - tag: scope
                      value: capacity
                - uuid: 00deb7608b3e4444bd4833f5b8ae5875
                  expression: 'min(/Morningstar TriStar MPPT by SNMP/battery.voltage[batteryVoltage.0{#SINGLETON}],5m)>{#VOLTAGE.MAX.WARN}'
                  name: 'Morningstar TriStar MPPT: Battery: High battery voltage'
                  event_name: 'Morningstar TriStar MPPT: Battery: High battery voltage (over {#VOLTAGE.MAX.WARN}V for 5m)'
                  opdata: 'Current value: {ITEM.LASTVALUE1}'
                  priority: WARNING
                  dependencies:
                    - name: 'Morningstar TriStar MPPT: Battery: Critically high battery voltage'
                      expression: 'min(/Morningstar TriStar MPPT by SNMP/battery.voltage[batteryVoltage.0{#SINGLETON}],5m)>{#VOLTAGE.MAX.CRIT}'
                  tags:
                    - tag: scope
                      value: capacity
                - uuid: 2877138cdfb0448a9a83eb807b5da24a
                  expression: 'max(/Morningstar TriStar MPPT by SNMP/battery.voltage[batteryVoltage.0{#SINGLETON}],5m)<{#VOLTAGE.MIN.WARN}'
                  name: 'Morningstar TriStar MPPT: Battery: Low battery voltage'
                  event_name: 'Morningstar TriStar MPPT: Battery: Low battery voltage (below {#VOLTAGE.MIN.WARN}V for 5m)'
                  opdata: 'Current value: {ITEM.LASTVALUE1}'
                  priority: WARNING
                  dependencies:
                    - name: 'Morningstar TriStar MPPT: Battery: Critically low battery voltage'
                      expression: 'max(/Morningstar TriStar MPPT by SNMP/battery.voltage[batteryVoltage.0{#SINGLETON}],5m)<{#VOLTAGE.MIN.CRIT}'
                  tags:
                    - tag: scope
                      value: capacity
          graph_prototypes:
            - uuid: f95cafe8c2a744908e3a290b0b2f6252
              name: 'Battery: Voltage{#SINGLETON}'
              graph_items:
                - drawtype: GRADIENT_LINE
                  color: 199C0D
                  item:
                    host: 'Morningstar TriStar MPPT by SNMP'
                    key: 'battery.voltage[batteryVoltage.0{#SINGLETON}]'
          master_item:
            key: 'battery.voltage.discovery[batteryVoltage.0]'
          preprocessing:
            - type: JAVASCRIPT
              parameters:
                - |
                  var v_range = [
                  	[[0, 18], [12, 15, 11.5, 15.5]],
                  	[[18, 36], [24, 30, 23, 31]],
                  	[[36, 99], [48, 60, 46, 62]],
                  ],
                  	result = [];
                  
                  for (var idx in v_range) {
                  	if (v_range[idx][0][0] < value && value <= v_range[idx][0][1]) {
                  		result = [{
                  			'{#VOLTAGE.MIN.WARN}': parseInt({$VOLTAGE.MIN.WARN}) || v_range[idx][1][0],
                  			'{#VOLTAGE.MAX.WARN}': parseInt({$VOLTAGE.MAX.WARN}) || v_range[idx][1][1],
                  			'{#VOLTAGE.MIN.CRIT}': parseInt({$VOLTAGE.MIN.CRIT}) || v_range[idx][1][2],
                  			'{#VOLTAGE.MAX.CRIT}': parseInt({$VOLTAGE.MAX.CRIT}) || v_range[idx][1][3],
                  			'{#SINGLETON}': ''
                  		}];
                  		break;
                  	}
                  }
                  
                  return JSON.stringify(result);
      tags:
        - tag: class
          value: hardware
        - tag: class
          value: power
        - tag: subclass
          value: device
        - tag: target
          value: morningstar
      macros:
        - macro: '{$BATTERY.TEMP.MAX.CRIT}'
          value: '60'
          description: 'Battery high temperature critical value'
          config:
            type: TEXT
            priority: '4'
            section_name: Thresholds
            label: 'Battery maximum critical threshold'
            description: 'Battery high temperature critical value'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$BATTERY.TEMP.MAX.WARN}'
          value: '45'
          description: 'Battery high temperature warning value'
          config:
            type: TEXT
            priority: '2'
            section_name: Thresholds
            label: 'Battery maximum warning threshold'
            description: 'Battery high temperature warning value'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$BATTERY.TEMP.MIN.CRIT}'
          value: '-20'
          description: 'Battery low temperature critical value'
          config:
            type: TEXT
            priority: '3'
            section_name: Thresholds
            label: 'Battery minimum critical threshold'
            description: 'Battery low temperature critical value'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$BATTERY.TEMP.MIN.WARN}'
          value: '0'
          description: 'Battery low temperature warning value'
          config:
            type: TEXT
            priority: '1'
            section_name: Thresholds
            label: 'Battery minimum warning threshold'
            description: 'Battery low temperature warning value'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$CHARGE.STATE.CRIT}'
          value: '4'
          description: fault
          config:
            type: TEXT
            priority: '10'
            section_name: Other
            label: 'Charging critical status'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$CHARGE.STATE.WARN}'
          value: '2'
          description: disconnect
          config:
            type: TEXT
            priority: '9'
            section_name: Other
            label: 'Charging warning status'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$LOAD.STATE.CRIT:"fault"}'
          value: '4'
          description: fault
          config:
            type: TEXT
            priority: '15'
            section_name: Other
            label: 'Load status critical (fault)'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$LOAD.STATE.CRIT:"lvd"}'
          value: '3'
          description: lvd
          config:
            type: TEXT
            priority: '14'
            section_name: Other
            label: 'Load status critical (lvd)'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$LOAD.STATE.WARN:"disconnect"}'
          value: '5'
          description: disconnect
          config:
            type: TEXT
            priority: '12'
            section_name: Other
            label: 'Load status warning (disconnect)'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$LOAD.STATE.WARN:"lvdWarning"}'
          value: '2'
          description: lvdWarning
          config:
            type: TEXT
            priority: '11'
            section_name: Other
            label: 'Load status warning (lvdWarning)'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$LOAD.STATE.WARN:"override"}'
          value: '7'
          description: override
          config:
            type: TEXT
            priority: '13'
            section_name: Other
            label: 'Load status warning (override)'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$VOLTAGE.MAX.CRIT}'
          config:
            type: TEXT
            priority: '8'
            section_name: Thresholds
            label: 'Voltage maximum critical threshold'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$VOLTAGE.MAX.WARN}'
          config:
            type: TEXT
            priority: '6'
            section_name: Thresholds
            label: 'Voltage maximum warning threshold'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$VOLTAGE.MIN.CRIT}'
          config:
            type: TEXT
            priority: '7'
            section_name: Thresholds
            label: 'Voltage minimum critical threshold'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$VOLTAGE.MIN.WARN}'
          config:
            type: TEXT
            priority: '5'
            section_name: Thresholds
            label: 'Voltage minimum warning threshold'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
      dashboards:
        - uuid: ae1fed8a8f3949698ee8510fedf839fe
          name: 'Morningstar TriStar MPPT: Overview'
          pages:
            - widgets:
                - type: graph
                  width: '72'
                  height: '4'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Morningstar TriStar MPPT by SNMP'
                        name: 'Array: Voltage'
                    - type: STRING
                      name: reference
                      value: AAAAA
                - type: graph
                  'y': '4'
                  width: '72'
                  height: '4'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Morningstar TriStar MPPT by SNMP'
                        name: 'Battery: Current'
                    - type: STRING
                      name: reference
                      value: AAAAB
                - type: graph
                  'y': '8'
                  width: '72'
                  height: '4'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Morningstar TriStar MPPT by SNMP'
                        name: 'Battery: Output Power (Watts)'
                    - type: STRING
                      name: reference
                      value: AAAAC
                - type: graph
                  'y': '12'
                  width: '72'
                  height: '4'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Morningstar TriStar MPPT by SNMP'
                        name: 'Temperature: Battery/Heatsink'
                    - type: STRING
                      name: reference
                      value: AAAAD
      valuemaps:
        - uuid: 3c6c60ef422c4788bf0c5b74ffab7ef0
          name: 'TriStar MPPT charge state'
          mappings:
            - value: '0'
              newvalue: Start
            - value: '1'
              newvalue: NightCheck
            - value: '2'
              newvalue: Disconnect
            - value: '3'
              newvalue: Night
            - value: '4'
              newvalue: Fault
            - value: '5'
              newvalue: Mppt
            - value: '6'
              newvalue: Absorption
            - value: '7'
              newvalue: Float
            - value: '8'
              newvalue: Equalize
            - value: '9'
              newvalue: Slave
    - uuid: 230fa9f7c1774821bbe6cdcbbba5cbc6
      template: 'Morningstar TriStar PWM by SNMP'
      name: 'Morningstar TriStar PWM by SNMP'
      description: |
        MIBs used:
        TRISTAR
        
        Generated by official Zabbix template tool "Templator"
      wizard_ready: 'YES'
      vendor:
        name: Zabbix
        version: 8.0-2
      groups:
        - name: 'Templates/Network devices'
      items:
        - uuid: b76ef47ada0c43cfb50c6a80c8ca55e5
          name: 'Battery: Battery Voltage discovery'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.33333.8.30.0]'
          key: 'battery.voltage.discovery[batteryVoltage.0]'
          delay: 15m
          history: '0'
          value_type: FLOAT
          units: V
          description: |
            MIB: TRISTAR
            Description:Battery voltage
            Scaling Factor:0.002950042724609375
            Units:V
            Range:[0.0, 80.0]
            Modbus address:0x0008
          preprocessing:
            - type: MULTIPLIER
              parameters:
                - '0.002950042725'
          tags:
            - tag: component
              value: battery
            - tag: component
              value: discovery
            - tag: component
              value: raw
        - uuid: 0c57da022cf8497e88f788cee1b3a0a6
          name: 'Status: Control Mode'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.33333.8.45.0]'
          key: 'control.mode[controlMode.0]'
          value_type: FLOAT
          description: |
            MIB: TRISTAR
            Description:Control Mode
            Modbus address:0x001A
            
            0: charge
            1: loadControl
            2: diversion
            3: lighting
          valuemap:
            name: 'TriStar PWM control mode'
          tags:
            - tag: component
              value: status
        - uuid: 25a576060f6948e59a855462b04c7276
          name: 'Counter: Amp-hours'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.33333.8.39.0]'
          key: 'counter.charge_amp_hours[ahResettable.0]'
          value_type: FLOAT
          units: Ah
          description: |
            MIB: TRISTAR
            Description:Ah (Resettable)
            Scaling Factor:0.1
            Units:Ah
            Range:[0.0, 50000.0]
            Modbus addresses:H=0x0011 L=0x0012
          preprocessing:
            - type: MULTIPLIER
              parameters:
                - '0.1'
          tags:
            - tag: component
              value: counter
        - uuid: d2351af0b6244044949eba67a7f7b39c
          name: 'Counter: KW-hours'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.33333.8.49.0]'
          key: 'counter.charge_kw_hours[kilowattHours.0]'
          value_type: FLOAT
          units: '!kWh'
          description: |
            MIB: TRISTAR
            Description:Kilowatt Hours
            Scaling Factor:1.0
            Units:kWh
            Range:[0.0, 5000.0]
            Modbus address:0x001E
          preprocessing:
            - type: MULTIPLIER
              parameters:
                - '0.001'
            - type: REGEX
              parameters:
                - '^(\d+)(\.\d{1,2})?'
                - \1\2
          tags:
            - tag: component
              value: counter
        - uuid: 03c3397ac32b47499002b13e0735ec9b
          name: 'Status: Alarms'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.33333.8.42.0]'
          key: 'status.alarms[alarms.0]'
          history: 1h
          value_type: TEXT
          description: |
            MIB: TRISTAR
            Description:Alarms
            Modbus addresses:H=0x001D L=0x0017
          preprocessing:
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
            - type: JAVASCRIPT
              parameters:
                - |
                  var FIELDS = [
                  	'rtsOpen',
                  	'rtsShorted',
                  	'rtsDisconnected',
                  	'heatsinkTempSensorOpen',
                  	'heatsinkTempSensorShorted',
                  	'tristarHot',
                  	'currentLimit',
                  	'currentOffset',
                  	'batterySense',
                  	'batterySenseDisconnected',
                  	'uncalibrated',
                  	'rtsMiswire',
                  	'highVoltageDisconnect',
                  	'diversionLoadNearMax',
                  	'systemMiswire',
                  	'mosfetSOpen',
                  	'p12VoltageReferenceOff',
                  	'loadDisconnectState',
                  ];
                  
                  var flags = parseInt(value.replace(/\x20/g, ''), 16),
                  	result = [];
                  
                  for (var i = 0, f = 1 << 31 >>> 0, l = FIELDS.length; i < l; i++, f >>>= 1) {
                  	if (flags & f) {
                  		result.push(FIELDS[i]);
                  	}
                  }
                  
                  return result.length ? result.join('\n') : 'No alarms';
          tags:
            - tag: component
              value: status
          triggers:
            - uuid: 121d47c6bbdd45bca261df2e01ea41c6
              expression: 'count(/Morningstar TriStar PWM by SNMP/status.alarms[alarms.0],#3,"like","batterySense")=2'
              name: 'Morningstar TriStar PWM: Status: Device has "batterySense" alarm flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: WARNING
              tags:
                - tag: scope
                  value: notice
            - uuid: fd2d9290144143d39bb5a3cf0a2d261f
              expression: 'count(/Morningstar TriStar PWM by SNMP/status.alarms[alarms.0],#3,"like","batterySenseDisconnected")=2'
              name: 'Morningstar TriStar PWM: Status: Device has "batterySenseDisconnected" alarm flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: WARNING
              tags:
                - tag: scope
                  value: notice
            - uuid: 83d5b8d52acd4e21ac6d3a9cf05dcd04
              expression: 'count(/Morningstar TriStar PWM by SNMP/status.alarms[alarms.0],#3,"like","currentLimit")=2'
              name: 'Morningstar TriStar PWM: Status: Device has "currentLimit" alarm flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: WARNING
              tags:
                - tag: scope
                  value: notice
            - uuid: d9529a4372d848038e6ee561d62e9f22
              expression: 'count(/Morningstar TriStar PWM by SNMP/status.alarms[alarms.0],#3,"like","currentOffset")=2'
              name: 'Morningstar TriStar PWM: Status: Device has "currentOffset" alarm flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: WARNING
              tags:
                - tag: scope
                  value: notice
            - uuid: 5f3983acc1cc417e860c1305b11c15ea
              expression: 'count(/Morningstar TriStar PWM by SNMP/status.alarms[alarms.0],#3,"like","diversionLoadNearMax")=2'
              name: 'Morningstar TriStar PWM: Status: Device has "diversionLoadNearMax" alarm flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: WARNING
              tags:
                - tag: scope
                  value: notice
            - uuid: 878e04df7e7b416bb0d2213b5dbb80e6
              expression: 'count(/Morningstar TriStar PWM by SNMP/status.alarms[alarms.0],#3,"like","heatsinkTempSensorOpen")=2'
              name: 'Morningstar TriStar PWM: Status: Device has "heatsinkTempSensorOpen" alarm flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: WARNING
              tags:
                - tag: scope
                  value: notice
            - uuid: c642ed9496ce4322809c7142d32929a5
              expression: 'count(/Morningstar TriStar PWM by SNMP/status.alarms[alarms.0],#3,"like","heatsinkTempSensorShorted")=2'
              name: 'Morningstar TriStar PWM: Status: Device has "heatsinkTempSensorShorted" alarm flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: WARNING
              tags:
                - tag: scope
                  value: notice
            - uuid: 532421fe17bf4732a01a6990e34e649a
              expression: 'count(/Morningstar TriStar PWM by SNMP/status.alarms[alarms.0],#3,"like","highVoltageDisconnect")=2'
              name: 'Morningstar TriStar PWM: Status: Device has "highVoltageDisconnect" alarm flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: WARNING
              tags:
                - tag: scope
                  value: notice
            - uuid: ae90e8034baf4b21906d56d18bfa4da8
              expression: 'count(/Morningstar TriStar PWM by SNMP/status.alarms[alarms.0],#3,"like","loadDisconnectState")=2'
              name: 'Morningstar TriStar PWM: Status: Device has "loadDisconnectState" alarm flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: WARNING
              tags:
                - tag: scope
                  value: notice
            - uuid: 8d8b721c6dee40499b29bee44b21589a
              expression: 'count(/Morningstar TriStar PWM by SNMP/status.alarms[alarms.0],#3,"like","mosfetSOpen")=2'
              name: 'Morningstar TriStar PWM: Status: Device has "mosfetSOpen" alarm flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: WARNING
              tags:
                - tag: scope
                  value: notice
            - uuid: 8cda8e5773de4583b9baa6a6e542e32c
              expression: 'count(/Morningstar TriStar PWM by SNMP/status.alarms[alarms.0],#3,"like","p12VoltageReferenceOff")=2'
              name: 'Morningstar TriStar PWM: Status: Device has "p12VoltageReferenceOff" alarm flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: WARNING
              tags:
                - tag: scope
                  value: notice
            - uuid: 1b6192b8ca364c229b35ba6de89ad56b
              expression: 'count(/Morningstar TriStar PWM by SNMP/status.alarms[alarms.0],#3,"like","rtsDisconnected")=2'
              name: 'Morningstar TriStar PWM: Status: Device has "rtsDisconnected" alarm flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: WARNING
              tags:
                - tag: scope
                  value: notice
            - uuid: 176de77a142d45a3ac39ea42989e209c
              expression: 'count(/Morningstar TriStar PWM by SNMP/status.alarms[alarms.0],#3,"like","rtsMiswire")=2'
              name: 'Morningstar TriStar PWM: Status: Device has "rtsMiswire" alarm flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: WARNING
              tags:
                - tag: scope
                  value: notice
            - uuid: f63029eabc8e498ea7e6336d312ac169
              expression: 'count(/Morningstar TriStar PWM by SNMP/status.alarms[alarms.0],#3,"like","rtsShorted")=2'
              name: 'Morningstar TriStar PWM: Status: Device has "rtsShorted" alarm flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: WARNING
              tags:
                - tag: scope
                  value: notice
            - uuid: 480b69c1febf45a2971788c2f967c45d
              expression: 'count(/Morningstar TriStar PWM by SNMP/status.alarms[alarms.0],#3,"like","systemMiswire")=2'
              name: 'Morningstar TriStar PWM: Status: Device has "systemMiswire" alarm flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: WARNING
              tags:
                - tag: scope
                  value: notice
            - uuid: 4a287e4086c4458aaa3dc48bbb8ee219
              expression: 'count(/Morningstar TriStar PWM by SNMP/status.alarms[alarms.0],#3,"like","tristarHot")=2'
              name: 'Morningstar TriStar PWM: Status: Device has "tristarHot" alarm flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: WARNING
              tags:
                - tag: scope
                  value: notice
            - uuid: de665482d2574730a3a839948dd730ea
              expression: 'count(/Morningstar TriStar PWM by SNMP/status.alarms[alarms.0],#3,"like","uncalibrated")=2'
              name: 'Morningstar TriStar PWM: Status: Device has "uncalibrated" alarm flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: WARNING
              tags:
                - tag: scope
                  value: notice
        - uuid: 9d0f4444f98c4ec082d35559e8fe9ac5
          name: 'Status: Faults'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.33333.8.43.0]'
          key: 'status.faults[faults.0]'
          history: 1h
          value_type: TEXT
          description: |
            MIB: TRISTAR
            Description:Battery voltage
            Scaling Factor:0.002950042724609375
            Units:V
            Range:[0.0, 80.0]
            Modbus address:0x0008
          preprocessing:
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
            - type: JAVASCRIPT
              parameters:
                - |
                  var FIELDS = [
                  	'externalShort',
                  	'overcurrent',
                  	'mosfetSShorted',
                  	'softwareFault',
                  	'highVoltageDisconnect',
                  	'tristarHot',
                  	'dipSwitchChange',
                  	'customSettingsEdit',
                  	'reset',
                  	'systemMiswire',
                  	'rtsShorted',
                  	'rtsDisconnected',
                  ];
                  
                  var flags = parseInt(value.replace(/\x20/g, ''), 16),
                  	result = [];
                  
                  for (var i = 0, f = 1 << 31 >>> 0, l = FIELDS.length; i < l; i++, f >>>= 1) {
                  	if (flags & f) {
                  		result.push(FIELDS[i]);
                  	}
                  }
                  
                  return result.length ? result.join('\n') : 'No faults';
          tags:
            - tag: component
              value: status
          triggers:
            - uuid: 514b041aebdd4ddb8ab2d1222c0ef295
              expression: 'count(/Morningstar TriStar PWM by SNMP/status.faults[faults.0],#3,"like","customSettingsEdit")=2'
              name: 'Morningstar TriStar PWM: Status: Device has "customSettingsEdit" faults flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: HIGH
              tags:
                - tag: scope
                  value: notice
            - uuid: 1a40ce8b87f04ab1b4f30387e9ce2d9d
              expression: 'count(/Morningstar TriStar PWM by SNMP/status.faults[faults.0],#3,"like","dipSwitchChange")=2'
              name: 'Morningstar TriStar PWM: Status: Device has "dipSwitchChange" faults flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: HIGH
              tags:
                - tag: scope
                  value: notice
            - uuid: 49b120c3933c43b1b7f5c77f7b359997
              expression: 'count(/Morningstar TriStar PWM by SNMP/status.faults[faults.0],#3,"like","externalShort")=2'
              name: 'Morningstar TriStar PWM: Status: Device has "externalShort" faults flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: HIGH
              tags:
                - tag: scope
                  value: notice
            - uuid: f063b9f717c44ab988db7ac95bfca68f
              expression: 'count(/Morningstar TriStar PWM by SNMP/status.faults[faults.0],#3,"like","highVoltageDisconnect")=2'
              name: 'Morningstar TriStar PWM: Status: Device has "highVoltageDisconnect" faults flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: HIGH
              tags:
                - tag: scope
                  value: notice
            - uuid: 468716d748f1470cb764ce1af922164d
              expression: 'count(/Morningstar TriStar PWM by SNMP/status.faults[faults.0],#3,"like","mosfetSShorted")=2'
              name: 'Morningstar TriStar PWM: Status: Device has "mosfetSShorted" faults flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: HIGH
              tags:
                - tag: scope
                  value: notice
            - uuid: b6f65dfca421490eafff48991cdf1e3b
              expression: 'count(/Morningstar TriStar PWM by SNMP/status.faults[faults.0],#3,"like","overcurrent")=2'
              name: 'Morningstar TriStar PWM: Status: Device has "overcurrent" faults flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: HIGH
              tags:
                - tag: scope
                  value: notice
            - uuid: 73561a5765694633b1dc0ef1b1f60fd4
              expression: 'count(/Morningstar TriStar PWM by SNMP/status.faults[faults.0],#3,"like","reset")=2'
              name: 'Morningstar TriStar PWM: Status: Device has "reset" faults flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: HIGH
              tags:
                - tag: scope
                  value: notice
            - uuid: d14c7d928f57448390c2b4c588a28c65
              expression: 'count(/Morningstar TriStar PWM by SNMP/status.faults[faults.0],#3,"like","rtsDisconnected")=2'
              name: 'Morningstar TriStar PWM: Status: Device has "rtsDisconnected" faults flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: HIGH
              tags:
                - tag: scope
                  value: notice
            - uuid: d94067598c234968b4929404067eff86
              expression: 'count(/Morningstar TriStar PWM by SNMP/status.faults[faults.0],#3,"like","rtsShorted")=2'
              name: 'Morningstar TriStar PWM: Status: Device has "rtsShorted" faults flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: HIGH
              tags:
                - tag: scope
                  value: notice
            - uuid: 886b18bee7cd4f8eb454973e2d2ae59f
              expression: 'count(/Morningstar TriStar PWM by SNMP/status.faults[faults.0],#3,"like","softwareFault")=2'
              name: 'Morningstar TriStar PWM: Status: Device has "softwareFault" faults flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: HIGH
              tags:
                - tag: scope
                  value: notice
            - uuid: 2e520cdafaaa4eefad5ebea71819c3a6
              expression: 'count(/Morningstar TriStar PWM by SNMP/status.faults[faults.0],#3,"like","systemMiswire")=2'
              name: 'Morningstar TriStar PWM: Status: Device has "systemMiswire" faults flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: HIGH
              tags:
                - tag: scope
                  value: notice
            - uuid: 041be44e639d4d1eadb15230a678e278
              expression: 'count(/Morningstar TriStar PWM by SNMP/status.faults[faults.0],#3,"like","tristarHot")=2'
              name: 'Morningstar TriStar PWM: Status: Device has "tristarHot" faults flag'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: HIGH
              tags:
                - tag: scope
                  value: notice
        - uuid: 6903297e21e14aa8b5eed4eb0f7e1e01
          name: 'Status: Uptime (hardware)'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.2.1.25.1.1.0]'
          key: status.hw.uptime
          units: uptime
          description: '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: status
        - uuid: 642eec19ba5d450186590e9f5bba36db
          name: 'Status: Uptime (network)'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.2.1.1.3.0]'
          key: status.net.uptime
          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: status
          triggers:
            - uuid: 64aa2a79fe854def8e179a4d27790417
              expression: 'nodata(/Morningstar TriStar PWM by SNMP/status.net.uptime,5m)=1'
              name: 'Morningstar TriStar PWM: Status: Failed to fetch data'
              event_name: 'Morningstar TriStar PWM: Status: Failed to fetch data (or no data for 5m)'
              priority: WARNING
              description: 'Zabbix has not received data for items for the last 5 minutes.'
              manual_close: 'YES'
              tags:
                - tag: scope
                  value: availability
        - uuid: bc729e23973b4d9d97d694d884431e0b
          name: 'Temperature: Battery'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.33333.8.37.0]'
          key: 'temp.battery[batteryTemperature.0]'
          value_type: FLOAT
          units: C
          description: |
            MIB: TRISTAR
            Description:Battery Temperature
            Scaling Factor:1.0
            Units:deg C
            Range:[-40, 120]
            Modbus address:0x000F
          tags:
            - tag: component
              value: temperature
          triggers:
            - uuid: e759b90e2bf44bbb8e5efe5b9e458e40
              expression: 'min(/Morningstar TriStar PWM by SNMP/temp.battery[batteryTemperature.0],5m)>{$BATTERY.TEMP.MAX.CRIT}'
              name: 'Morningstar TriStar PWM: Temperature: Critically high battery temperature'
              event_name: 'Morningstar TriStar PWM: Temperature: Critically high battery temperature (over {$BATTERY.TEMP.MAX.CRIT}C for 5m)'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: HIGH
              tags:
                - tag: scope
                  value: notice
            - uuid: e57f335f657d45768509f139d31dcdae
              expression: 'max(/Morningstar TriStar PWM by SNMP/temp.battery[batteryTemperature.0],5m)<{$BATTERY.TEMP.MIN.CRIT}'
              name: 'Morningstar TriStar PWM: Temperature: Critically low battery temperature'
              event_name: 'Morningstar TriStar PWM: Temperature: Critically low battery temperature (below {$BATTERY.TEMP.MIN.WARN}C for 5m)'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: HIGH
              tags:
                - tag: scope
                  value: notice
            - uuid: 7d1444dba9334e91ad425a6f2ff9fef9
              expression: 'min(/Morningstar TriStar PWM by SNMP/temp.battery[batteryTemperature.0],5m)>{$BATTERY.TEMP.MAX.WARN}'
              name: 'Morningstar TriStar PWM: Temperature: High battery temperature'
              event_name: 'Morningstar TriStar PWM: Temperature: High battery temperature (over {$BATTERY.TEMP.MAX.WARN}C for 5m)'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: WARNING
              dependencies:
                - name: 'Morningstar TriStar PWM: Temperature: Critically high battery temperature'
                  expression: 'min(/Morningstar TriStar PWM by SNMP/temp.battery[batteryTemperature.0],5m)>{$BATTERY.TEMP.MAX.CRIT}'
              tags:
                - tag: scope
                  value: notice
            - uuid: 14fe4a22b28c4d08a24da51a54e36e81
              expression: 'max(/Morningstar TriStar PWM by SNMP/temp.battery[batteryTemperature.0],5m)<{$BATTERY.TEMP.MIN.WARN}'
              name: 'Morningstar TriStar PWM: Temperature: Low battery temperature'
              event_name: 'Morningstar TriStar PWM: Temperature: Low battery temperature (below {$BATTERY.TEMP.MIN.WARN}C for 5m)'
              opdata: 'Current value: {ITEM.LASTVALUE1}'
              priority: WARNING
              dependencies:
                - name: 'Morningstar TriStar PWM: Temperature: Critically low battery temperature'
                  expression: 'max(/Morningstar TriStar PWM by SNMP/temp.battery[batteryTemperature.0],5m)<{$BATTERY.TEMP.MIN.CRIT}'
              tags:
                - tag: scope
                  value: notice
        - uuid: a9a009058e99419dbb6cbef5b7797388
          name: 'Temperature: Heatsink'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.33333.8.36.0]'
          key: 'temp.heatsink[heatsinkTemperature.0]'
          value_type: FLOAT
          units: C
          description: |
            MIB: TRISTAR
            Description:Heatsink Temperature
            Scaling Factor:1.0
            Units:deg C
            Range:[-40, 120]
            Modbus address:0x000E
          tags:
            - tag: component
              value: temperature
      discovery_rules:
        - uuid: 0e06c296579f4b6aa40d69ebb62742b4
          name: 'Battery voltage discovery'
          type: DEPENDENT
          key: battery.voltage.discovery
          description: 'Discovery for battery voltage triggers'
          item_prototypes:
            - uuid: e1960caed8c44606bb684e28cdfac3c7
              name: 'Battery: Voltage{#SINGLETON}'
              type: SNMP_AGENT
              snmp_oid: 'get[1.3.6.1.4.1.33333.8.30.0]'
              key: 'battery.voltage[batteryVoltage.0{#SINGLETON}]'
              value_type: FLOAT
              units: V
              description: |
                MIB: TRISTAR
                Description:Battery voltage
                Scaling Factor:0.002950042724609375
                Units:V
                Range:[0.0, 80.0]
                Modbus address:0x0008
              preprocessing:
                - type: MULTIPLIER
                  parameters:
                    - '0.002950042725'
                - type: REGEX
                  parameters:
                    - '^(\d+)(\.\d{1,2})?'
                    - \1\2
              tags:
                - tag: component
                  value: battery
              trigger_prototypes:
                - uuid: 156ec13d673b4a8aa02a87b1794cb722
                  expression: 'min(/Morningstar TriStar PWM by SNMP/battery.voltage[batteryVoltage.0{#SINGLETON}],5m)>{#VOLTAGE.MAX.CRIT}'
                  name: 'Morningstar TriStar PWM: Battery: Critically high battery voltage'
                  event_name: 'Morningstar TriStar PWM: Battery: Critically high battery voltage (over {#VOLTAGE.MAX.CRIT}V for 5m)'
                  opdata: 'Current value: {ITEM.LASTVALUE1}'
                  priority: HIGH
                  tags:
                    - tag: scope
                      value: capacity
                - uuid: 5e4400321f4f45b39397c68a4ba54d8e
                  expression: 'max(/Morningstar TriStar PWM by SNMP/battery.voltage[batteryVoltage.0{#SINGLETON}],5m)<{#VOLTAGE.MIN.CRIT}'
                  name: 'Morningstar TriStar PWM: Battery: Critically low battery voltage'
                  event_name: 'Morningstar TriStar PWM: Battery: Critically low battery voltage (below {#VOLTAGE.MIN.CRIT}V for 5m)'
                  opdata: 'Current value: {ITEM.LASTVALUE1}'
                  priority: HIGH
                  tags:
                    - tag: scope
                      value: capacity
                - uuid: fa6502a4a0214f7f933e982182d21d6b
                  expression: 'min(/Morningstar TriStar PWM by SNMP/battery.voltage[batteryVoltage.0{#SINGLETON}],5m)>{#VOLTAGE.MAX.WARN}'
                  name: 'Morningstar TriStar PWM: Battery: High battery voltage'
                  event_name: 'Morningstar TriStar PWM: Battery: High battery voltage (over {#VOLTAGE.MAX.WARN}V for 5m)'
                  opdata: 'Current value: {ITEM.LASTVALUE1}'
                  priority: WARNING
                  dependencies:
                    - name: 'Morningstar TriStar PWM: Battery: Critically high battery voltage'
                      expression: 'min(/Morningstar TriStar PWM by SNMP/battery.voltage[batteryVoltage.0{#SINGLETON}],5m)>{#VOLTAGE.MAX.CRIT}'
                  tags:
                    - tag: scope
                      value: capacity
                - uuid: a5275748f4c742ea8ab9efd266901e95
                  expression: 'max(/Morningstar TriStar PWM by SNMP/battery.voltage[batteryVoltage.0{#SINGLETON}],5m)<{#VOLTAGE.MIN.WARN}'
                  name: 'Morningstar TriStar PWM: Battery: Low battery voltage'
                  event_name: 'Morningstar TriStar PWM: Battery: Low battery voltage (below {#VOLTAGE.MIN.WARN}V for 5m)'
                  opdata: 'Current value: {ITEM.LASTVALUE1}'
                  priority: WARNING
                  dependencies:
                    - name: 'Morningstar TriStar PWM: Battery: Critically low battery voltage'
                      expression: 'max(/Morningstar TriStar PWM by SNMP/battery.voltage[batteryVoltage.0{#SINGLETON}],5m)<{#VOLTAGE.MIN.CRIT}'
                  tags:
                    - tag: scope
                      value: capacity
          graph_prototypes:
            - uuid: bbdea967f4f34a299dd8d9bee43f2841
              name: 'Battery: Voltage{#SINGLETON}'
              graph_items:
                - drawtype: GRADIENT_LINE
                  color: 199C0D
                  item:
                    host: 'Morningstar TriStar PWM by SNMP'
                    key: 'battery.voltage[batteryVoltage.0{#SINGLETON}]'
          master_item:
            key: 'battery.voltage.discovery[batteryVoltage.0]'
          preprocessing:
            - type: JAVASCRIPT
              parameters:
                - |
                  var v_range = [
                  	[[0, 18], [12, 15, 11.5, 15.5]],
                  	[[18, 36], [24, 30, 23, 31]],
                  	[[36, 99], [48, 60, 46, 62]],
                  ],
                  	result = [];
                  
                  for (var idx in v_range) {
                  	if (v_range[idx][0][0] < value && value <= v_range[idx][0][1]) {
                  		result = [{
                  			'{#VOLTAGE.MIN.WARN}': parseInt({$VOLTAGE.MIN.WARN}) || v_range[idx][1][0],
                  			'{#VOLTAGE.MAX.WARN}': parseInt({$VOLTAGE.MAX.WARN}) || v_range[idx][1][1],
                  			'{#VOLTAGE.MIN.CRIT}': parseInt({$VOLTAGE.MIN.CRIT}) || v_range[idx][1][2],
                  			'{#VOLTAGE.MAX.CRIT}': parseInt({$VOLTAGE.MAX.CRIT}) || v_range[idx][1][3],
                  			'{#SINGLETON}': ''
                  		}];
                  		break;
                  	}
                  }
                  
                  return JSON.stringify(result);
        - uuid: 58a500192e61490f97f33d5b5f6e972f
          name: 'Charge mode discovery'
          type: DEPENDENT
          key: controlmode.charge.discovery
          lifetime: 1h
          description: 'Discovery for device in charge mode'
          item_prototypes:
            - uuid: f5d120bee1964f10853819d576ddb930
              name: 'Array: Voltage{#SINGLETON}'
              type: SNMP_AGENT
              snmp_oid: 'get[1.3.6.1.4.1.33333.8.32.0]'
              key: 'array.voltage[arrayloadVoltage.0{#SINGLETON}]'
              value_type: FLOAT
              units: V
              description: |
                MIB: TRISTAR
                Description:Array/Load Voltage
                Scaling Factor:0.00424652099609375
                Units:V
                Range:[0, 80]
                Modbus address:0x000A
              preprocessing:
                - type: MULTIPLIER
                  parameters:
                    - '0.004246520996'
                - type: REGEX
                  parameters:
                    - '^(\d+)(\.\d{1,2})?'
                    - \1\2
              tags:
                - tag: component
                  value: array
            - uuid: b5d74de2e96440a5a00a4a4dffffbb26
              name: 'Battery: Charge Current{#SINGLETON}'
              type: SNMP_AGENT
              snmp_oid: 'get[1.3.6.1.4.1.33333.8.33.0]'
              key: 'charge.current[chargeCurrent.0{#SINGLETON}]'
              value_type: FLOAT
              units: A
              description: |
                MIB: TRISTAR
                Description:Charge Current
                Scaling Factor:0.002034515380859375
                Units:A
                Range:[0, 60]
                Modbus address:0x000B
              preprocessing:
                - type: MULTIPLIER
                  parameters:
                    - '0.002034515381'
                - type: REGEX
                  parameters:
                    - '^(\d+)(\.\d{1,2})?'
                    - \1\2
              tags:
                - tag: component
                  value: battery
          graph_prototypes:
            - uuid: 9886a05be4a74a82a208e3a5950f022d
              name: 'Array: Voltage{#SINGLETON}'
              graph_items:
                - drawtype: GRADIENT_LINE
                  color: 199C0D
                  item:
                    host: 'Morningstar TriStar PWM by SNMP'
                    key: 'array.voltage[arrayloadVoltage.0{#SINGLETON}]'
            - uuid: cd64c57669314d2e9526fbc580034c81
              name: 'Battery: Charge Current{#SINGLETON}'
              graph_items:
                - drawtype: GRADIENT_LINE
                  color: 199C0D
                  item:
                    host: 'Morningstar TriStar PWM by SNMP'
                    key: 'charge.current[chargeCurrent.0{#SINGLETON}]'
          master_item:
            key: 'control.mode[controlMode.0]'
          preprocessing:
            - type: JAVASCRIPT
              parameters:
                - 'return JSON.stringify(parseInt(value) === 0 ? [{ ''{#SINGLETON}'': '''' }] : []);'
        - uuid: 02fbfa1dd59a4b9c87bb81da81312f54
          name: 'Charge + Diversion mode discovery'
          type: DEPENDENT
          key: controlmode.charge_diversion.discovery
          lifetime: 1h
          description: 'Discovery for device in charge and diversion modes'
          item_prototypes:
            - uuid: e08b526bbb484753a11c99011d31d945
              name: 'Battery: Charge State{#SINGLETON}'
              type: SNMP_AGENT
              snmp_oid: 'get[1.3.6.1.4.1.33333.8.46.0]'
              key: 'charge.state[controlState.0{#SINGLETON}]'
              value_type: FLOAT
              description: |
                MIB: TRISTAR
                Description:Control State
                Modbus address:0x001B
              valuemap:
                name: 'TriStar PWM charge state'
              preprocessing:
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              tags:
                - tag: component
                  value: battery
              trigger_prototypes:
                - uuid: da21473ce79c42269cc24d3e470b7d07
                  expression: 'last(/Morningstar TriStar PWM by SNMP/charge.state[controlState.0{#SINGLETON}])={$CHARGE.STATE.CRIT}'
                  name: 'Morningstar TriStar PWM: Battery: Device charge in critical state'
                  opdata: 'Current value: {ITEM.LASTVALUE1}'
                  priority: HIGH
                  tags:
                    - tag: scope
                      value: notice
                - uuid: 79a592050bc64c018cfa5c7b779fba02
                  expression: 'last(/Morningstar TriStar PWM by SNMP/charge.state[controlState.0{#SINGLETON}])={$CHARGE.STATE.WARN}'
                  name: 'Morningstar TriStar PWM: Battery: Device charge in warning state'
                  opdata: 'Current value: {ITEM.LASTVALUE1}'
                  priority: WARNING
                  dependencies:
                    - name: 'Morningstar TriStar PWM: Battery: Device charge in critical state'
                      expression: 'last(/Morningstar TriStar PWM by SNMP/charge.state[controlState.0{#SINGLETON}])={$CHARGE.STATE.CRIT}'
                  tags:
                    - tag: scope
                      value: notice
            - uuid: edd7d01d2523481293f3ac9e8f3c0a00
              name: 'Battery: Target Voltage{#SINGLETON}'
              type: SNMP_AGENT
              snmp_oid: 'get[1.3.6.1.4.1.33333.8.38.0]'
              key: 'target.voltage[targetVoltage.0{#SINGLETON}]'
              value_type: FLOAT
              units: V
              description: |
                MIB: TRISTAR
                Description:Target Regulation Voltage
                Scaling Factor:0.002950042724609375
                Units:V
                Range:[0.0, 80.0]
                Modbus address:0x0010
              preprocessing:
                - type: MULTIPLIER
                  parameters:
                    - '0.002950042725'
                - type: REGEX
                  parameters:
                    - '^(\d+)(\.\d{1,2})?'
                    - \1\2
              tags:
                - tag: component
                  value: battery
          master_item:
            key: 'control.mode[controlMode.0]'
          preprocessing:
            - type: JAVASCRIPT
              parameters:
                - |
                  var mode = parseInt(value);
                  return JSON.stringify((mode === 0 || mode === 2) ? [{ '{#SINGLETON}': '' }] : []);
        - uuid: 8c345c0134fe4d90af83292e557d7309
          name: 'Diversion mode discovery'
          type: DEPENDENT
          key: controlmode.diversion.discovery
          lifetime: 1h
          description: 'Discovery for device in diversion mode'
          item_prototypes:
            - uuid: 33e6b5a75c1e454cb7b7bc0b1426d1b9
              name: 'Load: PWM Duty Cycle{#SINGLETON}'
              type: SNMP_AGENT
              snmp_oid: 'get[1.3.6.1.4.1.33333.8.48.0]'
              key: 'diversion.pwm_duty_cycle[pwmDutyCycle.0{#SINGLETON}]'
              value_type: FLOAT
              description: |
                MIB: TRISTAR
                Description:PWM Duty Cycle
                Scaling Factor:0.392156862745098
                Units:%
                Range:[0.0, 100.0]
                Modbus address:0x001C
              preprocessing:
                - type: MULTIPLIER
                  parameters:
                    - '0.3921568627'
                - type: REGEX
                  parameters:
                    - '^(\d+)(\.\d{1,2})?'
                    - \1\2
              tags:
                - tag: component
                  value: load
          master_item:
            key: 'control.mode[controlMode.0]'
          preprocessing:
            - type: JAVASCRIPT
              parameters:
                - 'return JSON.stringify(parseInt(value) === 2 ? [{ ''{#SINGLETON}'': '''' }] : []);'
        - uuid: 54bfd7f730e64af89f937e9b1b6e4d79
          name: 'Load mode discovery'
          type: DEPENDENT
          key: controlmode.load.discovery
          lifetime: 1h
          description: 'Discovery for device in load mode'
          item_prototypes:
            - uuid: 6d42918b9c244f88a23ab1daf2a929ce
              name: 'Load: State{#SINGLETON}'
              type: SNMP_AGENT
              snmp_oid: 'get[1.3.6.1.4.1.33333.8.47.0]'
              key: 'load.state[loadState.0{#SINGLETON}]'
              value_type: FLOAT
              description: |
                MIB: TRISTAR
                Description:Load State
                Modbus address:0x001B
                
                0: Start
                1: Normal
                2: LvdWarning
                3: Lvd
                4: Fault
                5: Disconnect
                6: LvdWarning1
                7: OverrideLvd
                8: Equalize
              valuemap:
                name: 'TriStar PWM load state'
              preprocessing:
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              tags:
                - tag: component
                  value: load
              trigger_prototypes:
                - uuid: 9035e0a92d384a3c844b8a4d4ebd1eb9
                  expression: 'last(/Morningstar TriStar PWM by SNMP/load.state[loadState.0{#SINGLETON}])={$LOAD.STATE.CRIT:"lvd"} or last(/Morningstar TriStar PWM by SNMP/load.state[loadState.0{#SINGLETON}])={$LOAD.STATE.CRIT:"fault"}'
                  name: 'Morningstar TriStar PWM: Load: Device load in critical state'
                  opdata: 'Current value: {ITEM.LASTVALUE1}'
                  priority: HIGH
                  tags:
                    - tag: scope
                      value: notice
                - uuid: a2d13f97c4bd46bfab8e74a2f2a7df2e
                  expression: 'last(/Morningstar TriStar PWM by SNMP/load.state[loadState.0{#SINGLETON}])={$LOAD.STATE.WARN:"lvdWarning"}  or last(/Morningstar TriStar PWM by SNMP/load.state[loadState.0{#SINGLETON}])={$LOAD.STATE.WARN:"override"}'
                  name: 'Morningstar TriStar PWM: Load: Device load in warning state'
                  opdata: 'Current value: {ITEM.LASTVALUE1}'
                  priority: WARNING
                  dependencies:
                    - name: 'Morningstar TriStar PWM: Load: Device load in critical state'
                      expression: 'last(/Morningstar TriStar PWM by SNMP/load.state[loadState.0{#SINGLETON}])={$LOAD.STATE.CRIT:"lvd"} or last(/Morningstar TriStar PWM by SNMP/load.state[loadState.0{#SINGLETON}])={$LOAD.STATE.CRIT:"fault"}'
                  tags:
                    - tag: scope
                      value: notice
          master_item:
            key: 'control.mode[controlMode.0]'
          preprocessing:
            - type: JAVASCRIPT
              parameters:
                - 'return JSON.stringify(parseInt(value) === 1 ? [{ ''{#SINGLETON}'': '''' }] : []);'
        - uuid: 2e2e01f5c1db4224a97162382c77832c
          name: 'Load + Diversion mode discovery'
          type: DEPENDENT
          key: controlmode.load_diversion.discovery
          lifetime: 1h
          description: 'Discovery for device in load and diversion modes'
          item_prototypes:
            - uuid: b6db019203cc41ca94dcbe54382fdaad
              name: 'Load: Current{#SINGLETON}'
              type: SNMP_AGENT
              snmp_oid: 'get[1.3.6.1.4.1.33333.8.34.0]'
              key: 'load.current[loadCurrent.0{#SINGLETON}]'
              value_type: FLOAT
              units: A
              description: |
                MIB: TRISTAR
                Description:Load Current
                Scaling Factor:0.00966400146484375
                Units:A
                Range:[0, 60]
                Modbus address:0x000C
              preprocessing:
                - type: MULTIPLIER
                  parameters:
                    - '0.009664001465'
                - type: REGEX
                  parameters:
                    - '^(\d+)(\.\d{1,2})?'
                    - \1\2
              tags:
                - tag: component
                  value: load
            - uuid: f87ddb7d31d748c8917030ede731f37a
              name: 'Load: Voltage{#SINGLETON}'
              type: SNMP_AGENT
              snmp_oid: 'get[1.3.6.1.4.1.33333.8.32.0]'
              key: 'load.voltage[arrayloadVoltage.0{#SINGLETON}]'
              value_type: FLOAT
              units: V
              description: |
                MIB: TRISTAR
                Description:Array/Load Voltage
                Scaling Factor:0.00424652099609375
                Units:V
                Range:[0, 80]
                Modbus address:0x000A
              preprocessing:
                - type: MULTIPLIER
                  parameters:
                    - '0.004246520996'
                - type: REGEX
                  parameters:
                    - '^(\d+)(\.\d{1,2})?'
                    - \1\2
              tags:
                - tag: component
                  value: load
          graph_prototypes:
            - uuid: 91ee10b435144218ab3dfac8f6bf7bdd
              name: 'Load: Current{#SINGLETON}'
              graph_items:
                - drawtype: GRADIENT_LINE
                  color: 199C0D
                  item:
                    host: 'Morningstar TriStar PWM by SNMP'
                    key: 'load.current[loadCurrent.0{#SINGLETON}]'
            - uuid: b4b595193e0c40a2b390f7ce6eefba4a
              name: 'Load: Voltage{#SINGLETON}'
              graph_items:
                - drawtype: GRADIENT_LINE
                  color: 199C0D
                  item:
                    host: 'Morningstar TriStar PWM by SNMP'
                    key: 'load.voltage[arrayloadVoltage.0{#SINGLETON}]'
          master_item:
            key: 'control.mode[controlMode.0]'
          preprocessing:
            - type: JAVASCRIPT
              parameters:
                - |
                  var mode = parseInt(value);
                  return JSON.stringify((mode === 1 || mode === 2) ? [{ '{#SINGLETON}': '' }] : []);
      tags:
        - tag: class
          value: hardware
        - tag: class
          value: power
        - tag: subclass
          value: device
        - tag: target
          value: morningstar
      macros:
        - macro: '{$BATTERY.TEMP.MAX.CRIT}'
          value: '60'
          description: 'Battery high temperature critical value'
          config:
            type: TEXT
            priority: '4'
            section_name: Thresholds
            label: 'Battery maximum critical threshold'
            description: 'Battery high temperature critical value'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$BATTERY.TEMP.MAX.WARN}'
          value: '45'
          description: 'Battery high temperature warning value'
          config:
            type: TEXT
            priority: '2'
            section_name: Thresholds
            label: 'Battery maximum warning threshold'
            description: 'Battery high temperature warning value'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$BATTERY.TEMP.MIN.CRIT}'
          value: '-20'
          description: 'Battery low temperature critical value'
          config:
            type: TEXT
            priority: '3'
            section_name: Thresholds
            label: 'Battery minimum critical threshold'
            description: 'Battery low temperature critical value'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$BATTERY.TEMP.MIN.WARN}'
          value: '0'
          description: 'Battery low temperature warning value'
          config:
            type: TEXT
            priority: '1'
            section_name: Thresholds
            label: 'Battery minimum warning threshold'
            description: 'Battery low temperature warning value'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$CHARGE.STATE.CRIT}'
          value: '4'
          description: fault
          config:
            type: TEXT
            priority: '10'
            section_name: Other
            label: 'Charging critical status'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$CHARGE.STATE.WARN}'
          value: '2'
          description: disconnect
          config:
            type: TEXT
            priority: '9'
            section_name: Other
            label: 'Charging warning status'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$LOAD.STATE.CRIT:"fault"}'
          value: '4'
          description: fault
          config:
            type: TEXT
            priority: '15'
            section_name: Other
            label: 'Load status critical (fault)'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$LOAD.STATE.CRIT:"lvd"}'
          value: '3'
          description: lvd
          config:
            type: TEXT
            priority: '14'
            section_name: Other
            label: 'Load status critical (lvd)'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$LOAD.STATE.WARN:"disconnect"}'
          value: '5'
          description: disconnect
          config:
            type: TEXT
            priority: '12'
            section_name: Other
            label: 'Load status warning (disconnect)'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$LOAD.STATE.WARN:"lvdWarning"}'
          value: '2'
          description: lvdWarning
          config:
            type: TEXT
            priority: '11'
            section_name: Other
            label: 'Load status warning (lvdWarning)'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$LOAD.STATE.WARN:"override"}'
          value: '7'
          description: override
          config:
            type: TEXT
            priority: '13'
            section_name: Other
            label: 'Load status warning (override)'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$VOLTAGE.MAX.CRIT}'
          config:
            type: TEXT
            priority: '8'
            section_name: Thresholds
            label: 'Voltage maximum critical threshold'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$VOLTAGE.MAX.WARN}'
          config:
            type: TEXT
            priority: '6'
            section_name: Thresholds
            label: 'Voltage maximum warning threshold'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$VOLTAGE.MIN.CRIT}'
          config:
            type: TEXT
            priority: '7'
            section_name: Thresholds
            label: 'Voltage minimum critical threshold'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$VOLTAGE.MIN.WARN}'
          config:
            type: TEXT
            priority: '5'
            section_name: Thresholds
            label: 'Voltage minimum warning threshold'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
      dashboards:
        - uuid: 7b5209a7cf3f407fb825712f3558bf03
          name: 'Morningstar TriStar PWM: Overview'
          pages:
            - widgets:
                - type: graph
                  width: '72'
                  height: '4'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Morningstar TriStar PWM by SNMP'
                        name: 'Temperature: Battery/Heatsink'
                    - type: STRING
                      name: reference
                      value: AAAAA
      valuemaps:
        - uuid: 4985c4742d5844e7bc0aee5aeeacc436
          name: 'TriStar PWM charge state'
          mappings:
            - value: '0'
              newvalue: Start
            - value: '1'
              newvalue: NightCheck
            - value: '2'
              newvalue: Disconnect
            - value: '3'
              newvalue: Night
            - value: '4'
              newvalue: Fault
            - value: '5'
              newvalue: Bulk
            - value: '6'
              newvalue: Absorption
            - value: '7'
              newvalue: Float
            - value: '8'
              newvalue: Equalize
        - uuid: 252c3fb63cc34bb1a36ae6e9cbe5880c
          name: 'TriStar PWM control mode'
          mappings:
            - value: '0'
              newvalue: Charge
            - value: '1'
              newvalue: LoadControl
            - value: '2'
              newvalue: Diversion
            - value: '3'
              newvalue: Lighting
        - uuid: 735e1a0d990a4c449e59eeb402f3b40e
          name: 'TriStar PWM load state'
          mappings:
            - value: '0'
              newvalue: Start
            - value: '1'
              newvalue: Normal
            - value: '2'
              newvalue: LvdWarning
            - value: '3'
              newvalue: Lvd
            - value: '4'
              newvalue: Fault
            - value: '5'
              newvalue: Disconnect
            - value: '6'
              newvalue: LvdWarning1
            - value: '7'
              newvalue: OverrideLvd
            - value: '8'
              newvalue: Equalize
    - uuid: 760be6e1c2194a5bb7c0df47cc5f71ca
      template: 'OpenBSD by Zabbix agent'
      name: 'OpenBSD by Zabbix agent'
      description: |
        This is an Official OpenBSD template. It requires Zabbix agent 8.0 or newer.
        
        Notes on filesystem (FS) discovery:
          - The ext4/3/2 FS reserves space for privileged usage, typically set at 5% by default.
          - BTRFS allocates a default of 10% of the volume for its own needs.
          - To mitigate potential disasters, FS usage triggers are based on the maximum available space.
            - Utilization formula: 'pused = 100 - 100 * (available / total - free + available)'
          - The FS utilization chart, derived from graph prototypes, reflects FS reserved space as the difference between used and available space from the total volume.
        
        You can discuss this template or leave feedback on our forum https://www.zabbix.com/forum/zabbix-suggestions-and-feedback/
        
        Generated by official Zabbix template tool "Templator"
      wizard_ready: 'YES'
      readme: |
        ## Overview
        
        This is an Official OpenBSD template. It requires Zabbix agent 8.0 or newer.
        
        #### Notes on filesystem (FS) discovery:
        - The ext4/3/2 FS reserves space for privileged usage, typically set at 5% by default.
        - BTRFS allocates a default of 10% of the volume for its own needs.
        - To mitigate potential disasters, FS usage triggers are based on the maximum available space.
          - Utilization formula: `pused = 100 - 100 * (available / total - free + available)`
        - The FS utilization chart, derived from graph prototypes, reflects FS reserved space as the difference between used and available space from the total volume.
        
        
        ## Setup
        
        Install Zabbix agent on OpenBSD according to Zabbix documentation.
      vendor:
        name: Zabbix
        version: 8.0-1
      groups:
        - name: 'Templates/Operating systems'
      items:
        - uuid: 390a1b2080e842f3985b0076509cc550
          name: 'Host name of Zabbix agent running'
          key: agent.hostname
          delay: 1h
          value_type: CHAR
          preprocessing:
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1d
          tags:
            - tag: component
              value: system
        - uuid: 99dbf8825c0d4e1f9ae433bcb786d7c7
          name: 'Zabbix agent ping'
          key: agent.ping
          description: 'The agent always returns "1" for this item. May be used in combination with `nodata()` for the availability check.'
          valuemap:
            name: 'Zabbix agent ping status'
          tags:
            - tag: component
              value: system
        - uuid: c65db5a2b42c46dc90cf4891ad1ecc83
          name: 'Version of Zabbix agent running'
          key: agent.version
          delay: 1h
          value_type: CHAR
          preprocessing:
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1d
          tags:
            - tag: component
              value: application
        - uuid: 56a83dc0e14e47339e13a451adcefef7
          name: 'Maximum number of opened files'
          key: kernel.maxfiles
          delay: 1h
          description: 'May be increased by using the `sysctl` utility or modifying the file `/etc/sysctl.conf`.'
          tags:
            - tag: component
              value: os
          triggers:
            - uuid: aab96e16dd194d72b9b049ffa8b41b02
              expression: 'last(/OpenBSD by Zabbix agent/kernel.maxfiles)<1024'
              name: 'OpenBSD: Configured max number of opened files is too low on {HOST.NAME}'
              priority: INFO
              tags:
                - tag: scope
                  value: notice
                - tag: scope
                  value: performance
        - uuid: e55f8256dd2d48fd9e7fd786f872b4bc
          name: 'Maximum number of processes'
          key: kernel.maxproc
          delay: 1h
          description: 'May be increased by using the `sysctl` utility or modifying the file `/etc/sysctl.conf`.'
          tags:
            - tag: component
              value: processes
          triggers:
            - uuid: 149b9b77d17543fba253666ccbd6a607
              expression: 'last(/OpenBSD by Zabbix agent/kernel.maxproc)<256'
              name: 'OpenBSD: Configured max number of processes is too low on {HOST.NAME}'
              priority: INFO
              tags:
                - tag: scope
                  value: notice
                - tag: scope
                  value: performance
        - uuid: 7f8fdbc74cf14fa2afda3b57c548c751
          name: 'Number of running processes'
          key: 'proc.num[,,run]'
          description: 'The number of processes in a running state.'
          tags:
            - tag: component
              value: processes
          triggers:
            - uuid: d67740bc103348ab8ab11df2bdb0ad8f
              expression: 'avg(/OpenBSD by Zabbix agent/proc.num[,,run],5m)>30'
              name: 'OpenBSD: Too many processes running on {HOST.NAME}'
              priority: WARNING
              tags:
                - tag: scope
                  value: performance
        - uuid: 966acafb928b43f8a63ee673b1716d28
          name: 'Number of processes'
          key: 'proc.num[]'
          description: 'The total number of processes in any state.'
          tags:
            - tag: component
              value: processes
          triggers:
            - uuid: dd1b0c14e6dd439ea8f7323cdcc607de
              expression: 'avg(/OpenBSD by Zabbix agent/proc.num[],5m)>300'
              name: 'OpenBSD: Too many processes on {HOST.NAME}'
              priority: WARNING
              tags:
                - tag: scope
                  value: performance
        - uuid: 4e06c5b504c04c169ea1a0d6a7951eeb
          name: 'Host boot time'
          key: system.boottime
          delay: 10m
          units: unixtime
          tags:
            - tag: component
              value: os
        - uuid: f6ed0de8cbb545298b174b19938a527e
          name: 'Interrupts per second'
          key: system.cpu.intr
          units: ips
          description: 'Number of interrupts processed.'
          preprocessing:
            - type: CHANGE_PER_SECOND
          tags:
            - tag: component
              value: cpu
        - uuid: 7e4eab397cfd43d2a4aef7e2aa8c3a37
          name: 'Processor load (1 min average per core)'
          key: 'system.cpu.load[percpu,avg1]'
          value_type: FLOAT
          description: 'Calculated as the system CPU load divided by the number of CPU cores.'
          tags:
            - tag: component
              value: cpu
          triggers:
            - uuid: 1128bfb41f5f420c81feffb1d395cf9f
              expression: 'avg(/OpenBSD by Zabbix agent/system.cpu.load[percpu,avg1],5m)>5'
              name: 'OpenBSD: Processor load is too high on {HOST.NAME}'
              priority: WARNING
              tags:
                - tag: scope
                  value: performance
        - uuid: 55ad1da5b20c465f8db86701dcf3e974
          name: 'Processor load (5 min average per core)'
          key: 'system.cpu.load[percpu,avg5]'
          value_type: FLOAT
          description: 'Calculated as the system CPU load divided by the number of CPU cores.'
          tags:
            - tag: component
              value: cpu
        - uuid: 0403d3b318a649d4aa0da97e18546bcb
          name: 'Processor load (15 min average per core)'
          key: 'system.cpu.load[percpu,avg15]'
          value_type: FLOAT
          description: 'Calculated as the system CPU load divided by the number of CPU cores.'
          tags:
            - tag: component
              value: cpu
        - uuid: 2226fac821fe4928a9d727770e0af4d0
          name: 'Context switches per second'
          key: system.cpu.switches
          units: sps
          description: 'The combined rate at which all processors on the computer are switched from one thread to another.'
          preprocessing:
            - type: CHANGE_PER_SECOND
          tags:
            - tag: component
              value: cpu
        - uuid: 4689c51946c845e5b31cb7ca5b58fbe3
          name: 'CPU idle time'
          key: 'system.cpu.util[,idle]'
          value_type: FLOAT
          units: '%'
          description: 'Time the CPU has spent doing nothing.'
          tags:
            - tag: component
              value: cpu
        - uuid: ad032417f6de4e03a4f956bea65d8ce0
          name: 'CPU interrupt time'
          key: 'system.cpu.util[,interrupt]'
          value_type: FLOAT
          units: '%'
          description: 'Time the CPU has spent servicing hardware interrupts.'
          tags:
            - tag: component
              value: cpu
        - uuid: 84030949a4d545b59db4aa3b38402174
          name: 'CPU nice time'
          key: 'system.cpu.util[,nice]'
          value_type: FLOAT
          units: '%'
          description: 'Time the CPU has spent running users'' processes that have been niced.'
          tags:
            - tag: component
              value: cpu
        - uuid: 636b16908e3746039cf0bc5edf5ef3c6
          name: 'CPU spin time'
          key: 'system.cpu.util[,spin]'
          value_type: FLOAT
          units: '%'
          description: 'Time the CPU has spent spinning on a lock.'
          tags:
            - tag: component
              value: cpu
        - uuid: 63121eb34bc94eeabd7352992b67befb
          name: 'CPU system time'
          key: 'system.cpu.util[,system]'
          value_type: FLOAT
          units: '%'
          description: 'Time the CPU has spent running the kernel and its processes.'
          tags:
            - tag: component
              value: cpu
        - uuid: c9adb1a7c2fd4db9b176f9008483f2d7
          name: 'CPU user time'
          key: 'system.cpu.util[,user]'
          value_type: FLOAT
          units: '%'
          description: 'Time the CPU has spent running users'' processes that are not niced.'
          tags:
            - tag: component
              value: cpu
        - uuid: a80cd7ca70954cd1b6b89a686f642b9d
          name: 'Host name'
          key: system.hostname
          delay: 1h
          value_type: CHAR
          description: 'The host name of the system.'
          inventory_link: NAME
          preprocessing:
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1d
          tags:
            - tag: component
              value: os
          triggers:
            - uuid: d6927a9b74eb4cb8b15400baf784fc36
              expression: 'last(/OpenBSD by Zabbix agent/system.hostname,#1)<>last(/OpenBSD by Zabbix agent/system.hostname,#2)'
              name: 'OpenBSD: Hostname was changed on {HOST.NAME}'
              priority: INFO
              tags:
                - tag: scope
                  value: notice
        - uuid: cfff34f2374c410492b89cce1c6b5198
          name: 'Host local time'
          key: system.localtime
          units: unixtime
          description: 'The local system time of the host.'
          tags:
            - tag: component
              value: os
        - uuid: e758448d5ec242e6a7a17f67c8f62874
          name: 'Free swap space'
          key: 'system.swap.size[,free]'
          units: B
          description: 'The free space of the swap volume/file expressed in bytes.'
          tags:
            - tag: component
              value: memory
        - uuid: 43648a7f2c79443781a0ad500e7a9e6c
          name: 'Free swap space in %'
          key: 'system.swap.size[,pfree]'
          value_type: FLOAT
          units: '%'
          description: 'The free space of the swap volume/file expressed in %.'
          tags:
            - tag: component
              value: memory
          triggers:
            - uuid: 0efa45d2c8884bc6b4090afc6408198b
              expression: 'last(/OpenBSD by Zabbix agent/system.swap.size[,pfree])<50'
              name: 'OpenBSD: Lack of free swap space on {HOST.NAME}'
              priority: WARNING
              description: 'It probably means that the systems requires more physical memory.'
              tags:
                - tag: scope
                  value: capacity
                - tag: scope
                  value: performance
        - uuid: 61f33f0c3e35499b999626058048ec66
          name: 'Total swap space'
          key: 'system.swap.size[,total]'
          delay: 1h
          units: B
          description: 'Total space of the swap volume/file expressed in bytes.'
          tags:
            - tag: component
              value: memory
        - uuid: b19974c64b4141c2aca0e997b03c2f0a
          name: 'System information'
          key: system.uname
          delay: 1h
          value_type: CHAR
          description: 'Information as normally returned by `uname -a`.'
          inventory_link: OS
          preprocessing:
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1d
          tags:
            - tag: component
              value: os
          triggers:
            - uuid: 3d3bcd54f24448c1a11746a4e75ea736
              expression: 'last(/OpenBSD by Zabbix agent/system.uname,#1)<>last(/OpenBSD by Zabbix agent/system.uname,#2)'
              name: 'OpenBSD: Host information was changed on {HOST.NAME}'
              priority: INFO
              tags:
                - tag: scope
                  value: notice
        - uuid: d14bcdc15cc24f90baea06a13077a54f
          name: 'System uptime'
          key: system.uptime
          delay: 10m
          units: uptime
          tags:
            - tag: component
              value: os
          triggers:
            - uuid: de874b9d875a4298ab39888c9e9cb747
              expression: 'change(/OpenBSD by Zabbix agent/system.uptime)<0'
              name: 'OpenBSD: {HOST.NAME} has just been restarted'
              priority: INFO
              tags:
                - tag: scope
                  value: notice
        - uuid: 165a44bf3b9d49378e500acb90aa7957
          name: 'Number of logged in users'
          key: system.users.num
          description: 'The number of users who are currently logged in.'
          tags:
            - tag: component
              value: os
            - tag: component
              value: security
        - uuid: f11f6e3539a244409f1c72dbd6f16b76
          name: 'Checksum of /etc/passwd'
          key: 'vfs.file.cksum[/etc/passwd,sha256]'
          delay: 15m
          value_type: CHAR
          preprocessing:
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          tags:
            - tag: component
              value: security
          triggers:
            - uuid: 9db4055df94d414d86938066ed05dbc5
              expression: 'last(/OpenBSD by Zabbix agent/vfs.file.cksum[/etc/passwd,sha256],#1)<>last(/OpenBSD by Zabbix agent/vfs.file.cksum[/etc/passwd,sha256],#2)'
              name: 'OpenBSD: /etc/passwd has been changed on {HOST.NAME}'
              priority: WARNING
              tags:
                - tag: scope
                  value: security
        - uuid: b5de01cf628b48cb899a8ad2a02a3b62
          name: 'Get filesystems'
          key: vfs.fs.get
          history: '0'
          value_type: TEXT
          description: 'The `vfs.fs.get` key acquires raw information set about the filesystems. Later to be extracted by preprocessing in dependent items.'
          tags:
            - tag: component
              value: raw
        - uuid: 5b6c92c92e434dff8ce19e28b3ba785e
          name: 'Available memory'
          key: 'vm.memory.size[available]'
          units: B
          description: 'Defined as free + cached + buffers.'
          tags:
            - tag: component
              value: memory
          triggers:
            - uuid: bdf3c729b8bc4a9481c9041e4c1ea624
              expression: 'last(/OpenBSD by Zabbix agent/vm.memory.size[available])<20M'
              name: 'OpenBSD: Lack of available memory on server {HOST.NAME}'
              priority: AVERAGE
              tags:
                - tag: scope
                  value: capacity
                - tag: scope
                  value: performance
        - uuid: b32320608732421fac18437006bc1874
          name: 'Total memory'
          key: 'vm.memory.size[total]'
          delay: 1h
          units: B
          description: 'Total memory expressed in bytes.'
          tags:
            - tag: component
              value: memory
        - uuid: 7ab36f1fcf0244229effa26f16889a36
          name: 'Zabbix agent availability'
          type: INTERNAL
          key: 'zabbix[host,agent,available]'
          description: 'Used for monitoring the availability status of the agent.'
          valuemap:
            name: zabbix.host.available
          tags:
            - tag: component
              value: system
          triggers:
            - uuid: d046f431e11d4bd7be42e66e14a21663
              expression: 'max(/OpenBSD by Zabbix agent/zabbix[host,agent,available],{$AGENT.TIMEOUT})=0'
              name: 'OpenBSD: Zabbix agent is not available'
              event_name: 'OpenBSD: Zabbix agent is not available (for {$AGENT.TIMEOUT})'
              priority: AVERAGE
              description: 'For passive checks only; the availability of the agent(s) and a host is used with `{$AGENT.TIMEOUT}` as the time threshold.'
              manual_close: 'YES'
              tags:
                - tag: scope
                  value: availability
      discovery_rules:
        - uuid: d02d41ad698942bfab1fe29fad31010a
          name: 'Network interface discovery'
          key: net.if.discovery
          delay: 1h
          filter:
            conditions:
              - macro: '{#IFNAME}'
                value: '@Network interfaces for discovery'
          description: 'Used for the discovery of network interfaces.'
          item_prototypes:
            - uuid: 81dec4b8de8c4ab68aef26d9f00aee87
              name: 'Interface {#IFNAME}: Incoming network traffic'
              key: 'net.if.in[{#IFNAME}]'
              units: bps
              preprocessing:
                - type: CHANGE_PER_SECOND
                - type: MULTIPLIER
                  parameters:
                    - '8'
              tags:
                - tag: component
                  value: interfaces
                - tag: interfaces
                  value: '{#IFNAME}'
            - uuid: 16bced1c77eb46799ecedcde5049dbdb
              name: 'Interface {#IFNAME}: Outgoing network traffic'
              key: 'net.if.out[{#IFNAME}]'
              units: bps
              preprocessing:
                - type: CHANGE_PER_SECOND
                - type: MULTIPLIER
                  parameters:
                    - '8'
              tags:
                - tag: component
                  value: interfaces
                - tag: interfaces
                  value: '{#IFNAME}'
          graph_prototypes:
            - uuid: c79845ab3101451c8f0fe033b5b2166e
              name: 'Interface {#IFNAME}: Network traffic'
              ymin_type_1: FIXED
              graph_items:
                - drawtype: GRADIENT_LINE
                  color: 00AA00
                  item:
                    host: 'OpenBSD by Zabbix agent'
                    key: 'net.if.in[{#IFNAME}]'
                - sortorder: '1'
                  drawtype: GRADIENT_LINE
                  color: 3333FF
                  item:
                    host: 'OpenBSD by Zabbix agent'
                    key: 'net.if.out[{#IFNAME}]'
        - uuid: feb02c707aa64b91a3b340aa5ef23de9
          name: 'Mounted filesystem discovery'
          type: DEPENDENT
          key: vfs.fs.dependent.discovery
          filter:
            evaltype: AND
            conditions:
              - macro: '{#FSNAME}'
                value: '{$VFS.FS.FSNAME.MATCHES}'
              - macro: '{#FSNAME}'
                value: '{$VFS.FS.FSNAME.NOT_MATCHES}'
                operator: NOT_MATCHES_REGEX
              - macro: '{#FSTYPE}'
                value: '{$VFS.FS.FSTYPE.MATCHES}'
              - macro: '{#FSTYPE}'
                value: '{$VFS.FS.FSTYPE.NOT_MATCHES}'
                operator: NOT_MATCHES_REGEX
          description: 'The discovery of mounted filesystems with different types.'
          item_prototypes:
            - uuid: c29bc3c6bd844242b9165251dd3266bb
              name: 'FS [{#FSNAME}]: Inodes: Free, in %'
              type: DEPENDENT
              key: 'vfs.fs.dependent.inode[{#FSNAME},pfree]'
              value_type: FLOAT
              units: '%'
              description: 'Free metadata space expressed in %.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.inodes.pfree
              master_item:
                key: 'vfs.fs.dependent[{#FSNAME},data]'
              tags:
                - tag: component
                  value: storage
                - tag: filesystem
                  value: '{#FSNAME}'
                - tag: fstype
                  value: '{#FSTYPE}'
              trigger_prototypes:
                - uuid: 25a43340efc94c8b982204a920441ff3
                  expression: 'min(/OpenBSD by Zabbix agent/vfs.fs.dependent.inode[{#FSNAME},pfree],5m)<{$VFS.FS.INODE.PFREE.MIN.CRIT:"{#FSNAME}"}'
                  name: 'OpenBSD: FS [{#FSNAME}]: Running out of free inodes'
                  event_name: 'OpenBSD: {#FSNAME}: Running out of free inodes (free < {$VFS.FS.INODE.PFREE.MIN.CRIT:"{#FSNAME}"}%)'
                  opdata: 'Free inodes: {ITEM.LASTVALUE1}'
                  priority: AVERAGE
                  description: 'Disk writing may fail if index nodes are exhausted, leading to error messages like "No space left on device" or "Disk is full", despite available free space.'
                  tags:
                    - tag: scope
                      value: capacity
                    - tag: scope
                      value: performance
                - uuid: 7802203fd5ba471db2be4f35eda44a0b
                  expression: 'min(/OpenBSD by Zabbix agent/vfs.fs.dependent.inode[{#FSNAME},pfree],5m)<{$VFS.FS.INODE.PFREE.MIN.WARN:"{#FSNAME}"}'
                  name: 'OpenBSD: FS [{#FSNAME}]: Running out of free inodes'
                  event_name: 'OpenBSD: FS [{#FSNAME}]: Running out of free inodes (free < {$VFS.FS.INODE.PFREE.MIN.WARN:"{#FSNAME}"}%)'
                  opdata: 'Free inodes: {ITEM.LASTVALUE1}'
                  priority: WARNING
                  description: 'Disk writing may fail if index nodes are exhausted, leading to error messages like "No space left on device" or "Disk is full", despite available free space.'
                  dependencies:
                    - name: 'OpenBSD: FS [{#FSNAME}]: Running out of free inodes'
                      expression: 'min(/OpenBSD by Zabbix agent/vfs.fs.dependent.inode[{#FSNAME},pfree],5m)<{$VFS.FS.INODE.PFREE.MIN.CRIT:"{#FSNAME}"}'
                  tags:
                    - tag: scope
                      value: capacity
                    - tag: scope
                      value: performance
            - uuid: d53bf828e684464a88157fd3dfd1b8d4
              name: 'FS [{#FSNAME}]: Space: Available'
              type: DEPENDENT
              key: 'vfs.fs.dependent.size[{#FSNAME},free]'
              units: B
              description: 'Available storage space expressed in bytes.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.bytes.free
              master_item:
                key: 'vfs.fs.dependent[{#FSNAME},data]'
              tags:
                - tag: component
                  value: storage
                - tag: filesystem
                  value: '{#FSNAME}'
                - tag: fstype
                  value: '{#FSTYPE}'
            - uuid: bcae23e8404349af87c570c353bfe0fe
              name: 'FS [{#FSNAME}]: Space: Available, in %'
              type: DEPENDENT
              key: 'vfs.fs.dependent.size[{#FSNAME},pfree]'
              value_type: FLOAT
              units: '%'
              description: |
                Deprecated metric.
                Space availability expressed as a percentage, calculated using the current and maximum available spaces.
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.bytes.pfree
              master_item:
                key: 'vfs.fs.dependent[{#FSNAME},data]'
              tags:
                - tag: component
                  value: storage
                - tag: deprecated
                - tag: filesystem
                  value: '{#FSNAME}'
                - tag: fstype
                  value: '{#FSTYPE}'
            - uuid: bb0110994e1243d6b6763c41b34cfee1
              name: 'FS [{#FSNAME}]: Space: Used, in %'
              type: DEPENDENT
              key: 'vfs.fs.dependent.size[{#FSNAME},pused]'
              value_type: FLOAT
              units: '%'
              description: 'Calculated as the percentage of currently used space compared to the maximum available space.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.bytes.pused
              master_item:
                key: 'vfs.fs.dependent[{#FSNAME},data]'
              tags:
                - tag: component
                  value: storage
                - tag: filesystem
                  value: '{#FSNAME}'
                - tag: fstype
                  value: '{#FSTYPE}'
              trigger_prototypes:
                - uuid: dfe8922f9bf94933a940133997df9997
                  expression: 'min(/OpenBSD by Zabbix agent/vfs.fs.dependent.size[{#FSNAME},pused],5m)>{$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"}'
                  name: 'OpenBSD: FS [{#FSNAME}]: Space is critically low'
                  event_name: 'OpenBSD: FS [{#FSNAME}]: Space is critically low (used > {$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"}%, total {{?last(//vfs.fs.dependent.size[{#FSNAME},total])/1024/1024/1024}.fmtnum(1)}GB)'
                  opdata: 'Space used: {{ITEM.LASTVALUE1}.fmtnum(1)}%'
                  priority: AVERAGE
                  description: |
                    The volume's space usage exceeds the `{$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"}%` limit.
                    The trigger expression is based on the current used and maximum available spaces.
                    Event name represents the total volume space, which can differ from the maximum available space, depending on the filesystem type.
                  manual_close: 'YES'
                  tags:
                    - tag: scope
                      value: availability
                    - tag: scope
                      value: capacity
                - uuid: 9741c9425c984804ac8fb9a52ef22221
                  expression: 'min(/OpenBSD by Zabbix agent/vfs.fs.dependent.size[{#FSNAME},pused],5m)>{$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"}'
                  name: 'OpenBSD: FS [{#FSNAME}]: Space is low'
                  event_name: 'OpenBSD: FS [{#FSNAME}]: Space is low (used > {$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"}%, total {{?last(//vfs.fs.dependent.size[{#FSNAME},total])/1024/1024/1024}.fmtnum(1)}GB)'
                  opdata: 'Space used: {{ITEM.LASTVALUE1}.fmtnum(1)}%'
                  priority: WARNING
                  description: |
                    The volume's space usage exceeds the `{$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"}%` limit.
                    The trigger expression is based on the current used and maximum available spaces.
                    Event name represents the total volume space, which can differ from the maximum available space, depending on the filesystem type.
                  manual_close: 'YES'
                  dependencies:
                    - name: 'OpenBSD: FS [{#FSNAME}]: Space is critically low'
                      expression: 'min(/OpenBSD by Zabbix agent/vfs.fs.dependent.size[{#FSNAME},pused],5m)>{$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"}'
                  tags:
                    - tag: scope
                      value: availability
                    - tag: scope
                      value: capacity
            - uuid: 5c27bfca98fc4e709b5fe66e8c181fbd
              name: 'FS [{#FSNAME}]: Space: Total'
              type: DEPENDENT
              key: 'vfs.fs.dependent.size[{#FSNAME},total]'
              units: B
              description: 'Total space expressed in bytes.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.bytes.total
              master_item:
                key: 'vfs.fs.dependent[{#FSNAME},data]'
              tags:
                - tag: component
                  value: storage
                - tag: filesystem
                  value: '{#FSNAME}'
                - tag: fstype
                  value: '{#FSTYPE}'
            - uuid: 840eed51cf264b5698fe4f38fd03ea16
              name: 'FS [{#FSNAME}]: Space: Used'
              type: DEPENDENT
              key: 'vfs.fs.dependent.size[{#FSNAME},used]'
              units: B
              description: 'Used storage expressed in bytes.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.bytes.used
              master_item:
                key: 'vfs.fs.dependent[{#FSNAME},data]'
              tags:
                - tag: component
                  value: storage
                - tag: filesystem
                  value: '{#FSNAME}'
                - tag: fstype
                  value: '{#FSTYPE}'
            - uuid: 03ed5a98a0a444f08bfc602877b1cc18
              name: 'FS [{#FSNAME}]: Get data'
              type: DEPENDENT
              key: 'vfs.fs.dependent[{#FSNAME},data]'
              history: 1h
              value_type: TEXT
              description: 'Intermediate data of `{#FSNAME}` filesystem.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.[?(@.fsname==''{#FSNAME}'')].first()'
              master_item:
                key: vfs.fs.get
              tags:
                - tag: component
                  value: raw
                - tag: component
                  value: storage
                - tag: filesystem
                  value: '{#FSNAME}'
                - tag: fstype
                  value: '{#FSTYPE}'
            - uuid: f37d99368b3d463a9474422fccd703f9
              name: 'FS [{#FSNAME}]: Option: Read-only'
              type: DEPENDENT
              key: 'vfs.fs.dependent[{#FSNAME},readonly]'
              description: 'The filesystem is mounted as read-only. It is available only for Zabbix agents 6.4 and higher.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.options
                  error_handler: DISCARD_VALUE
                - type: REGEX
                  parameters:
                    - '(?:^|,)ro\b'
                    - '1'
                  error_handler: CUSTOM_VALUE
                  error_handler_params: '0'
              master_item:
                key: 'vfs.fs.dependent[{#FSNAME},data]'
              tags:
                - tag: component
                  value: storage
                - tag: filesystem
                  value: '{#FSNAME}'
                - tag: fstype
                  value: '{#FSTYPE}'
              trigger_prototypes:
                - uuid: 7d1eaacab7ac4af7969c7fc22c67cfb8
                  expression: 'last(/OpenBSD by Zabbix agent/vfs.fs.dependent[{#FSNAME},readonly],#2)=0 and last(/OpenBSD by Zabbix agent/vfs.fs.dependent[{#FSNAME},readonly])=1'
                  recovery_mode: RECOVERY_EXPRESSION
                  recovery_expression: 'last(/OpenBSD by Zabbix agent/vfs.fs.dependent[{#FSNAME},readonly])=0'
                  name: 'OpenBSD: FS [{#FSNAME}]: Filesystem has become read-only'
                  priority: AVERAGE
                  description: 'The filesystem has become read-only, possibly due to an I/O error. Available only for Zabbix agents 6.4 and higher.'
                  manual_close: 'YES'
                  tags:
                    - tag: scope
                      value: availability
                    - tag: scope
                      value: performance
          graph_prototypes:
            - uuid: 5ea3f4e5af7a468fa4b7ba5dc6a9144d
              name: 'FS [{#FSTYPE}({#FSNAME})]: Space usage graph, in % (relative to max available)'
              width: '600'
              height: '340'
              ymin_type_1: FIXED
              ymax_type_1: FIXED
              graph_items:
                - drawtype: FILLED_REGION
                  color: F63100
                  calc_fnc: ALL
                  item:
                    host: 'OpenBSD by Zabbix agent'
                    key: 'vfs.fs.dependent.size[{#FSNAME},pused]'
            - uuid: 8b5ab39870b248b28e7099a2801b9c2d
              name: 'FS [{#FSTYPE}({#FSNAME})]: Space utilization chart (relative to total)'
              width: '600'
              height: '340'
              type: PIE
              show_3d: 'YES'
              graph_items:
                - color: '787878'
                  calc_fnc: LAST
                  type: GRAPH_SUM
                  item:
                    host: 'OpenBSD by Zabbix agent'
                    key: 'vfs.fs.dependent.size[{#FSNAME},total]'
                - sortorder: '1'
                  color: F63100
                  calc_fnc: LAST
                  item:
                    host: 'OpenBSD by Zabbix agent'
                    key: 'vfs.fs.dependent.size[{#FSNAME},used]'
                - sortorder: '2'
                  color: 199C09
                  calc_fnc: LAST
                  item:
                    host: 'OpenBSD by Zabbix agent'
                    key: 'vfs.fs.dependent.size[{#FSNAME},free]'
          master_item:
            key: vfs.fs.get
          lld_macro_paths:
            - lld_macro: '{#FSNAME}'
              path: $.fsname
            - lld_macro: '{#FSTYPE}'
              path: $.fstype
          preprocessing:
            - type: JAVASCRIPT
              parameters:
                - |
                  var filesystems = JSON.parse(value);
                  
                  result = filesystems.map(function (filesystem) {
                  	return {
                  		'fsname': filesystem.fsname,
                  		'fstype': filesystem.fstype
                  	};
                  });
                  
                  return JSON.stringify(result);
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          overrides:
            - name: 'Skip metadata collection for dynamic FS'
              step: '1'
              filter:
                conditions:
                  - macro: '{#FSTYPE}'
                    value: ^(btrfs|zfs)$
              operations:
                - operator: LIKE
                  value: Inodes
                  discover: NO_DISCOVER
      tags:
        - tag: class
          value: os
        - tag: target
          value: openbsd
      macros:
        - macro: '{$AGENT.TIMEOUT}'
          value: 3m
          description: 'Timeout after which the agent is considered unavailable. Works only for agents reachable from Zabbix server/proxy (in passive mode).'
          config:
            type: TEXT
            priority: '1'
            section_name: Other
            label: 'Seconds since the last Zabbix agent seen'
            description: 'Timeout after which the agent is considered unavailable. Works only for agents reachable from Zabbix server/proxy (in passive mode).'
        - macro: '{$VFS.FS.FSNAME.MATCHES}'
          value: .+
          description: 'Used for filesystem discovery. Can be overridden on the host or linked template level.'
          config:
            type: TEXT
            priority: '3'
            section_name: Filters
            label: 'Filter for filesystems by name'
            description: 'Used for filesystem discovery. Can be overridden on the host or linked template level.'
        - macro: '{$VFS.FS.FSNAME.NOT_MATCHES}'
          value: ^(/dev|/sys|/run|/proc|.+/shm$)
          description: 'Used for filesystem discovery. Can be overridden on the host or linked template level.'
          config:
            type: TEXT
            priority: '2'
            section_name: Filters
            label: 'Filter for filesystems by name (exclude)'
            description: 'Used for filesystem discovery. Can be overridden on the host or linked template level.'
        - macro: '{$VFS.FS.FSTYPE.MATCHES}'
          value: ^(btrfs|ext2|ext3|ext4|reiser|xfs|ffs|ufs|jfs|jfs2|vxfs|hfs|apfs|refs|ntfs|fat32|zfs)$
          description: 'Used for filesystem discovery. Can be overridden on the host or linked template level.'
          config:
            type: TEXT
            priority: '4'
            section_name: Filters
            label: 'Filter for filesystems by type'
            description: 'Used for filesystem discovery. Can be overridden on the host or linked template level.'
        - macro: '{$VFS.FS.FSTYPE.NOT_MATCHES}'
          value: ^\s$
          description: 'Used for filesystem discovery. Can be overridden on the host or linked template level.'
          config:
            type: TEXT
            priority: '5'
            section_name: Filters
            label: 'Filter for filesystems by type (exclude)'
            description: 'Used for filesystem discovery. Can be overridden on the host or linked template level.'
        - macro: '{$VFS.FS.INODE.PFREE.MIN.CRIT}'
          value: '10'
          description: 'The critical threshold of the filesystem metadata utilization.'
          config:
            type: TEXT
            priority: '6'
            section_name: Thresholds
            label: 'Threshold of the filesystem metadata utilization (critical)'
            description: 'The critical threshold of the filesystem metadata utilization. In the range from 0 to 100 inclusive.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$VFS.FS.INODE.PFREE.MIN.WARN}'
          value: '20'
          description: 'The warning threshold of the filesystem metadata utilization.'
          config:
            type: TEXT
            priority: '7'
            section_name: Thresholds
            label: 'Threshold of the filesystem metadata utilization'
            description: 'The warning threshold of the filesystem metadata utilization. In the range from 0 to 100 inclusive.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$VFS.FS.PUSED.MAX.CRIT}'
          value: '90'
          description: 'The critical threshold of the filesystem utilization.'
          config:
            type: TEXT
            priority: '8'
            section_name: Thresholds
            label: 'Threshold for filesystem utilization (critical)'
            description: 'The critical threshold of the filesystem utilization. In the range from 0 to 100 inclusive.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$VFS.FS.PUSED.MAX.WARN}'
          value: '80'
          description: 'The warning threshold of the filesystem utilization.'
          config:
            type: TEXT
            priority: '9'
            section_name: Thresholds
            label: 'Threshold for filesystem utilization (warning)'
            description: 'The warning threshold of the filesystem utilization. In the range from 0 to 100 inclusive.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
      dashboards:
        - uuid: c51fe9986e174a96a37187d09f175548
          name: Filesystems
          pages:
            - name: Overview
              widgets:
                - type: graphprototype
                  width: '72'
                  height: '5'
                  fields:
                    - type: INTEGER
                      name: columns
                      value: '3'
                    - type: GRAPH_PROTOTYPE
                      name: graphid.0
                      value:
                        host: 'OpenBSD by Zabbix agent'
                        name: 'FS [{#FSTYPE}({#FSNAME})]: Space utilization chart (relative to total)'
                    - type: STRING
                      name: reference
                      value: AAAEB
                - type: graphprototype
                  'y': '5'
                  width: '72'
                  height: '5'
                  fields:
                    - type: INTEGER
                      name: columns
                      value: '1'
                    - type: GRAPH_PROTOTYPE
                      name: graphid.0
                      value:
                        host: 'OpenBSD by Zabbix agent'
                        name: 'FS [{#FSTYPE}({#FSNAME})]: Space usage graph, in % (relative to max available)'
                    - type: STRING
                      name: reference
                      value: AAAEC
        - uuid: b4606920366049bd98e2e6d31c602d67
          name: 'System performance'
          pages:
            - widgets:
                - type: graph
                  width: '36'
                  height: '5'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'OpenBSD by Zabbix agent'
                        name: 'OpenBSD: CPU load'
                    - type: STRING
                      name: reference
                      value: AAAAA
                - type: graph
                  'y': '5'
                  width: '36'
                  height: '5'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'OpenBSD by Zabbix agent'
                        name: 'OpenBSD: Memory usage'
                    - type: STRING
                      name: reference
                      value: AAAAC
                - type: graphprototype
                  'y': '10'
                  width: '72'
                  height: '5'
                  fields:
                    - type: INTEGER
                      name: columns
                      value: '3'
                    - type: GRAPH_PROTOTYPE
                      name: graphid.0
                      value:
                        host: 'OpenBSD by Zabbix agent'
                        name: 'FS [{#FSTYPE}({#FSNAME})]: Space utilization chart (relative to total)'
                    - type: STRING
                      name: reference
                      value: AAAEA
                - type: graph
                  x: '36'
                  width: '36'
                  height: '5'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'OpenBSD by Zabbix agent'
                        name: 'OpenBSD: CPU utilization'
                    - type: STRING
                      name: reference
                      value: AAAAB
                - type: graph
                  x: '36'
                  'y': '5'
                  width: '36'
                  height: '5'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'OpenBSD by Zabbix agent'
                        name: 'OpenBSD: Swap usage'
                    - type: STRING
                      name: reference
                      value: AAAAD
      valuemaps:
        - uuid: 693c226692c548869e77d3313934ca28
          name: zabbix.host.available
          mappings:
            - value: '0'
              newvalue: 'not available'
            - value: '1'
              newvalue: available
            - value: '2'
              newvalue: unknown
        - uuid: 8dad41742edf49178119c70abea0a0dc
          name: 'Zabbix agent ping status'
          mappings:
            - value: '1'
              newvalue: Up
    - uuid: 8c8474148c2a4eaeabe5a9331ea99d77
      template: 'RabbitMQ cluster by HTTP'
      name: 'RabbitMQ cluster by HTTP'
      description: |
        This template is developed to monitor the messaging broker RabbitMQ cluster by Zabbix that works without any external scripts.
        Most of the metrics are collected in one go, thanks to Zabbix bulk data collection.
        
        The template collects metrics by polling RabbitMQ management plugin with HTTP agent remotely.
        
        Setup:
        
        1. Enable the RabbitMQ management plugin. See the RabbitMQ documentation for the instructions:
        https://www.rabbitmq.com/management.html
        
        2. Create a user to monitor the service:
        
        rabbitmqctl add_user zbx_monitor <PASSWORD>
        rabbitmqctl set_permissions  -p / zbx_monitor "" "" ".*"
        rabbitmqctl set_user_tags zbx_monitor monitoring
        
        3. Set the hostname or IP address of the RabbitMQ cluster host in the '{$RABBITMQ.API.CLUSTER_HOST}' macro. You can also change the port in the '{$RABBITMQ.API.PORT}' macro and the scheme in the '{$RABBITMQ.API.SCHEME}' macro if necessary.
        
        4. Set the user name and password in the macros '{$RABBITMQ.API.USER}' and '{$RABBITMQ.API.PASSWORD}'.
        
        You can discuss this template or leave feedback on our forum https://www.zabbix.com/forum/zabbix-suggestions-and-feedback/387226-discussion-thread-for-official-zabbix-template-rabbitmq
        
        Generated by official Zabbix template tool "Templator"
      wizard_ready: 'YES'
      readme: |
        ## Overview
        
        This template is developed to monitor the messaging broker RabbitMQ cluster by Zabbix that works without any external scripts.
        Most of the metrics are collected in one go, thanks to Zabbix bulk data collection.
        
        The template collects metrics by polling RabbitMQ management plugin with HTTP agent remotely.
        
        ## Setup
        
        1. Enable the RabbitMQ management plugin. See the [`RabbitMQ documentation`](https://www.rabbitmq.com/management.html) for the instructions.
        
        2. Create a user to monitor the service:
        
        ```bash
        rabbitmqctl add_user zbx_monitor <PASSWORD>
        rabbitmqctl set_permissions  -p / zbx_monitor "" "" ".*"
        rabbitmqctl set_user_tags zbx_monitor monitoring
        ```
        
        3. Set the hostname or IP address of the RabbitMQ cluster host in the `Address` host wizard configuration field. You can also change the port in the `Port` and the scheme in the `Scheme` if necessary.
        
        4. Set the user name and password in the host wizard configuration fields `Username` and `Password`.
      vendor:
        name: Zabbix
        version: 8.0-2
      groups:
        - name: Templates/Applications
      items:
        - uuid: dd74265fcc2d48e2b160e749706c9a6c
          name: 'Get exchanges'
          type: HTTP_AGENT
          key: rabbitmq.get_exchanges
          history: 1h
          value_type: TEXT
          authtype: BASIC
          username: '{$RABBITMQ.API.USER}'
          password: '{$RABBITMQ.API.PASSWORD}'
          description: 'The HTTP API endpoint that returns exchanges metrics.'
          url: '{$RABBITMQ.API.SCHEME}://{$RABBITMQ.API.CLUSTER_HOST}:{$RABBITMQ.API.PORT}/api/exchanges'
          tags:
            - tag: component
              value: raw
        - uuid: c0d7c1940dea4cd4a01a94b9629db3ce
          name: 'Get overview'
          type: HTTP_AGENT
          key: rabbitmq.get_overview
          history: 1h
          value_type: TEXT
          authtype: BASIC
          username: '{$RABBITMQ.API.USER}'
          password: '{$RABBITMQ.API.PASSWORD}'
          description: 'The HTTP API endpoint that returns cluster-wide metrics.'
          url: '{$RABBITMQ.API.SCHEME}://{$RABBITMQ.API.CLUSTER_HOST}:{$RABBITMQ.API.PORT}/api/overview'
          tags:
            - tag: component
              value: raw
          triggers:
            - uuid: ae7f1953f9b94c9c907d7bd7627d389d
              expression: 'nodata(/RabbitMQ cluster by HTTP/rabbitmq.get_overview,30m)=1'
              name: 'RabbitMQ cluster: Failed to fetch overview data'
              event_name: 'RabbitMQ cluster: Failed to fetch overview data (or no data for 30m)'
              priority: WARNING
              description: 'Zabbix has not received any data for items for the last 30 minutes.'
              manual_close: 'YES'
              tags:
                - tag: scope
                  value: availability
        - uuid: 94ffc83030e84d93a2bcafc9fc1b307b
          name: 'Messages acknowledged'
          type: DEPENDENT
          key: rabbitmq.overview.messages.ack
          description: 'The number of messages delivered to clients and acknowledged.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.message_stats.ack
              error_handler: CUSTOM_VALUE
              error_handler_params: '0'
          master_item:
            key: rabbitmq.get_overview
          tags:
            - tag: component
              value: messages
        - uuid: b7c9ca566af64e62bc450752d5cd7777
          name: 'Messages acknowledged per second'
          type: DEPENDENT
          key: rabbitmq.overview.messages.ack.rate
          value_type: FLOAT
          description: 'The rate of messages (per second) delivered to clients and acknowledged.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.message_stats.ack_details.rate
              error_handler: CUSTOM_VALUE
              error_handler_params: '0'
          master_item:
            key: rabbitmq.get_overview
          tags:
            - tag: component
              value: messages
        - uuid: 5f2ae9a4ca0643c6b3d3e7b1ed36f3e4
          name: 'Messages confirmed'
          type: DEPENDENT
          key: rabbitmq.overview.messages.confirm
          description: 'The count of confirmed messages.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.message_stats.confirm
              error_handler: CUSTOM_VALUE
              error_handler_params: '0'
          master_item:
            key: rabbitmq.get_overview
          tags:
            - tag: component
              value: messages
        - uuid: 302caaded1ec40a984c13c3eab6f7509
          name: 'Messages confirmed per second'
          type: DEPENDENT
          key: rabbitmq.overview.messages.confirm.rate
          value_type: FLOAT
          description: 'The rate of messages confirmed per second.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.message_stats.confirm_details.rate
              error_handler: CUSTOM_VALUE
              error_handler_params: '0'
          master_item:
            key: rabbitmq.get_overview
          tags:
            - tag: component
              value: messages
        - uuid: fa4dcdd9a76c47fb8b3e0e238077f591
          name: 'Messages delivered'
          type: DEPENDENT
          key: rabbitmq.overview.messages.deliver_get
          description: 'The sum of messages delivered to consumers: in acknowledgement mode and in no-acknowledgement mode; delivered to consumers in response to the `basic.get`: in acknowledgement mode and in no-acknowledgement mode.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.message_stats.deliver_get
              error_handler: CUSTOM_VALUE
              error_handler_params: '0'
          master_item:
            key: rabbitmq.get_overview
          tags:
            - tag: component
              value: messages
        - uuid: 483b3ccd192a4f7a8142da5fc3303d63
          name: 'Messages delivered per second'
          type: DEPENDENT
          key: rabbitmq.overview.messages.deliver_get.rate
          value_type: FLOAT
          description: 'The rate of the sum of messages (per second) delivered to consumers: in acknowledgement mode and in no-acknowledgement mode; delivered to consumers in response to the `basic.get`: in acknowledgement mode and in no-acknowledgement mode.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.message_stats.deliver_get_details.rate
              error_handler: CUSTOM_VALUE
              error_handler_params: '0'
          master_item:
            key: rabbitmq.get_overview
          tags:
            - tag: component
              value: messages
        - uuid: af401642e23241f38b453ce65439a3fb
          name: 'Messages published'
          type: DEPENDENT
          key: rabbitmq.overview.messages.publish
          description: 'The count of published messages.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.message_stats.publish
              error_handler: CUSTOM_VALUE
              error_handler_params: '0'
          master_item:
            key: rabbitmq.get_overview
          tags:
            - tag: component
              value: messages
        - uuid: e386d202d87c442c94ea6151af8f1c45
          name: 'Messages published per second'
          type: DEPENDENT
          key: rabbitmq.overview.messages.publish.rate
          value_type: FLOAT
          description: 'The rate of messages published per second.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.message_stats.publish_details.rate
              error_handler: CUSTOM_VALUE
              error_handler_params: '0'
          master_item:
            key: rabbitmq.get_overview
          tags:
            - tag: component
              value: messages
        - uuid: ebe18f0f04fe4c098283cfeab6ebb716
          name: 'Messages publish_in'
          type: DEPENDENT
          key: rabbitmq.overview.messages.publish_in
          description: 'The count of messages published from the channels into this overview.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.message_stats.publish_in
              error_handler: CUSTOM_VALUE
              error_handler_params: '0'
          master_item:
            key: rabbitmq.get_overview
          tags:
            - tag: component
              value: messages
        - uuid: 8078d1269b0f4650b2a2c8d0f7de8bfd
          name: 'Messages publish_in per second'
          type: DEPENDENT
          key: rabbitmq.overview.messages.publish_in.rate
          value_type: FLOAT
          description: 'The rate of messages (per second) published from the channels into this overview.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.message_stats.publish_in_details.rate
              error_handler: CUSTOM_VALUE
              error_handler_params: '0'
          master_item:
            key: rabbitmq.get_overview
          tags:
            - tag: component
              value: messages
        - uuid: 8d5523cd5120462f903af9b67e2abb10
          name: 'Messages publish_out'
          type: DEPENDENT
          key: rabbitmq.overview.messages.publish_out
          description: 'The count of messages published from this overview into queues.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.message_stats.publish_out
              error_handler: CUSTOM_VALUE
              error_handler_params: '0'
          master_item:
            key: rabbitmq.get_overview
          tags:
            - tag: component
              value: messages
        - uuid: c1a7ca5a475449b4b4d916693acd515b
          name: 'Messages publish_out per second'
          type: DEPENDENT
          key: rabbitmq.overview.messages.publish_out.rate
          value_type: FLOAT
          description: 'The rate of messages (per second) published from this overview into queues.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.message_stats.publish_out_details.rate
              error_handler: CUSTOM_VALUE
              error_handler_params: '0'
          master_item:
            key: rabbitmq.get_overview
          tags:
            - tag: component
              value: messages
        - uuid: 6c0d428069a84443affba5b1a7f886bc
          name: 'Messages returned redeliver'
          type: DEPENDENT
          key: rabbitmq.overview.messages.redeliver
          description: 'The count of subset of messages in the `deliver_get`, which had the `redelivered` flag set.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.message_stats.redeliver
              error_handler: CUSTOM_VALUE
              error_handler_params: '0'
          master_item:
            key: rabbitmq.get_overview
          tags:
            - tag: component
              value: messages
        - uuid: 7d239c3cb6604521b1291bce0dbdf10c
          name: 'Messages returned redeliver per second'
          type: DEPENDENT
          key: rabbitmq.overview.messages.redeliver.rate
          value_type: FLOAT
          description: 'The rate of subset of messages (per second) in the `deliver_get`, which had the `redelivered` flag set.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.message_stats.redeliver_details.rate
              error_handler: CUSTOM_VALUE
              error_handler_params: '0'
          master_item:
            key: rabbitmq.get_overview
          tags:
            - tag: component
              value: messages
        - uuid: 70ab0718b7784a8280c99b6af21d909a
          name: 'Messages returned unroutable'
          type: DEPENDENT
          key: rabbitmq.overview.messages.return_unroutable
          description: 'The count of messages returned to a publisher as unroutable.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.message_stats.return_unroutable
              error_handler: CUSTOM_VALUE
              error_handler_params: '0'
          master_item:
            key: rabbitmq.get_overview
          tags:
            - tag: component
              value: messages
        - uuid: e2983b5d27294b92b658070e0ef0a2ca
          name: 'Messages returned unroutable per second'
          type: DEPENDENT
          key: rabbitmq.overview.messages.return_unroutable.rate
          value_type: FLOAT
          description: 'The rate of messages (per second) returned to a publisher as unroutable.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.message_stats.return_unroutable_details.rate
              error_handler: CUSTOM_VALUE
              error_handler_params: '0'
          master_item:
            key: rabbitmq.get_overview
          tags:
            - tag: component
              value: messages
        - uuid: 787ea966afd741b99bbdce665aebf15a
          name: 'Channels total'
          type: DEPENDENT
          key: rabbitmq.overview.object_totals.channels
          description: 'The total number of channels.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.object_totals.channels
          master_item:
            key: rabbitmq.get_overview
          tags:
            - tag: component
              value: channels
        - uuid: 3b488cdb79ac4b95abe55ddec9f74dd1
          name: 'Connections total'
          type: DEPENDENT
          key: rabbitmq.overview.object_totals.connections
          description: 'The total number of connections.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.object_totals.connections
          master_item:
            key: rabbitmq.get_overview
          tags:
            - tag: component
              value: connections
        - uuid: 4b02b27b8091430eb80e6451935848d8
          name: 'Consumers total'
          type: DEPENDENT
          key: rabbitmq.overview.object_totals.consumers
          description: 'The total number of consumers.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.object_totals.consumers
          master_item:
            key: rabbitmq.get_overview
          tags:
            - tag: component
              value: consumers
        - uuid: 1b98a03a243c4b698faa93228cb9cfb0
          name: 'Exchanges total'
          type: DEPENDENT
          key: rabbitmq.overview.object_totals.exchanges
          description: 'The total number of exchanges.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.object_totals.exchanges
          master_item:
            key: rabbitmq.get_overview
          tags:
            - tag: component
              value: exchanges
        - uuid: 011491d6f5954cf3bf37ee45a62a4d86
          name: 'Queues total'
          type: DEPENDENT
          key: rabbitmq.overview.object_totals.queues
          description: 'The total number of queues.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.object_totals.queues
          master_item:
            key: rabbitmq.get_overview
          tags:
            - tag: component
              value: queues
        - uuid: c9bc0b0a61be4412bfc31cb725bbe837
          name: 'Messages total'
          type: DEPENDENT
          key: rabbitmq.overview.queue_totals.messages
          description: 'The total number of messages (ready, plus unacknowledged).'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.queue_totals.messages
              error_handler: CUSTOM_VALUE
              error_handler_params: '0'
          master_item:
            key: rabbitmq.get_overview
          tags:
            - tag: component
              value: messages
        - uuid: 7c7e5c4111ff464b913a43b59fcb2e9b
          name: 'Messages ready for delivery'
          type: DEPENDENT
          key: rabbitmq.overview.queue_totals.messages.ready
          description: 'The number of messages ready for delivery.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.queue_totals.messages_ready
              error_handler: CUSTOM_VALUE
              error_handler_params: '0'
          master_item:
            key: rabbitmq.get_overview
          tags:
            - tag: component
              value: messages
        - uuid: 3403648d6b964edd8c390e2c175b068a
          name: 'Messages unacknowledged'
          type: DEPENDENT
          key: rabbitmq.overview.queue_totals.messages.unacknowledged
          description: 'The number of unacknowledged messages.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.queue_totals.messages_unacknowledged
              error_handler: CUSTOM_VALUE
              error_handler_params: '0'
          master_item:
            key: rabbitmq.get_overview
          tags:
            - tag: component
              value: messages
      discovery_rules:
        - uuid: 689cf8096c0c49099e2b56c5b639d3c6
          name: 'Exchanges discovery'
          type: DEPENDENT
          key: rabbitmq.exchanges.discovery
          filter:
            evaltype: AND
            conditions:
              - macro: '{#EXCHANGE}'
                value: '{$RABBITMQ.LLD.FILTER.EXCHANGE.MATCHES}'
              - macro: '{#EXCHANGE}'
                value: '{$RABBITMQ.LLD.FILTER.EXCHANGE.NOT_MATCHES}'
                operator: NOT_MATCHES_REGEX
          description: 'The metrics for an individual exchange.'
          item_prototypes:
            - uuid: d8cdcef7ad324aebb597e9d2cd32bdf2
              name: 'Exchange [{#VHOST}][{#EXCHANGE}][{#TYPE}]: Messages acknowledged per second'
              type: DEPENDENT
              key: 'rabbitmq.exchange.messages.ack.rate["{#VHOST}/{#EXCHANGE}/{#TYPE}"]'
              value_type: FLOAT
              description: 'The rate of messages (per second) delivered to clients and acknowledged.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.message_stats.ack_details.rate
                  error_handler: CUSTOM_VALUE
                  error_handler_params: '0'
              master_item:
                key: 'rabbitmq.get_exchanges["{#VHOST}/{#EXCHANGE}/{#TYPE}"]'
              tags:
                - tag: component
                  value: messages
                - tag: exchange
                  value: '{#EXCHANGE}'
                - tag: type
                  value: '{#TYPE}'
                - tag: vhost
                  value: '{#VHOST}'
            - uuid: fd3d7de712d84721a09248670a7504f1
              name: 'Exchange [{#VHOST}][{#EXCHANGE}][{#TYPE}]: Messages acknowledged'
              type: DEPENDENT
              key: 'rabbitmq.exchange.messages.ack["{#VHOST}/{#EXCHANGE}/{#TYPE}"]'
              description: 'The number of messages delivered to clients and acknowledged.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.message_stats.ack
                  error_handler: CUSTOM_VALUE
                  error_handler_params: '0'
              master_item:
                key: 'rabbitmq.get_exchanges["{#VHOST}/{#EXCHANGE}/{#TYPE}"]'
              tags:
                - tag: component
                  value: messages
                - tag: exchange
                  value: '{#EXCHANGE}'
                - tag: type
                  value: '{#TYPE}'
                - tag: vhost
                  value: '{#VHOST}'
            - uuid: bc57ae1a1c1d4e9c96a268906d88dbf8
              name: 'Exchange [{#VHOST}][{#EXCHANGE}][{#TYPE}]: Messages confirmed per second'
              type: DEPENDENT
              key: 'rabbitmq.exchange.messages.confirm.rate["{#VHOST}/{#EXCHANGE}/{#TYPE}"]'
              value_type: FLOAT
              description: 'The rate of messages confirmed per second.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.message_stats.confirm_details.rate
                  error_handler: CUSTOM_VALUE
                  error_handler_params: '0'
              master_item:
                key: 'rabbitmq.get_exchanges["{#VHOST}/{#EXCHANGE}/{#TYPE}"]'
              tags:
                - tag: component
                  value: messages
                - tag: exchange
                  value: '{#EXCHANGE}'
                - tag: type
                  value: '{#TYPE}'
                - tag: vhost
                  value: '{#VHOST}'
            - uuid: 8fac23c225d449b3a01d495b52131f5c
              name: 'Exchange [{#VHOST}][{#EXCHANGE}][{#TYPE}]: Messages confirmed'
              type: DEPENDENT
              key: 'rabbitmq.exchange.messages.confirm["{#VHOST}/{#EXCHANGE}/{#TYPE}"]'
              description: 'The count of confirmed messages.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.message_stats.confirm
                  error_handler: CUSTOM_VALUE
                  error_handler_params: '0'
              master_item:
                key: 'rabbitmq.get_exchanges["{#VHOST}/{#EXCHANGE}/{#TYPE}"]'
              tags:
                - tag: component
                  value: messages
                - tag: exchange
                  value: '{#EXCHANGE}'
                - tag: type
                  value: '{#TYPE}'
                - tag: vhost
                  value: '{#VHOST}'
            - uuid: 18916e7d0fce41d698f57f0f1be5dab1
              name: 'Exchange [{#VHOST}][{#EXCHANGE}][{#TYPE}]: Messages delivered per second'
              type: DEPENDENT
              key: 'rabbitmq.exchange.messages.deliver_get.rate["{#VHOST}/{#EXCHANGE}/{#TYPE}"]'
              value_type: FLOAT
              description: 'The rate of the sum of messages (per second) delivered to consumers: in acknowledgement mode and in no-acknowledgement mode; delivered to consumers in response to the `basic.get`: in acknowledgement mode and in no-acknowledgement mode.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.message_stats.deliver_get_details.rate
                  error_handler: CUSTOM_VALUE
                  error_handler_params: '0'
              master_item:
                key: 'rabbitmq.get_exchanges["{#VHOST}/{#EXCHANGE}/{#TYPE}"]'
              tags:
                - tag: component
                  value: messages
                - tag: exchange
                  value: '{#EXCHANGE}'
                - tag: type
                  value: '{#TYPE}'
                - tag: vhost
                  value: '{#VHOST}'
            - uuid: b86cc017bbb247b79e5b0522cf895d33
              name: 'Exchange [{#VHOST}][{#EXCHANGE}][{#TYPE}]: Messages delivered'
              type: DEPENDENT
              key: 'rabbitmq.exchange.messages.deliver_get["{#VHOST}/{#EXCHANGE}/{#TYPE}"]'
              description: 'The sum of messages delivered to consumers: in acknowledgement mode and in no-acknowledgement mode; delivered to consumers in response to the `basic.get`: in acknowledgement mode and in no-acknowledgement mode.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.message_stats.deliver_get
                  error_handler: CUSTOM_VALUE
                  error_handler_params: '0'
              master_item:
                key: 'rabbitmq.get_exchanges["{#VHOST}/{#EXCHANGE}/{#TYPE}"]'
              tags:
                - tag: component
                  value: messages
                - tag: exchange
                  value: '{#EXCHANGE}'
                - tag: type
                  value: '{#TYPE}'
                - tag: vhost
                  value: '{#VHOST}'
            - uuid: a4a890d6cbdc40528dee488d8649343d
              name: 'Exchange [{#VHOST}][{#EXCHANGE}][{#TYPE}]: Messages published per second'
              type: DEPENDENT
              key: 'rabbitmq.exchange.messages.publish.rate["{#VHOST}/{#EXCHANGE}/{#TYPE}"]'
              value_type: FLOAT
              description: 'The rate of messages published per second.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.message_stats.publish_details.rate
                  error_handler: CUSTOM_VALUE
                  error_handler_params: '0'
              master_item:
                key: 'rabbitmq.get_exchanges["{#VHOST}/{#EXCHANGE}/{#TYPE}"]'
              tags:
                - tag: component
                  value: messages
                - tag: exchange
                  value: '{#EXCHANGE}'
                - tag: type
                  value: '{#TYPE}'
                - tag: vhost
                  value: '{#VHOST}'
            - uuid: 24515b4712014fbeb857592664624be3
              name: 'Exchange [{#VHOST}][{#EXCHANGE}][{#TYPE}]: Messages published'
              type: DEPENDENT
              key: 'rabbitmq.exchange.messages.publish["{#VHOST}/{#EXCHANGE}/{#TYPE}"]'
              description: 'The count of published messages.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.message_stats.publish
                  error_handler: CUSTOM_VALUE
                  error_handler_params: '0'
              master_item:
                key: 'rabbitmq.get_exchanges["{#VHOST}/{#EXCHANGE}/{#TYPE}"]'
              tags:
                - tag: component
                  value: messages
                - tag: exchange
                  value: '{#EXCHANGE}'
                - tag: type
                  value: '{#TYPE}'
                - tag: vhost
                  value: '{#VHOST}'
            - uuid: d7ecda9c49ee479481b0b96d92113064
              name: 'Exchange [{#VHOST}][{#EXCHANGE}][{#TYPE}]: Messages publish_in per second'
              type: DEPENDENT
              key: 'rabbitmq.exchange.messages.publish_in.rate["{#VHOST}/{#EXCHANGE}/{#TYPE}"]'
              value_type: FLOAT
              description: 'The rate of messages (per second) published from the channels into this overview.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.message_stats.publish_in_details.rate
                  error_handler: CUSTOM_VALUE
                  error_handler_params: '0'
              master_item:
                key: 'rabbitmq.get_exchanges["{#VHOST}/{#EXCHANGE}/{#TYPE}"]'
              tags:
                - tag: component
                  value: messages
                - tag: exchange
                  value: '{#EXCHANGE}'
                - tag: type
                  value: '{#TYPE}'
                - tag: vhost
                  value: '{#VHOST}'
            - uuid: 02ebc8dacc0b44cd81bd9a83394359ff
              name: 'Exchange [{#VHOST}][{#EXCHANGE}][{#TYPE}]: Messages publish_in'
              type: DEPENDENT
              key: 'rabbitmq.exchange.messages.publish_in["{#VHOST}/{#EXCHANGE}/{#TYPE}"]'
              description: 'The count of messages published from the channels into this overview.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.message_stats.publish_in
                  error_handler: CUSTOM_VALUE
                  error_handler_params: '0'
              master_item:
                key: 'rabbitmq.get_exchanges["{#VHOST}/{#EXCHANGE}/{#TYPE}"]'
              tags:
                - tag: component
                  value: messages
                - tag: exchange
                  value: '{#EXCHANGE}'
                - tag: type
                  value: '{#TYPE}'
                - tag: vhost
                  value: '{#VHOST}'
            - uuid: 46a5efc69f2e4928b5744b5ea0cd6ae3
              name: 'Exchange [{#VHOST}][{#EXCHANGE}][{#TYPE}]: Messages publish_out per second'
              type: DEPENDENT
              key: 'rabbitmq.exchange.messages.publish_out.rate["{#VHOST}/{#EXCHANGE}/{#TYPE}"]'
              value_type: FLOAT
              description: 'The rate of messages (per second) published from this overview into queues.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.message_stats.publish_out_details.rate
                  error_handler: CUSTOM_VALUE
                  error_handler_params: '0'
              master_item:
                key: 'rabbitmq.get_exchanges["{#VHOST}/{#EXCHANGE}/{#TYPE}"]'
              tags:
                - tag: component
                  value: messages
                - tag: exchange
                  value: '{#EXCHANGE}'
                - tag: type
                  value: '{#TYPE}'
                - tag: vhost
                  value: '{#VHOST}'
            - uuid: c83921ac67074e169e247dc3392213cf
              name: 'Exchange [{#VHOST}][{#EXCHANGE}][{#TYPE}]: Messages publish_out'
              type: DEPENDENT
              key: 'rabbitmq.exchange.messages.publish_out["{#VHOST}/{#EXCHANGE}/{#TYPE}"]'
              description: 'The count of messages published from this overview into queues.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.message_stats.publish_out
                  error_handler: CUSTOM_VALUE
                  error_handler_params: '0'
              master_item:
                key: 'rabbitmq.get_exchanges["{#VHOST}/{#EXCHANGE}/{#TYPE}"]'
              tags:
                - tag: component
                  value: messages
                - tag: exchange
                  value: '{#EXCHANGE}'
                - tag: type
                  value: '{#TYPE}'
                - tag: vhost
                  value: '{#VHOST}'
            - uuid: 64bc6c65cc2f46b1841bd9852020bf44
              name: 'Exchange {#VHOST}/{#EXCHANGE}/{#TYPE}: Messages redelivered per second'
              type: DEPENDENT
              key: 'rabbitmq.exchange.messages.redeliver.rate["{#VHOST}/{#EXCHANGE}/{#TYPE}"]'
              value_type: FLOAT
              description: 'The rate of subset of messages (per second) in the `deliver_get`, which had the `redelivered` flag set.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.message_stats.redeliver_details.rate
                  error_handler: CUSTOM_VALUE
                  error_handler_params: '0'
              master_item:
                key: 'rabbitmq.get_exchanges["{#VHOST}/{#EXCHANGE}/{#TYPE}"]'
              tags:
                - tag: component
                  value: messages
                - tag: exchange
                  value: '{#EXCHANGE}'
                - tag: type
                  value: '{#TYPE}'
                - tag: vhost
                  value: '{#VHOST}'
            - uuid: 3203320d008d484d917827f93b213725
              name: 'Exchange [{#VHOST}][{#EXCHANGE}][{#TYPE}]: Messages redelivered'
              type: DEPENDENT
              key: 'rabbitmq.exchange.messages.redeliver["{#VHOST}/{#EXCHANGE}/{#TYPE}"]'
              description: 'The count of subset of messages in the `deliver_get`, which had the `redelivered` flag set.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.message_stats.redeliver
                  error_handler: CUSTOM_VALUE
                  error_handler_params: '0'
              master_item:
                key: 'rabbitmq.get_exchanges["{#VHOST}/{#EXCHANGE}/{#TYPE}"]'
              tags:
                - tag: component
                  value: messages
                - tag: exchange
                  value: '{#EXCHANGE}'
                - tag: type
                  value: '{#TYPE}'
                - tag: vhost
                  value: '{#VHOST}'
            - uuid: 1aad46c39cc347f59ed953aa6bc23fbe
              name: 'Exchange [{#VHOST}][{#EXCHANGE}][{#TYPE}]: Messages returned unroutable per second'
              type: DEPENDENT
              key: 'rabbitmq.exchange.messages.return_unroutable.rate["{#VHOST}/{#EXCHANGE}/{#TYPE}"]'
              value_type: FLOAT
              description: 'The rate of messages (per second) returned to a publisher as unroutable.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.message_stats.return_unroutable_details.rate
                  error_handler: CUSTOM_VALUE
                  error_handler_params: '0'
              master_item:
                key: 'rabbitmq.get_exchanges["{#VHOST}/{#EXCHANGE}/{#TYPE}"]'
              tags:
                - tag: component
                  value: messages
                - tag: exchange
                  value: '{#EXCHANGE}'
                - tag: type
                  value: '{#TYPE}'
                - tag: vhost
                  value: '{#VHOST}'
            - uuid: caaaf925f72e42d2b3112098bd05b3d1
              name: 'Exchange [{#VHOST}][{#EXCHANGE}][{#TYPE}]: Messages returned unroutable'
              type: DEPENDENT
              key: 'rabbitmq.exchange.messages.return_unroutable["{#VHOST}/{#EXCHANGE}/{#TYPE}"]'
              description: 'The count of messages returned to a publisher as unroutable.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.message_stats.return_unroutable
                  error_handler: CUSTOM_VALUE
                  error_handler_params: '0'
              master_item:
                key: 'rabbitmq.get_exchanges["{#VHOST}/{#EXCHANGE}/{#TYPE}"]'
              tags:
                - tag: component
                  value: messages
                - tag: exchange
                  value: '{#EXCHANGE}'
                - tag: type
                  value: '{#TYPE}'
                - tag: vhost
                  value: '{#VHOST}'
            - uuid: 54ec0943af1b4c0c807bcc222f5d70c7
              name: 'Exchange [{#VHOST}][{#EXCHANGE}][{#TYPE}]: Get data'
              type: DEPENDENT
              key: 'rabbitmq.get_exchanges["{#VHOST}/{#EXCHANGE}/{#TYPE}"]'
              history: '0'
              value_type: TEXT
              description: 'The HTTP API endpoint that returns [{#VHOST}][{#EXCHANGE}][{#TYPE}] exchanges metrics'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$[?(@.name == "{#EXCHANGE}" && @.vhost == "{#VHOST}" && @.type =="{#TYPE}")].first()'
              master_item:
                key: rabbitmq.get_exchanges
              tags:
                - tag: component
                  value: raw
          master_item:
            key: rabbitmq.get_exchanges
          lld_macro_paths:
            - lld_macro: '{#EXCHANGE}'
              path: $.name
            - lld_macro: '{#TYPE}'
              path: $.type
            - lld_macro: '{#VHOST}'
              path: $.vhost
          preprocessing:
            - type: JAVASCRIPT
              parameters:
                - 'return JSON.stringify(JSON.parse(value),[''name'',''type'',''vhost'']);'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
        - uuid: 8655f85b65cc4eb0a0470db45ca1c963
          name: 'Health Check 3.8.10+ discovery'
          type: DEPENDENT
          key: rabbitmq.healthcheck.v3810.discovery
          description: 'Specific metrics for the versions: up to and including 3.8.10.'
          item_prototypes:
            - uuid: 90db70de99454f7b924d84174a5951fb
              name: 'Healthcheck: alarms in effect in the cluster{#SINGLETON}'
              type: HTTP_AGENT
              key: 'rabbitmq.healthcheck.alarms[{#SINGLETON}]'
              authtype: BASIC
              username: '{$RABBITMQ.API.USER}'
              password: '{$RABBITMQ.API.PASSWORD}'
              description: 'Responds a 200 OK if there are no alarms in effect in the cluster, otherwise responds with a 503 Service Unavailable.'
              valuemap:
                name: 'RabbitMQ healthcheck'
              preprocessing:
                - type: REGEX
                  parameters:
                    - 'HTTP\/[\d.]+\s+(\d{3})'
                    - \1
                - type: JAVASCRIPT
                  parameters:
                    - |
                      switch(value){
                      case '200': return 1
                      case '503': return 0
                      default: 2}
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3h
              url: '{$RABBITMQ.API.SCHEME}://{$RABBITMQ.API.CLUSTER_HOST}:{$RABBITMQ.API.PORT}/api/health/checks/alarms'
              status_codes: '200,503,404'
              retrieve_mode: HEADERS
              tags:
                - tag: component
                  value: health
                - tag: component
                  value: system
              trigger_prototypes:
                - uuid: 58592bb4d473497e9942634db2001823
                  expression: 'last(/RabbitMQ cluster by HTTP/rabbitmq.healthcheck.alarms[{#SINGLETON}])=0'
                  name: 'RabbitMQ cluster: There are active alarms in the cluster'
                  opdata: 'Current state: {ITEM.LASTVALUE1}'
                  priority: AVERAGE
                  description: 'This is the default API endpoint path: http://{$RABBITMQ.API.CLUSTER_HOST}:{$RABBITMQ.API.PORT}/api/index.html.'
                  tags:
                    - tag: scope
                      value: notice
          master_item:
            key: rabbitmq.get_overview
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.management_version
            - type: JAVASCRIPT
              parameters:
                - |
                  var rabbit_version = parseInt(value.split('.')[0]) * 10000 +
                  	parseInt(value.split('.')[1]) * 100 +
                  	parseInt(value.split('.')[2]);
                  return JSON.stringify(rabbit_version >= 30810 ? [{ '{#SINGLETON}': '' }] : []);
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
      tags:
        - tag: class
          value: software
        - tag: subclass
          value: messaging
        - tag: target
          value: rabbitmq
      macros:
        - macro: '{$RABBITMQ.API.CLUSTER_HOST}'
          description: 'The hostname or IP of the API endpoint for the RabbitMQ cluster.'
          config:
            type: TEXT
            priority: '3'
            label: Address
            description: 'The hostname or IP of the API endpoint for the RabbitMQ cluster.'
            required: 'YES'
        - macro: '{$RABBITMQ.API.PASSWORD}'
          value: zabbix
          config:
            type: TEXT
            priority: '2'
            label: Password
            required: 'YES'
        - macro: '{$RABBITMQ.API.PORT}'
          value: '15672'
          description: 'The port of the RabbitMQ API endpoint.'
          config:
            type: TEXT
            priority: '4'
            label: Port
            description: 'The port of the RabbitMQ API endpoint. In the range from 1 to 65535 inclusive.'
            required: 'YES'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$RABBITMQ.API.SCHEME}'
          value: http
          description: 'The request scheme, which may be HTTP or HTTPS.'
          config:
            type: LIST
            priority: '5'
            label: Scheme
            description: 'The request scheme, which may be HTTP or HTTPS.'
            required: 'YES'
            options:
              - value: http
                text: http
              - value: https
                text: https
        - macro: '{$RABBITMQ.API.USER}'
          value: zbx_monitor
          config:
            type: TEXT
            priority: '1'
            label: Username
            required: 'YES'
        - macro: '{$RABBITMQ.LLD.FILTER.EXCHANGE.MATCHES}'
          value: '.*'
          description: 'This macro is used in the discovery of exchanges. It can be overridden at host level or its linked template level.'
          config:
            type: TEXT
            priority: '6'
            section_name: Filters
            label: 'Filter for exchange (include)'
            description: 'This macro is used in the discovery of exchanges. It can be overridden at host level or its linked template level.'
        - macro: '{$RABBITMQ.LLD.FILTER.EXCHANGE.NOT_MATCHES}'
          value: CHANGE_IF_NEEDED
          description: 'This macro is used in the discovery of exchanges. It can be overridden at host level or its linked template level.'
          config:
            type: TEXT
            priority: '7'
            section_name: Filters
            label: 'Filter for exchange (exclude)'
            description: 'This macro is used in the discovery of exchanges. It can be overridden at host level or its linked template level.'
      dashboards:
        - uuid: 1b64af348f284f74a1f7f03de1d55f7b
          name: 'RabbitMQ overview'
          pages:
            - widgets:
                - type: graph
                  width: '36'
                  height: '5'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'RabbitMQ cluster by HTTP'
                        name: 'RabbitMQ: Messages'
                    - type: STRING
                      name: reference
                      value: AAAAA
                - type: graph
                  'y': '5'
                  width: '36'
                  height: '5'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'RabbitMQ cluster by HTTP'
                        name: 'RabbitMQ: Messages status'
                    - type: STRING
                      name: reference
                      value: AAAAC
                - type: graph
                  'y': '10'
                  width: '36'
                  height: '5'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'RabbitMQ cluster by HTTP'
                        name: 'RabbitMQ: Messages per second'
                    - type: STRING
                      name: reference
                      value: AAAAE
                - type: graph
                  x: '36'
                  width: '36'
                  height: '5'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'RabbitMQ cluster by HTTP'
                        name: 'RabbitMQ: Connections'
                    - type: STRING
                      name: reference
                      value: AAAAB
                - type: graph
                  x: '36'
                  'y': '5'
                  width: '36'
                  height: '5'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'RabbitMQ cluster by HTTP'
                        name: 'RabbitMQ: Queues'
                    - type: STRING
                      name: reference
                      value: AAAAD
      valuemaps:
        - uuid: 3380e05a15774dad92e77c983448698b
          name: 'RabbitMQ healthcheck'
          mappings:
            - value: '0'
              newvalue: Failed
            - value: '1'
              newvalue: Ok
            - value: '2'
              newvalue: Error
    - uuid: 5fa761bc51e4432a90c6c9eece930c4a
      template: 'RabbitMQ cluster by Zabbix agent'
      name: 'RabbitMQ cluster by Zabbix agent'
      description: |
        Get cluster metrics from RabbitMQ management plugin provided an HTTP-based API using Zabbix agent.
        
        You can discuss this template or leave feedback on our forum https://www.zabbix.com/forum/zabbix-suggestions-and-feedback/387226-discussion-thread-for-official-zabbix-template-rabbitmq
        
        Generated by official Zabbix template tool "Templator"
      wizard_ready: 'YES'
      readme: |
        ## Overview
        
        This template is developed to monitor the messaging broker RabbitMQ by Zabbix that works without any external scripts.
        Most of the metrics are collected in one go, thanks to Zabbix bulk data collection.
        
        The template `RabbitMQ Cluster` — collects metrics by polling [RabbitMQ management plugin](https://www.rabbitmq.com/management.html) with Zabbix agent.
        
        
        ## Setup
        
        Enable the RabbitMQ management plugin. See [RabbitMQ documentation](https://www.rabbitmq.com/management.html) for the instructions.
        
        Create a user to monitor the service:
        
        ```bash
        rabbitmqctl add_user zbx_monitor <PASSWORD>
        rabbitmqctl set_permissions  -p / zbx_monitor "" "" ".*"
        rabbitmqctl set_user_tags zbx_monitor monitoring
        ```
        
        A login name and password are also supported in macros functions:
        
        - {$RABBITMQ.API.USER}
        - {$RABBITMQ.API.PASSWORD}
        
        If your cluster consists of several nodes, it is recommended to assign the `cluster` template to a separate balancing host.
        In the case of a single-node installation, you can assign the `cluster` template to one host with a `node` template.
        
        If you use another API endpoint, then don't forget to change `Address` host wizard configuration field.
        
        Install and setup [Zabbix agent](https://www.zabbix.com/documentation/8.0/manual/installation/install_from_packages).
      vendor:
        name: Zabbix
        version: 8.0-2
      groups:
        - name: Templates/Applications
      items:
        - uuid: 31908a8287be442681a0ded564977ff2
          name: 'Messages acknowledged'
          type: DEPENDENT
          key: rabbitmq.overview.messages.ack
          description: 'The number of messages delivered to clients and acknowledged.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.message_stats.ack
              error_handler: CUSTOM_VALUE
              error_handler_params: '0'
          master_item:
            key: 'web.page.get["{$RABBITMQ.API.SCHEME}://{$RABBITMQ.API.USER}:{$RABBITMQ.API.PASSWORD}@{$RABBITMQ.API.CLUSTER_HOST}:{$RABBITMQ.API.PORT}/api/overview"]'
          tags:
            - tag: component
              value: messages
        - uuid: f78fabbd7e3f44dc81b1cf9c90b26f2e
          name: 'Messages acknowledged per second'
          type: DEPENDENT
          key: rabbitmq.overview.messages.ack.rate
          value_type: FLOAT
          description: 'The rate of messages (per second) delivered to clients and acknowledged.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.message_stats.ack_details.rate
              error_handler: CUSTOM_VALUE
              error_handler_params: '0'
          master_item:
            key: 'web.page.get["{$RABBITMQ.API.SCHEME}://{$RABBITMQ.API.USER}:{$RABBITMQ.API.PASSWORD}@{$RABBITMQ.API.CLUSTER_HOST}:{$RABBITMQ.API.PORT}/api/overview"]'
          tags:
            - tag: component
              value: messages
        - uuid: 45cf9b5cf5cd4b13b0e140383233799f
          name: 'Messages confirmed'
          type: DEPENDENT
          key: rabbitmq.overview.messages.confirm
          description: 'The count of confirmed messages.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.message_stats.confirm
              error_handler: CUSTOM_VALUE
              error_handler_params: '0'
          master_item:
            key: 'web.page.get["{$RABBITMQ.API.SCHEME}://{$RABBITMQ.API.USER}:{$RABBITMQ.API.PASSWORD}@{$RABBITMQ.API.CLUSTER_HOST}:{$RABBITMQ.API.PORT}/api/overview"]'
          tags:
            - tag: component
              value: messages
        - uuid: bc85a070e1e9451b953d85bb519ed63d
          name: 'Messages confirmed per second'
          type: DEPENDENT
          key: rabbitmq.overview.messages.confirm.rate
          value_type: FLOAT
          description: 'The rate of messages confirmed per second.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.message_stats.confirm_details.rate
              error_handler: CUSTOM_VALUE
              error_handler_params: '0'
          master_item:
            key: 'web.page.get["{$RABBITMQ.API.SCHEME}://{$RABBITMQ.API.USER}:{$RABBITMQ.API.PASSWORD}@{$RABBITMQ.API.CLUSTER_HOST}:{$RABBITMQ.API.PORT}/api/overview"]'
          tags:
            - tag: component
              value: messages
        - uuid: 004da545af4a4f61bd2167281bb9a02b
          name: 'Messages delivered'
          type: DEPENDENT
          key: rabbitmq.overview.messages.deliver_get
          description: 'The sum of messages delivered to consumers: in acknowledgement mode and in no-acknowledgement mode; delivered to consumers in response to the `basic.get`: in acknowledgement mode and in no-acknowledgement mode.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.message_stats.deliver_get
              error_handler: CUSTOM_VALUE
              error_handler_params: '0'
          master_item:
            key: 'web.page.get["{$RABBITMQ.API.SCHEME}://{$RABBITMQ.API.USER}:{$RABBITMQ.API.PASSWORD}@{$RABBITMQ.API.CLUSTER_HOST}:{$RABBITMQ.API.PORT}/api/overview"]'
          tags:
            - tag: component
              value: messages
        - uuid: c00a84c8676544dcbdd74fec13881063
          name: 'Messages delivered per second'
          type: DEPENDENT
          key: rabbitmq.overview.messages.deliver_get.rate
          value_type: FLOAT
          description: 'The rate of the sum of messages (per second) delivered to consumers: in acknowledgement mode and in no-acknowledgement mode; delivered to consumers in response to the `basic.get`: in acknowledgement mode and in no-acknowledgement mode.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.message_stats.deliver_get_details.rate
              error_handler: CUSTOM_VALUE
              error_handler_params: '0'
          master_item:
            key: 'web.page.get["{$RABBITMQ.API.SCHEME}://{$RABBITMQ.API.USER}:{$RABBITMQ.API.PASSWORD}@{$RABBITMQ.API.CLUSTER_HOST}:{$RABBITMQ.API.PORT}/api/overview"]'
          tags:
            - tag: component
              value: messages
        - uuid: 4215bdf87f0e426f85bd79434a0fb0bb
          name: 'Messages published'
          type: DEPENDENT
          key: rabbitmq.overview.messages.publish
          description: 'The count of published messages.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.message_stats.publish
              error_handler: CUSTOM_VALUE
              error_handler_params: '0'
          master_item:
            key: 'web.page.get["{$RABBITMQ.API.SCHEME}://{$RABBITMQ.API.USER}:{$RABBITMQ.API.PASSWORD}@{$RABBITMQ.API.CLUSTER_HOST}:{$RABBITMQ.API.PORT}/api/overview"]'
          tags:
            - tag: component
              value: messages
        - uuid: cfadadb681474c7eb0512d1f4d223ff6
          name: 'Messages published per second'
          type: DEPENDENT
          key: rabbitmq.overview.messages.publish.rate
          value_type: FLOAT
          description: 'The rate of messages published per second.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.message_stats.publish_details.rate
              error_handler: CUSTOM_VALUE
              error_handler_params: '0'
          master_item:
            key: 'web.page.get["{$RABBITMQ.API.SCHEME}://{$RABBITMQ.API.USER}:{$RABBITMQ.API.PASSWORD}@{$RABBITMQ.API.CLUSTER_HOST}:{$RABBITMQ.API.PORT}/api/overview"]'
          tags:
            - tag: component
              value: messages
        - uuid: bb068ac7c6094fb8a59cd1a003e88c39
          name: 'Messages publish_in'
          type: DEPENDENT
          key: rabbitmq.overview.messages.publish_in
          description: 'The count of messages published from the channels into this overview.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.message_stats.publish_in
              error_handler: CUSTOM_VALUE
              error_handler_params: '0'
          master_item:
            key: 'web.page.get["{$RABBITMQ.API.SCHEME}://{$RABBITMQ.API.USER}:{$RABBITMQ.API.PASSWORD}@{$RABBITMQ.API.CLUSTER_HOST}:{$RABBITMQ.API.PORT}/api/overview"]'
          tags:
            - tag: component
              value: messages
        - uuid: db511bf1cd6c465f8fe1ae6b5fa08660
          name: 'Messages publish_in per second'
          type: DEPENDENT
          key: rabbitmq.overview.messages.publish_in.rate
          value_type: FLOAT
          description: 'The rate of messages (per second) published from the channels into this overview.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.message_stats.publish_in_details.rate
              error_handler: CUSTOM_VALUE
              error_handler_params: '0'
          master_item:
            key: 'web.page.get["{$RABBITMQ.API.SCHEME}://{$RABBITMQ.API.USER}:{$RABBITMQ.API.PASSWORD}@{$RABBITMQ.API.CLUSTER_HOST}:{$RABBITMQ.API.PORT}/api/overview"]'
          tags:
            - tag: component
              value: messages
        - uuid: 23dcb85dd9bc4fefb1a9682956181c2e
          name: 'Messages publish_out'
          type: DEPENDENT
          key: rabbitmq.overview.messages.publish_out
          description: 'The count of messages published from this overview into queues.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.message_stats.publish_out
              error_handler: CUSTOM_VALUE
              error_handler_params: '0'
          master_item:
            key: 'web.page.get["{$RABBITMQ.API.SCHEME}://{$RABBITMQ.API.USER}:{$RABBITMQ.API.PASSWORD}@{$RABBITMQ.API.CLUSTER_HOST}:{$RABBITMQ.API.PORT}/api/overview"]'
          tags:
            - tag: component
              value: messages
        - uuid: 05e4c745be95412995749c352ec0f925
          name: 'Messages publish_out per second'
          type: DEPENDENT
          key: rabbitmq.overview.messages.publish_out.rate
          value_type: FLOAT
          description: 'The rate of messages (per second) published from this overview into queues.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.message_stats.publish_out_details.rate
              error_handler: CUSTOM_VALUE
              error_handler_params: '0'
          master_item:
            key: 'web.page.get["{$RABBITMQ.API.SCHEME}://{$RABBITMQ.API.USER}:{$RABBITMQ.API.PASSWORD}@{$RABBITMQ.API.CLUSTER_HOST}:{$RABBITMQ.API.PORT}/api/overview"]'
          tags:
            - tag: component
              value: messages
        - uuid: 650d6a94e381477299c62cfb2a2252cf
          name: 'Messages returned redeliver'
          type: DEPENDENT
          key: rabbitmq.overview.messages.redeliver
          description: 'The count of subset of messages in the `deliver_get`, which had the `redelivered` flag set.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.message_stats.redeliver
              error_handler: CUSTOM_VALUE
              error_handler_params: '0'
          master_item:
            key: 'web.page.get["{$RABBITMQ.API.SCHEME}://{$RABBITMQ.API.USER}:{$RABBITMQ.API.PASSWORD}@{$RABBITMQ.API.CLUSTER_HOST}:{$RABBITMQ.API.PORT}/api/overview"]'
          tags:
            - tag: component
              value: messages
        - uuid: 6d7eb8880bca4c6e92f65f8a32911599
          name: 'Messages returned redeliver per second'
          type: DEPENDENT
          key: rabbitmq.overview.messages.redeliver.rate
          value_type: FLOAT
          description: 'The rate of subset of messages (per second) in the `deliver_get`, which had the `redelivered` flag set.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.message_stats.redeliver_details.rate
              error_handler: CUSTOM_VALUE
              error_handler_params: '0'
          master_item:
            key: 'web.page.get["{$RABBITMQ.API.SCHEME}://{$RABBITMQ.API.USER}:{$RABBITMQ.API.PASSWORD}@{$RABBITMQ.API.CLUSTER_HOST}:{$RABBITMQ.API.PORT}/api/overview"]'
          tags:
            - tag: component
              value: messages
        - uuid: e3faec09ae0a4d7aa8aab50d71de7bb3
          name: 'Messages returned unroutable'
          type: DEPENDENT
          key: rabbitmq.overview.messages.return_unroutable
          description: 'The count of messages returned to a publisher as unroutable.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.message_stats.return_unroutable
              error_handler: CUSTOM_VALUE
              error_handler_params: '0'
          master_item:
            key: 'web.page.get["{$RABBITMQ.API.SCHEME}://{$RABBITMQ.API.USER}:{$RABBITMQ.API.PASSWORD}@{$RABBITMQ.API.CLUSTER_HOST}:{$RABBITMQ.API.PORT}/api/overview"]'
          tags:
            - tag: component
              value: messages
        - uuid: 72267cce69cf490ea626ff3ae17b6362
          name: 'Messages returned unroutable per second'
          type: DEPENDENT
          key: rabbitmq.overview.messages.return_unroutable.rate
          value_type: FLOAT
          description: 'The rate of messages (per second) returned to a publisher as unroutable.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.message_stats.return_unroutable_details.rate
              error_handler: CUSTOM_VALUE
              error_handler_params: '0'
          master_item:
            key: 'web.page.get["{$RABBITMQ.API.SCHEME}://{$RABBITMQ.API.USER}:{$RABBITMQ.API.PASSWORD}@{$RABBITMQ.API.CLUSTER_HOST}:{$RABBITMQ.API.PORT}/api/overview"]'
          tags:
            - tag: component
              value: messages
        - uuid: 2b03117e863348ee84d94acfe877ef7f
          name: 'Channels total'
          type: DEPENDENT
          key: rabbitmq.overview.object_totals.channels
          description: 'The total number of channels.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.object_totals.channels
          master_item:
            key: 'web.page.get["{$RABBITMQ.API.SCHEME}://{$RABBITMQ.API.USER}:{$RABBITMQ.API.PASSWORD}@{$RABBITMQ.API.CLUSTER_HOST}:{$RABBITMQ.API.PORT}/api/overview"]'
          tags:
            - tag: component
              value: channels
        - uuid: b3cdd6739a964447b524df4fdd726434
          name: 'Connections total'
          type: DEPENDENT
          key: rabbitmq.overview.object_totals.connections
          description: 'The total number of connections.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.object_totals.connections
          master_item:
            key: 'web.page.get["{$RABBITMQ.API.SCHEME}://{$RABBITMQ.API.USER}:{$RABBITMQ.API.PASSWORD}@{$RABBITMQ.API.CLUSTER_HOST}:{$RABBITMQ.API.PORT}/api/overview"]'
          tags:
            - tag: component
              value: connections
        - uuid: c39007dbd4374bee943d61b7e90c0f01
          name: 'Consumers total'
          type: DEPENDENT
          key: rabbitmq.overview.object_totals.consumers
          description: 'The total number of consumers.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.object_totals.consumers
          master_item:
            key: 'web.page.get["{$RABBITMQ.API.SCHEME}://{$RABBITMQ.API.USER}:{$RABBITMQ.API.PASSWORD}@{$RABBITMQ.API.CLUSTER_HOST}:{$RABBITMQ.API.PORT}/api/overview"]'
          tags:
            - tag: component
              value: consumers
        - uuid: be0b952e5d08409aa2c65fe143a9193c
          name: 'Exchanges total'
          type: DEPENDENT
          key: rabbitmq.overview.object_totals.exchanges
          description: 'The total number of exchanges.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.object_totals.exchanges
          master_item:
            key: 'web.page.get["{$RABBITMQ.API.SCHEME}://{$RABBITMQ.API.USER}:{$RABBITMQ.API.PASSWORD}@{$RABBITMQ.API.CLUSTER_HOST}:{$RABBITMQ.API.PORT}/api/overview"]'
          tags:
            - tag: component
              value: exchanges
        - uuid: d7c86b4921f54924af1b72cd2493da1c
          name: 'Queues total'
          type: DEPENDENT
          key: rabbitmq.overview.object_totals.queues
          description: 'The total number of queues.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.object_totals.queues
          master_item:
            key: 'web.page.get["{$RABBITMQ.API.SCHEME}://{$RABBITMQ.API.USER}:{$RABBITMQ.API.PASSWORD}@{$RABBITMQ.API.CLUSTER_HOST}:{$RABBITMQ.API.PORT}/api/overview"]'
          tags:
            - tag: component
              value: queues
        - uuid: c98b2b3dd2bd4fec9e7c571bc631167b
          name: 'Messages total'
          type: DEPENDENT
          key: rabbitmq.overview.queue_totals.messages
          description: 'The total number of messages (ready, plus unacknowledged).'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.queue_totals.messages
              error_handler: CUSTOM_VALUE
              error_handler_params: '0'
          master_item:
            key: 'web.page.get["{$RABBITMQ.API.SCHEME}://{$RABBITMQ.API.USER}:{$RABBITMQ.API.PASSWORD}@{$RABBITMQ.API.CLUSTER_HOST}:{$RABBITMQ.API.PORT}/api/overview"]'
          tags:
            - tag: component
              value: messages
        - uuid: efaabe175e5f4fffa8a810ea35753475
          name: 'Messages ready for delivery'
          type: DEPENDENT
          key: rabbitmq.overview.queue_totals.messages.ready
          description: 'The number of messages ready for delivery.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.queue_totals.messages_ready
              error_handler: CUSTOM_VALUE
              error_handler_params: '0'
          master_item:
            key: 'web.page.get["{$RABBITMQ.API.SCHEME}://{$RABBITMQ.API.USER}:{$RABBITMQ.API.PASSWORD}@{$RABBITMQ.API.CLUSTER_HOST}:{$RABBITMQ.API.PORT}/api/overview"]'
          tags:
            - tag: component
              value: messages
        - uuid: 6cf09ed9d244464288c8050b10622e3a
          name: 'Messages unacknowledged'
          type: DEPENDENT
          key: rabbitmq.overview.queue_totals.messages.unacknowledged
          description: 'The number of unacknowledged messages.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.queue_totals.messages_unacknowledged
              error_handler: CUSTOM_VALUE
              error_handler_params: '0'
          master_item:
            key: 'web.page.get["{$RABBITMQ.API.SCHEME}://{$RABBITMQ.API.USER}:{$RABBITMQ.API.PASSWORD}@{$RABBITMQ.API.CLUSTER_HOST}:{$RABBITMQ.API.PORT}/api/overview"]'
          tags:
            - tag: component
              value: messages
        - uuid: f015f991bcea4c4dbf83dfb013300010
          name: 'Get exchanges'
          key: 'web.page.get["{$RABBITMQ.API.SCHEME}://{$RABBITMQ.API.USER}:{$RABBITMQ.API.PASSWORD}@{$RABBITMQ.API.CLUSTER_HOST}:{$RABBITMQ.API.PORT}/api/exchanges"]'
          history: 1h
          value_type: TEXT
          description: 'The HTTP API endpoint that returns exchanges metrics.'
          preprocessing:
            - type: REGEX
              parameters:
                - '\n\s?\n(.*)'
                - \1
          tags:
            - tag: component
              value: raw
        - uuid: 943eabfb44164908b9135aa4d6478bea
          name: 'Get overview'
          key: 'web.page.get["{$RABBITMQ.API.SCHEME}://{$RABBITMQ.API.USER}:{$RABBITMQ.API.PASSWORD}@{$RABBITMQ.API.CLUSTER_HOST}:{$RABBITMQ.API.PORT}/api/overview"]'
          history: 1h
          value_type: TEXT
          description: 'The HTTP API endpoint that returns cluster-wide metrics.'
          preprocessing:
            - type: REGEX
              parameters:
                - '\n\s?\n(.*)'
                - \1
          tags:
            - tag: component
              value: raw
          triggers:
            - uuid: 000d3e773f6e4ebf89f16daa2ce8c168
              expression: 'nodata(/RabbitMQ cluster by Zabbix agent/web.page.get["{$RABBITMQ.API.SCHEME}://{$RABBITMQ.API.USER}:{$RABBITMQ.API.PASSWORD}@{$RABBITMQ.API.CLUSTER_HOST}:{$RABBITMQ.API.PORT}/api/overview"],30m)=1'
              name: 'RabbitMQ cluster: Failed to fetch overview data'
              event_name: 'RabbitMQ cluster: Failed to fetch overview data (or no data for 30m)'
              priority: WARNING
              description: 'Zabbix has not received any data for items for the last 30 minutes.'
              manual_close: 'YES'
              tags:
                - tag: scope
                  value: availability
      discovery_rules:
        - uuid: e28b4491721d4dbf8eded86a5caeabc2
          name: 'Exchanges discovery'
          type: DEPENDENT
          key: rabbitmq.exchanges.discovery
          filter:
            evaltype: AND
            conditions:
              - macro: '{#EXCHANGE}'
                value: '{$RABBITMQ.LLD.FILTER.EXCHANGE.MATCHES}'
              - macro: '{#EXCHANGE}'
                value: '{$RABBITMQ.LLD.FILTER.EXCHANGE.NOT_MATCHES}'
                operator: NOT_MATCHES_REGEX
          description: 'The metrics for an individual exchange.'
          item_prototypes:
            - uuid: 68892e56e0074516b5d052dd7178955f
              name: 'Exchange [{#VHOST}][{#EXCHANGE}][{#TYPE}]: Messages acknowledged per second'
              type: DEPENDENT
              key: 'rabbitmq.exchange.messages.ack.rate["{#VHOST}/{#EXCHANGE}/{#TYPE}"]'
              value_type: FLOAT
              description: 'The rate of messages (per second) delivered to clients and acknowledged.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.message_stats.ack_details.rate
                  error_handler: CUSTOM_VALUE
                  error_handler_params: '0'
              master_item:
                key: 'rabbitmq.get_exchanges["{#VHOST}/{#EXCHANGE}/{#TYPE}"]'
              tags:
                - tag: component
                  value: messages
                - tag: exchange
                  value: '{#EXCHANGE}'
                - tag: type
                  value: '{#TYPE}'
                - tag: vhost
                  value: '{#VHOST}'
            - uuid: fcf7807f096d4cddb8fa2b3671814dfa
              name: 'Exchange [{#VHOST}][{#EXCHANGE}][{#TYPE}]: Messages acknowledged'
              type: DEPENDENT
              key: 'rabbitmq.exchange.messages.ack["{#VHOST}/{#EXCHANGE}/{#TYPE}"]'
              description: 'The number of messages delivered to clients and acknowledged.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.message_stats.ack
                  error_handler: CUSTOM_VALUE
                  error_handler_params: '0'
              master_item:
                key: 'rabbitmq.get_exchanges["{#VHOST}/{#EXCHANGE}/{#TYPE}"]'
              tags:
                - tag: component
                  value: messages
                - tag: exchange
                  value: '{#EXCHANGE}'
                - tag: type
                  value: '{#TYPE}'
                - tag: vhost
                  value: '{#VHOST}'
            - uuid: 858f8ce62fa04a31902569a712e58234
              name: 'Exchange [{#VHOST}][{#EXCHANGE}][{#TYPE}]: Messages confirmed per second'
              type: DEPENDENT
              key: 'rabbitmq.exchange.messages.confirm.rate["{#VHOST}/{#EXCHANGE}/{#TYPE}"]'
              value_type: FLOAT
              description: 'The rate of messages confirmed per second.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.message_stats.confirm_details.rate
                  error_handler: CUSTOM_VALUE
                  error_handler_params: '0'
              master_item:
                key: 'rabbitmq.get_exchanges["{#VHOST}/{#EXCHANGE}/{#TYPE}"]'
              tags:
                - tag: component
                  value: messages
                - tag: exchange
                  value: '{#EXCHANGE}'
                - tag: type
                  value: '{#TYPE}'
                - tag: vhost
                  value: '{#VHOST}'
            - uuid: 38d41b5d815a40ff816f6fad2395b61a
              name: 'Exchange [{#VHOST}][{#EXCHANGE}][{#TYPE}]: Messages confirmed'
              type: DEPENDENT
              key: 'rabbitmq.exchange.messages.confirm["{#VHOST}/{#EXCHANGE}/{#TYPE}"]'
              description: 'The count of confirmed messages.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.message_stats.confirm
                  error_handler: CUSTOM_VALUE
                  error_handler_params: '0'
              master_item:
                key: 'rabbitmq.get_exchanges["{#VHOST}/{#EXCHANGE}/{#TYPE}"]'
              tags:
                - tag: component
                  value: messages
                - tag: exchange
                  value: '{#EXCHANGE}'
                - tag: type
                  value: '{#TYPE}'
                - tag: vhost
                  value: '{#VHOST}'
            - uuid: ab53a6957ea641fe8b2a7f26c4bcc743
              name: 'Exchange [{#VHOST}][{#EXCHANGE}][{#TYPE}]: Messages delivered per second'
              type: DEPENDENT
              key: 'rabbitmq.exchange.messages.deliver_get.rate["{#VHOST}/{#EXCHANGE}/{#TYPE}"]'
              value_type: FLOAT
              description: 'The rate of the sum of messages (per second) delivered to consumers: in acknowledgement mode and in no-acknowledgement mode; delivered to consumers in response to the `basic.get`: in acknowledgement mode and in no-acknowledgement mode.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.message_stats.deliver_get_details.rate
                  error_handler: CUSTOM_VALUE
                  error_handler_params: '0'
              master_item:
                key: 'rabbitmq.get_exchanges["{#VHOST}/{#EXCHANGE}/{#TYPE}"]'
              tags:
                - tag: component
                  value: messages
                - tag: exchange
                  value: '{#EXCHANGE}'
                - tag: type
                  value: '{#TYPE}'
                - tag: vhost
                  value: '{#VHOST}'
            - uuid: 412e5003ad2d4e80832ee0551a596791
              name: 'Exchange [{#VHOST}][{#EXCHANGE}][{#TYPE}]: Messages delivered'
              type: DEPENDENT
              key: 'rabbitmq.exchange.messages.deliver_get["{#VHOST}/{#EXCHANGE}/{#TYPE}"]'
              description: 'The sum of messages delivered to consumers: in acknowledgement mode and in no-acknowledgement mode; delivered to consumers in response to the `basic.get`: in acknowledgement mode and in no-acknowledgement mode.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.message_stats.deliver_get
                  error_handler: CUSTOM_VALUE
                  error_handler_params: '0'
              master_item:
                key: 'rabbitmq.get_exchanges["{#VHOST}/{#EXCHANGE}/{#TYPE}"]'
              tags:
                - tag: component
                  value: messages
                - tag: exchange
                  value: '{#EXCHANGE}'
                - tag: type
                  value: '{#TYPE}'
                - tag: vhost
                  value: '{#VHOST}'
            - uuid: 32a0c7af8b9940a482a3a1d63ee90940
              name: 'Exchange [{#VHOST}][{#EXCHANGE}][{#TYPE}]: Messages published per second'
              type: DEPENDENT
              key: 'rabbitmq.exchange.messages.publish.rate["{#VHOST}/{#EXCHANGE}/{#TYPE}"]'
              value_type: FLOAT
              description: 'The rate of messages published per second.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.message_stats.publish_details.rate
                  error_handler: CUSTOM_VALUE
                  error_handler_params: '0'
              master_item:
                key: 'rabbitmq.get_exchanges["{#VHOST}/{#EXCHANGE}/{#TYPE}"]'
              tags:
                - tag: component
                  value: messages
                - tag: exchange
                  value: '{#EXCHANGE}'
                - tag: type
                  value: '{#TYPE}'
                - tag: vhost
                  value: '{#VHOST}'
            - uuid: 1eccbe4450d74d5f9c5b8f7e6279b214
              name: 'Exchange [{#VHOST}][{#EXCHANGE}][{#TYPE}]: Messages published'
              type: DEPENDENT
              key: 'rabbitmq.exchange.messages.publish["{#VHOST}/{#EXCHANGE}/{#TYPE}"]'
              description: 'The count of published messages.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.message_stats.publish
                  error_handler: CUSTOM_VALUE
                  error_handler_params: '0'
              master_item:
                key: 'rabbitmq.get_exchanges["{#VHOST}/{#EXCHANGE}/{#TYPE}"]'
              tags:
                - tag: component
                  value: messages
                - tag: exchange
                  value: '{#EXCHANGE}'
                - tag: type
                  value: '{#TYPE}'
                - tag: vhost
                  value: '{#VHOST}'
            - uuid: 3520a523abd1413f88c1c19978e6d562
              name: 'Exchange [{#VHOST}][{#EXCHANGE}][{#TYPE}]: Messages publish_in per second'
              type: DEPENDENT
              key: 'rabbitmq.exchange.messages.publish_in.rate["{#VHOST}/{#EXCHANGE}/{#TYPE}"]'
              value_type: FLOAT
              description: 'The rate of messages (per second) published from the channels into this overview.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.message_stats.publish_in_details.rate
                  error_handler: CUSTOM_VALUE
                  error_handler_params: '0'
              master_item:
                key: 'rabbitmq.get_exchanges["{#VHOST}/{#EXCHANGE}/{#TYPE}"]'
              tags:
                - tag: component
                  value: messages
                - tag: exchange
                  value: '{#EXCHANGE}'
                - tag: type
                  value: '{#TYPE}'
                - tag: vhost
                  value: '{#VHOST}'
            - uuid: 520d8301e48540679472bf508a6e293b
              name: 'Exchange [{#VHOST}][{#EXCHANGE}][{#TYPE}]: Messages publish_in'
              type: DEPENDENT
              key: 'rabbitmq.exchange.messages.publish_in["{#VHOST}/{#EXCHANGE}/{#TYPE}"]'
              description: 'The count of messages published from the channels into this overview.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.message_stats.publish_in
                  error_handler: CUSTOM_VALUE
                  error_handler_params: '0'
              master_item:
                key: 'rabbitmq.get_exchanges["{#VHOST}/{#EXCHANGE}/{#TYPE}"]'
              tags:
                - tag: component
                  value: messages
                - tag: exchange
                  value: '{#EXCHANGE}'
                - tag: type
                  value: '{#TYPE}'
                - tag: vhost
                  value: '{#VHOST}'
            - uuid: 6beb5e40cb8b416a8722ea77abb7355d
              name: 'Exchange [{#VHOST}][{#EXCHANGE}][{#TYPE}]: Messages publish_out per second'
              type: DEPENDENT
              key: 'rabbitmq.exchange.messages.publish_out.rate["{#VHOST}/{#EXCHANGE}/{#TYPE}"]'
              value_type: FLOAT
              description: 'The rate of messages (per second) published from this overview into queues.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.message_stats.publish_out_details.rate
                  error_handler: CUSTOM_VALUE
                  error_handler_params: '0'
              master_item:
                key: 'rabbitmq.get_exchanges["{#VHOST}/{#EXCHANGE}/{#TYPE}"]'
              tags:
                - tag: component
                  value: messages
                - tag: exchange
                  value: '{#EXCHANGE}'
                - tag: type
                  value: '{#TYPE}'
                - tag: vhost
                  value: '{#VHOST}'
            - uuid: beb929ee395e4caba73f3063c24a1d60
              name: 'Exchange [{#VHOST}][{#EXCHANGE}][{#TYPE}]: Messages publish_out'
              type: DEPENDENT
              key: 'rabbitmq.exchange.messages.publish_out["{#VHOST}/{#EXCHANGE}/{#TYPE}"]'
              description: 'The count of messages published from this overview into queues.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.message_stats.publish_out
                  error_handler: CUSTOM_VALUE
                  error_handler_params: '0'
              master_item:
                key: 'rabbitmq.get_exchanges["{#VHOST}/{#EXCHANGE}/{#TYPE}"]'
              tags:
                - tag: component
                  value: messages
                - tag: exchange
                  value: '{#EXCHANGE}'
                - tag: type
                  value: '{#TYPE}'
                - tag: vhost
                  value: '{#VHOST}'
            - uuid: 7485d5a12fb04a13810ea54b9cc598e1
              name: 'Exchange {#VHOST}/{#EXCHANGE}/{#TYPE}: Messages redelivered per second'
              type: DEPENDENT
              key: 'rabbitmq.exchange.messages.redeliver.rate["{#VHOST}/{#EXCHANGE}/{#TYPE}"]'
              value_type: FLOAT
              description: 'The rate of subset of messages (per second) in the `deliver_get`, which had the `redelivered` flag set.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.message_stats.redeliver_details.rate
                  error_handler: CUSTOM_VALUE
                  error_handler_params: '0'
              master_item:
                key: 'rabbitmq.get_exchanges["{#VHOST}/{#EXCHANGE}/{#TYPE}"]'
              tags:
                - tag: component
                  value: messages
                - tag: exchange
                  value: '{#EXCHANGE}'
                - tag: type
                  value: '{#TYPE}'
                - tag: vhost
                  value: '{#VHOST}'
            - uuid: 58a06005659943429122d451acb521e0
              name: 'Exchange [{#VHOST}][{#EXCHANGE}][{#TYPE}]: Messages redelivered'
              type: DEPENDENT
              key: 'rabbitmq.exchange.messages.redeliver["{#VHOST}/{#EXCHANGE}/{#TYPE}"]'
              description: 'The count of subset of messages in the `deliver_get`, which had the `redelivered` flag set.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.message_stats.redeliver
                  error_handler: CUSTOM_VALUE
                  error_handler_params: '0'
              master_item:
                key: 'rabbitmq.get_exchanges["{#VHOST}/{#EXCHANGE}/{#TYPE}"]'
              tags:
                - tag: component
                  value: messages
                - tag: exchange
                  value: '{#EXCHANGE}'
                - tag: type
                  value: '{#TYPE}'
                - tag: vhost
                  value: '{#VHOST}'
            - uuid: 295eeb3bd071400d921efe1f5a924a3e
              name: 'Exchange [{#VHOST}][{#EXCHANGE}][{#TYPE}]: Messages returned unroutable per second'
              type: DEPENDENT
              key: 'rabbitmq.exchange.messages.return_unroutable.rate["{#VHOST}/{#EXCHANGE}/{#TYPE}"]'
              value_type: FLOAT
              description: 'The rate of messages (per second) returned to a publisher as unroutable.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.message_stats.return_unroutable_details.rate
                  error_handler: CUSTOM_VALUE
                  error_handler_params: '0'
              master_item:
                key: 'rabbitmq.get_exchanges["{#VHOST}/{#EXCHANGE}/{#TYPE}"]'
              tags:
                - tag: component
                  value: messages
                - tag: exchange
                  value: '{#EXCHANGE}'
                - tag: type
                  value: '{#TYPE}'
                - tag: vhost
                  value: '{#VHOST}'
            - uuid: 2901eccbd8ef483ba63c5522755155e7
              name: 'Exchange [{#VHOST}][{#EXCHANGE}][{#TYPE}]: Messages returned unroutable'
              type: DEPENDENT
              key: 'rabbitmq.exchange.messages.return_unroutable["{#VHOST}/{#EXCHANGE}/{#TYPE}"]'
              description: 'The count of messages returned to a publisher as unroutable.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.message_stats.return_unroutable
                  error_handler: CUSTOM_VALUE
                  error_handler_params: '0'
              master_item:
                key: 'rabbitmq.get_exchanges["{#VHOST}/{#EXCHANGE}/{#TYPE}"]'
              tags:
                - tag: component
                  value: messages
                - tag: exchange
                  value: '{#EXCHANGE}'
                - tag: type
                  value: '{#TYPE}'
                - tag: vhost
                  value: '{#VHOST}'
            - uuid: 4491f48f732d40c0b7f29010cf4ca046
              name: 'Exchange [{#VHOST}][{#EXCHANGE}][{#TYPE}]: Get data'
              type: DEPENDENT
              key: 'rabbitmq.get_exchanges["{#VHOST}/{#EXCHANGE}/{#TYPE}"]'
              history: '0'
              value_type: TEXT
              description: 'The HTTP API endpoint that returns [{#VHOST}][{#EXCHANGE}][{#TYPE}] exchanges metrics'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$[?(@.name == "{#EXCHANGE}" && @.vhost == "{#VHOST}" && @.type =="{#TYPE}")].first()'
              master_item:
                key: 'web.page.get["{$RABBITMQ.API.SCHEME}://{$RABBITMQ.API.USER}:{$RABBITMQ.API.PASSWORD}@{$RABBITMQ.API.CLUSTER_HOST}:{$RABBITMQ.API.PORT}/api/exchanges"]'
              tags:
                - tag: component
                  value: raw
          master_item:
            key: 'web.page.get["{$RABBITMQ.API.SCHEME}://{$RABBITMQ.API.USER}:{$RABBITMQ.API.PASSWORD}@{$RABBITMQ.API.CLUSTER_HOST}:{$RABBITMQ.API.PORT}/api/exchanges"]'
          lld_macro_paths:
            - lld_macro: '{#EXCHANGE}'
              path: $.name
            - lld_macro: '{#TYPE}'
              path: $.type
            - lld_macro: '{#VHOST}'
              path: $.vhost
          preprocessing:
            - type: JAVASCRIPT
              parameters:
                - 'return JSON.stringify(JSON.parse(value),[''name'',''type'',''vhost'']);'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
        - uuid: 406836367f45425fbd181a20dc3d08d7
          name: 'Health Check 3.8.10+ discovery'
          type: DEPENDENT
          key: rabbitmq.healthcheck.v3810.discovery
          description: 'Specific metrics for the versions: up to and including 3.8.10.'
          item_prototypes:
            - uuid: 4c93b04164d24eb8b9dbdab652afc7bc
              name: 'Healthcheck: alarms in effect in the cluster{#SINGLETON}'
              key: 'web.page.get["{$RABBITMQ.API.SCHEME}://{$RABBITMQ.API.USER}:{$RABBITMQ.API.PASSWORD}@{$RABBITMQ.API.CLUSTER_HOST}:{$RABBITMQ.API.PORT}/api/health/checks/alarms{#SINGLETON}"]'
              description: |
                It responds with a status code `200 OK` if there are no alarms in effect in the cluster.
                Otherwise, it responds with a status code `503 Service Unavailable`.
              valuemap:
                name: 'RabbitMQ healthcheck'
              preprocessing:
                - type: REGEX
                  parameters:
                    - 'HTTP\/[\d.]+\s+(\d{3})'
                    - \1
                - type: JAVASCRIPT
                  parameters:
                    - |
                      switch(value){
                      case '200': return 1
                      case '503': return 0
                      default: 2}
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 3h
              tags:
                - tag: component
                  value: health
                - tag: component
                  value: system
              trigger_prototypes:
                - uuid: 032949c387c64223b3125ba1120ae082
                  expression: 'last(/RabbitMQ cluster by Zabbix agent/web.page.get["{$RABBITMQ.API.SCHEME}://{$RABBITMQ.API.USER}:{$RABBITMQ.API.PASSWORD}@{$RABBITMQ.API.CLUSTER_HOST}:{$RABBITMQ.API.PORT}/api/health/checks/alarms{#SINGLETON}"])=0'
                  name: 'RabbitMQ cluster: There are active alarms in the cluster'
                  opdata: 'Current state: {ITEM.LASTVALUE1}'
                  priority: AVERAGE
                  description: 'This is the default API endpoint path: http://{$RABBITMQ.API.CLUSTER_HOST}:{$RABBITMQ.API.PORT}/api/index.html.'
                  tags:
                    - tag: scope
                      value: notice
          master_item:
            key: 'web.page.get["{$RABBITMQ.API.SCHEME}://{$RABBITMQ.API.USER}:{$RABBITMQ.API.PASSWORD}@{$RABBITMQ.API.CLUSTER_HOST}:{$RABBITMQ.API.PORT}/api/overview"]'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.management_version
            - type: JAVASCRIPT
              parameters:
                - |
                  var rabbit_version = parseInt(value.split('.')[0]) * 10000 +
                  	parseInt(value.split('.')[1]) * 100 +
                  	parseInt(value.split('.')[2]);
                  return JSON.stringify(rabbit_version >= 30810 ? [{ '{#SINGLETON}': '' }] : []);
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
      tags:
        - tag: class
          value: software
        - tag: subclass
          value: messaging
        - tag: target
          value: rabbitmq
      macros:
        - macro: '{$RABBITMQ.API.CLUSTER_HOST}'
          value: 127.0.0.1
          description: 'The hostname or IP of the API endpoint for the RabbitMQ cluster.'
          config:
            type: TEXT
            priority: '3'
            label: Address
            description: 'The hostname or IP of the API endpoint for the RabbitMQ cluster.'
            required: 'YES'
        - macro: '{$RABBITMQ.API.PASSWORD}'
          value: zabbix
          config:
            type: TEXT
            priority: '2'
            label: Password
            required: 'YES'
        - macro: '{$RABBITMQ.API.PORT}'
          value: '15672'
          description: 'The port of the RabbitMQ API endpoint.'
          config:
            type: TEXT
            priority: '4'
            label: Port
            description: 'The port of the RabbitMQ API endpoint. In the range from 1 to 65535 inclusive.'
            required: 'YES'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$RABBITMQ.API.SCHEME}'
          value: http
          description: 'The request scheme, which may be HTTP or HTTPS.'
          config:
            type: LIST
            priority: '5'
            label: Scheme
            description: 'The request scheme, which may be HTTP or HTTPS.'
            required: 'YES'
            options:
              - value: http
                text: http
              - value: https
                text: https
        - macro: '{$RABBITMQ.API.USER}'
          value: zbx_monitor
          config:
            type: TEXT
            priority: '1'
            label: Username
            required: 'YES'
        - macro: '{$RABBITMQ.LLD.FILTER.EXCHANGE.MATCHES}'
          value: '.*'
          description: 'This macro is used in the discovery of exchanges. It can be overridden at host level or its linked template level.'
          config:
            type: TEXT
            priority: '6'
            section_name: Filters
            label: 'Filter for exchange (include)'
            description: 'This macro is used in the discovery of exchanges. It can be overridden at host level or its linked template level.'
        - macro: '{$RABBITMQ.LLD.FILTER.EXCHANGE.NOT_MATCHES}'
          value: CHANGE_IF_NEEDED
          description: 'This macro is used in the discovery of exchanges. It can be overridden at host level or its linked template level.'
          config:
            type: TEXT
            priority: '7'
            section_name: Filters
            label: 'Filter for exchange (exclude)'
            description: 'This macro is used in the discovery of exchanges. It can be overridden at host level or its linked template level.'
      dashboards:
        - uuid: a886a871a00d47e28b8648cadae3bc99
          name: 'RabbitMQ overview'
          pages:
            - widgets:
                - type: graph
                  width: '36'
                  height: '5'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'RabbitMQ cluster by Zabbix agent'
                        name: 'RabbitMQ: Messages'
                    - type: STRING
                      name: reference
                      value: AAAAA
                - type: graph
                  'y': '5'
                  width: '36'
                  height: '5'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'RabbitMQ cluster by Zabbix agent'
                        name: 'RabbitMQ: Messages status'
                    - type: STRING
                      name: reference
                      value: AAAAC
                - type: graph
                  'y': '10'
                  width: '36'
                  height: '5'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'RabbitMQ cluster by Zabbix agent'
                        name: 'RabbitMQ: Messages per second'
                    - type: STRING
                      name: reference
                      value: AAAAE
                - type: graph
                  x: '36'
                  width: '36'
                  height: '5'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'RabbitMQ cluster by Zabbix agent'
                        name: 'RabbitMQ: Connections'
                    - type: STRING
                      name: reference
                      value: AAAAB
                - type: graph
                  x: '36'
                  'y': '5'
                  width: '36'
                  height: '5'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'RabbitMQ cluster by Zabbix agent'
                        name: 'RabbitMQ: Queues'
                    - type: STRING
                      name: reference
                      value: AAAAD
      valuemaps:
        - uuid: 78275d6daacf42b4b97e3d806dfe81fe
          name: 'RabbitMQ healthcheck'
          mappings:
            - value: '0'
              newvalue: Failed
            - value: '1'
              newvalue: Ok
            - value: '2'
              newvalue: Error
    - uuid: eaf36c98b91843b7b79bd5184a23d377
      template: 'Solaris by Zabbix agent'
      name: 'Solaris by Zabbix agent'
      description: |
        This is an official Solaris OS template. It requires Zabbix agent 8.0 or newer.
        
        Notes on filesystem (FS) discovery:
          - The ext4/3/2 FS reserves space for privileged usage, typically set at 5% by default.
          - BTRFS allocates a default of 10% of the volume for its own needs.
          - To mitigate potential disasters, FS usage triggers are based on the maximum available space.
            - Utilization formula: 'pused = 100 - 100 * (available / total - free + available)'
          - The FS utilization chart, derived from graph prototypes, reflects FS reserved space as the difference between used and available space from the total volume.
        
        You can discuss this template or leave feedback on our forum https://www.zabbix.com/forum/zabbix-suggestions-and-feedback/
        
        Generated by official Zabbix template tool "Templator"
      wizard_ready: 'YES'
      readme: |
        ## Overview
        
        This is an official Solaris OS template. It requires Zabbix agent 8.0 or newer.
        
        #### Notes on filesystem (FS) discovery:
        - The ext4/3/2 FS reserves space for privileged usage, typically set at 5% by default.
        - BTRFS allocates a default of 10% of the volume for its own needs.
        - To mitigate potential disasters, FS usage triggers are based on the maximum available space.
          - Utilization formula: `pused = 100 - 100 * (available / total - free + available)`
        - The FS utilization chart, derived from graph prototypes, reflects FS reserved space as the difference between used and available space from the total volume.
        
        
        ## Setup
        
        Install Zabbix agent on Solaris OS according to Zabbix documentation.
      vendor:
        name: Zabbix
        version: 8.0-1
      groups:
        - name: 'Templates/Operating systems'
      items:
        - uuid: 0a64ce48b94b4886af4bd97beab5f93d
          name: 'Host name of Zabbix agent running'
          key: agent.hostname
          delay: 1h
          value_type: CHAR
          preprocessing:
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1d
          tags:
            - tag: component
              value: system
        - uuid: d708ce58ad214d19a740824512e8be6a
          name: 'Zabbix agent ping'
          key: agent.ping
          description: 'The agent always returns "1" for this item. May be used in combination with `nodata()` for the availability check.'
          valuemap:
            name: 'Zabbix agent ping status'
          tags:
            - tag: component
              value: system
        - uuid: 633a1d74569f4f61892dabf7e0acf6c1
          name: 'Version of Zabbix agent running'
          key: agent.version
          delay: 1h
          value_type: CHAR
          preprocessing:
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1d
          tags:
            - tag: component
              value: application
        - uuid: 2fa6d58a5c7d48da90b1caf521e867cd
          name: 'Maximum number of processes'
          key: kernel.maxproc
          delay: 1h
          description: 'May be increased by using the `sysctl` utility or modifying the file `/etc/sysctl.conf`.'
          tags:
            - tag: component
              value: processes
          triggers:
            - uuid: 2a567bc9d5584dfea986b5b70c89fc65
              expression: 'last(/Solaris by Zabbix agent/kernel.maxproc)<256'
              name: 'Solaris: Configured max number of processes is too low'
              priority: INFO
              tags:
                - tag: scope
                  value: notice
                - tag: scope
                  value: performance
        - uuid: 7c8c8421fb514e67bc9f14cefe4018f3
          name: 'Number of running processes'
          key: 'proc.num[,,run]'
          description: 'The number of processes in a running state.'
          tags:
            - tag: component
              value: processes
          triggers:
            - uuid: 6504ba0f7fa445ea9083af008d52c525
              expression: 'avg(/Solaris by Zabbix agent/proc.num[,,run],5m)>30'
              name: 'Solaris: Too many processes running'
              priority: WARNING
              tags:
                - tag: scope
                  value: notice
                - tag: scope
                  value: performance
        - uuid: 74c805e8bfd947348b206a0d33bfc461
          name: 'Number of processes'
          key: 'proc.num[]'
          description: 'The total number of processes in any state.'
          tags:
            - tag: component
              value: processes
          triggers:
            - uuid: cc2731add899436ca2c12fff13c838fb
              expression: 'avg(/Solaris by Zabbix agent/proc.num[],5m)>300'
              name: 'Solaris: Too many processes'
              priority: WARNING
              tags:
                - tag: scope
                  value: notice
                - tag: scope
                  value: performance
        - uuid: 1812e26de9ad4a36abb5498154e6ea3c
          name: 'Host boot time'
          key: system.boottime
          delay: 10m
          units: unixtime
          tags:
            - tag: component
              value: os
        - uuid: 8186ed95ed8c4d6eb52ea2e718984170
          name: 'Interrupts per second'
          key: system.cpu.intr
          units: ips
          description: 'Number of interrupts processed.'
          preprocessing:
            - type: CHANGE_PER_SECOND
          tags:
            - tag: component
              value: cpu
        - uuid: 1a7cc53a5497427da28f882b1b185fad
          name: 'Processor load (1 min average per core)'
          key: 'system.cpu.load[percpu,avg1]'
          value_type: FLOAT
          description: 'Calculated as the system CPU load divided by the number of CPU cores.'
          tags:
            - tag: component
              value: cpu
          triggers:
            - uuid: e7ef1c2b702440a3a7a20a544446a068
              expression: 'avg(/Solaris by Zabbix agent/system.cpu.load[percpu,avg1],5m)>5'
              name: 'Solaris: Processor load is too high'
              priority: WARNING
              tags:
                - tag: scope
                  value: performance
        - uuid: 5b053b6c00464f8b8f5fc49fffda1394
          name: 'Processor load (5 min average per core)'
          key: 'system.cpu.load[percpu,avg5]'
          value_type: FLOAT
          description: 'Calculated as the system CPU load divided by the number of CPU cores.'
          tags:
            - tag: component
              value: cpu
        - uuid: c13c2ff556594c5d985420dc974659cf
          name: 'Processor load (15 min average per core)'
          key: 'system.cpu.load[percpu,avg15]'
          value_type: FLOAT
          description: 'Calculated as the system CPU load divided by the number of CPU cores.'
          tags:
            - tag: component
              value: cpu
        - uuid: 320f8803624f4ad2b9e66f1a08f5a145
          name: 'Context switches per second'
          key: system.cpu.switches
          units: sps
          description: 'The combined rate at which all processors on the computer are switched from one thread to another.'
          preprocessing:
            - type: CHANGE_PER_SECOND
          tags:
            - tag: component
              value: cpu
        - uuid: a653205d5ce4462089da4ed4d6f97f3a
          name: 'CPU idle time'
          key: 'system.cpu.util[,idle]'
          value_type: FLOAT
          units: '%'
          description: 'Time the CPU has spent doing nothing.'
          tags:
            - tag: component
              value: cpu
        - uuid: 9bee92be803c48489509e41c19718abc
          name: 'CPU iowait time'
          key: 'system.cpu.util[,iowait]'
          value_type: FLOAT
          units: '%'
          description: 'Time the CPU has been waiting for the I/O to complete.'
          tags:
            - tag: component
              value: cpu
          triggers:
            - uuid: 280634a65c9d4702a4913c9c2cd5869c
              expression: 'avg(/Solaris by Zabbix agent/system.cpu.util[,iowait],5m)>20'
              name: 'Solaris: Disk I/O is overloaded'
              priority: WARNING
              description: 'Extended OS wait times for I/O operations may signal potential performance issues with the storage system.'
              tags:
                - tag: scope
                  value: performance
        - uuid: bb32808bf73f489399ecb3e02bc18194
          name: 'CPU system time'
          key: 'system.cpu.util[,system]'
          value_type: FLOAT
          units: '%'
          description: 'Time the CPU has spent running the kernel and its processes.'
          tags:
            - tag: component
              value: cpu
        - uuid: d30ad6a457df4e39819b76fc1be7a562
          name: 'CPU user time'
          key: 'system.cpu.util[,user]'
          value_type: FLOAT
          units: '%'
          description: 'Time the CPU has spent running users'' processes that are not niced.'
          tags:
            - tag: component
              value: cpu
        - uuid: 1945e624e1864f2ba543f9438b1733f1
          name: 'Host name'
          key: system.hostname
          delay: 1h
          value_type: CHAR
          description: 'The host name of the system.'
          inventory_link: NAME
          preprocessing:
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1d
          tags:
            - tag: component
              value: os
          triggers:
            - uuid: cc5a9c97827f4091b83af8be33d58560
              expression: 'last(/Solaris by Zabbix agent/system.hostname,#1)<>last(/Solaris by Zabbix agent/system.hostname,#2)'
              name: 'Solaris: Hostname was changed'
              priority: INFO
              tags:
                - tag: scope
                  value: notice
        - uuid: 0a0a8ab7047b400aaffe99917349291e
          name: 'Host local time'
          key: system.localtime
          units: unixtime
          description: 'The local system time of the host.'
          tags:
            - tag: component
              value: os
        - uuid: 71597a2dfdeb4c63acf7505ffb7f4f08
          name: 'Free swap space'
          key: 'system.swap.size[,free]'
          units: B
          description: 'The free space of the swap volume/file expressed in bytes.'
          tags:
            - tag: component
              value: memory
        - uuid: b2ee2b52a64841e282915d6de3c7f739
          name: 'Free swap space in %'
          key: 'system.swap.size[,pfree]'
          value_type: FLOAT
          units: '%'
          description: 'The free space of the swap volume/file expressed in %.'
          tags:
            - tag: component
              value: memory
          triggers:
            - uuid: 7be6856162ca445388b13e524f01a3c2
              expression: 'last(/Solaris by Zabbix agent/system.swap.size[,pfree])<50'
              name: 'Solaris: Lack of free swap space'
              priority: WARNING
              description: 'It probably means that the systems requires more physical memory.'
              tags:
                - tag: scope
                  value: capacity
                - tag: scope
                  value: performance
        - uuid: 0e7ea1fd204c44f3b0a7880eac21a0df
          name: 'Total swap space'
          key: 'system.swap.size[,total]'
          delay: 1h
          units: B
          description: 'Total space of the swap volume/file expressed in bytes.'
          tags:
            - tag: component
              value: memory
        - uuid: 034f7934cdb54cc6b99194fac9197bfb
          name: 'System information'
          key: system.uname
          delay: 1h
          value_type: CHAR
          description: 'Information as normally returned by `uname -a`.'
          inventory_link: OS
          preprocessing:
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1d
          tags:
            - tag: component
              value: os
          triggers:
            - uuid: dc293e688ac54ac0aee61e398d8bc5c5
              expression: 'last(/Solaris by Zabbix agent/system.uname,#1)<>last(/Solaris by Zabbix agent/system.uname,#2)'
              name: 'Solaris: Host information was changed'
              priority: INFO
              tags:
                - tag: scope
                  value: notice
        - uuid: c15a8b1b6cbd446bad669ead64a172a1
          name: 'System uptime'
          key: system.uptime
          delay: 10m
          units: uptime
          tags:
            - tag: component
              value: os
          triggers:
            - uuid: 56284beb4a464017b3aa2f4c00bc271f
              expression: 'change(/Solaris by Zabbix agent/system.uptime)<0'
              name: 'Solaris: Server has just been restarted'
              priority: INFO
              tags:
                - tag: scope
                  value: notice
        - uuid: a2c0d69124424e49aa4fc1f2416ffc37
          name: 'Number of logged in users'
          key: system.users.num
          description: 'The number of users who are currently logged in.'
          tags:
            - tag: component
              value: security
        - uuid: 5dd55b892d1b4828bfc570d6bf48251d
          name: 'Checksum of /etc/passwd'
          key: 'vfs.file.cksum[/etc/passwd,sha256]'
          delay: 15m
          value_type: CHAR
          preprocessing:
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          tags:
            - tag: component
              value: security
          triggers:
            - uuid: 50e5be0acabb41658ec82772d9ec234e
              expression: 'last(/Solaris by Zabbix agent/vfs.file.cksum[/etc/passwd,sha256],#1)<>last(/Solaris by Zabbix agent/vfs.file.cksum[/etc/passwd,sha256],#2)'
              name: 'Solaris: /etc/passwd has been changed'
              priority: WARNING
              tags:
                - tag: scope
                  value: security
        - uuid: 897f991e6f8f433bbd52a958f4f54c08
          name: 'Get filesystems'
          key: vfs.fs.get
          history: '0'
          value_type: TEXT
          description: 'The `vfs.fs.get` key acquires raw information set about the filesystems. Later to be extracted by preprocessing in dependent items.'
          tags:
            - tag: component
              value: raw
        - uuid: 6888f0dd6b2e418f8c28a0ee59648fa3
          name: 'Available memory'
          key: 'vm.memory.size[available]'
          units: B
          description: 'Defined as free + cached + buffers.'
          tags:
            - tag: component
              value: memory
          triggers:
            - uuid: a0769befcb4e4c649557926824d7dbf3
              expression: 'last(/Solaris by Zabbix agent/vm.memory.size[available])<20M'
              name: 'Solaris: Lack of available memory on server'
              priority: AVERAGE
              tags:
                - tag: scope
                  value: capacity
                - tag: scope
                  value: performance
        - uuid: d96d5ebfa074428e957335b5fa58189b
          name: 'Total memory'
          key: 'vm.memory.size[total]'
          delay: 1h
          units: B
          description: 'Total memory expressed in bytes.'
          tags:
            - tag: component
              value: memory
        - uuid: 46dc8d0138314f41962dc357d1e4af20
          name: 'Zabbix agent availability'
          type: INTERNAL
          key: 'zabbix[host,agent,available]'
          description: 'Used for monitoring agent availability status'
          valuemap:
            name: zabbix.host.available
          tags:
            - tag: component
              value: system
          triggers:
            - uuid: 4ca39fa4a86c45e19e03eff89edd239b
              expression: 'max(/Solaris by Zabbix agent/zabbix[host,agent,available],{$AGENT.TIMEOUT})=0'
              name: 'Solaris: Zabbix agent is not available'
              event_name: 'Solaris: Zabbix agent is not available (for {$AGENT.TIMEOUT})'
              priority: AVERAGE
              description: 'For passive checks only; the availability of the agent(s) and a host is used with `{$AGENT.TIMEOUT}` as the time threshold.'
              manual_close: 'YES'
              tags:
                - tag: scope
                  value: availability
      discovery_rules:
        - uuid: 6a47f796859241c1aa30f0d731cacf52
          name: 'Network interface discovery'
          key: net.if.discovery
          delay: 1h
          filter:
            conditions:
              - macro: '{#IFNAME}'
                value: '@Network interfaces for discovery'
          description: 'Used for the discovery of network interfaces.'
          item_prototypes:
            - uuid: 548f317737ee4facbed4a371f3476352
              name: 'Interface {#IFNAME}: Incoming network traffic'
              key: 'net.if.in[{#IFNAME}]'
              units: bps
              preprocessing:
                - type: CHANGE_PER_SECOND
                - type: MULTIPLIER
                  parameters:
                    - '8'
              tags:
                - tag: component
                  value: interfaces
                - tag: interfaces
                  value: '{#IFNAME}'
            - uuid: 02dbf0af85294ab0bbf042fca79448cc
              name: 'Interface {#IFNAME}: Outgoing network traffic'
              key: 'net.if.out[{#IFNAME}]'
              units: bps
              preprocessing:
                - type: CHANGE_PER_SECOND
                - type: MULTIPLIER
                  parameters:
                    - '8'
              tags:
                - tag: component
                  value: interfaces
                - tag: interfaces
                  value: '{#IFNAME}'
          graph_prototypes:
            - uuid: 61d0d627f36e4b1b97fec7857ac99ac1
              name: 'Interface {#IFNAME}: Network traffic'
              ymin_type_1: FIXED
              graph_items:
                - drawtype: GRADIENT_LINE
                  color: 00AA00
                  item:
                    host: 'Solaris by Zabbix agent'
                    key: 'net.if.in[{#IFNAME}]'
                - sortorder: '1'
                  drawtype: GRADIENT_LINE
                  color: 3333FF
                  item:
                    host: 'Solaris by Zabbix agent'
                    key: 'net.if.out[{#IFNAME}]'
        - uuid: 3abf31160b404cf095daca79f2a03188
          name: 'Mounted filesystem discovery'
          type: DEPENDENT
          key: vfs.fs.dependent.discovery
          filter:
            evaltype: AND
            conditions:
              - macro: '{#FSNAME}'
                value: '{$VFS.FS.FSNAME.MATCHES}'
              - macro: '{#FSNAME}'
                value: '{$VFS.FS.FSNAME.NOT_MATCHES}'
                operator: NOT_MATCHES_REGEX
              - macro: '{#FSTYPE}'
                value: '{$VFS.FS.FSTYPE.MATCHES}'
              - macro: '{#FSTYPE}'
                value: '{$VFS.FS.FSTYPE.NOT_MATCHES}'
                operator: NOT_MATCHES_REGEX
          description: 'The discovery of mounted filesystems with different types.'
          item_prototypes:
            - uuid: aa40b3df2229405193c373b00064e420
              name: 'FS [{#FSNAME}]: Inodes: Free, in %'
              type: DEPENDENT
              key: 'vfs.fs.dependent.inode[{#FSNAME},pfree]'
              value_type: FLOAT
              units: '%'
              description: 'Free metadata space expressed in %.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.inodes.pfree
              master_item:
                key: 'vfs.fs.dependent[{#FSNAME},data]'
              tags:
                - tag: component
                  value: storage
                - tag: filesystem
                  value: '{#FSNAME}'
                - tag: fstype
                  value: '{#FSTYPE}'
              trigger_prototypes:
                - uuid: dcf89ee9976944e3af1357fadc028d22
                  expression: 'min(/Solaris by Zabbix agent/vfs.fs.dependent.inode[{#FSNAME},pfree],5m)<{$VFS.FS.INODE.PFREE.MIN.CRIT:"{#FSNAME}"}'
                  name: 'Solaris: FS [{#FSNAME}]: Running out of free inodes'
                  event_name: 'Solaris: {#FSNAME}: Running out of free inodes (free < {$VFS.FS.INODE.PFREE.MIN.CRIT:"{#FSNAME}"}%)'
                  opdata: 'Free inodes: {ITEM.LASTVALUE1}'
                  priority: AVERAGE
                  description: 'Disk writing may fail if index nodes are exhausted, leading to error messages like "No space left on device" or "Disk is full", despite available free space.'
                  tags:
                    - tag: scope
                      value: capacity
                    - tag: scope
                      value: performance
                - uuid: a56d85c866814b5e9273815beafba98c
                  expression: 'min(/Solaris by Zabbix agent/vfs.fs.dependent.inode[{#FSNAME},pfree],5m)<{$VFS.FS.INODE.PFREE.MIN.WARN:"{#FSNAME}"}'
                  name: 'Solaris: FS [{#FSNAME}]: Running out of free inodes'
                  event_name: 'Solaris: FS [{#FSNAME}]: Running out of free inodes (free < {$VFS.FS.INODE.PFREE.MIN.WARN:"{#FSNAME}"}%)'
                  opdata: 'Free inodes: {ITEM.LASTVALUE1}'
                  priority: WARNING
                  description: 'Disk writing may fail if index nodes are exhausted, leading to error messages like "No space left on device" or "Disk is full", despite available free space.'
                  dependencies:
                    - name: 'Solaris: FS [{#FSNAME}]: Running out of free inodes'
                      expression: 'min(/Solaris by Zabbix agent/vfs.fs.dependent.inode[{#FSNAME},pfree],5m)<{$VFS.FS.INODE.PFREE.MIN.CRIT:"{#FSNAME}"}'
                  tags:
                    - tag: scope
                      value: capacity
                    - tag: scope
                      value: performance
            - uuid: e4c935091c6c49f185ef0e93963388ff
              name: 'FS [{#FSNAME}]: Space: Available'
              type: DEPENDENT
              key: 'vfs.fs.dependent.size[{#FSNAME},free]'
              units: B
              description: 'Available storage space expressed in bytes.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.bytes.free
              master_item:
                key: 'vfs.fs.dependent[{#FSNAME},data]'
              tags:
                - tag: component
                  value: storage
                - tag: filesystem
                  value: '{#FSNAME}'
                - tag: fstype
                  value: '{#FSTYPE}'
            - uuid: e2805fb218d64ddd8ea58beae73e1343
              name: 'FS [{#FSNAME}]: Space: Available, in %'
              type: DEPENDENT
              key: 'vfs.fs.dependent.size[{#FSNAME},pfree]'
              value_type: FLOAT
              units: '%'
              description: |
                Deprecated metric.
                Space availability expressed as a percentage, calculated using the current and maximum available spaces.
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.bytes.pfree
              master_item:
                key: 'vfs.fs.dependent[{#FSNAME},data]'
              tags:
                - tag: component
                  value: storage
                - tag: deprecated
                - tag: filesystem
                  value: '{#FSNAME}'
                - tag: fstype
                  value: '{#FSTYPE}'
            - uuid: 3b4f23722c49429ba5b6a6ecccb52d95
              name: 'FS [{#FSNAME}]: Space: Used, in %'
              type: DEPENDENT
              key: 'vfs.fs.dependent.size[{#FSNAME},pused]'
              value_type: FLOAT
              units: '%'
              description: 'Calculated as the percentage of currently used space compared to the maximum available space.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.bytes.pused
              master_item:
                key: 'vfs.fs.dependent[{#FSNAME},data]'
              tags:
                - tag: component
                  value: storage
                - tag: filesystem
                  value: '{#FSNAME}'
                - tag: fstype
                  value: '{#FSTYPE}'
              trigger_prototypes:
                - uuid: 091ecfd7c946472aa370e98f1d97ffe6
                  expression: 'min(/Solaris by Zabbix agent/vfs.fs.dependent.size[{#FSNAME},pused],5m)>{$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"}'
                  name: 'Solaris: FS [{#FSNAME}]: Space is critically low'
                  event_name: 'Solaris: FS [{#FSNAME}]: Space is critically low (used > {$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"}%, total {{?last(//vfs.fs.dependent.size[{#FSNAME},total])/1024/1024/1024}.fmtnum(1)}GB)'
                  opdata: 'Space used: {{ITEM.LASTVALUE1}.fmtnum(1)}%'
                  priority: AVERAGE
                  description: |
                    The volume's space usage exceeds the `{$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"}%` limit.
                    The trigger expression is based on the current used and maximum available spaces.
                    Event name represents the total volume space, which can differ from the maximum available space, depending on the filesystem type.
                  manual_close: 'YES'
                  tags:
                    - tag: scope
                      value: availability
                    - tag: scope
                      value: capacity
                - uuid: e93165ebd8d94064836405c8c377bf62
                  expression: 'min(/Solaris by Zabbix agent/vfs.fs.dependent.size[{#FSNAME},pused],5m)>{$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"}'
                  name: 'Solaris: FS [{#FSNAME}]: Space is low'
                  event_name: 'Solaris: FS [{#FSNAME}]: Space is low (used > {$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"}%, total {{?last(//vfs.fs.dependent.size[{#FSNAME},total])/1024/1024/1024}.fmtnum(1)}GB)'
                  opdata: 'Space used: {{ITEM.LASTVALUE1}.fmtnum(1)}%'
                  priority: WARNING
                  description: |
                    The volume's space usage exceeds the `{$VFS.FS.PUSED.MAX.WARN:"{#FSNAME}"}%` limit.
                    The trigger expression is based on the current used and maximum available spaces.
                    Event name represents the total volume space, which can differ from the maximum available space, depending on the filesystem type.
                  manual_close: 'YES'
                  dependencies:
                    - name: 'Solaris: FS [{#FSNAME}]: Space is critically low'
                      expression: 'min(/Solaris by Zabbix agent/vfs.fs.dependent.size[{#FSNAME},pused],5m)>{$VFS.FS.PUSED.MAX.CRIT:"{#FSNAME}"}'
                  tags:
                    - tag: scope
                      value: availability
                    - tag: scope
                      value: capacity
            - uuid: e15cfb60494944db8e9b2fe929d91fef
              name: 'FS [{#FSNAME}]: Space: Total'
              type: DEPENDENT
              key: 'vfs.fs.dependent.size[{#FSNAME},total]'
              units: B
              description: 'Total space expressed in bytes.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.bytes.total
              master_item:
                key: 'vfs.fs.dependent[{#FSNAME},data]'
              tags:
                - tag: component
                  value: storage
                - tag: filesystem
                  value: '{#FSNAME}'
                - tag: fstype
                  value: '{#FSTYPE}'
            - uuid: 0da8a65250ec4027b3093772f5c26532
              name: 'FS [{#FSNAME}]: Space: Used'
              type: DEPENDENT
              key: 'vfs.fs.dependent.size[{#FSNAME},used]'
              units: B
              description: 'Used storage expressed in bytes.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.bytes.used
              master_item:
                key: 'vfs.fs.dependent[{#FSNAME},data]'
              tags:
                - tag: component
                  value: storage
                - tag: filesystem
                  value: '{#FSNAME}'
                - tag: fstype
                  value: '{#FSTYPE}'
            - uuid: 2076c4c4799646d9b42f881369a36f7d
              name: 'FS [{#FSNAME}]: Get data'
              type: DEPENDENT
              key: 'vfs.fs.dependent[{#FSNAME},data]'
              history: 1h
              value_type: TEXT
              description: 'Intermediate data of `{#FSNAME}` filesystem.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.[?(@.fsname==''{#FSNAME}'')].first()'
              master_item:
                key: vfs.fs.get
              tags:
                - tag: component
                  value: raw
                - tag: component
                  value: storage
                - tag: filesystem
                  value: '{#FSNAME}'
                - tag: fstype
                  value: '{#FSTYPE}'
            - uuid: de8a43c30de44e83b381b75254735a10
              name: 'FS [{#FSNAME}]: Option: Read-only'
              type: DEPENDENT
              key: 'vfs.fs.dependent[{#FSNAME},readonly]'
              description: 'The filesystem is mounted as read-only. It is available only for Zabbix agents 6.4 and higher.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.options
                  error_handler: DISCARD_VALUE
                - type: REGEX
                  parameters:
                    - '(?:^|,)ro\b'
                    - '1'
                  error_handler: CUSTOM_VALUE
                  error_handler_params: '0'
              master_item:
                key: 'vfs.fs.dependent[{#FSNAME},data]'
              tags:
                - tag: component
                  value: storage
                - tag: filesystem
                  value: '{#FSNAME}'
                - tag: fstype
                  value: '{#FSTYPE}'
              trigger_prototypes:
                - uuid: cbbcf1204cf345ceaaf2a9b12996f52f
                  expression: 'last(/Solaris by Zabbix agent/vfs.fs.dependent[{#FSNAME},readonly],#2)=0 and last(/Solaris by Zabbix agent/vfs.fs.dependent[{#FSNAME},readonly])=1'
                  recovery_mode: RECOVERY_EXPRESSION
                  recovery_expression: 'last(/Solaris by Zabbix agent/vfs.fs.dependent[{#FSNAME},readonly])=0'
                  name: 'Solaris: FS [{#FSNAME}]: Filesystem has become read-only'
                  priority: AVERAGE
                  description: 'The filesystem has become read-only, possibly due to an I/O error. Available only for Zabbix agents 6.4 and higher.'
                  manual_close: 'YES'
                  tags:
                    - tag: scope
                      value: availability
                    - tag: scope
                      value: performance
          graph_prototypes:
            - uuid: e6dd13c45cac48db8aead11e9af0cd9d
              name: 'FS [{#FSTYPE}({#FSNAME})]: Space usage graph, in % (relative to max available)'
              width: '600'
              height: '340'
              ymin_type_1: FIXED
              ymax_type_1: FIXED
              graph_items:
                - drawtype: FILLED_REGION
                  color: F63100
                  calc_fnc: ALL
                  item:
                    host: 'Solaris by Zabbix agent'
                    key: 'vfs.fs.dependent.size[{#FSNAME},pused]'
            - uuid: 38a43d8fa8fb40f2aa59dd6a8f069f90
              name: 'FS [{#FSTYPE}({#FSNAME})]: Space utilization chart (relative to total)'
              width: '600'
              height: '340'
              type: PIE
              show_3d: 'YES'
              graph_items:
                - color: '787878'
                  calc_fnc: LAST
                  type: GRAPH_SUM
                  item:
                    host: 'Solaris by Zabbix agent'
                    key: 'vfs.fs.dependent.size[{#FSNAME},total]'
                - sortorder: '1'
                  color: F63100
                  calc_fnc: LAST
                  item:
                    host: 'Solaris by Zabbix agent'
                    key: 'vfs.fs.dependent.size[{#FSNAME},used]'
                - sortorder: '2'
                  color: 199C09
                  calc_fnc: LAST
                  item:
                    host: 'Solaris by Zabbix agent'
                    key: 'vfs.fs.dependent.size[{#FSNAME},free]'
          master_item:
            key: vfs.fs.get
          lld_macro_paths:
            - lld_macro: '{#FSNAME}'
              path: $.fsname
            - lld_macro: '{#FSTYPE}'
              path: $.fstype
          preprocessing:
            - type: JAVASCRIPT
              parameters:
                - |
                  var filesystems = JSON.parse(value);
                  
                  result = filesystems.map(function (filesystem) {
                  	return {
                  		'fsname': filesystem.fsname,
                  		'fstype': filesystem.fstype
                  	};
                  });
                  
                  return JSON.stringify(result);
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          overrides:
            - name: 'Skip metadata collection for dynamic FS'
              step: '1'
              filter:
                conditions:
                  - macro: '{#FSTYPE}'
                    value: ^(btrfs|zfs)$
              operations:
                - operator: LIKE
                  value: Inodes
                  discover: NO_DISCOVER
      tags:
        - tag: class
          value: os
        - tag: target
          value: solaris
      macros:
        - macro: '{$AGENT.TIMEOUT}'
          value: 3m
          description: 'Timeout after which the agent is considered unavailable. Works only for agents reachable from Zabbix server/proxy (in passive mode).'
          config:
            type: TEXT
            priority: '1'
            section_name: Other
            label: 'Seconds since the last Zabbix agent seen'
            description: 'Timeout after which the agent is considered unavailable. Works only for agents reachable from Zabbix server/proxy (in passive mode).'
        - macro: '{$VFS.FS.FSNAME.MATCHES}'
          value: .+
          description: 'Used for filesystem discovery. Can be overridden on the host or linked template level.'
          config:
            type: TEXT
            priority: '3'
            section_name: Filters
            label: 'Filter for filesystems by name'
            description: 'Used for filesystem discovery. Can be overridden on the host or linked template level.'
        - macro: '{$VFS.FS.FSNAME.NOT_MATCHES}'
          value: ^(/dev|/sys|/run|/proc|.+/shm$)
          description: 'Used for filesystem discovery. Can be overridden on the host or linked template level.'
          config:
            type: TEXT
            priority: '2'
            section_name: Filters
            label: 'Filter for filesystems by name (exclude)'
            description: 'Used for filesystem discovery. Can be overridden on the host or linked template level.'
        - macro: '{$VFS.FS.FSTYPE.MATCHES}'
          value: ^(btrfs|ext2|ext3|ext4|reiser|xfs|ffs|ufs|jfs|jfs2|vxfs|hfs|apfs|refs|ntfs|fat32|zfs)$
          description: 'Used for filesystem discovery. Can be overridden on the host or linked template level.'
          config:
            type: TEXT
            priority: '4'
            section_name: Filters
            label: 'Filter for filesystems by type'
            description: 'Used for filesystem discovery. Can be overridden on the host or linked template level.'
        - macro: '{$VFS.FS.FSTYPE.NOT_MATCHES}'
          value: ^\s$
          description: 'Used for filesystem discovery. Can be overridden on the host or linked template level.'
          config:
            type: TEXT
            priority: '5'
            section_name: Filters
            label: 'Filter for filesystems by type (exclude)'
            description: 'Used for filesystem discovery. Can be overridden on the host or linked template level.'
        - macro: '{$VFS.FS.INODE.PFREE.MIN.CRIT}'
          value: '10'
          description: 'The critical threshold of the filesystem metadata utilization.'
          config:
            type: TEXT
            priority: '6'
            section_name: Thresholds
            label: 'Threshold of the filesystem metadata utilization (critical)'
            description: 'The critical threshold of the filesystem metadata utilization. In the range from 0 to 100 inclusive.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$VFS.FS.INODE.PFREE.MIN.WARN}'
          value: '20'
          description: 'The warning threshold of the filesystem metadata utilization.'
          config:
            type: TEXT
            priority: '7'
            section_name: Thresholds
            label: 'Threshold of the filesystem metadata utilization'
            description: 'The warning threshold of the filesystem metadata utilization. In the range from 0 to 100 inclusive.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$VFS.FS.PUSED.MAX.CRIT}'
          value: '90'
          description: 'The critical threshold of the filesystem utilization.'
          config:
            type: TEXT
            priority: '8'
            section_name: Thresholds
            label: 'Threshold for filesystem utilization (critical)'
            description: 'The critical threshold of the filesystem utilization. In the range from 0 to 100 inclusive.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$VFS.FS.PUSED.MAX.WARN}'
          value: '80'
          description: 'The warning threshold of the filesystem utilization.'
          config:
            type: TEXT
            priority: '9'
            section_name: Thresholds
            label: 'Threshold for filesystem utilization (warning)'
            description: 'The warning threshold of the filesystem utilization. In the range from 0 to 100 inclusive.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
      dashboards:
        - uuid: 7a8dd74f9e2d4df090a76d0fc1eabdcf
          name: Filesystems
          pages:
            - name: Overview
              widgets:
                - type: graphprototype
                  width: '72'
                  height: '5'
                  fields:
                    - type: INTEGER
                      name: columns
                      value: '3'
                    - type: GRAPH_PROTOTYPE
                      name: graphid.0
                      value:
                        host: 'Solaris by Zabbix agent'
                        name: 'FS [{#FSTYPE}({#FSNAME})]: Space utilization chart (relative to total)'
                    - type: STRING
                      name: reference
                      value: AAAEB
                - type: graphprototype
                  'y': '5'
                  width: '72'
                  height: '5'
                  fields:
                    - type: INTEGER
                      name: columns
                      value: '1'
                    - type: GRAPH_PROTOTYPE
                      name: graphid.0
                      value:
                        host: 'Solaris by Zabbix agent'
                        name: 'FS [{#FSTYPE}({#FSNAME})]: Space usage graph, in % (relative to max available)'
                    - type: STRING
                      name: reference
                      value: AAAEC
        - uuid: 774e5b14c75c49b4a3a4196ce1ccdaf7
          name: 'System performance'
          pages:
            - widgets:
                - type: graph
                  width: '36'
                  height: '5'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Solaris by Zabbix agent'
                        name: 'CPU load'
                    - type: STRING
                      name: reference
                      value: AAAAA
                - type: graph
                  'y': '5'
                  width: '36'
                  height: '5'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Solaris by Zabbix agent'
                        name: 'Memory usage'
                    - type: STRING
                      name: reference
                      value: AAAAC
                - type: graphprototype
                  'y': '10'
                  width: '72'
                  height: '5'
                  fields:
                    - type: INTEGER
                      name: columns
                      value: '3'
                    - type: GRAPH_PROTOTYPE
                      name: graphid.0
                      value:
                        host: 'Solaris by Zabbix agent'
                        name: 'FS [{#FSTYPE}({#FSNAME})]: Space utilization chart (relative to total)'
                    - type: STRING
                      name: reference
                      value: AAAEA
                - type: graph
                  'y': '15'
                  width: '36'
                  height: '5'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Solaris by Zabbix agent'
                        key: 'proc.num[]'
                    - type: STRING
                      name: reference
                      value: AAAAE
                    - type: INTEGER
                      name: source_type
                      value: '1'
                - type: graph
                  x: '36'
                  width: '36'
                  height: '5'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Solaris by Zabbix agent'
                        name: 'CPU utilization'
                    - type: STRING
                      name: reference
                      value: AAAAB
                - type: graph
                  x: '36'
                  'y': '5'
                  width: '36'
                  height: '5'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Solaris by Zabbix agent'
                        name: 'Swap usage'
                    - type: STRING
                      name: reference
                      value: AAAAD
                - type: graph
                  x: '36'
                  'y': '15'
                  width: '36'
                  height: '5'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Solaris by Zabbix agent'
                        key: 'proc.num[,,run]'
                    - type: STRING
                      name: reference
                      value: AAAAF
                    - type: INTEGER
                      name: source_type
                      value: '1'
      valuemaps:
        - uuid: 2a704279b6e946a99b88bdebd4f99653
          name: zabbix.host.available
          mappings:
            - value: '0'
              newvalue: 'not available'
            - value: '1'
              newvalue: available
            - value: '2'
              newvalue: unknown
        - uuid: 5db838501e354313888d84800658ed6a
          name: 'Zabbix agent ping status'
          mappings:
            - value: '1'
              newvalue: Up
    - uuid: 8ec72ebbe3204d7789429640abcac610
      template: 'TiDB by HTTP'
      name: 'TiDB by HTTP'
      description: |
        The template to monitor TiDB server of TiDB cluster by Zabbix that works without any external scripts.
        Most of the metrics are collected in one go, thanks to Zabbix bulk data collection.
        Don't forget to change the macros {$TIDB.URL}, {$TIDB.PORT}.
        
        Template `TiDB by HTTP` — collects metrics by HTTP agent from PD /metrics endpoint and from monitoring API.
        
        You can discuss this template or leave feedback on our forum https://www.zabbix.com/forum/zabbix-suggestions-and-feedback
        
        Generated by official Zabbix template tool "Templator"
      wizard_ready: 'YES'
      readme: |
        ## Overview
        
        The template to monitor TiDB server of TiDB cluster by Zabbix that works without any external scripts.
        Most of the metrics are collected in one go, thanks to Zabbix bulk data collection.
        
        Template `TiDB by HTTP` — collects metrics by HTTP agent from PD /metrics endpoint and from monitoring API.
        See https://docs.pingcap.com/tidb/stable/tidb-monitoring-api.
        
        
        ## Setup
        
        This template works with TiDB server of TiDB cluster.
        Internal service metrics are collected from TiDB /metrics endpoint and from monitoring API.
        See https://docs.pingcap.com/tidb/stable/tidb-monitoring-api.
        Don't forget to change the host wizard configuration fields `Address`, `Port`.
      vendor:
        name: Zabbix
        version: 8.0-1
      groups:
        - name: Templates/Databases
      items:
        - uuid: f6c68d3961e04d5185ab38c12fa25532
          name: CPU
          type: DEPENDENT
          key: tidb.cpu.util
          value_type: FLOAT
          units: '%'
          description: 'Total user and system CPU usage ratio.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.name=="process_cpu_seconds_total")].value.first()'
            - type: CHANGE_PER_SECOND
            - type: MULTIPLIER
              parameters:
                - '100'
          master_item:
            key: tidb.get_metrics
          tags:
            - tag: component
              value: cpu
        - uuid: e1da33fc95ab46bcbe6bc6a68154d172
          name: 'DDL waiting jobs'
          type: DEPENDENT
          key: tidb.ddl_waiting_jobs
          value_type: FLOAT
          description: 'The number of TiDB operations that resolve locks per second. When TiDB''s read or write request encounters a lock, it tries to resolve the lock.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.name=="tidb_ddl_waiting_jobs")].value.sum()'
              error_handler: CUSTOM_VALUE
              error_handler_params: '0'
          master_item:
            key: tidb.get_metrics
          tags:
            - tag: component
              value: operations
          triggers:
            - uuid: 4125d55d9931455091d2f3a0b25e9678
              expression: 'min(/TiDB by HTTP/tidb.ddl_waiting_jobs,5m)>{$TIDB.DDL.WAITING.MAX.WARN}'
              name: 'TiDB: Too many DDL waiting jobs'
              event_name: 'TiDB: Too many DDL waiting jobs (over {$TIDB.DDL.WAITING.MAX.WARN} for 5m)'
              priority: WARNING
              tags:
                - tag: scope
                  value: performance
        - uuid: 0fe0c1dee67e469d9d38193ef7b040ec
          name: 'Load schema failed, rate'
          type: DEPENDENT
          key: tidb.domain_load_schema.failed.rate
          value_type: FLOAT
          description: 'The total number of failures to reload the latest schema information in TiDB per second.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.name=="tidb_domain_load_schema_total && @.labels.type == "failed"")].value.first()'
              error_handler: DISCARD_VALUE
            - type: CHANGE_PER_SECOND
          master_item:
            key: tidb.get_metrics
          tags:
            - tag: component
              value: domain
          triggers:
            - uuid: b4948f37af804c01a2b8887f9e89ec90
              expression: 'min(/TiDB by HTTP/tidb.domain_load_schema.failed.rate,5m)>{$TIDB.SCHEMA_LOAD_ERRORS.MAX.WARN}'
              name: 'TiDB: Too many schema lease errors'
              event_name: 'TiDB: Too many schema lease errors (over {$TIDB.SCHEMA_LOAD_ERRORS.MAX.WARN} for 5m)'
              priority: AVERAGE
              tags:
                - tag: scope
                  value: availability
        - uuid: b0e960ddac4d43a3860e8a06dfe09e03
          name: 'Load schema total, rate'
          type: DEPENDENT
          key: tidb.domain_load_schema.rate
          value_type: FLOAT
          description: 'The statistics of the schemas that TiDB obtains from TiKV per second.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.name=="tidb_domain_load_schema_total")].value.sum()'
            - type: CHANGE_PER_SECOND
          master_item:
            key: tidb.get_metrics
          tags:
            - tag: component
              value: domain
        - uuid: 8fffe502bd2f42368e60d2110f1c3319
          name: 'Failed Query, rate'
          type: DEPENDENT
          key: tidb.execute_error.rate
          value_type: FLOAT
          description: 'The number of error occurred when executing SQL statements per second (such as syntax errors and primary key conflicts).'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.name=="tidb_server_execute_error_total")].value.sum()'
              error_handler: DISCARD_VALUE
            - type: CHANGE_PER_SECOND
          master_item:
            key: tidb.get_metrics
          tags:
            - tag: component
              value: sql
        - uuid: 954f5e433a7c44128d7772b87d493270
          name: 'Get instance metrics'
          type: HTTP_AGENT
          key: tidb.get_metrics
          history: '0'
          value_type: TEXT
          description: 'Get TiDB instance metrics.'
          preprocessing:
            - type: CHECK_NOT_SUPPORTED
              parameters:
                - '-1'
            - type: PROMETHEUS_TO_JSON
              parameters:
                - ''
          url: '{$TIDB.URL}:{$TIDB.PORT}/metrics'
          tags:
            - tag: component
              value: raw
        - uuid: e95ebe1050b8404f8274e243203fdecc
          name: 'Get instance status'
          type: HTTP_AGENT
          key: tidb.get_status
          history: '0'
          value_type: TEXT
          description: 'Get TiDB instance status info.'
          preprocessing:
            - type: CHECK_NOT_SUPPORTED
              parameters:
                - '-1'
              error_handler: CUSTOM_VALUE
              error_handler_params: '{"status": "0"}'
          url: '{$TIDB.URL}:{$TIDB.PORT}/status'
          tags:
            - tag: component
              value: health
            - tag: component
              value: raw
        - uuid: 14cf8296365048a59fd42f03966b1e1e
          name: 'Goroutine count'
          type: DEPENDENT
          key: tidb.goroutines
          description: 'The number of Goroutines on TiDB instance.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.name=="go_goroutines")].value.first()'
          master_item:
            key: tidb.get_metrics
          tags:
            - tag: component
              value: goroutines
        - uuid: 78e60bd44e3e4a4a859705c94ef94420
          name: 'Heap memory usage'
          type: DEPENDENT
          key: tidb.heap_bytes
          value_type: FLOAT
          units: B
          description: 'Number of heap bytes that are in use.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.name=="go_memstats_heap_inuse_bytes")].value.first()'
          master_item:
            key: tidb.get_metrics
          tags:
            - tag: component
              value: memory
          triggers:
            - uuid: 575a4821ed8c4a1881b7f9bd264b1929
              expression: 'min(/TiDB by HTTP/tidb.heap_bytes,5m)>{$TIDB.HEAP.USAGE.MAX.WARN}'
              name: 'TiDB: Heap memory usage is too high'
              event_name: 'TiDB: Heap memory usage is too high (over {$TIDB.HEAP.USAGE.MAX.WARN} for 5m)'
              priority: WARNING
              tags:
                - tag: scope
                  value: capacity
        - uuid: 104c09cb47f640fb804c136a09aa3bd2
          name: 'Keep alive, rate'
          type: DEPENDENT
          key: tidb.monitor_keep_alive.rate
          value_type: FLOAT
          units: Ops
          description: 'The number of times that the metrics are refreshed on TiDB instance per minute.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.name=="tidb_monitor_keep_alive_total")].value.first()'
              error_handler: DISCARD_VALUE
            - type: SIMPLE_CHANGE
          master_item:
            key: tidb.get_metrics
          tags:
            - tag: component
              value: health
          triggers:
            - uuid: eb3c09904fa843d78401b00eff4f6a08
              expression: 'max(/TiDB by HTTP/tidb.monitor_keep_alive.rate,5m)<{$TIDB.MONITOR_KEEP_ALIVE.MAX.WARN}'
              name: 'TiDB: Too few keep alive operations'
              event_name: 'TiDB: Too few keep alive operations (less {$TIDB.MONITOR_KEEP_ALIVE.MAX.WARN} for 5m)'
              priority: AVERAGE
              description: 'Indicates whether the TiDB process still exists. If the number of times for tidb_monitor_keep_alive_total increases less than 10 per minute, the TiDB process might already exit and an alert is triggered.'
              tags:
                - tag: scope
                  value: availability
        - uuid: d3ef55b9fd8b4a2aa1cbbc48f15203cb
          name: 'Time jump back, rate'
          type: DEPENDENT
          key: tidb.monitor_time_jump_back.rate
          value_type: FLOAT
          units: Ops
          description: 'The number of times that the operating system rewinds every second.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.name=="tidb_monitor_time_jump_back_total")].value.first()'
            - type: CHANGE_PER_SECOND
          master_item:
            key: tidb.get_metrics
          tags:
            - tag: component
              value: application
          triggers:
            - uuid: c3c1f6eab224453b92534d5393aca2b7
              expression: 'min(/TiDB by HTTP/tidb.monitor_time_jump_back.rate,5m)>{$TIDB.TIME_JUMP_BACK.MAX.WARN}'
              name: 'TiDB: Too many time jump backs'
              event_name: 'TiDB: Too many time jump backs (over {$TIDB.TIME_JUMP_BACK.MAX.WARN} for 5m)'
              priority: WARNING
              tags:
                - tag: scope
                  value: performance
        - uuid: dce76be0ccbe44969bb09ad29d599790
          name: 'PD TSO commands, rate'
          type: DEPENDENT
          key: tidb.pd_tso_cmd.rate
          value_type: FLOAT
          units: Ops
          description: 'The number of TSO commands that TiDB obtains from PD per second.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.name=="pd_client_cmd_handle_cmds_duration_seconds_count" && @.labels.type == "tso")].value.first()'
            - type: CHANGE_PER_SECOND
          master_item:
            key: tidb.get_metrics
          tags:
            - tag: component
              value: pd-commands
        - uuid: 2bde50849f5541c3ac8aa5b26f5b8b52
          name: 'PD TSO requests, rate'
          type: DEPENDENT
          key: tidb.pd_tso_request.rate
          value_type: FLOAT
          units: Ops
          description: 'The number of TSO requests that TiDB obtains from PD per second.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.name=="pd_client_request_handle_requests_duration_seconds_count" && @.labels.type == "tso")].value.first()'
            - type: CHANGE_PER_SECOND
          master_item:
            key: tidb.get_metrics
          tags:
            - tag: component
              value: pd-commands
        - uuid: ad8764623b8e46238efc0a94f0766a5b
          name: 'Open file descriptors, max'
          type: DEPENDENT
          key: tidb.process_max_fds
          value_type: FLOAT
          description: 'Maximum number of open file descriptors.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.name=="process_max_fds")].value.first()'
          master_item:
            key: tidb.get_metrics
          tags:
            - tag: component
              value: fds
        - uuid: 04b3d6bf810c449db1e4b79be6b263a9
          name: 'Open file descriptors'
          type: DEPENDENT
          key: tidb.process_open_fds
          value_type: FLOAT
          description: 'Number of open file descriptors.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.name=="process_open_fds")].value.first()'
          master_item:
            key: tidb.get_metrics
          tags:
            - tag: component
              value: fds
        - uuid: fbee374d0fda4679a693ccccc26e5713
          name: 'RSS memory usage'
          type: DEPENDENT
          key: tidb.rss_bytes
          value_type: FLOAT
          units: B
          description: 'Resident memory size in bytes.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.name=="process_resident_memory_bytes")].value.first()'
          master_item:
            key: tidb.get_metrics
          tags:
            - tag: component
              value: memory
        - uuid: 651140aae7334994a31d24568c08a9ab
          name: 'Total "error" server query, rate'
          type: DEPENDENT
          key: tidb.server_query.error.rate
          value_type: FLOAT
          units: Qps
          description: 'The number of queries on TiDB instance per second with failure of command execution results.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.labels.result == "Error")].value.sum()'
            - type: CHANGE_PER_SECOND
          master_item:
            key: tidb.server_query.get_metrics
          tags:
            - tag: component
              value: queries
        - uuid: d563866ed3be46b991175c0250495cc7
          name: 'Get total server query metrics'
          type: DEPENDENT
          key: tidb.server_query.get_metrics
          history: '0'
          value_type: TEXT
          description: 'Get information about server queries.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.name == "tidb_server_query_total")]'
              error_handler: DISCARD_VALUE
          master_item:
            key: tidb.get_metrics
          tags:
            - tag: component
              value: raw
        - uuid: 00374eab11a14ab1b4e636996519ab80
          name: 'Total "ok" server query, rate'
          type: DEPENDENT
          key: tidb.server_query.ok.rate
          value_type: FLOAT
          units: Qps
          description: 'The number of queries on TiDB instance per second with success of command execution results.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.labels.result == "OK")].value.sum()'
            - type: CHANGE_PER_SECOND
          master_item:
            key: tidb.server_query.get_metrics
          tags:
            - tag: component
              value: queries
        - uuid: 938e7bb83c714e198db55f3bb009daaf
          name: 'Total server query, rate'
          type: DEPENDENT
          key: tidb.server_query.rate
          value_type: FLOAT
          units: Qps
          description: 'The number of queries per second on TiDB instance.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $..value.sum()
            - type: CHANGE_PER_SECOND
          master_item:
            key: tidb.server_query.get_metrics
          tags:
            - tag: component
              value: queries
        - uuid: 84824ff459b74679b33e34a1f1e8cc69
          name: 'Schema lease "change" errors, rate'
          type: DEPENDENT
          key: tidb.session_schema_lease_error.change.rate
          value_type: FLOAT
          description: |
            The number of schema lease errors per second.
            "change" means that the schema has changed
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.name=="tidb_session_schema_lease_error_total && @.labels.type == "change"")].value.first()'
              error_handler: DISCARD_VALUE
            - type: CHANGE_PER_SECOND
          master_item:
            key: tidb.get_metrics
          tags:
            - tag: component
              value: sessions
        - uuid: fe35df7cc7de4b0b8d616b042da99d69
          name: 'Schema lease "outdate" errors , rate'
          type: DEPENDENT
          key: tidb.session_schema_lease_error.outdate.rate
          value_type: FLOAT
          description: |
            The number of schema lease errors per second.
            "outdate" errors means that the schema cannot be updated, which is a more serious error and triggers an alert.
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.name=="tidb_session_schema_lease_error_total && @.labels.type == "outdate"")].value.first()'
              error_handler: DISCARD_VALUE
            - type: CHANGE_PER_SECOND
          master_item:
            key: tidb.get_metrics
          tags:
            - tag: component
              value: sessions
          triggers:
            - uuid: b077eb1afe6a4da79707987324fb40c8
              expression: 'min(/TiDB by HTTP/tidb.session_schema_lease_error.outdate.rate,5m)>{$TIDB.SCHEMA_LEASE_ERRORS.MAX.WARN}'
              name: 'TiDB: Too many schema lease errors'
              event_name: 'TiDB: Too many schema lease errors (over {$TIDB.SCHEMA_LEASE_ERRORS.MAX.WARN} for 5m)'
              priority: AVERAGE
              description: 'The latest schema information is not reloaded in TiDB within one lease.'
              tags:
                - tag: scope
                  value: availability
        - uuid: e4979490578848ecb9716c43050463ce
          name: 'Get SQL statements metrics'
          type: DEPENDENT
          key: tidb.statement_total.get_metrics
          history: '0'
          value_type: TEXT
          description: 'Get SQL statements metrics.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.name=="tidb_executor_statement_total")]'
              error_handler: DISCARD_VALUE
          master_item:
            key: tidb.get_metrics
          tags:
            - tag: component
              value: raw
        - uuid: fe8cf5e5c7704db797e76fd9d64e6d17
          name: 'SQL statements, rate'
          type: DEPENDENT
          key: tidb.statement_total.rate
          value_type: FLOAT
          description: 'The total number of SQL statements executed per second.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $..value.sum()
            - type: CHANGE_PER_SECOND
          master_item:
            key: tidb.statement_total.get_metrics
          tags:
            - tag: component
              value: sql
        - uuid: ed86585a496b4b438c521c4765d76b11
          name: Status
          type: DEPENDENT
          key: tidb.status
          value_type: CHAR
          description: 'Status of PD instance.'
          valuemap:
            name: 'Service state'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.status
              error_handler: CUSTOM_VALUE
              error_handler_params: '1'
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: tidb.get_status
          tags:
            - tag: component
              value: health
          triggers:
            - uuid: 82a638ac4a3f4b349ee7bb0d53bc1f29
              expression: 'last(/TiDB by HTTP/tidb.status)=0'
              name: 'TiDB: Instance is not responding'
              priority: AVERAGE
              tags:
                - tag: scope
                  value: availability
        - uuid: b5db09e71f2341b8ac1b9e48cbdefc82
          name: 'Server connections'
          type: DEPENDENT
          key: tidb.tidb_server_connections
          description: 'The connection number of current TiDB instance.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.name=="tidb_server_connections")].value.first()'
          master_item:
            key: tidb.get_metrics
          tags:
            - tag: component
              value: connections
        - uuid: 73992d4be61e443eafcc03aaa1bbf4a5
          name: 'Server critical error, rate'
          type: DEPENDENT
          key: tidb.tidb_server_critical_error_total.rate
          value_type: FLOAT
          description: 'The number of critical errors occurred in TiDB per second.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.name=="tidb_server_critical_error_total")].value.first()'
            - type: CHANGE_PER_SECOND
          master_item:
            key: tidb.get_metrics
          tags:
            - tag: component
              value: server
        - uuid: f1e2436ced3c456a85650e0622715777
          name: 'Server panic, rate'
          type: DEPENDENT
          key: tidb.tidb_server_panic_total.rate
          value_type: FLOAT
          description: 'The number of panics occurred in TiDB per second.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.name=="tidb_server_panic_total")].value.first()'
              error_handler: DISCARD_VALUE
            - type: CHANGE_PER_SECOND
          master_item:
            key: tidb.get_metrics
          tags:
            - tag: component
              value: server
          triggers:
            - uuid: c457465731c947eab7b477186d8ba876
              expression: 'last(/TiDB by HTTP/tidb.tidb_server_panic_total.rate)>0'
              name: 'TiDB: There are panicked TiDB threads'
              priority: AVERAGE
              description: 'When a panic occurs, an alert is triggered. The thread is often recovered, otherwise, TiDB will frequently restart.'
              tags:
                - tag: scope
                  value: availability
        - uuid: dbeb9ccf30834e22bb7e264061274b9b
          name: 'Get TiKV client metrics'
          type: DEPENDENT
          key: tidb.tikvclient.get_metrics
          history: '0'
          value_type: TEXT
          description: 'Get TiKV client metrics.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.name=~"tidb_tikvclient_*")]'
              error_handler: DISCARD_VALUE
          master_item:
            key: tidb.get_metrics
          tags:
            - tag: component
              value: raw
        - uuid: 8a63b326356f4fdbb9cb6e73437348be
          name: 'KV backoff, rate'
          type: DEPENDENT
          key: tidb.tikvclient_backoff.rate
          value_type: FLOAT
          units: Ops
          description: 'The number of errors returned by TiKV.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.name=="tidb_tikvclient_backoff_total")].value.sum()'
              error_handler: DISCARD_VALUE
            - type: CHANGE_PER_SECOND
          master_item:
            key: tidb.tikvclient.get_metrics
          tags:
            - tag: component
              value: tikv-commands
        - uuid: aef7cdfd07f1420c970f20c821fed8dd
          name: 'Lock resolves, rate'
          type: DEPENDENT
          key: tidb.tikvclient_lock_resolver_action.rate
          value_type: FLOAT
          units: Ops
          description: 'The number of DDL tasks that are waiting.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.name=="tidb_tikvclient_lock_resolver_actions_total")].value.sum()'
            - type: CHANGE_PER_SECOND
          master_item:
            key: tidb.tikvclient.get_metrics
          tags:
            - tag: component
              value: tikv-commands
        - uuid: c116313e63fa45d89bf44772cc9cb3b8
          name: 'TiClient region errors, rate'
          type: DEPENDENT
          key: tidb.tikvclient_region_err.rate
          value_type: FLOAT
          units: Ops
          description: 'The number of region related errors returned by TiKV per second.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.name=="tidb_tikvclient_region_err_total")].value.sum()'
            - type: CHANGE_PER_SECOND
          master_item:
            key: tidb.tikvclient.get_metrics
          tags:
            - tag: component
              value: regions
          triggers:
            - uuid: d3cb81c46e414ff2a7e411a877b899ef
              expression: 'min(/TiDB by HTTP/tidb.tikvclient_region_err.rate,5m)>{$TIDB.REGION_ERROR.MAX.WARN}'
              name: 'TiDB: Too many region related errors'
              event_name: 'TiDB: Too many region related errors (over {$TIDB.REGION_ERROR.MAX.WARN} for 5m)'
              priority: AVERAGE
              tags:
                - tag: scope
                  value: performance
        - uuid: 8ddf164df8c9404ba9f7c0f87db3bc2f
          name: 'KV commands, rate'
          type: DEPENDENT
          key: tidb.tikvclient_txn.rate
          value_type: FLOAT
          units: Ops
          description: 'The number of executed KV commands per second.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.name=="tidb_tikvclient_txn_cmd_duration_seconds_count")].value.sum()'
            - type: CHANGE_PER_SECOND
          master_item:
            key: tidb.tikvclient.get_metrics
          tags:
            - tag: component
              value: tikv-commands
        - uuid: 20c0fffd66c84a16bb4d8f7882c896bc
          name: Uptime
          type: DEPENDENT
          key: tidb.uptime
          value_type: FLOAT
          units: uptime
          description: 'The runtime of each TiDB instance.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.name=="process_start_time_seconds")].value.first()'
            - type: JAVASCRIPT
              parameters:
                - 'return (Math.floor(Date.now() / 1000) - Number(value));'
          master_item:
            key: tidb.get_metrics
          tags:
            - tag: component
              value: application
          triggers:
            - uuid: 91adc4c6b9364693891faf58c8cced75
              expression: 'last(/TiDB by HTTP/tidb.uptime)<10m'
              name: 'TiDB: Instance has been restarted'
              event_name: 'TiDB: Instance has been restarted (uptime < 10m)'
              priority: INFO
              description: 'Uptime is less than 10 minutes.'
              manual_close: 'YES'
              tags:
                - tag: scope
                  value: notice
        - uuid: 65fa2b077073467387b39bef035b0644
          name: Version
          type: DEPENDENT
          key: tidb.version
          value_type: CHAR
          description: 'Version of the TiDB instance.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.version
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 3h
          master_item:
            key: tidb.get_status
          tags:
            - tag: component
              value: application
          triggers:
            - uuid: 5f863fc0944848fdad145f42c94dbea3
              expression: 'last(/TiDB by HTTP/tidb.version,#1)<>last(/TiDB by HTTP/tidb.version,#2) and length(last(/TiDB by HTTP/tidb.version))>0'
              name: 'TiDB: Version has changed'
              event_name: 'TiDB: Version has changed (new version: {ITEM.VALUE})'
              priority: INFO
              description: 'TiDB version has changed. Acknowledge to close the problem manually.'
              manual_close: 'YES'
              tags:
                - tag: scope
                  value: notice
      discovery_rules:
        - uuid: 4db735b652eb451d911f6dc01de6b1ba
          name: 'KV metrics discovery'
          type: DEPENDENT
          key: tidb.kv_ops.discovery
          description: 'Discovery KV specific metrics.'
          item_prototypes:
            - uuid: 79b0a13b25c745d288c313c4197f2e5c
              name: 'KV Commands: {#TYPE}, rate'
              type: DEPENDENT
              key: 'tidb.tikvclient_txn.rate[{#TYPE}]'
              value_type: FLOAT
              units: Ops
              description: 'The number of executed KV commands per second.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$[?(@.name=="tidb_tikvclient_txn_cmd_duration_seconds_count" && @.labels.type == "{#TYPE}")].value.first()'
                - type: CHANGE_PER_SECOND
              master_item:
                key: tidb.tikvclient.get_metrics
              tags:
                - tag: component
                  value: tikv-commands
                - tag: type
                  value: '{#TYPE}'
          master_item:
            key: tidb.tikvclient.get_metrics
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.name=="tidb_tikvclient_txn_cmd_duration_seconds_count")]'
            - type: JAVASCRIPT
              parameters:
                - |
                  output = JSON.parse(value).map(function (item) {
                  	return {
                  		"{#TYPE}": item.labels.type,
                  	};
                  });
                  return JSON.stringify({ "data": output });
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
        - uuid: bcaf700328b94b59b35cf5bfaf27d5ac
          name: 'QPS metrics discovery'
          type: DEPENDENT
          key: tidb.qps.discovery
          description: 'Discovery QPS specific metrics.'
          item_prototypes:
            - uuid: f5966b0b3840432a8809a0dbb128ecaf
              name: 'Get QPS metrics: {#TYPE}'
              type: DEPENDENT
              key: 'tidb.qps.get_metrics[{#TYPE}]'
              history: '0'
              value_type: TEXT
              description: 'Get QPS metrics of {#TYPE}.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$[?(@.labels.type == "{#TYPE}")]'
                  error_handler: DISCARD_VALUE
              master_item:
                key: tidb.server_query.get_metrics
              tags:
                - tag: component
                  value: raw
                - tag: type
                  value: '{#TYPE}'
            - uuid: 3b450f5a853247358a8fe6f31f000575
              name: 'Server query "Error": {#TYPE}, rate'
              type: DEPENDENT
              key: 'tidb.server_query.error.rate[{#TYPE}]'
              value_type: FLOAT
              units: Qps
              description: 'The number of queries on TiDB instance per second with failure of command execution results.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$[?(@.labels.result == "Error")].value.first()'
                - type: CHANGE_PER_SECOND
              master_item:
                key: 'tidb.qps.get_metrics[{#TYPE}]'
              tags:
                - tag: component
                  value: queries
                - tag: type
                  value: '{#TYPE}'
            - uuid: 125bdd3eb1b643f4ad00d58fbed455f6
              name: 'Server query "OK": {#TYPE}, rate'
              type: DEPENDENT
              key: 'tidb.server_query.ok.rate[{#TYPE}]'
              value_type: FLOAT
              units: Qps
              description: 'The number of queries on TiDB instance per second with success of command execution results.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$[?(@.labels.result == "OK")].value.first()'
                - type: CHANGE_PER_SECOND
              master_item:
                key: 'tidb.qps.get_metrics[{#TYPE}]'
              tags:
                - tag: component
                  value: queries
                - tag: type
                  value: '{#TYPE}'
          master_item:
            key: tidb.server_query.get_metrics
          preprocessing:
            - type: JAVASCRIPT
              parameters:
                - |
                  var lookup = {},
                  	result = [];
                  
                  JSON.parse(value).forEach(function (item) {
                  	var type = item.labels.type;
                  	if (!(lookup[type])) {
                  		lookup[type] = 1;
                  		result.push({ "{#TYPE}": type });
                  	}
                  });
                  
                  return JSON.stringify(result);
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
        - uuid: e3c23b94a9514389b37e3911f79db8f8
          name: 'Statement metrics discovery'
          type: DEPENDENT
          key: tidb.statement.discover
          description: 'Discovery statement specific metrics.'
          item_prototypes:
            - uuid: 111ffa26edd247eb9325f5ab5f5f3f94
              name: 'SQL statements: {#TYPE}, rate'
              type: DEPENDENT
              key: 'tidb.statement.rate[{#TYPE}]'
              value_type: FLOAT
              description: 'The number of SQL statements executed per second.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$[?(@.labels.type == "{#TYPE}")].value.first()'
                - type: CHANGE_PER_SECOND
              master_item:
                key: tidb.statement_total.get_metrics
              tags:
                - tag: component
                  value: sql
                - tag: type
                  value: '{#TYPE}'
          master_item:
            key: tidb.statement_total.get_metrics
          preprocessing:
            - type: JAVASCRIPT
              parameters:
                - |
                  output = JSON.parse(value).map(function (item) {
                  	return {
                  		"{#TYPE}": item.labels.type,
                  	};
                  });
                  return JSON.stringify({ "data": output });
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
        - uuid: f9af6d56e612459583a1f5d3b4a7d61b
          name: 'KV backoff discovery'
          type: DEPENDENT
          key: tidb.tikvclient_backoff.discovery
          description: 'Discovery KV backoff specific metrics.'
          item_prototypes:
            - uuid: a11cf69675654e7ca70dbab255509bb8
              name: 'KV backoff: {#TYPE}, rate'
              type: DEPENDENT
              key: 'tidb.tikvclient_backoff.rate[{#TYPE}]'
              value_type: FLOAT
              units: Ops
              description: 'The number of TiDB operations that resolve locks per second. When TiDB''s read or write request encounters a lock, it tries to resolve the lock.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$[?(@.name=="tidb_tikvclient_backoff_total" && @.labels.type == "{#TYPE}")].value.first()'
                - type: CHANGE_PER_SECOND
              master_item:
                key: tidb.tikvclient.get_metrics
              tags:
                - tag: component
                  value: tikv-backoff
                - tag: type
                  value: '{#TYPE}'
          master_item:
            key: tidb.tikvclient.get_metrics
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.name=="tidb_tikvclient_backoff_total")]'
              error_handler: DISCARD_VALUE
            - type: JAVASCRIPT
              parameters:
                - |
                  output = JSON.parse(value).map(function (item) {
                  	return {
                  		"{#TYPE}": item.labels.type,
                  	};
                  });
                  return JSON.stringify({ "data": output });
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
        - uuid: 72d1f090ce9c4f89b06e4195989e4b2b
          name: 'GC action results discovery'
          type: DEPENDENT
          key: tidb.tikvclient_gc_action.discovery
          description: 'Discovery GC action results metrics.'
          item_prototypes:
            - uuid: e3c19674dcdf4fdea1f8cd82e3df9f72
              name: 'GC action result: {#TYPE}, rate'
              type: DEPENDENT
              key: 'tidb.tikvclient_gc_action.rate[{#TYPE}]'
              value_type: FLOAT
              units: Ops
              description: 'The number of results of GC-related operations per second.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$[?(@.name=="tidb_tikvclient_gc_action_result" && @.labels.type == "{#TYPE}")].value.first()'
                - type: CHANGE_PER_SECOND
              master_item:
                key: tidb.tikvclient.get_metrics
              tags:
                - tag: component
                  value: gc
                - tag: type
                  value: '{#TYPE}'
              trigger_prototypes:
                - uuid: 2d24956d0a4f459fad155590376696c1
                  expression: 'min(/TiDB by HTTP/tidb.tikvclient_gc_action.rate[{#TYPE}],5m)>{$TIDB.GC_ACTIONS.ERRORS.MAX.WARN}'
                  name: 'TiDB: Too many failed GC-related operations'
                  event_name: 'TiDB: Too many failed GC-related operations (over {$TIDB.GC_ACTIONS.ERRORS.MAX.WARN} in 5m)'
                  discover: NO_DISCOVER
                  priority: WARNING
                  tags:
                    - tag: scope
                      value: performance
          master_item:
            key: tidb.tikvclient.get_metrics
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.name=="tidb_tikvclient_gc_action_result")]'
              error_handler: DISCARD_VALUE
            - type: JAVASCRIPT
              parameters:
                - |
                  output = JSON.parse(value).map(function (item) {
                  	return {
                  		"{#TYPE}": item.labels.type,
                  	};
                  });
                  return JSON.stringify({ "data": output });
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          overrides:
            - name: 'Failed GC-related operations trigger'
              step: '1'
              filter:
                conditions:
                  - macro: '{#TYPE}'
                    value: failed
              operations:
                - operationobject: TRIGGER_PROTOTYPE
                  operator: LIKE
                  value: 'Too many failed GC-related operations'
                  discover: DISCOVER
                  status: ENABLED
        - uuid: a4f2e1902cc54f0db9e9c345c63285e2
          name: 'Lock resolves discovery'
          type: DEPENDENT
          key: tidb.tikvclient_lock_resolver_action.discovery
          description: 'Discovery lock resolves specific metrics.'
          item_prototypes:
            - uuid: 2eebf2ccc44a4cadb0b70e153b70b3a2
              name: 'Lock resolves: {#TYPE}, rate'
              type: DEPENDENT
              key: 'tidb.tikvclient_lock_resolver_action.rate[{#TYPE}]'
              value_type: FLOAT
              units: Ops
              description: 'The number of TiDB operations that resolve locks per second. When TiDB''s read or write request encounters a lock, it tries to resolve the lock.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$[?(@.name=="tidb_tikvclient_lock_resolver_actions_total" && @.labels.type == "{#TYPE}")].value.first()'
                - type: CHANGE_PER_SECOND
              master_item:
                key: tidb.tikvclient.get_metrics
              tags:
                - tag: component
                  value: locks
                - tag: type
                  value: '{#TYPE}'
          master_item:
            key: tidb.tikvclient.get_metrics
          preprocessing:
            - type: JSONPATH
              parameters:
                - '$[?(@.name=="tidb_tikvclient_lock_resolver_actions_total")]'
            - type: JAVASCRIPT
              parameters:
                - |
                  output = JSON.parse(value).map(function (item) {
                  	return {
                  		"{#TYPE}": item.labels.type,
                  	};
                  });
                  return JSON.stringify({ "data": output });
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
      tags:
        - tag: class
          value: database
        - tag: subclass
          value: sql
        - tag: target
          value: tidb
      macros:
        - macro: '{$TIDB.DDL.WAITING.MAX.WARN}'
          value: '5'
          description: 'Maximum number of DDL tasks that are waiting'
          config:
            type: TEXT
            priority: '5'
            section_name: Thresholds
            label: 'Max waiting DDL tasks'
            description: 'Maximum number of DDL tasks that are waiting'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$TIDB.GC_ACTIONS.ERRORS.MAX.WARN}'
          value: '1'
          description: 'Maximum number of GC-related operations failures'
          config:
            type: TEXT
            priority: '9'
            section_name: Thresholds
            label: 'Max GC operation failures'
            description: 'Maximum number of GC-related operations failures'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$TIDB.HEAP.USAGE.MAX.WARN}'
          value: 10G
          description: 'Maximum heap memory used'
          config:
            type: TEXT
            priority: '4'
            section_name: Thresholds
            label: 'Max heap memory used'
            description: 'Maximum heap memory used'
        - macro: '{$TIDB.MONITOR_KEEP_ALIVE.MAX.WARN}'
          value: '10'
          description: 'Minimum number of keep alive operations'
          config:
            type: TEXT
            priority: '11'
            section_name: Thresholds
            label: 'Min keep alive operations'
            description: 'Minimum number of keep alive operations'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$TIDB.OPEN.FDS.MAX.WARN}'
          value: '90'
          description: 'Maximum percentage of used file descriptors'
          config:
            type: TEXT
            priority: '3'
            section_name: Thresholds
            label: 'Max used file descriptors (%)'
            description: 'Maximum percentage of used file descriptors'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$TIDB.PORT}'
          value: '10080'
          description: 'The port of TiDB server metrics web endpoint'
          config:
            type: TEXT
            priority: '1'
            label: Port
            description: 'The port of TiDB server metrics web endpoint In the range from 1 to 65535 inclusive.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$TIDB.REGION_ERROR.MAX.WARN}'
          value: '50'
          description: 'Maximum number of region related errors'
          config:
            type: TEXT
            priority: '10'
            section_name: Thresholds
            label: 'Max region errors'
            description: 'Maximum number of region related errors'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$TIDB.SCHEMA_LEASE_ERRORS.MAX.WARN}'
          value: '0'
          description: 'Maximum number of schema lease errors'
          config:
            type: TEXT
            priority: '7'
            section_name: Thresholds
            label: 'Max schema lease errors'
            description: 'Maximum number of schema lease errors'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$TIDB.SCHEMA_LOAD_ERRORS.MAX.WARN}'
          value: '1'
          description: 'Maximum number of load schema errors'
          config:
            type: TEXT
            priority: '8'
            section_name: Thresholds
            label: 'Max load schema errors'
            description: 'Maximum number of load schema errors'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$TIDB.TIME_JUMP_BACK.MAX.WARN}'
          value: '1'
          description: 'Maximum number of times that the operating system rewinds every second'
          config:
            type: TEXT
            priority: '6'
            section_name: Thresholds
            label: 'Max OS rewinds per second'
            description: 'Maximum number of times that the operating system rewinds every second'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$TIDB.URL}'
          value: localhost
          description: 'TiDB server URL'
          config:
            type: TEXT
            priority: '2'
            label: Address
            description: 'TiDB server URL'
      dashboards:
        - uuid: 7e70b8a9af42441397241465dbf5e32c
          name: 'TiDB: Overview'
          pages:
            - name: Main
              widgets:
                - type: graph
                  width: '36'
                  height: '5'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'TiDB by HTTP'
                        name: 'TiDB: Memory usage'
                    - type: STRING
                      name: reference
                      value: AAAAA
                - type: graph
                  'y': '5'
                  width: '36'
                  height: '5'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'TiDB by HTTP'
                        name: 'TiDB: File descriptors'
                    - type: STRING
                      name: reference
                      value: AAAAC
                - type: graph
                  x: '36'
                  width: '36'
                  height: '5'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'TiDB by HTTP'
                        name: 'TiDB: Server query rate'
                    - type: STRING
                      name: reference
                      value: AAAAB
      valuemaps:
        - uuid: 047f0303f1bc424a959f5d0ceaab77c7
          name: 'Service state'
          mappings:
            - value: '0'
              newvalue: Down
            - value: '1'
              newvalue: Up
    - uuid: b606eda347ea4663a33ad4d12a482750
      template: 'Zookeeper by HTTP'
      name: 'Zookeeper by HTTP'
      description: |
        This template is designed for the effortless deployment of Apache Zookeeper monitoring by Zabbix via HTTP and doesn't require any external scripts.
        
        This template works with standalone and cluster instances. Metrics are collected from each Zookeeper node by requests to AdminServer
        
        Setup:
        
        1. Enable the AdminServer and configure the parameters according to the official documentation:
        https://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_adminserver_config
        
        2. Set the hostname or IP address of the Apache Zookeeper host in the '{$ZOOKEEPER.HOST}' macro. You can also change the '{$ZOOKEEPER.COMMAND_URL}', '{$ZOOKEEPER.PORT}' and '{$ZOOKEEPER.SCHEME}' macros if necessary.
        
        You can discuss this template or leave feedback on our forum:
        https://www.zabbix.com/forum/zabbix-suggestions-and-feedback
        
        Generated by official Zabbix template tool "Templator"
      wizard_ready: 'YES'
      readme: |
        ## Overview
        
        This template is designed for the effortless deployment of Apache Zookeeper monitoring by Zabbix via HTTP and doesn't require any external scripts.
        
        This template works with standalone and cluster instances. Metrics are collected from each Zookeeper node by requests to AdminServer.
        
        ## Setup
        
        1. Enable the AdminServer and configure the parameters according to the [`official documentation`](https://zookeeper.apache.org/doc/current/zookeeperAdmin.html#sc_adminserver_config).
        
        2. Set the hostname or IP address of the Apache Zookeeper host in the `Address` host wizard configuration field. You can also change the `Command URL`, `Port` and `Scheme` if necessary.
      vendor:
        name: Zabbix
        version: 8.0-1
      groups:
        - name: Templates/Applications
      items:
        - uuid: c7e7e728371a45ef81c35929a713ab4a
          name: 'Approximate data size'
          type: DEPENDENT
          key: zookeeper.approximate_data_size
          units: B
          description: 'Data tree size in bytes.The size includes the znode path and its value.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.approximate_data_size
          master_item:
            key: zookeeper.get_metrics
          tags:
            - tag: component
              value: disk
        - uuid: 260f60267bda40099f323292d7f0b8fd
          name: 'Election time, avg'
          type: DEPENDENT
          key: zookeeper.avg_election_time
          value_type: FLOAT
          units: ms
          description: 'Time between entering and leaving election.'
          preprocessing:
            - type: JAVASCRIPT
              parameters:
                - |
                  var metrics = JSON.parse(value),
                  	res = metrics.avg_election_time || metrics['election_time{quantile="0.5"}'];
                  if (isNaN(res)) {
                  	return 0;
                  }
                  return res;
          master_item:
            key: zookeeper.get_metrics
          tags:
            - tag: component
              value: application
        - uuid: 28aa45a47df64503a9553a05794f512a
          name: 'Fsync time, avg'
          type: DEPENDENT
          key: zookeeper.avg_fsynctime
          value_type: FLOAT
          units: ms
          description: 'Time to fsync transaction log.'
          preprocessing:
            - type: JAVASCRIPT
              parameters:
                - |
                  var metrics = JSON.parse(value),
                  	res = metrics.avg_fsynctime || metrics['fsynctime{quantile="0.5"}'];
                  if (isNaN(res)) {
                  	return 0;
                  }
                  return res;
          master_item:
            key: zookeeper.get_metrics
          tags:
            - tag: component
              value: disk
        - uuid: 243ea1e324d5464a88c8847e721cd38b
          name: 'Latency, avg'
          type: DEPENDENT
          key: zookeeper.avg_latency
          value_type: FLOAT
          units: ms
          description: 'The average amount of time it takes for the server to respond to a client request.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.avg_latency
          master_item:
            key: zookeeper.get_metrics
          tags:
            - tag: component
              value: requests
        - uuid: 6195a64eb23341f0964d8d9ffbf9e624
          name: 'Snapshot write time, avg'
          type: DEPENDENT
          key: zookeeper.avg_snapshottime
          value_type: FLOAT
          units: ms
          description: 'Average time to write a snapshot.'
          preprocessing:
            - type: JAVASCRIPT
              parameters:
                - |
                  var metrics = JSON.parse(value),
                  	res = metrics['snapshottime{quantile="0.5"}'] || metrics.avg_snapshottime ;
                  if (isNaN(res)) {
                  	return 0;
                  }
                  return res;
          master_item:
            key: zookeeper.get_metrics
          tags:
            - tag: component
              value: disk
        - uuid: f227c61a498f47f6ba1862a741da3789
          name: 'Bytes received per sec'
          type: DEPENDENT
          key: zookeeper.bytes_received_count.rate
          value_type: FLOAT
          units: Bps
          description: 'Number of bytes received per second.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.bytes_received_count
            - type: CHANGE_PER_SECOND
          master_item:
            key: zookeeper.get_metrics
          tags:
            - tag: component
              value: network
        - uuid: b9a97ebbaf7d416998e24553cee3559c
          name: Elections
          type: DEPENDENT
          key: zookeeper.cnt_election_time
          description: 'Number of elections happened.'
          preprocessing:
            - type: JAVASCRIPT
              parameters:
                - |
                  var metrics = JSON.parse(value);
                  if (metrics.server_state === "standalone") {
                  	return 0
                  	}
                  else {
                  	return metrics.cnt_election_time || metrics.election_time_count
                  }
          master_item:
            key: zookeeper.get_metrics
          tags:
            - tag: component
              value: application
        - uuid: 01d490987f954950b7ce3a107aefa200
          name: Fsync
          type: DEPENDENT
          key: zookeeper.cnt_fsynctime
          description: 'Count of performed fsyncs.'
          preprocessing:
            - type: JAVASCRIPT
              parameters:
                - |
                  var metrics = JSON.parse(value)
                  return metrics.cnt_fsynctime || metrics.fsynctime_count
          master_item:
            key: zookeeper.get_metrics
          tags:
            - tag: component
              value: disk
        - uuid: 159bf1c1f29846a582e201c143239182
          name: 'Snapshot writes'
          type: DEPENDENT
          key: zookeeper.cnt_snapshottime
          description: 'Count of performed snapshot writes.'
          preprocessing:
            - type: JAVASCRIPT
              parameters:
                - |
                  var metrics = JSON.parse(value)
                  return metrics.snapshottime_count || metrics.cnt_snapshottime
          master_item:
            key: zookeeper.get_metrics
          tags:
            - tag: component
              value: disk
        - uuid: 10b17f0682c44e2391b8ee191ed355c1
          name: 'Commit per sec'
          type: DEPENDENT
          key: zookeeper.commit_count.rate
          value_type: FLOAT
          description: 'The number of commits performed per second'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.commit_count
            - type: CHANGE_PER_SECOND
          master_item:
            key: zookeeper.get_metrics
          tags:
            - tag: component
              value: operations
        - uuid: 1c0ff2c8d4844ed4b815f2a793dd6e7b
          name: 'Drop connections per sec'
          type: DEPENDENT
          key: zookeeper.connection_drop_count.rate
          value_type: FLOAT
          description: 'Rate of connection drops.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.connection_drop_count
            - type: CHANGE_PER_SECOND
          master_item:
            key: zookeeper.get_metrics
          tags:
            - tag: component
              value: connections
        - uuid: 640195274cda47ed83faa4f0c6529818
          name: 'Rejected connections per sec'
          type: DEPENDENT
          key: zookeeper.connection_rejected.rate
          value_type: FLOAT
          description: 'Rate of connection rejected.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.connection_rejected
            - type: CHANGE_PER_SECOND
          master_item:
            key: zookeeper.get_metrics
          tags:
            - tag: component
              value: connections
        - uuid: 1498099b44d3424093f7cea55cb256e8
          name: 'Revalidate connections per sec'
          type: DEPENDENT
          key: zookeeper.connection_revalidate_count.rate
          value_type: FLOAT
          description: 'Rate of connection revalidations.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.connection_revalidate_count
            - type: CHANGE_PER_SECOND
          master_item:
            key: zookeeper.get_metrics
          tags:
            - tag: component
              value: connections
        - uuid: 3e8e3bc9910e4c3c898e1371790a35f0
          name: 'Diff syncs per sec'
          type: DEPENDENT
          key: zookeeper.diff_count.rate
          value_type: FLOAT
          description: 'Number of diff syncs performed per second'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.diff_count
            - type: CHANGE_PER_SECOND
          master_item:
            key: zookeeper.get_metrics
          tags:
            - tag: component
              value: operations
        - uuid: 1a581bf18a364868b6eb47bbafcaa105
          name: 'Ephemeral nodes count'
          type: DEPENDENT
          key: zookeeper.ephemerals_count
          description: 'Number of ephemeral nodes that a zookeeper server has in its data tree.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.ephemerals_count
          master_item:
            key: zookeeper.get_metrics
          tags:
            - tag: component
              value: application
        - uuid: f682f5d6e1664f919872f309371e4079
          name: 'Get connections stats'
          type: HTTP_AGENT
          key: zookeeper.get_connections_stats
          history: '0'
          value_type: TEXT
          description: 'Get information on client connections to server. Note, depending on the number of client connections this operation may be expensive (i.e. impact server performance).'
          url: '{$ZOOKEEPER.SCHEME}://{$ZOOKEEPER.HOST}:{$ZOOKEEPER.PORT}/{$ZOOKEEPER.COMMAND_URL}/connections'
          tags:
            - tag: component
              value: connections
            - tag: component
              value: raw
        - uuid: cf7e83297d6343fb87dcd7848f62ce41
          name: 'Get server metrics'
          type: HTTP_AGENT
          key: zookeeper.get_metrics
          history: '0'
          value_type: TEXT
          url: '{$ZOOKEEPER.SCHEME}://{$ZOOKEEPER.HOST}:{$ZOOKEEPER.PORT}/{$ZOOKEEPER.COMMAND_URL}/monitor'
          tags:
            - tag: component
              value: raw
        - uuid: 0f8e7ac6f753483d86744b2ab6aa28dd
          name: 'Global sessions'
          type: DEPENDENT
          key: zookeeper.global_sessions
          description: 'Number of global sessions.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.global_sessions
          master_item:
            key: zookeeper.get_metrics
          tags:
            - tag: component
              value: sessions
        - uuid: 72519325755b4c27931c674756313ebb
          name: 'Local sessions'
          type: DEPENDENT
          key: zookeeper.local_sessions
          description: 'Number of local sessions.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.local_sessions
          master_item:
            key: zookeeper.get_metrics
          tags:
            - tag: component
              value: sessions
        - uuid: 8a784676586d4b719a0b5c1327a0645f
          name: 'Looking per sec'
          type: DEPENDENT
          key: zookeeper.looking_count.rate
          value_type: FLOAT
          description: 'Rate of transitions into looking state.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.looking_count
            - type: CHANGE_PER_SECOND
          master_item:
            key: zookeeper.get_metrics
          tags:
            - tag: component
              value: operations
        - uuid: 350a5b566e054e8390bb43ce0b2916c6
          name: 'File descriptors, max'
          type: DEPENDENT
          key: zookeeper.max_file_descriptor_count
          description: 'Maximum number of file descriptors that a zookeeper server can open.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.max_file_descriptor_count
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: zookeeper.get_metrics
          tags:
            - tag: component
              value: fds
        - uuid: 185f5c3fdfde43afa55ed4c38c0878dc
          name: 'Latency, max'
          type: DEPENDENT
          key: zookeeper.max_latency
          value_type: FLOAT
          units: ms
          description: 'The maximum amount of time it takes for the server to respond to a client request.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.max_latency
          master_item:
            key: zookeeper.get_metrics
          tags:
            - tag: component
              value: requests
        - uuid: a4b3d6d9cfb14454b83475b89fe44e06
          name: 'Latency, min'
          type: DEPENDENT
          key: zookeeper.min_latency
          value_type: FLOAT
          units: ms
          description: 'The minimum amount of time it takes for the server to respond to a client request.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.min_latency
          master_item:
            key: zookeeper.get_metrics
          tags:
            - tag: component
              value: requests
        - uuid: 86ba6a7967e8462cb6ff4be126e21a44
          name: 'Alive connections'
          type: DEPENDENT
          key: zookeeper.num_alive_connections
          description: 'Number of active clients connected to a zookeeper server.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.num_alive_connections
          master_item:
            key: zookeeper.get_metrics
          tags:
            - tag: component
              value: connections
        - uuid: e441c926d2f947708b39d7615520405d
          name: 'File descriptors, open'
          type: DEPENDENT
          key: zookeeper.open_file_descriptor_count
          description: 'Number of file descriptors that a zookeeper server has open.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.open_file_descriptor_count
          master_item:
            key: zookeeper.get_metrics
          tags:
            - tag: component
              value: fds
        - uuid: 88ede9687323440183d665d38938212e
          name: 'Outstanding requests'
          type: DEPENDENT
          key: zookeeper.outstanding_requests
          description: 'The number of queued requests when the server is under load and is receiving more sustained requests than it can process.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.outstanding_requests
          master_item:
            key: zookeeper.get_metrics
          tags:
            - tag: component
              value: requests
          triggers:
            - uuid: ac27f2d8b34546d1bdc6d7ab858c04a1
              expression: 'min(/Zookeeper by HTTP/zookeeper.outstanding_requests,5m)>{$ZOOKEEPER.OUTSTANDING_REQ.MAX.WARN}'
              name: 'Zookeeper: Too many queued requests'
              event_name: 'Zookeeper: Too many queued requests (over {$ZOOKEEPER.OUTSTANDING_REQ.MAX.WARN}% for 5 min)'
              priority: AVERAGE
              description: 'Number of queued requests in the server. This goes up when the server receives more requests than it can process.'
              manual_close: 'YES'
              tags:
                - tag: scope
                  value: performance
        - uuid: 3295ed3fdb504014b351eba81bf55ccf
          name: 'Packets received per sec'
          type: DEPENDENT
          key: zookeeper.packets_received.rate
          value_type: FLOAT
          description: 'The number of zookeeper packets received by a server per second.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.packets_received
            - type: CHANGE_PER_SECOND
          master_item:
            key: zookeeper.get_metrics
          tags:
            - tag: component
              value: network
        - uuid: ecef658cb34247e2838e0f7313dba0bf
          name: 'Packets sent per sec'
          type: DEPENDENT
          key: zookeeper.packets_sent
          value_type: FLOAT
          description: 'The number of zookeeper packets sent from a server per second.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.packets_sent
            - type: CHANGE_PER_SECOND
          master_item:
            key: zookeeper.get_metrics
          tags:
            - tag: component
              value: network
        - uuid: 8295b8c4c1f44ba48987f36b54b43ab8
          name: 'Revalidate per sec'
          type: DEPENDENT
          key: zookeeper.revalidate_count.rate
          value_type: FLOAT
          description: 'Rate of revalidations.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.revalidate_count
            - type: CHANGE_PER_SECOND
          master_item:
            key: zookeeper.get_metrics
          tags:
            - tag: component
              value: operations
        - uuid: 44a1f40fb3604fcda9fedc4beeb87baf
          name: 'Server mode'
          type: DEPENDENT
          key: zookeeper.server_state
          value_type: CHAR
          description: 'Mode of the server. In an ensemble, this may either be leader or follower. Otherwise, it is standalone'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.server_state
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: zookeeper.get_metrics
          tags:
            - tag: component
              value: application
          triggers:
            - uuid: 494624353875401eaf65f7eb0273ca35
              expression: 'last(/Zookeeper by HTTP/zookeeper.server_state,#1)<>last(/Zookeeper by HTTP/zookeeper.server_state,#2) and length(last(/Zookeeper by HTTP/zookeeper.server_state))>0'
              name: 'Zookeeper: Server mode has changed'
              event_name: 'Zookeeper: Server mode has changed (new mode: {ITEM.VALUE})'
              priority: INFO
              description: 'Zookeeper node state has changed. Acknowledge to close the problem manually.'
              manual_close: 'YES'
              tags:
                - tag: scope
                  value: notice
        - uuid: d143981fdaee4c51bcbb773579be25f0
          name: 'Snap syncs per sec'
          type: DEPENDENT
          key: zookeeper.snap_count.rate
          value_type: FLOAT
          description: 'Number of snap syncs performed per second'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.snap_count
            - type: CHANGE_PER_SECOND
          master_item:
            key: zookeeper.get_metrics
          tags:
            - tag: component
              value: operations
        - uuid: cea535cfb32940f29aee3c17734e8c51
          name: Uptime
          type: DEPENDENT
          key: zookeeper.uptime
          units: s
          description: 'Uptime that a peer has been in a table leading/following/observing state.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.uptime
            - type: MULTIPLIER
              parameters:
                - '0.001'
          master_item:
            key: zookeeper.get_metrics
          tags:
            - tag: component
              value: application
          triggers:
            - uuid: db35b5c75fc543ef8ffe766a0671fd6d
              expression: 'nodata(/Zookeeper by HTTP/zookeeper.uptime,10m)=1'
              name: 'Zookeeper: Failed to fetch info data'
              event_name: 'Zookeeper: Failed to fetch info data (or no data for 10m)'
              priority: WARNING
              description: 'Zabbix has not received data for items for the last 10 minutes'
              manual_close: 'YES'
              tags:
                - tag: scope
                  value: availability
        - uuid: 86a65edd19e14fa9aea1ff40220f895c
          name: Version
          type: DEPENDENT
          key: zookeeper.version
          value_type: CHAR
          description: 'Version of Zookeeper server.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.version
            - type: REGEX
              parameters:
                - '^([0-9\.]+)'
                - \1
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 3h
          master_item:
            key: zookeeper.get_metrics
          tags:
            - tag: component
              value: application
          triggers:
            - uuid: 2a091bcfafe84ea9aee5238ce5e25651
              expression: 'last(/Zookeeper by HTTP/zookeeper.version,#1)<>last(/Zookeeper by HTTP/zookeeper.version,#2) and length(last(/Zookeeper by HTTP/zookeeper.version))>0'
              name: 'Zookeeper: Version has changed'
              event_name: 'Zookeeper: Version has changed (new version: {ITEM.VALUE})'
              priority: INFO
              description: 'Zookeeper version has changed. Acknowledge to close the problem manually.'
              manual_close: 'YES'
              tags:
                - tag: scope
                  value: notice
        - uuid: 5cbc4414c19146ff87e15f21c77808c9
          name: 'Watch count'
          type: DEPENDENT
          key: zookeeper.watch_count
          description: 'Number of watches currently set on the local ZooKeeper process.'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.watch_count
          master_item:
            key: zookeeper.get_metrics
          tags:
            - tag: component
              value: application
        - uuid: 07925b71e3fe421eac9b338fc23713d0
          name: 'Znode count'
          type: DEPENDENT
          key: zookeeper.znode_count
          description: 'The number of znodes in the ZooKeeper namespace (the data)'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.znode_count
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 1h
          master_item:
            key: zookeeper.get_metrics
          tags:
            - tag: component
              value: application
      discovery_rules:
        - uuid: e0f576ea5ae44289866fb726079ddbf8
          name: 'Clients discovery'
          type: HTTP_AGENT
          key: zookeeper.clients
          delay: 1h
          description: |
            Get list of client connections.
            Note, depending on the number of client connections this operation may be expensive (i.e. impact server performance).
          item_prototypes:
            - uuid: b5a378d3785542dca169b1bc1c02189f
              name: 'Zookeeper client {#TYPE} [{#CLIENT}]: Latency, avg'
              type: DEPENDENT
              key: 'zookeeper.avg_latency[{#TYPE},{#CLIENT}]'
              value_type: FLOAT
              units: ms
              description: 'The average amount of time it takes for the server to respond to a client request.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.avg_latency
              master_item:
                key: 'zookeeper.client_info[{#TYPE},{#CLIENT}]'
              tags:
                - tag: client
                  value: '{#CLIENT}'
                - tag: component
                  value: clients
                - tag: component
                  value: requests
                - tag: type
                  value: '{#TYPE}'
            - uuid: 76f3b4f0a73d4565bdb5391ac9af9f24
              name: 'Zookeeper client {#TYPE} [{#CLIENT}]: Get client info'
              type: DEPENDENT
              key: 'zookeeper.client_info[{#TYPE},{#CLIENT}]'
              history: '0'
              value_type: TEXT
              description: 'The item gets information about "{#CLIENT}" client of "{#TYPE}" type.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.{#TYPE}.[?(@.remote_socket_address == "{#ADDRESS}")].first()'
                  error_handler: DISCARD_VALUE
              master_item:
                key: zookeeper.get_connections_stats
              tags:
                - tag: client
                  value: '{#CLIENT}'
                - tag: component
                  value: raw
                - tag: type
                  value: '{#TYPE}'
            - uuid: 2a36ecfb56754bcb8bdc91da76316fb4
              name: 'Zookeeper client {#TYPE} [{#CLIENT}]: Latency, max'
              type: DEPENDENT
              key: 'zookeeper.max_latency[{#TYPE},{#CLIENT}]'
              value_type: FLOAT
              units: ms
              description: 'The maximum amount of time it takes for the server to respond to a client request.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.max_latency
              master_item:
                key: 'zookeeper.client_info[{#TYPE},{#CLIENT}]'
              tags:
                - tag: client
                  value: '{#CLIENT}'
                - tag: component
                  value: clients
                - tag: component
                  value: requests
                - tag: type
                  value: '{#TYPE}'
            - uuid: 6a245634ec9b4aa0b2df8360b42ac8aa
              name: 'Zookeeper client {#TYPE} [{#CLIENT}]: Latency, min'
              type: DEPENDENT
              key: 'zookeeper.min_latency[{#TYPE},{#CLIENT}]'
              value_type: FLOAT
              units: ms
              description: 'The minimum amount of time it takes for the server to respond to a client request.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.min_latency
              master_item:
                key: 'zookeeper.client_info[{#TYPE},{#CLIENT}]'
              tags:
                - tag: client
                  value: '{#CLIENT}'
                - tag: component
                  value: clients
                - tag: component
                  value: requests
                - tag: type
                  value: '{#TYPE}'
            - uuid: 89805694583b453e99f833e850b5c5dc
              name: 'Zookeeper client {#TYPE} [{#CLIENT}]: Outstanding requests'
              type: DEPENDENT
              key: 'zookeeper.outstanding_requests[{#TYPE},{#CLIENT}]'
              description: 'The number of queued requests when the server is under load and is receiving more sustained requests than it can process.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.outstanding_requests
              master_item:
                key: 'zookeeper.client_info[{#TYPE},{#CLIENT}]'
              tags:
                - tag: client
                  value: '{#CLIENT}'
                - tag: component
                  value: clients
                - tag: component
                  value: requests
                - tag: type
                  value: '{#TYPE}'
            - uuid: e68a429aa986477e894b2a4437b6ec4a
              name: 'Zookeeper client {#TYPE} [{#CLIENT}]: Packets received per sec'
              type: DEPENDENT
              key: 'zookeeper.packets_received[{#TYPE},{#CLIENT}]'
              value_type: FLOAT
              description: 'The number of packets received.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.packets_received
                - type: CHANGE_PER_SECOND
              master_item:
                key: 'zookeeper.client_info[{#TYPE},{#CLIENT}]'
              tags:
                - tag: client
                  value: '{#CLIENT}'
                - tag: component
                  value: clients
                - tag: component
                  value: network
                - tag: type
                  value: '{#TYPE}'
            - uuid: c748207b3f3e4a7ca6bb8ff3ecc8959b
              name: 'Zookeeper client {#TYPE} [{#CLIENT}]: Packets sent per sec'
              type: DEPENDENT
              key: 'zookeeper.packets_sent[{#TYPE},{#CLIENT}]'
              value_type: FLOAT
              description: 'The number of packets sent.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.packets_sent
                - type: CHANGE_PER_SECOND
              master_item:
                key: 'zookeeper.client_info[{#TYPE},{#CLIENT}]'
              tags:
                - tag: client
                  value: '{#CLIENT}'
                - tag: component
                  value: clients
                - tag: component
                  value: network
                - tag: type
                  value: '{#TYPE}'
          graph_prototypes:
            - uuid: 9ea4e5af47124317ba7f4502af97bc9c
              name: 'Zookeeper client {#TYPE} [{#CLIENT}]: Latency'
              graph_items:
                - color: 199C0D
                  item:
                    host: 'Zookeeper by HTTP'
                    key: 'zookeeper.max_latency[{#TYPE},{#CLIENT}]'
                - sortorder: '1'
                  color: F63100
                  item:
                    host: 'Zookeeper by HTTP'
                    key: 'zookeeper.min_latency[{#TYPE},{#CLIENT}]'
                - sortorder: '2'
                  drawtype: BOLD_LINE
                  color: 00611C
                  item:
                    host: 'Zookeeper by HTTP'
                    key: 'zookeeper.avg_latency[{#TYPE},{#CLIENT}]'
            - uuid: b41e4ca001fe4a6789b1b4490861bd26
              name: 'Zookeeper client {#TYPE} [{#CLIENT}]: Packets'
              graph_items:
                - color: 199C0D
                  item:
                    host: 'Zookeeper by HTTP'
                    key: 'zookeeper.packets_sent[{#TYPE},{#CLIENT}]'
                - sortorder: '1'
                  color: F63100
                  item:
                    host: 'Zookeeper by HTTP'
                    key: 'zookeeper.packets_received[{#TYPE},{#CLIENT}]'
          url: '{$ZOOKEEPER.SCHEME}://{$ZOOKEEPER.HOST}:{$ZOOKEEPER.PORT}/{$ZOOKEEPER.COMMAND_URL}/connections'
          preprocessing:
            - type: JAVASCRIPT
              parameters:
                - |
                  var source = JSON.parse(value),
                  	data = [];
                  
                  source.connections.forEach(function(v){
                  	data.push({
                  		"{#ADDRESS}": v.remote_socket_address,
                  		"{#CLIENT}": v.remote_socket_address.split(':')[0],
                  		"{#TYPE}": "connections"})
                  });
                  
                  source.secure_connections.forEach(function(v){
                  data.push({
                  	"{#ADDRESS}": v.remote_socket_address,
                  	"{#CLIENT}":v.remote_socket_address.split(':')[0],
                  	"{#TYPE}": "secure_connections"})
                  });
                  
                  return JSON.stringify(data);
        - uuid: 70e9fabfdfe446edae67a340f648612f
          name: 'Leader metrics discovery'
          type: DEPENDENT
          key: zookeeper.metrics.leader
          description: 'Additional metrics for leader node'
          item_prototypes:
            - uuid: 3a9b38e228a0438eae354cfc885b81ab
              name: 'Learners{#SINGLETON}'
              type: DEPENDENT
              key: 'zookeeper.learners[{#SINGLETON}]'
              description: 'Number of learners.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.learners
              master_item:
                key: zookeeper.get_metrics
              tags:
                - tag: component
                  value: cluster
            - uuid: c6ae1476b69f43108f843508a02343a7
              name: 'Pending syncs{#SINGLETON}'
              type: DEPENDENT
              key: 'zookeeper.pending_syncs[{#SINGLETON}]'
              description: 'Number of pending syncs to carry out to ZooKeeper ensemble followers.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.pending_syncs
              master_item:
                key: zookeeper.get_metrics
              tags:
                - tag: component
                  value: operations
              trigger_prototypes:
                - uuid: 004e26cca4934d1992b3c894f36b5643
                  expression: 'min(/Zookeeper by HTTP/zookeeper.pending_syncs[{#SINGLETON}],5m)>{$ZOOKEEPER.PENDING_SYNCS.MAX.WARN}'
                  name: 'Zookeeper: Too many pending syncs'
                  event_name: 'Zookeeper: Too many pending syncs (over {$ZOOKEEPER.PENDING_SYNCS.MAX.WARN}% for 5 min)'
                  priority: AVERAGE
                  manual_close: 'YES'
                  tags:
                    - tag: scope
                      value: performance
            - uuid: d5297a5598e94ef5acb1f6affdf51eee
              name: 'Quorum size{#SINGLETON}'
              type: DEPENDENT
              key: 'zookeeper.quorum_size[{#SINGLETON}]'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.quorum_size
              master_item:
                key: zookeeper.get_metrics
              tags:
                - tag: component
                  value: cluster
            - uuid: 406d13a8d38a47498e939a118ec0329a
              name: 'Synced followers{#SINGLETON}'
              type: DEPENDENT
              key: 'zookeeper.synced_followers[{#SINGLETON}]'
              description: 'Number of synced followers reported when a node server_state is leader.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.synced_followers
              master_item:
                key: zookeeper.get_metrics
              tags:
                - tag: component
                  value: cluster
            - uuid: 71c9de2ed85d4a5fb2306b24b9ca67d3
              name: 'Synced non-voting follower{#SINGLETON}'
              type: DEPENDENT
              key: 'zookeeper.synced_non_voting_followers[{#SINGLETON}]'
              description: 'Number of synced voting followers reported when a node server_state is leader.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.synced_non_voting_followers
              master_item:
                key: zookeeper.get_metrics
              tags:
                - tag: component
                  value: cluster
            - uuid: 299da1a6343b47a4a25efe2d8581965e
              name: 'Synced observers{#SINGLETON}'
              type: DEPENDENT
              key: 'zookeeper.synced_observers[{#SINGLETON}]'
              description: 'Number of synced observers.'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - $.synced_observers
              master_item:
                key: zookeeper.get_metrics
              tags:
                - tag: component
                  value: cluster
          trigger_prototypes:
            - uuid: 4b0df830eef84e78a04a6980b627b8d0
              expression: 'last(/Zookeeper by HTTP/zookeeper.synced_followers[{#SINGLETON}]) < last(/Zookeeper by HTTP/zookeeper.quorum_size[{#SINGLETON}])-1'
              name: 'Zookeeper: Too few active followers'
              priority: AVERAGE
              description: 'The number of followers should equal the total size of your ZooKeeper ensemble, minus 1 (the leader is not included in the follower count). If the ensemble fails to maintain quorum, all automatic failover features are suspended.'
              tags:
                - tag: scope
                  value: availability
          master_item:
            key: zookeeper.get_metrics
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.server_state
            - type: JAVASCRIPT
              parameters:
                - 'return JSON.stringify(value == ''leader'' ? [{''{#SINGLETON}'': ''''}] : []);'
      tags:
        - tag: class
          value: software
        - tag: target
          value: zookeeper
      macros:
        - macro: '{$ZOOKEEPER.COMMAND_URL}'
          value: commands
          description: 'The URL for listing and issuing commands relative to the root URL (admin.commandURL).'
          config:
            type: TEXT
            priority: '3'
            label: 'Command URL'
            description: 'The URL for listing and issuing commands relative to the root URL (admin.commandURL).'
        - macro: '{$ZOOKEEPER.FILE_DESCRIPTORS.MAX.WARN}'
          value: '85'
          description: 'Maximum percentage of file descriptors usage alert threshold (for trigger expression).'
          config:
            type: TEXT
            priority: '5'
            section_name: Thresholds
            label: 'Max file descriptors usage (%)'
            description: 'Maximum percentage of file descriptors usage alert threshold (for trigger expression). In the range from 0 to 100 inclusive.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$ZOOKEEPER.HOST}'
          value: '<SET ZOOKEEPER HOST>'
          description: 'The hostname or IP address of the Apache Zookeeper host.'
          config:
            type: TEXT
            priority: '1'
            label: Address
            description: 'The hostname or IP address of the Apache Zookeeper host.'
        - macro: '{$ZOOKEEPER.OUTSTANDING_REQ.MAX.WARN}'
          value: '10'
          description: 'Maximum number of outstanding requests (for trigger expression).'
          config:
            type: TEXT
            priority: '6'
            section_name: Thresholds
            label: 'Max outstanding requests'
            description: 'Maximum number of outstanding requests (for trigger expression).'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$ZOOKEEPER.PENDING_SYNCS.MAX.WARN}'
          value: '10'
          description: 'Maximum number of pending syncs from the followers (for trigger expression).'
          config:
            type: TEXT
            priority: '7'
            section_name: Thresholds
            label: 'Max pending syncs from followers'
            description: 'Maximum number of pending syncs from the followers (for trigger expression).'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$ZOOKEEPER.PORT}'
          value: '8080'
          description: 'The port the embedded Jetty server listens on (admin.serverPort).'
          config:
            type: TEXT
            priority: '2'
            label: Port
            description: 'The port the embedded Jetty server listens on (admin.serverPort). In the range from 1 to 65535 inclusive.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$ZOOKEEPER.SCHEME}'
          value: http
          description: 'Request scheme which may be http or https'
          config:
            type: LIST
            priority: '4'
            label: Scheme
            description: 'Request scheme which may be http or https'
            options:
              - value: http
                text: http
              - value: https
                text: https
      dashboards:
        - uuid: 3c684a537ed74a0884ae663b97b23a9c
          name: 'Zookeeper: Overview'
          pages:
            - name: Main
              widgets:
                - type: item
                  name: Mode
                  width: '12'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Zookeeper by HTTP'
                        key: zookeeper.server_state
                    - type: INTEGER
                      name: show.0
                      value: '2'
                - type: graph
                  'y': '2'
                  width: '36'
                  height: '5'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Zookeeper by HTTP'
                        name: 'Zookeeper: Nodes'
                    - type: STRING
                      name: reference
                      value: AAAAA
                - type: graph
                  'y': '7'
                  width: '36'
                  height: '5'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Zookeeper by HTTP'
                        name: 'Zookeeper: Latency'
                    - type: STRING
                      name: reference
                      value: AAAAC
                - type: item
                  name: Uptime
                  x: '12'
                  width: '12'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Zookeeper by HTTP'
                        key: zookeeper.uptime
                    - type: INTEGER
                      name: show.0
                      value: '4'
                    - type: INTEGER
                      name: show.1
                      value: '2'
                - type: item
                  name: Version
                  x: '24'
                  width: '12'
                  fields:
                    - type: ITEM
                      name: itemid.0
                      value:
                        host: 'Zookeeper by HTTP'
                        key: zookeeper.version
                    - type: INTEGER
                      name: show.0
                      value: '2'
                - type: graph
                  x: '36'
                  'y': '2'
                  width: '36'
                  height: '5'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Zookeeper by HTTP'
                        name: 'Zookeeper: Packets'
                    - type: STRING
                      name: reference
                      value: AAAAB
                - type: graph
                  x: '36'
                  'y': '7'
                  width: '36'
                  height: '5'
                  fields:
                    - type: GRAPH
                      name: graphid.0
                      value:
                        host: 'Zookeeper by HTTP'
                        name: 'Zookeeper: File descriptors usage'
                    - type: STRING
                      name: reference
                      value: AAAAD
            - name: Clients
              widgets:
                - type: graphprototype
                  width: '36'
                  height: '15'
                  fields:
                    - type: INTEGER
                      name: columns
                      value: '1'
                    - type: GRAPH_PROTOTYPE
                      name: graphid.0
                      value:
                        host: 'Zookeeper by HTTP'
                        name: 'Zookeeper client {#TYPE} [{#CLIENT}]: Latency'
                    - type: STRING
                      name: reference
                      value: AAAAE
                    - type: INTEGER
                      name: rows
                      value: '3'
                - type: graphprototype
                  x: '36'
                  width: '36'
                  height: '15'
                  fields:
                    - type: INTEGER
                      name: columns
                      value: '1'
                    - type: GRAPH_PROTOTYPE
                      name: graphid.0
                      value:
                        host: 'Zookeeper by HTTP'
                        name: 'Zookeeper client {#TYPE} [{#CLIENT}]: Packets'
                    - type: STRING
                      name: reference
                      value: AAAAF
                    - type: INTEGER
                      name: rows
                      value: '3'
    - uuid: 3a71dcdcfe0b4a0e8284d8939d335cce
      template: 'ZYXEL AAM1212-51 IES-612 by SNMP'
      name: 'ZYXEL AAM1212-51 IES-612 by SNMP'
      description: |
        ZYXEL AAM1212-51 / IES-612
        
        MIBs used:
        RFC1213-MIB
        HOST-RESOURCES-MIB
        ADSL-LINE-MIB
        ZYXEL-IESCOMMON-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 AAM1212-51 / IES-612
        
        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"
      wizard_ready: 'YES'
      readme: |
        ## Overview
        
        http://origin-eu.zyxel.com/products_services/ies_1248_51v.shtml?t=p
        
        ### 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 AAM1212-51 / IES-612
      vendor:
        name: Zabbix
        version: 8.0-2
      groups:
        - name: 'Templates/Network devices'
      items:
        - uuid: 5b6932995b634a5792d3948ba79312e5
          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: 40839f3008b84e3c9ffa8858bd2ab616
              expression: 'max(/ZYXEL AAM1212-51 IES-612 by SNMP/zabbix[host,snmp,available],{$SNMP.TIMEOUT})=0'
              name: 'ZYXEL: 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: 9b04315c5e9a41eea5f50623c83f21d0
          name: Contact
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.2.1.1.4.0]'
          key: zyxel.aam1212.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: 6b29fd2b27fe4788bef1e4072430d5bd
          name: 'ZyNOS F/W Version'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.890.1.5.13.1.1.3.1.4.0.0]'
          key: zyxel.aam1212.fwversion
          delay: 1h
          value_type: CHAR
          description: 'MIB: ZYXEL-IESCOMMON-MIB'
          inventory_link: SOFTWARE_FULL
          preprocessing:
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 6h
          tags:
            - tag: component
              value: inventory
          triggers:
            - uuid: 02ba3941993f48ca8d5f40b3b19804e8
              expression: 'last(/ZYXEL AAM1212-51 IES-612 by SNMP/zyxel.aam1212.fwversion,#1)<>last(/ZYXEL AAM1212-51 IES-612 by SNMP/zyxel.aam1212.fwversion,#2) and length(last(/ZYXEL AAM1212-51 IES-612 by SNMP/zyxel.aam1212.fwversion))>0'
              name: 'ZYXEL: 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: 5197238bef51468c80e6a4180babee5b
          name: 'Uptime (hardware)'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.2.1.25.1.1.0]'
          key: zyxel.aam1212.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: ea699e392c154a79927a056ff050c59d
          name: Location
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.2.1.1.6.0]'
          key: zyxel.aam1212.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: d2cabaa6e083489b8b11e6a349ba1bc9
          name: 'MAC address'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.2.1.2.2.1.6.1]'
          key: zyxel.aam1212.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: 31840a6849f7437bbb77334128c9e90b
          name: 'Hardware model name'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.2.1.1.1.0]'
          key: zyxel.aam1212.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: 5a3f459afc4f42fb90849e98c7639a96
              expression: 'last(/ZYXEL AAM1212-51 IES-612 by SNMP/zyxel.aam1212.model)<>"AAM1212-51 / IES-612"'
              name: 'ZYXEL: Template does not match hardware'
              priority: INFO
              description: 'This template is for Zyxel AAM1212-51 / IES-612, but connected to {ITEM.VALUE}'
              tags:
                - tag: scope
                  value: notice
        - uuid: 59628c9211c444228b6d8d9ddb30af54
          name: 'Host name'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.2.1.1.5.0]'
          key: zyxel.aam1212.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: 6fe78b9b065243b8bcebf8f6c234f868
          name: 'Uptime (network)'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.2.1.1.3.0]'
          key: zyxel.aam1212.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: 33df8d594d7f4e4aa148927b117f30df
          name: 'Hardware serial number'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.890.1.5.13.1.1.2.1.3.0]'
          key: zyxel.aam1212.serialnumber
          delay: 1h
          value_type: CHAR
          description: |
            MIB: ZYXEL-IESCOMMON-MIB
            Serial number
          inventory_link: SERIALNO_A
          preprocessing:
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 6h
          tags:
            - tag: component
              value: inventory
          triggers:
            - uuid: 7528520bca7c4524b7451aeaca440cc5
              expression: 'last(/ZYXEL AAM1212-51 IES-612 by SNMP/zyxel.aam1212.serialnumber,#1)<>last(/ZYXEL AAM1212-51 IES-612 by SNMP/zyxel.aam1212.serialnumber,#2) and length(last(/ZYXEL AAM1212-51 IES-612 by SNMP/zyxel.aam1212.serialnumber))>0'
              name: 'ZYXEL: Device has been replaced'
              event_name: 'ZYXEL: 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
        - uuid: 4efb46536e8a43e78cd26ae90bd2ab83
          name: 'Alarm status'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.890.1.5.13.1.1.3.1.8.0.0]'
          key: zyxel.aam1212.slot.alarm
          value_type: CHAR
          description: |
            MIB: ZYXEL-IESCOMMON-MIB
            This variable indicates the alarm status of the module.
            It is a bit map represented a sum, therefore, it can represent
            multiple defects simultaneously. The moduleNoDefect should be set
            if and only if no other flag is set.
            The various bit positions are:
            1   moduleNoDefect
            2   moduleOverHeat
            3   moduleFanRpmLow
            4   moduleVoltageLow
            5   moduleThermalSensorFailure
            6   modulePullOut
            7   powerDC48VAFailure
            8   powerDC48VBFailure
            9   extAlarmInputTrigger
            10   moduleDown
            11   mscSwitchOverOK
            12   networkTopologyChange
            13   macSpoof
            14   cpuHigh
            15   memoryUsageHigh
            16   packetBufferUsageHigh
            17   loopguardOccurence
          preprocessing:
            - type: JAVASCRIPT
              parameters:
                - |
                  var valueArray = [
                  	'moduleNoDefect',
                  	'moduleOverHeat',
                  	'moduleFanRpmLow',
                  	'moduleVoltageLow',
                  	'moduleThermalSensorFailure',
                  	'modulePullOut',
                  	'powerDC48VAFailure',
                  	'powerDC48VBFailure',
                  	'extAlarmInputTrigger',
                  	'moduleDown',
                  	'mscSwitchOverOK',
                  	'networkTopologyChange',
                  	'macSpoof',
                  	'cpuHigh',
                  	'memoryUsageHigh',
                  	'packetBufferUsageHigh',
                  	'loopguardOccurence'
                  ];
                  var base2 = parseInt(value).toString(2);
                  var outArray = [];
                  for (var i = 0; i < base2.length; ++i) {
                  	if (base2[base2.length - 1 - i] === '1') outArray.push(valueArray[i]);
                  }
                  return outArray.join();
          tags:
            - tag: component
              value: line-card
            - tag: interface
              value: 'slot-{#ZYXEL.SLOT.ID}'
          triggers:
            - uuid: eec541b07a434770b2a3301825cc5e82
              expression: 'find(/ZYXEL AAM1212-51 IES-612 by SNMP/zyxel.aam1212.slot.alarm,,"like","moduleNoDefect")=0'
              name: 'ZYXEL: Port {#SNMPINDEX} alarm'
              priority: AVERAGE
              description: 'The slot reported an error.'
              tags:
                - tag: scope
                  value: notice
      discovery_rules:
        - uuid: c0fa2c901419420eaaa2a64e59fbad29
          name: 'ADSL interface discovery'
          type: SNMP_AGENT
          snmp_oid: 'discovery[{#ZYXEL.IF.NAME},1.3.6.1.2.1.2.2.1.2,{#ZYXEL.IF.LINKSTATUS},1.3.6.1.2.1.2.2.1.8]'
          key: zyxel.aam1212.net.adsl.discovery
          delay: 1h
          filter:
            evaltype: AND
            conditions:
              - macro: '{#ZYXEL.IF.LINKSTATUS}'
                value: '{$ZYXEL.LLD.FILTER.IF.LINKSTATUS.MATCHES}'
              - macro: '{#ZYXEL.IF.LINKSTATUS}'
                value: '{$ZYXEL.LLD.FILTER.IF.LINKSTATUS.NOT_MATCHES}'
                operator: NOT_MATCHES_REGEX
              - macro: '{#ZYXEL.IF.NAME}'
                value: adsl
          item_prototypes:
            - uuid: 8b8e4d329490481983d2a1b0209e18a1
              name: 'Port {#SNMPINDEX}: Administrative status'
              type: SNMP_AGENT
              snmp_oid: 'get[1.3.6.1.2.1.2.2.1.7.{#SNMPINDEX}]'
              key: 'zyxel.aam1212.net.adsl.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 AAM1212-51 / IES-612 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: 010b15528a8d498bb8f77db9c548bc8e
              name: 'Port {#SNMPINDEX}: ATUC attenuation'
              type: SNMP_AGENT
              snmp_oid: 'get[1.3.6.1.2.1.10.94.1.1.2.1.5.{#SNMPINDEX}]'
              key: 'zyxel.aam1212.net.adsl.atuc.atn[{#SNMPINDEX}]'
              value_type: FLOAT
              units: dB
              description: |
                MIB: ADSL-LINE-MIB
                Measured difference in the total power transmitted by
                the peer ATU and the total power received by this ATU.
                The Info Atuc fields show data acquired from the ATUC (ADSL Termination Unit - Central), in this case ZYXEL AAM1212-51 / IES-612, during negotiation/provisioning message interchanges.
              preprocessing:
                - type: MULTIPLIER
                  parameters:
                    - '0.1'
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              tags:
                - tag: component
                  value: network
                - tag: description
                  value: '{#ZYXEL.IF.NAME}'
                - tag: interface
                  value: '{#SNMPINDEX}'
              trigger_prototypes:
                - uuid: 0c78247a1003496abab584a526777a40
                  expression: 'min(/ZYXEL AAM1212-51 IES-612 by SNMP/zyxel.aam1212.net.adsl.atuc.atn[{#SNMPINDEX}],5m)>{$ZYXEL.ADSL.ATN.MAX}'
                  name: 'ZYXEL: High the DSL line attenuation in Port {#SNMPINDEX}'
                  event_name: 'ZYXEL: High the DSL line attenuation in Port {#SNMPINDEX} (>{$ZYXEL.ADSL.ATN.MAX}dB for 5m)'
                  priority: WARNING
                  description: 'The reductions in amplitude of the downstream and upstream DSL signals.'
                  tags:
                    - tag: scope
                      value: capacity
            - uuid: 382d9f2f9458423eb887b6fd28697c3a
              name: 'Port {#SNMPINDEX}: ATUC output power'
              type: SNMP_AGENT
              snmp_oid: 'get[1.3.6.1.2.1.10.94.1.1.2.1.7.{#SNMPINDEX}]'
              key: 'zyxel.aam1212.net.adsl.atuc.outpwr[{#SNMPINDEX}]'
              value_type: FLOAT
              units: dB
              description: |
                MIB: ADSL-LINE-MIB
                Measured total output power transmitted by this ATU.
                The Info Atuc fields show data acquired from the ATUC (ADSL Termination Unit - Central), in this case ZYXEL AAM1212-51 / IES-612, during negotiation/provisioning message interchanges.
              preprocessing:
                - type: MULTIPLIER
                  parameters:
                    - '0.1'
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              tags:
                - tag: component
                  value: network
                - tag: description
                  value: '{#ZYXEL.IF.NAME}'
                - tag: interface
                  value: '{#SNMPINDEX}'
            - uuid: a273e455881948a895eb60b453ce8f61
              name: 'Port {#SNMPINDEX}: ATUC noise margin'
              type: SNMP_AGENT
              snmp_oid: 'get[1.3.6.1.2.1.10.94.1.1.2.1.4.{#SNMPINDEX}]'
              key: 'zyxel.aam1212.net.adsl.atuc.snrmgn[{#SNMPINDEX}]'
              value_type: FLOAT
              units: dB
              description: |
                MIB: ADSL-LINE-MIB
                Noise Margin as seen by this ATU with respect to its
                received signal in tenth dB.
                The Info Atuc fields show data acquired from the ATUC (ADSL Termination Unit - Central), in this case ZYXEL AAM1212-51 / IES-612, during negotiation/provisioning message interchanges.
              preprocessing:
                - type: MULTIPLIER
                  parameters:
                    - '0.1'
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              tags:
                - tag: component
                  value: network
                - tag: description
                  value: '{#ZYXEL.IF.NAME}'
                - tag: interface
                  value: '{#SNMPINDEX}'
              trigger_prototypes:
                - uuid: 14cbae6c16c245b09ed46e0cc01a556c
                  expression: 'min(/ZYXEL AAM1212-51 IES-612 by SNMP/zyxel.aam1212.net.adsl.atuc.snrmgn[{#SNMPINDEX}],5m)<{$ZYXEL.ADSL.SNR.MIN}'
                  name: 'ZYXEL: Low the DSL line noise margins in Port {#SNMPINDEX}'
                  event_name: 'ZYXEL: Low the DSL line noise margins in Port {#SNMPINDEX} (<{$ZYXEL.ADSL.SNR.MIN}dB for 5m)'
                  priority: WARNING
                  description: 'Signal-to-noise margin (SNR Margin) which is the difference between the actual SNR and the SNR required to sync at a specific speed'
                  tags:
                    - tag: scope
                      value: capacity
            - uuid: 3bfa258832dd49cca9ced6d5d78252d1
              name: 'Port {#SNMPINDEX}: ATUR attenuation'
              type: SNMP_AGENT
              snmp_oid: 'get[1.3.6.1.2.1.10.94.1.1.3.1.5.{#SNMPINDEX}]'
              key: 'zyxel.aam1212.net.adsl.atur.atn[{#SNMPINDEX}]'
              value_type: FLOAT
              units: dB
              description: |
                MIB: ADSL-LINE-MIB
                Measured difference in the total power transmitted by
                the peer ATU and the total power received by this ATU.
                The Info Atur fields show data acquired from the ATUR (ADSL Termination Unit - Remote), in this case the subscriber's ADSL modem or router, during negotiation/provisioning message interchanges.
              preprocessing:
                - type: MULTIPLIER
                  parameters:
                    - '0.1'
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              tags:
                - tag: component
                  value: network
                - tag: description
                  value: '{#ZYXEL.IF.NAME}'
                - tag: interface
                  value: '{#SNMPINDEX}'
              trigger_prototypes:
                - uuid: e917c9a8d6bb4af3a40c6c5b41f90c22
                  expression: 'min(/ZYXEL AAM1212-51 IES-612 by SNMP/zyxel.aam1212.net.adsl.atur.atn[{#SNMPINDEX}],5m)>{$ZYXEL.ADSL.ATN.MAX}'
                  name: 'ZYXEL: High the DSL line attenuation in Port {#SNMPINDEX}'
                  event_name: 'ZYXEL: High the DSL line attenuation in Port {#SNMPINDEX} (>{$ZYXEL.ADSL.ATN.MAX}dB for 5m)'
                  priority: WARNING
                  description: 'The reductions in amplitude of the downstream and upstream DSL signals.'
                  tags:
                    - tag: scope
                      value: capacity
            - uuid: da2105dce83d4f619b69a9c8e5875bac
              name: 'Port {#SNMPINDEX}: ATUR output power'
              type: SNMP_AGENT
              snmp_oid: 'get[1.3.6.1.2.1.10.94.1.1.3.1.7.{#SNMPINDEX}]'
              key: 'zyxel.aam1212.net.adsl.atur.outpwr[{#SNMPINDEX}]'
              value_type: FLOAT
              units: dB
              description: |
                MIB: ADSL-LINE-MIB
                Measured total output power transmitted by this ATU.
                The Info Atur fields show data acquired from the ATUR (ADSL Termination Unit - Remote), in this case the subscriber's ADSL modem or router, during negotiation/provisioning message interchanges.
              preprocessing:
                - type: MULTIPLIER
                  parameters:
                    - '0.1'
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              tags:
                - tag: component
                  value: network
                - tag: description
                  value: '{#ZYXEL.IF.NAME}'
                - tag: interface
                  value: '{#SNMPINDEX}'
            - uuid: e59b98a685874f888557eb3d1c41a828
              name: 'Port {#SNMPINDEX}: ATUR noise margin'
              type: SNMP_AGENT
              snmp_oid: 'get[1.3.6.1.2.1.10.94.1.1.3.1.4.{#SNMPINDEX}]'
              key: 'zyxel.aam1212.net.adsl.atur.snrmgn[{#SNMPINDEX}]'
              value_type: FLOAT
              units: dB
              description: |
                MIB: ADSL-LINE-MIB
                Noise Margin as seen by this ATU with respect to its
                received signal in tenth dB.
                The Info Atur fields show data acquired from the ATUR (ADSL Termination Unit - Remote), in this case the subscriber's ADSL modem or router, during negotiation/provisioning message interchanges.
              preprocessing:
                - type: MULTIPLIER
                  parameters:
                    - '0.1'
                - type: DISCARD_UNCHANGED_HEARTBEAT
                  parameters:
                    - 1h
              tags:
                - tag: component
                  value: network
                - tag: description
                  value: '{#ZYXEL.IF.NAME}'
                - tag: interface
                  value: '{#SNMPINDEX}'
              trigger_prototypes:
                - uuid: 125b08332e2f409985cade88ab3842f1
                  expression: 'min(/ZYXEL AAM1212-51 IES-612 by SNMP/zyxel.aam1212.net.adsl.atur.snrmgn[{#SNMPINDEX}],5m)<{$ZYXEL.ADSL.SNR.MIN}'
                  name: 'ZYXEL: Low the DSL line noise margins in Port {#SNMPINDEX}'
                  event_name: 'ZYXEL: Low the DSL line noise margins in Port {#SNMPINDEX} (<{$ZYXEL.ADSL.SNR.MIN}dB for 5m)'
                  priority: WARNING
                  description: 'Signal-to-noise margin (SNR Margin) which is the difference between the actual SNR and the SNR required to sync at a specific speed'
                  tags:
                    - tag: scope
                      value: capacity
            - uuid: 70fa53318d354503b44b70696cb8ccd2
              name: 'Port {#SNMPINDEX}: Incoming traffic'
              type: SNMP_AGENT
              snmp_oid: 'get[1.3.6.1.2.1.2.2.1.10.{#SNMPINDEX}]'
              key: 'zyxel.aam1212.net.adsl.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: 53241d402d0f4b4ca826f9712ad1af69
              name: 'Port {#SNMPINDEX}: Interface name'
              type: SNMP_AGENT
              snmp_oid: 'get[1.3.6.1.2.1.2.2.1.2.{#SNMPINDEX}]'
              key: 'zyxel.aam1212.net.adsl.name[{#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: 53ff6ee2132a4503890c35919baa2fd8
              name: 'Port {#SNMPINDEX}: Operational status'
              type: SNMP_AGENT
              snmp_oid: 'get[1.3.6.1.2.1.2.2.1.8.{#SNMPINDEX}]'
              key: 'zyxel.aam1212.net.adsl.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 AAM1212-51 / IES-612 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: 956fc99c2c5341a2b29ba2f302cc0a3a
                  expression: 'last(/ZYXEL AAM1212-51 IES-612 by SNMP/zyxel.aam1212.net.adsl.operstatus[{#SNMPINDEX}])=2 and last(/ZYXEL AAM1212-51 IES-612 by SNMP/zyxel.aam1212.net.adsl.operstatus[{#SNMPINDEX}],#1)<>last(/ZYXEL AAM1212-51 IES-612 by SNMP/zyxel.aam1212.net.adsl.operstatus[{#SNMPINDEX}],#2)'
                  recovery_mode: RECOVERY_EXPRESSION
                  recovery_expression: 'last(/ZYXEL AAM1212-51 IES-612 by SNMP/zyxel.aam1212.net.adsl.operstatus[{#SNMPINDEX}])<>2'
                  name: 'ZYXEL: 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: 021b85f4efea4be9834e7959ed2471f5
              name: 'Port {#SNMPINDEX}: Outgoing traffic'
              type: SNMP_AGENT
              snmp_oid: 'get[1.3.6.1.2.1.2.2.1.16.{#SNMPINDEX}]'
              key: 'zyxel.aam1212.net.adsl.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}'
          graph_prototypes:
            - uuid: 09d34a6f9dd2499b8759e15301eefdb5
              name: 'ZYXEL AAM1212-51 / IES-612: ADSL port {#SNMPINDEX}: Traffic'
              graph_items:
                - color: 199C0D
                  item:
                    host: 'ZYXEL AAM1212-51 IES-612 by SNMP'
                    key: 'zyxel.aam1212.net.adsl.in.traffic[{#SNMPINDEX}]'
                - sortorder: '1'
                  color: F63100
                  item:
                    host: 'ZYXEL AAM1212-51 IES-612 by SNMP'
                    key: 'zyxel.aam1212.net.adsl.out.traffic[{#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: 8e327f4a888b417db390148e7a894d10
          name: 'Ethernet interface discovery'
          type: SNMP_AGENT
          snmp_oid: 'discovery[{#ZYXEL.IF.NAME},1.3.6.1.2.1.2.2.1.2,{#ZYXEL.IF.LINKSTATUS},1.3.6.1.2.1.2.2.1.8]'
          key: zyxel.aam1212.net.if.discovery
          delay: 1h
          filter:
            evaltype: AND
            conditions:
              - macro: '{#ZYXEL.IF.LINKSTATUS}'
                value: '{$ZYXEL.LLD.FILTER.IF.LINKSTATUS.MATCHES}'
              - macro: '{#ZYXEL.IF.LINKSTATUS}'
                value: '{$ZYXEL.LLD.FILTER.IF.LINKSTATUS.NOT_MATCHES}'
                operator: NOT_MATCHES_REGEX
              - macro: '{#ZYXEL.IF.NAME}'
                value: enet
          item_prototypes:
            - uuid: d68dd1f83f5f41f4b372cc0a2261f30e
              name: 'Port {#ZYXEL.IF.NAME}: Administrative status'
              type: SNMP_AGENT
              snmp_oid: 'get[1.3.6.1.2.1.2.2.1.7.{#SNMPINDEX}]'
              key: 'zyxel.aam1212.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 AAM1212-51 / IES-612 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: f5dd08da51664f1d82a16b0826cdb9ce
              name: 'Port {#ZYXEL.IF.NAME}: Incoming traffic'
              type: SNMP_AGENT
              snmp_oid: 'get[1.3.6.1.2.1.2.2.1.10.{#SNMPINDEX}]'
              key: 'zyxel.aam1212.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: e2a630669e924f069b98d11a32737411
              name: 'Port {#ZYXEL.IF.NAME}: Interface name'
              type: SNMP_AGENT
              snmp_oid: 'get[1.3.6.1.2.1.2.2.1.2.{#SNMPINDEX}]'
              key: 'zyxel.aam1212.net.if.name[{#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: 6232538bf48a4f12a1f85164dc95bcf8
              name: 'Port {#ZYXEL.IF.NAME}: Operational status'
              type: SNMP_AGENT
              snmp_oid: 'get[1.3.6.1.2.1.2.2.1.8.{#SNMPINDEX}]'
              key: 'zyxel.aam1212.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 AAM1212-51 / IES-612 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: 805f49836f794aad9ee00f66dd90ffc1
                  expression: 'last(/ZYXEL AAM1212-51 IES-612 by SNMP/zyxel.aam1212.net.if.operstatus[{#SNMPINDEX}])=2 and last(/ZYXEL AAM1212-51 IES-612 by SNMP/zyxel.aam1212.net.if.operstatus[{#SNMPINDEX}],#1)<>last(/ZYXEL AAM1212-51 IES-612 by SNMP/zyxel.aam1212.net.if.operstatus[{#SNMPINDEX}],#2)'
                  recovery_mode: RECOVERY_EXPRESSION
                  recovery_expression: 'last(/ZYXEL AAM1212-51 IES-612 by SNMP/zyxel.aam1212.net.if.operstatus[{#SNMPINDEX}])<>2'
                  name: 'ZYXEL: Port {#ZYXEL.IF.NAME}: 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: d69676fc00e64c97afd7da416891b0ef
              name: 'Port {#ZYXEL.IF.NAME}: Outgoing traffic'
              type: SNMP_AGENT
              snmp_oid: 'get[1.3.6.1.2.1.31.1.1.1.10.{#SNMPINDEX}]'
              key: 'zyxel.aam1212.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}'
          graph_prototypes:
            - uuid: 4f5b714c04a44fbb9a64399c831b2980
              name: 'ZYXEL AAM1212-51 / IES-612: Ethernet port {#SNMPINDEX}: Traffic'
              graph_items:
                - color: 199C0D
                  item:
                    host: 'ZYXEL AAM1212-51 IES-612 by SNMP'
                    key: 'zyxel.aam1212.net.if.in.traffic[{#SNMPINDEX}]'
                - sortorder: '1'
                  color: F63100
                  item:
                    host: 'ZYXEL AAM1212-51 IES-612 by SNMP'
                    key: 'zyxel.aam1212.net.if.out.traffic[{#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: 4bc61b4441a840a79bbd118a1d3cf66e
          name: 'Temperature discovery'
          type: SNMP_AGENT
          snmp_oid: 'discovery[{#ZYXEL.TEMP.ID},1.3.6.1.4.1.890.1.5.13.1.2.3.1.1,{#ZYXEL.TEMP.THRESH.HIGH},1.3.6.1.4.1.890.1.5.13.1.2.3.1.5]'
          key: zyxel.aam1212.temp.discovery
          delay: 1h
          description: 'An entry in tempTable.'
          item_prototypes:
            - uuid: 82045c5b71b04c62b7525db28f292ad2
              name: 'Temperature "{#ZYXEL.TEMP.ID}"'
              type: SNMP_AGENT
              snmp_oid: 'get[1.3.6.1.4.1.890.1.5.13.1.2.3.1.2.{#SNMPINDEX}]'
              key: 'zyxel.aam1212.temp[{#SNMPINDEX}]'
              units: '!°C'
              description: |
                MIB: ZYXEL-IESCOMMON-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: 321b2efb6e8e4117949b3644cc101ff2
                  expression: 'last(/ZYXEL AAM1212-51 IES-612 by SNMP/zyxel.aam1212.temp[{#SNMPINDEX}])>{#ZYXEL.TEMP.THRESH.HIGH}'
                  name: 'ZYXEL: 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: 00cd199f1e114fcbafbd3dd19c1b2f47
              name: 'ZYXEL AAM1212-51 / IES-612: "Temperature {#ZYXEL.TEMP.ID}'
              graph_items:
                - color: 199C0D
                  item:
                    host: 'ZYXEL AAM1212-51 IES-612 by SNMP'
                    key: 'zyxel.aam1212.temp[{#SNMPINDEX}]'
        - uuid: fbb48a267b7646a98246da0357a1ee95
          name: 'Voltage discovery'
          type: SNMP_AGENT
          snmp_oid: 'discovery[{#ZYXEL.VOLT.THRESH.LOW},1.3.6.1.4.1.890.1.5.13.1.2.2.1.6,{#ZYXEL.VOLT.NOMINAL},1.3.6.1.4.1.890.1.5.13.1.2.2.1.5]'
          key: zyxel.aam1212.volt.discovery
          delay: 1h
          description: 'An entry in voltageTable.'
          item_prototypes:
            - uuid: 9e73d63d1af2473599e17ab214f03b32
              name: 'Nominal "{#ZYXEL.VOLT.NOMINAL}"'
              type: SNMP_AGENT
              snmp_oid: 'get[1.3.6.1.4.1.890.1.5.13.1.2.2.1.2.{#SNMPINDEX}]'
              key: 'zyxel.aam1212.volt[{#SNMPINDEX}]'
              value_type: FLOAT
              units: V
              description: |
                MIB: ZYXEL-IESCOMMON-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: a7aa1ae207bb462bb23d3f2fca2c3533
                  expression: 'last(/ZYXEL AAM1212-51 IES-612 by SNMP/zyxel.aam1212.volt[{#SNMPINDEX}])<{#ZYXEL.VOLT.THRESH.LOW}'
                  name: 'ZYXEL: 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: afdd9501f85c4c9f9a81b8f16968990b
              name: 'ZYXEL AAM1212-51 / IES-612: Nominal "{#ZYXEL.VOLT.NOMINAL}"'
              graph_items:
                - color: 199C0D
                  item:
                    host: 'ZYXEL AAM1212-51 IES-612 by SNMP'
                    key: 'zyxel.aam1212.volt[{#SNMPINDEX}]'
          preprocessing:
            - type: JAVASCRIPT
              parameters:
                - |
                  var inArray = JSON.parse(value);
                  var outArr = []
                  inArray.forEach(function (item, i, arr) {
                  	item['{#ZYXEL.SLOT.ID}'] = item['{#SNMPINDEX}'].split('.')[1];
                  	item['{#ZYXEL.SENSOR.ID}'] = item['{#SNMPINDEX}'].split('.')[2];
                  	item["{#ZYXEL.VOLT.NOMINAL}"] = "+" + item["{#ZYXEL.VOLT.NOMINAL}"] / 1000 + "V";
                  	item["{#ZYXEL.VOLT.THRESH.LOW}"] /= 1000;
                  	item["{#ZYXEL.VOLT.THRESH.HIGH}"] /= 1000;
                  	outArr.push(item)
                  });
                  return JSON.stringify(outArr);
      tags:
        - tag: class
          value: network
        - tag: target
          value: aam1212-51
        - tag: target
          value: dslam
        - tag: target
          value: zyxel
      macros:
        - macro: '{$SNMP.TIMEOUT}'
          value: 5m
          description: 'The time interval for SNMP agent availability trigger expression.'
          config:
            type: TEXT
            priority: '2'
            section_name: Other
            label: 'Time interval'
            description: 'The time interval for SNMP agent availability trigger expression.'
        - macro: '{$ZYXEL.ADSL.ATN.MAX}'
          value: '40'
          description: 'Type the maximum signal attenuation'
          config:
            type: TEXT
            priority: '4'
            section_name: Thresholds
            label: 'Max signal attenuation'
            description: 'Type the maximum signal attenuation'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$ZYXEL.ADSL.SNR.MIN}'
          value: '8'
          description: 'Type the minimum signal to noise margin (0-31 dB)'
          config:
            type: TEXT
            priority: '3'
            section_name: Thresholds
            label: 'Min signal-to-noise margin (dB)'
            description: 'Type the minimum signal to noise margin (0-31 dB)'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - 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'
          config:
            type: TEXT
            priority: '1'
            section_name: Filters
            label: 'Filter for interface control (include)'
            description: 'Triggers will be created only for interfaces whose description contains the value of this macro'
        - macro: '{$ZYXEL.LLD.FILTER.IF.LINKSTATUS.MATCHES}'
          value: '.*'
          description: 'Filter of discoverable link types.'
          config:
            type: TEXT
            priority: '5'
            section_name: Filters
            label: 'Link type filter (include)'
            description: 'Filter of discoverable link types.'
        - macro: '{$ZYXEL.LLD.FILTER.IF.LINKSTATUS.NOT_MATCHES}'
          value: '2'
          description: 'Filter to exclude discovered by link types.'
          config:
            type: TEXT
            priority: '6'
            section_name: Filters
            label: 'Link type filter (exclude)'
            description: 'Filter to exclude discovered by link types.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
      dashboards:
        - uuid: 82c428eb915e45f3af759b9d9f44d90e
          name: 'Network interfaces'
          pages:
            - widgets:
                - type: graphprototype
                  width: '72'
                  height: '10'
                  fields:
                    - type: INTEGER
                      name: columns
                      value: '1'
                    - type: GRAPH_PROTOTYPE
                      name: graphid.0
                      value:
                        host: 'ZYXEL AAM1212-51 IES-612 by SNMP'
                        name: 'ZYXEL AAM1212-51 / IES-612: Ethernet port {#SNMPINDEX}: Traffic'
                    - type: STRING
                      name: reference
                      value: AAAAA
                    - type: INTEGER
                      name: rows
                      value: '4'
      valuemaps:
        - uuid: 2b7c7c3eecb743e8a30ab3adc74ffd06
          name: 'SNMP available'
          mappings:
            - value: '0'
              newvalue: 'not available'
            - value: '1'
              newvalue: available
            - value: '2'
              newvalue: unknown
        - uuid: db7f61bebcac452c8081b2c58d1013d8
          name: 'ZYXEL AAM1212-51 / IES-612 port admin status'
          mappings:
            - value: '1'
              newvalue: Up
            - value: '2'
              newvalue: Down
            - value: '3'
              newvalue: Testing
        - uuid: 6c2a29dac43340399990340fe26a7a72
          name: 'ZYXEL AAM1212-51 / IES-612 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: 73f123bb9ffe4587a0269c7e8752b2ed
      template: 'ZYXEL GS-4012F by SNMP'
      name: 'ZYXEL GS-4012F by SNMP'
      description: |
        ZYXEL GS-4012F
        
        MIBs used:
        ZYXEL-GS4012F-MIB
        RFC1213-MIB
        HOST-RESOURCES-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 GS-4012F
        
        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"
      wizard_ready: 'YES'
      readme: |
        ## Overview
        
        https://service-provider.zyxel.com/global/en/products/carrier-and-access-switches/access-switches/mgs-3712f
        
        ### 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 GS-4012F
      vendor:
        name: Zabbix
        version: 8.0-2
      groups:
        - name: 'Templates/Network devices'
      items:
        - uuid: 2839fec9602a4162bb0acfb1be89fd57
          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: 07b74d3face24c838c7efe8dfb87564e
              expression: 'max(/ZYXEL GS-4012F by SNMP/zabbix[host,snmp,available],{$SNMP.TIMEOUT})=0'
              name: 'ZYXEL: 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: 831444715edf4a12baf6a5727ba9276c
          name: Contact
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.2.1.1.4.0]'
          key: zyxel.4012f.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: e2a6ce044f6d40bebb50927cc70bd593
          name: 'CPU utilization'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.890.1.5.8.20.12.7.0]'
          key: zyxel.4012f.cpuusage
          value_type: FLOAT
          units: '%'
          description: |
            MIB: ZYXEL-GS4012F-MIB
            Show device CPU load in %, it's the snapshot of CPU load when
            getting the values.
          tags:
            - tag: component
              value: cpu
          triggers:
            - uuid: 2052d9e6becd48e5a3aed8037eaf9e87
              expression: 'min(/ZYXEL GS-4012F by SNMP/zyxel.4012f.cpuusage,5m)>{$CPU.UTIL.CRIT}'
              name: 'ZYXEL: High CPU utilization'
              event_name: 'ZYXEL: 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: adb85140eb8c4b6489078dc79bd61a87
          name: 'ZyNOS F/W Version'
          type: SNMP_AGENT
          snmp_oid: 'discovery[{#SNMP.ARRAY},1.3.6.1.4.1.890.1.5.8.20.1]'
          key: zyxel.4012f.fwversion
          delay: 1h
          value_type: CHAR
          description: 'MIB: ZYXEL-GS4012F-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: ecde6db248674039a30874f29e704e65
              expression: 'last(/ZYXEL GS-4012F by SNMP/zyxel.4012f.fwversion,#1)<>last(/ZYXEL GS-4012F by SNMP/zyxel.4012f.fwversion,#2) and length(last(/ZYXEL GS-4012F by SNMP/zyxel.4012f.fwversion))>0'
              name: 'ZYXEL: 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: 1f979fc1f31c4766949cfc343d3c231a
          name: 'Uptime (hardware)'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.2.1.25.1.1.0]'
          key: zyxel.4012f.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: f55214647bab4544adb7d9a63e8be69d
          name: Location
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.2.1.1.6.0]'
          key: zyxel.4012f.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: 770d70d2ebcb4978b6c6fae0692ab77f
          name: 'MAC address'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.2.1.2.2.1.6.1]'
          key: zyxel.4012f.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: 25c5e9b3d34f4bb8805e2a6c43934f51
          name: 'Hardware model name'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.2.1.1.1.0]'
          key: zyxel.4012f.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: 1ba1faabe15c4d46adaa4dc74c5dc05c
              expression: 'last(/ZYXEL GS-4012F by SNMP/zyxel.4012f.model)<>"GS-4012F"'
              name: 'ZYXEL: Template does not match hardware'
              priority: INFO
              description: 'This template is for Zyxel GS-4012F, but connected to {ITEM.VALUE}'
              tags:
                - tag: scope
                  value: notice
        - uuid: 38fb81dca1db49bc83343ba197bfe980
          name: 'Host name'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.2.1.1.5.0]'
          key: zyxel.4012f.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: 1c14e77679fe4ee6b167036d8888867e
          name: 'Uptime (network)'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.2.1.1.3.0]'
          key: zyxel.4012f.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: 0080e896f1384245887a191d87496fa9
          name: 'Hardware serial number'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.890.1.5.8.20.1.10.0]'
          key: zyxel.4012f.serialnumber
          delay: 1h
          value_type: CHAR
          description: |
            MIB: ZYXEL-GS4012F-MIB
            Serial number
          inventory_link: SERIALNO_A
          preprocessing:
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 6h
          tags:
            - tag: component
              value: inventory
          triggers:
            - uuid: ae941404115d4b10809bce603528ceaa
              expression: 'last(/ZYXEL GS-4012F by SNMP/zyxel.4012f.serialnumber,#1)<>last(/ZYXEL GS-4012F by SNMP/zyxel.4012f.serialnumber,#2) and length(last(/ZYXEL GS-4012F by SNMP/zyxel.4012f.serialnumber))>0'
              name: 'ZYXEL: Device has been replaced'
              event_name: 'ZYXEL: 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: 344cd89247db49ba854ab6edb504086d
          name: 'Fan discovery'
          type: SNMP_AGENT
          snmp_oid: 'discovery[{#ZYXEL.FANRPM.THRESH.LOW},1.3.6.1.4.1.890.1.5.8.20.9.1.1.5]'
          key: zyxel.4012f.fan.discovery
          delay: 1h
          description: 'An entry in fanRpmTable.'
          item_prototypes:
            - uuid: 0f7fb278c896436c96fb1b5006ee4e06
              name: 'Fan #{#SNMPINDEX}'
              type: SNMP_AGENT
              snmp_oid: 'get[1.3.6.1.4.1.890.1.5.8.20.9.1.1.2.{#SNMPINDEX}]'
              key: 'zyxel.4012f.fan[{#SNMPINDEX}]'
              units: '!rpm'
              description: |
                MIB: ZYXEL-GS4012F-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: c91993daf9e44102a04b1ff2b72bf773
                  expression: 'last(/ZYXEL GS-4012F by SNMP/zyxel.4012f.fan[{#SNMPINDEX}])<{#ZYXEL.FANRPM.THRESH.LOW}'
                  name: 'ZYXEL: 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: 9c17e54a98324a9bb35c3a4234efe55f
              name: 'ZYXEL GS-4012F: Fan #{#SNMPINDEX}'
              graph_items:
                - color: 199C0D
                  item:
                    host: 'ZYXEL GS-4012F by SNMP'
                    key: 'zyxel.4012f.fan[{#SNMPINDEX}]'
        - uuid: 2f731cdb2e2943fbae17b6858859eb7a
          name: 'Interface discovery'
          type: SNMP_AGENT
          snmp_oid: 'discovery[{#ZYXEL.IF.NAME},1.3.6.1.4.1.890.1.5.8.20.23.1.1.3,{#ZYXEL.IF.LINKUPTYPE},1.3.6.1.4.1.890.1.5.8.20.23.1.1.5]'
          key: zyxel.4012f.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: 2b87dc4104704d3891ac061aaa81c629
              name: 'Port {#SNMPINDEX}: Administrative status'
              type: SNMP_AGENT
              snmp_oid: 'get[1.3.6.1.2.1.2.2.1.7.{#SNMPINDEX}]'
              key: 'zyxel.4012f.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 GS-4012F 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: 32abe2903d1c4652a74a44c5154f1451
              name: 'Port {#SNMPINDEX}: Interface name'
              type: SNMP_AGENT
              snmp_oid: 'get[1.3.6.1.2.1.2.2.1.2.{#SNMPINDEX}]'
              key: 'zyxel.4012f.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: 42040f2ca85e4f80bdc4bdc9d0ef5966
              name: 'Port {#SNMPINDEX}: Link speed'
              type: SNMP_AGENT
              snmp_oid: 'get[1.3.6.1.2.1.31.1.1.1.15.{#SNMPINDEX}]'
              key: 'zyxel.4012f.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: a71a364726524a6e9d00eb4098fa5faa
              name: 'Port {#SNMPINDEX}: Incoming broadcast packages'
              type: SNMP_AGENT
              snmp_oid: 'get[1.3.6.1.2.1.31.1.1.1.9.{#SNMPINDEX}]'
              key: 'zyxel.4012f.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: 8dda9a8e70bc44c5acca08284eb94bac
              name: 'Port {#SNMPINDEX}: Incoming multicast packages'
              type: SNMP_AGENT
              snmp_oid: 'get[1.3.6.1.2.1.31.1.1.1.8.{#SNMPINDEX}]'
              key: 'zyxel.4012f.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: 7240d04927a742dd93844c1fcc68dba0
              name: 'Port {#SNMPINDEX}: Incoming traffic'
              type: SNMP_AGENT
              snmp_oid: 'get[1.3.6.1.2.1.31.1.1.1.6.{#SNMPINDEX}]'
              key: 'zyxel.4012f.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: 4b7a80cf38d44dd9b270dcbc5c44ecfc
              name: 'Port {#SNMPINDEX}: Incoming unicast packages'
              type: SNMP_AGENT
              snmp_oid: 'get[1.3.6.1.2.1.31.1.1.1.7.{#SNMPINDEX}]'
              key: 'zyxel.4012f.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: 8c0eca407f47404a86d26c5fb1885f87
              name: 'Port {#SNMPINDEX}: Incoming utilization'
              type: CALCULATED
              key: 'zyxel.4012f.net.if.in.util[{#SNMPINDEX}]'
              value_type: FLOAT
              units: '%'
              params: 'last(//zyxel.4012f.net.if.in.traffic[{#SNMPINDEX}]) * (last(//zyxel.4012f.net.if.highspeed[{#SNMPINDEX}]) <> 0) / ( last(//zyxel.4012f.net.if.highspeed[{#SNMPINDEX}]) + (last(//zyxel.4012f.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: a63165d407e740c38cab55aefeccbca8
              name: 'Port {#SNMPINDEX}: Link type'
              type: SNMP_AGENT
              snmp_oid: 'get[1.3.6.1.4.1.890.1.5.8.20.23.1.1.5.{#SNMPINDEX}]'
              key: 'zyxel.4012f.net.if.link_type[{#SNMPINDEX}]'
              description: |
                MIB: ZYXEL-GS4012F-MIB
                Physical connection type
              valuemap:
                name: 'ZYXEL GS-4012F 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: 5c439eae60184abd8ec9b209cda19f8b
              name: 'Port {#SNMPINDEX}: Interface description'
              type: SNMP_AGENT
              snmp_oid: 'get[1.3.6.1.4.1.890.1.5.8.20.23.1.1.3.{#SNMPINDEX}]'
              key: 'zyxel.4012f.net.if.name[{#SNMPINDEX}]'
              value_type: CHAR
              description: |
                MIB: ZYXEL-GS4012F-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: 033b0e5b141b437c805b845f2e3f54a0
              name: 'Port {#SNMPINDEX}: Operational status'
              type: SNMP_AGENT
              snmp_oid: 'get[1.3.6.1.2.1.2.2.1.8.{#SNMPINDEX}]'
              key: 'zyxel.4012f.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 GS-4012F 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: 9c332411a6db46acaab2b49ccabd2970
                  expression: 'last(/ZYXEL GS-4012F by SNMP/zyxel.4012f.net.if.operstatus[{#SNMPINDEX}])=2 and last(/ZYXEL GS-4012F by SNMP/zyxel.4012f.net.if.operstatus[{#SNMPINDEX}],#1)<>last(/ZYXEL GS-4012F by SNMP/zyxel.4012f.net.if.operstatus[{#SNMPINDEX}],#2)'
                  recovery_mode: RECOVERY_EXPRESSION
                  recovery_expression: 'last(/ZYXEL GS-4012F by SNMP/zyxel.4012f.net.if.operstatus[{#SNMPINDEX}])<>2'
                  name: 'ZYXEL: 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: 0f3decaec17a4812aac826056cce9e8a
              name: 'Port {#SNMPINDEX}: Outgoing broadcast packages'
              type: SNMP_AGENT
              snmp_oid: 'get[1.3.6.1.2.1.31.1.1.1.13.{#SNMPINDEX}]'
              key: 'zyxel.4012f.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: 5ac33c29b537409cb6347548290e5ecc
              name: 'Port {#SNMPINDEX}: Outgoing multicast packages'
              type: SNMP_AGENT
              snmp_oid: 'get[1.3.6.1.2.1.31.1.1.1.12.{#SNMPINDEX}]'
              key: 'zyxel.4012f.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: 69ab1d86cd0347b49e2500a1d8e7e6a8
              name: 'Port {#SNMPINDEX}: Outgoing traffic'
              type: SNMP_AGENT
              snmp_oid: 'get[1.3.6.1.2.1.31.1.1.1.10.{#SNMPINDEX}]'
              key: 'zyxel.4012f.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: 870c54f85d57473c8b48ed896d5e2b2b
              name: 'Port {#SNMPINDEX}: Outgoing unicast packages'
              type: SNMP_AGENT
              snmp_oid: 'get[1.3.6.1.2.1.31.1.1.1.11.{#SNMPINDEX}]'
              key: 'zyxel.4012f.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: 98fffdb492a149b7b684e3867b113d37
              name: 'Port {#SNMPINDEX}: Outgoing utilization'
              type: CALCULATED
              key: 'zyxel.4012f.net.if.out.util[{#SNMPINDEX}]'
              value_type: FLOAT
              units: '%'
              params: 'last(//zyxel.4012f.net.if.out.traffic[{#SNMPINDEX}]) * (last(//zyxel.4012f.net.if.highspeed[{#SNMPINDEX}]) <> 0) / ( last(//zyxel.4012f.net.if.highspeed[{#SNMPINDEX}]) + (last(//zyxel.4012f.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: 64037c50f0344d02ae06690e91c7ead8
              name: 'Port {#SNMPINDEX}: Speed Duplex'
              type: SNMP_AGENT
              snmp_oid: 'get[1.3.6.1.4.1.890.1.5.8.20.23.1.1.1.{#SNMPINDEX}]'
              key: 'zyxel.4012f.net.if.speed_duplex[{#SNMPINDEX}]'
              description: |
                MIB: ZYXEL-GS4012F-MIB
                Transmission mode
              valuemap:
                name: 'ZYXEL GS-4012F 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: 1cad0c1a40a8472da2edee9cd889e6cf
              name: 'ZYXEL GS-4012F: Port {#SNMPINDEX}: Packets traffic'
              graph_items:
                - color: 199C0D
                  item:
                    host: 'ZYXEL GS-4012F by SNMP'
                    key: 'zyxel.4012f.net.if.in.ucastpkts[{#SNMPINDEX}]'
                - sortorder: '1'
                  color: F63100
                  item:
                    host: 'ZYXEL GS-4012F by SNMP'
                    key: 'zyxel.4012f.net.if.out.ucastpkts[{#SNMPINDEX}]'
                - sortorder: '2'
                  color: 00611C
                  item:
                    host: 'ZYXEL GS-4012F by SNMP'
                    key: 'zyxel.4012f.net.if.in.multicastpkts[{#SNMPINDEX}]'
                - sortorder: '3'
                  color: F7941D
                  item:
                    host: 'ZYXEL GS-4012F by SNMP'
                    key: 'zyxel.4012f.net.if.out.multicastpkts[{#SNMPINDEX}]'
                - sortorder: '4'
                  color: FC6EA3
                  item:
                    host: 'ZYXEL GS-4012F by SNMP'
                    key: 'zyxel.4012f.net.if.in.broadcastpkts[{#SNMPINDEX}]'
                - sortorder: '5'
                  color: 6C59DC
                  item:
                    host: 'ZYXEL GS-4012F by SNMP'
                    key: 'zyxel.4012f.net.if.out.broadcastpkts[{#SNMPINDEX}]'
            - uuid: ca2e18634f87486987251a2894eabaa0
              name: 'ZYXEL GS-4012F: Port {#SNMPINDEX}: Traffic'
              graph_items:
                - color: 199C0D
                  item:
                    host: 'ZYXEL GS-4012F by SNMP'
                    key: 'zyxel.4012f.net.if.in.traffic[{#SNMPINDEX}]'
                - sortorder: '1'
                  color: F63100
                  item:
                    host: 'ZYXEL GS-4012F by SNMP'
                    key: 'zyxel.4012f.net.if.out.traffic[{#SNMPINDEX}]'
            - uuid: 3223519ee24947c5a82b584fc3f2dd3d
              name: 'ZYXEL GS-4012F: Port {#SNMPINDEX}: Utilization'
              ymin_type_1: FIXED
              ymax_type_1: FIXED
              graph_items:
                - color: 199C0D
                  item:
                    host: 'ZYXEL GS-4012F by SNMP'
                    key: 'zyxel.4012f.net.if.out.util[{#SNMPINDEX}]'
                - sortorder: '1'
                  color: F63100
                  item:
                    host: 'ZYXEL GS-4012F by SNMP'
                    key: 'zyxel.4012f.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: de7fbcbcaa8a460d8048e7816ccc1a87
          name: 'Temperature discovery'
          type: SNMP_AGENT
          snmp_oid: 'discovery[{#ZYXEL.TEMP.THRESH.HIGH},1.3.6.1.4.1.890.1.5.8.20.9.2.1.5]'
          key: zyxel.4012f.temp.discovery
          delay: 1h
          description: |
            An entry in tempTable.
            Index of temperature unit. 1:MAC, 2:CPU, 3:PHY
          item_prototypes:
            - uuid: ee82e6f1916a4ce7b5cd77f0249cc2af
              name: 'Temperature "{#ZYXEL.TEMP.ID}"'
              type: SNMP_AGENT
              snmp_oid: 'get[1.3.6.1.4.1.890.1.5.8.20.9.2.1.2.{#SNMPINDEX}]'
              key: 'zyxel.4012f.temp[{#SNMPINDEX}]'
              units: '!°C'
              description: |
                MIB: ZYXEL-GS4012F-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: 719aad00708e4fd3b99997834c5d68b2
                  expression: 'last(/ZYXEL GS-4012F by SNMP/zyxel.4012f.temp[{#SNMPINDEX}])>{#ZYXEL.TEMP.THRESH.HIGH}'
                  name: 'ZYXEL: 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: f2dbed78c1d2440480cff0d1b243a546
              name: 'ZYXEL GS-4012F: Temperature "{#ZYXEL.TEMP.ID}"'
              graph_items:
                - color: 199C0D
                  item:
                    host: 'ZYXEL GS-4012F by SNMP'
                    key: 'zyxel.4012f.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: 88047112669f4d7eae81c8bb514ddecb
          name: 'Voltage discovery'
          type: SNMP_AGENT
          snmp_oid: 'discovery[{#ZYXEL.VOLT.THRESH.LOW},1.3.6.1.4.1.890.1.5.8.20.9.3.1.6,{#ZYXEL.VOLT.NOMINAL},1.3.6.1.4.1.890.1.5.8.20.9.3.1.5]'
          key: zyxel.4012f.volt.discovery
          delay: 1h
          description: 'An entry in voltageTable.'
          item_prototypes:
            - uuid: b5cb92c8d63a41158e7072b8ebf33ca1
              name: 'Nominal "{#ZYXEL.VOLT.NOMINAL}"'
              type: SNMP_AGENT
              snmp_oid: 'get[1.3.6.1.4.1.890.1.5.8.20.9.3.1.2.{#SNMPINDEX}]'
              key: 'zyxel.4012f.volt[{#SNMPINDEX}]'
              value_type: FLOAT
              units: V
              description: |
                MIB: ZYXEL-GS4012F-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: 7d28666404bd4cedb687214846f89d4a
                  expression: 'last(/ZYXEL GS-4012F by SNMP/zyxel.4012f.volt[{#SNMPINDEX}])<{#ZYXEL.VOLT.THRESH.LOW}'
                  name: 'ZYXEL: 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: 021bf935acc542d89a0a26120e995671
              name: 'ZYXEL GS-4012F: Nominal "{#ZYXEL.VOLT.NOMINAL}"'
              graph_items:
                - color: 199C0D
                  item:
                    host: 'ZYXEL GS-4012F by SNMP'
                    key: 'zyxel.4012f.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: gs-4012f
        - tag: target
          value: switch
        - tag: target
          value: zyxel
      macros:
        - macro: '{$CPU.UTIL.CRIT}'
          value: '90'
          config:
            type: TEXT
            priority: '3'
            section_name: Thresholds
            label: 'Threshold for CPU utilization (critical)'
            description: 'In the range from 0 to 100 inclusive.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$SNMP.TIMEOUT}'
          value: 5m
          description: 'The time interval for SNMP agent availability trigger expression.'
          config:
            type: TEXT
            priority: '2'
            section_name: Thresholds
            label: 'Time interval'
            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'
          config:
            type: TEXT
            priority: '1'
            section_name: Filters
            label: 'Filter for interface control (include)'
            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
          config:
            type: TEXT
            priority: '6'
            section_name: Filters
            label: 'Filter for interface link-up type (include)'
            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.'
          config:
            type: TEXT
            priority: '7'
            section_name: Filters
            label: 'Filter for interface link-up type (exclude)'
            description: 'Filter to exclude discovered by link types.'
        - macro: '{$ZYXEL.LLD.FILTER.IF.NAME.MATCHES}'
          value: '.*'
          description: 'Filter by discoverable interface names.'
          config:
            type: TEXT
            priority: '4'
            section_name: Filters
            label: 'Filter for interface name (include)'
            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.'
          config:
            type: TEXT
            priority: '5'
            section_name: Filters
            label: 'Filter for interface name (exclude)'
            description: 'Filter to exclude discovered interfaces by name.'
      dashboards:
        - uuid: b3135c2af7284dfdb15f37aea90d3ad0
          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 GS-4012F by SNMP'
                        name: 'ZYXEL GS-4012F: Port {#SNMPINDEX}: Traffic'
                    - type: STRING
                      name: reference
                      value: AAAAA
                    - type: INTEGER
                      name: rows
                      value: '5'
      valuemaps:
        - uuid: c6ba6086ed584ba0a4dd58ffe8564fbf
          name: 'SNMP available'
          mappings:
            - value: '0'
              newvalue: 'not available'
            - value: '1'
              newvalue: available
            - value: '2'
              newvalue: unknown
        - uuid: 82cce670bef64a47b326bb8b1a2f6cd8
          name: 'ZYXEL GS-4012F operational mode port link up type'
          mappings:
            - value: '0'
              newvalue: Down
            - value: '1'
              newvalue: Cooper
            - value: '2'
              newvalue: Fiber
        - uuid: d7d38cadffc240f9a01434546659d036
          name: 'ZYXEL GS-4012F 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: 7456d212b8f44f7da215fc86f39e3956
          name: 'ZYXEL GS-4012F port admin status'
          mappings:
            - value: '1'
              newvalue: Up
            - value: '2'
              newvalue: Down
            - value: '3'
              newvalue: Testing
        - uuid: afa699db0bfc4cfbb48729932967230e
          name: 'ZYXEL GS-4012F 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: 249de8d8d21e4dda9c3f766ab6201378
      template: 'ZYXEL MES-3528 by SNMP'
      name: 'ZYXEL MES-3528 by SNMP'
      description: |
        ZYXEL MES-3528
        
        MIBs used:
        RFC1213-MIB
        HOST-RESOURCES-MIB
        ZYXEL-MES3528-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 MES-3528
        
        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"
      wizard_ready: 'YES'
      readme: |
        ## Overview
        
        https://service-provider.zyxel.com/emea/en/products/carrier-and-access-switches/access-switches/mes3500-series
        
        ### 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 MES-3528
      vendor:
        name: Zabbix
        version: 8.0-2
      groups:
        - name: 'Templates/Network devices'
      items:
        - uuid: 836a8ccc430a4ede87906b9f9eef8471
          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: 0e38d148fc29439488b3b23ee308b1d9
              expression: 'max(/ZYXEL MES-3528 by SNMP/zabbix[host,snmp,available],{$SNMP.TIMEOUT})=0'
              name: 'ZYXEL: 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: 7f947ff733314b23be2cea634a1fba75
          name: Contact
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.2.1.1.4.0]'
          key: zyxel.3528.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: c7bd32a8835842d7b469f2323cc8a308
          name: 'CPU utilization'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.890.1.5.8.51.12.7.0]'
          key: zyxel.3528.cpuusage
          value_type: FLOAT
          units: '%'
          description: |
            MIB: ZYXEL-MES3528-MIB
            Show device CPU load in %, it's the snapshot of CPU load when
            getting the values.
          tags:
            - tag: component
              value: cpu
          triggers:
            - uuid: 247a25a4976a45eca78853aea112cdd6
              expression: 'min(/ZYXEL MES-3528 by SNMP/zyxel.3528.cpuusage,5m)>{$CPU.UTIL.CRIT}'
              name: 'ZYXEL: High CPU utilization'
              event_name: 'ZYXEL: 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: c650e217f92c4e2ca1ec94f391dfe706
          name: 'ZyNOS F/W Version'
          type: SNMP_AGENT
          snmp_oid: 'discovery[{#SNMP.ARRAY},1.3.6.1.4.1.890.1.5.8.51.1]'
          key: zyxel.3528.fwversion
          delay: 1h
          value_type: CHAR
          description: 'MIB: ZYXEL-MES3528-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: 7c4cfa75447a4eeda874d916d052eb6e
              expression: 'last(/ZYXEL MES-3528 by SNMP/zyxel.3528.fwversion,#1)<>last(/ZYXEL MES-3528 by SNMP/zyxel.3528.fwversion,#2) and length(last(/ZYXEL MES-3528 by SNMP/zyxel.3528.fwversion))>0'
              name: 'ZYXEL: 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: 9293989c2bd14bc4a12cdd40a9c7f229
          name: 'Uptime (hardware)'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.2.1.25.1.1.0]'
          key: zyxel.3528.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: 679445d352f14db4b5401efa5661447d
          name: Location
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.2.1.1.6.0]'
          key: zyxel.3528.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: 1b4f56edba2a486a9c48ccafaa10eb09
          name: 'MAC address'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.2.1.2.2.1.6.1]'
          key: zyxel.3528.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: 050fbf9b7c544678b79b37572984f698
          name: 'Hardware model name'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.2.1.1.1.0]'
          key: zyxel.3528.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: b98e244abe2a4bd481be50048234afe6
              expression: 'last(/ZYXEL MES-3528 by SNMP/zyxel.3528.model)<>"MES-3528"'
              name: 'ZYXEL: Template does not match hardware'
              priority: INFO
              description: 'This template is for Zyxel MES-3528, but connected to {ITEM.VALUE}'
              tags:
                - tag: scope
                  value: notice
        - uuid: 2411ebd40ee94b6285f4a6abf6127e04
          name: 'Host name'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.2.1.1.5.0]'
          key: zyxel.3528.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: 351295fe155543c18930541c20ccac58
          name: 'Uptime (network)'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.2.1.1.3.0]'
          key: zyxel.3528.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: ea25cf79e45f40398580afd48e0bb9c8
          name: 'Hardware serial number'
          type: SNMP_AGENT
          snmp_oid: 'get[1.3.6.1.4.1.890.1.5.8.51.1.10.0]'
          key: zyxel.3528.serialnumber
          delay: 1h
          value_type: CHAR
          description: |
            MIB: ZYXEL-MES3528-MIB
            Serial number
          inventory_link: SERIALNO_A
          preprocessing:
            - type: DISCARD_UNCHANGED_HEARTBEAT
              parameters:
                - 6h
          tags:
            - tag: component
              value: inventory
          triggers:
            - uuid: d08bc1ffb11e4bbc98851c30595e996c
              expression: 'last(/ZYXEL MES-3528 by SNMP/zyxel.3528.serialnumber,#1)<>last(/ZYXEL MES-3528 by SNMP/zyxel.3528.serialnumber,#2) and length(last(/ZYXEL MES-3528 by SNMP/zyxel.3528.serialnumber))>0'
              name: 'ZYXEL: Device has been replaced'
              event_name: 'ZYXEL: 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: ebe2a413217c4239805f3f592f551b7c
          name: 'Interface discovery'
          type: SNMP_AGENT
          snmp_oid: 'discovery[{#ZYXEL.IF.NAME},1.3.6.1.4.1.890.1.5.8.51.24.1.1.3,{#ZYXEL.IF.LINKUPTYPE},1.3.6.1.4.1.890.1.5.8.51.24.1.1.5]'
          key: zyxel.3528.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: 6dc0efb31738415a884d15020d9e30a9
              name: 'Port {#SNMPINDEX}: Administrative status'
              type: SNMP_AGENT
              snmp_oid: 'get[1.3.6.1.2.1.2.2.1.7.{#SNMPINDEX}]'
              key: 'zyxel.3528.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 MES-3528 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: e719364c125048e8a1fb6712e507863b
              name: 'Port {#SNMPINDEX}: Interface name'
              type: SNMP_AGENT
              snmp_oid: 'get[1.3.6.1.2.1.2.2.1.2.{#SNMPINDEX}]'
              key: 'zyxel.3528.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: b2225fa57c0d468b9b0a40b220d50639
              name: 'Port {#SNMPINDEX}: Link speed'
              type: SNMP_AGENT
              snmp_oid: 'get[1.3.6.1.2.1.31.1.1.1.15.{#SNMPINDEX}]'
              key: 'zyxel.3528.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: 9f1720f6286a4b038724563a32f97844
              name: 'Port {#SNMPINDEX}: Incoming broadcast packages'
              type: SNMP_AGENT
              snmp_oid: 'get[1.3.6.1.2.1.31.1.1.1.9.{#SNMPINDEX}]'
              key: 'zyxel.3528.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: 184f7cfcfe964ea9b2b310a666c77420
              name: 'Port {#SNMPINDEX}: Incoming multicast packages'
              type: SNMP_AGENT
              snmp_oid: 'get[1.3.6.1.2.1.31.1.1.1.8.{#SNMPINDEX}]'
              key: 'zyxel.3528.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: 41f4b8bb9e1c461e8ef834348589e468
              name: 'Port {#SNMPINDEX}: Incoming traffic'
              type: SNMP_AGENT
              snmp_oid: 'get[1.3.6.1.2.1.31.1.1.1.6.{#SNMPINDEX}]'
              key: 'zyxel.3528.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: 681460dffc9242fba072eacd503fd190
              name: 'Port {#SNMPINDEX}: Incoming unicast packages'
              type: SNMP_AGENT
              snmp_oid: 'get[1.3.6.1.2.1.31.1.1.1.7.{#SNMPINDEX}]'
              key: 'zyxel.3528.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: c2792996d52045c9ad4c955f6330264e
              name: 'Port {#SNMPINDEX}: Incoming utilization'
              type: CALCULATED
              key: 'zyxel.3528.net.if.in.util[{#SNMPINDEX}]'
              value_type: FLOAT
              units: '%'
              params: 'last(//zyxel.3528.net.if.in.traffic[{#SNMPINDEX}]) * (last(//zyxel.3528.net.if.highspeed[{#SNMPINDEX}]) <> 0) / ( last(//zyxel.3528.net.if.highspeed[{#SNMPINDEX}]) + (last(//zyxel.3528.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: 9a45866adc3043ad81c7778b4334b317
              name: 'Port {#SNMPINDEX}: Link type'
              type: SNMP_AGENT
              snmp_oid: 'get[1.3.6.1.4.1.890.1.5.8.51.24.1.1.5.{#SNMPINDEX}]'
              key: 'zyxel.3528.net.if.link_type[{#SNMPINDEX}]'
              description: |
                MIB:  ZYXEL-MES3528-MIB
                Physical connection type
              valuemap:
                name: 'ZYXEL MES-3528 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: 5a30094c57b54d89b1d61a73616e186e
              name: 'Port {#SNMPINDEX}: Interface description'
              type: SNMP_AGENT
              snmp_oid: 'get[1.3.6.1.4.1.890.1.5.8.51.24.1.1.3.{#SNMPINDEX}]'
              key: 'zyxel.3528.net.if.name[{#SNMPINDEX}]'
              value_type: CHAR
              description: |
                MIB:  ZYXEL-MES3528-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: 1ed72a56523b48e89b964f6c4afc8800
              name: 'Port {#SNMPINDEX}: Operational status'
              type: SNMP_AGENT
              snmp_oid: 'get[1.3.6.1.2.1.2.2.1.8.{#SNMPINDEX}]'
              key: 'zyxel.3528.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 MES-3528 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: c23272db35f44fe6958e3b5e31a52974
                  expression: 'last(/ZYXEL MES-3528 by SNMP/zyxel.3528.net.if.operstatus[{#SNMPINDEX}])=2 and last(/ZYXEL MES-3528 by SNMP/zyxel.3528.net.if.operstatus[{#SNMPINDEX}],#1)<>last(/ZYXEL MES-3528 by SNMP/zyxel.3528.net.if.operstatus[{#SNMPINDEX}],#2)'
                  recovery_mode: RECOVERY_EXPRESSION
                  recovery_expression: 'last(/ZYXEL MES-3528 by SNMP/zyxel.3528.net.if.operstatus[{#SNMPINDEX}])<>2'
                  name: 'ZYXEL: 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: 873ba4c47c1c4525b52d53e6d98e8b6e
              name: 'Port {#SNMPINDEX}: Outgoing broadcast packages'
              type: SNMP_AGENT
              snmp_oid: 'get[1.3.6.1.2.1.31.1.1.1.13.{#SNMPINDEX}]'
              key: 'zyxel.3528.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: 9dae4fa8d9c2494aa01478dc9605b066
              name: 'Port {#SNMPINDEX}: Outgoing multicast packages'
              type: SNMP_AGENT
              snmp_oid: 'get[1.3.6.1.2.1.31.1.1.1.12.{#SNMPINDEX}]'
              key: 'zyxel.3528.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: 63f92516450d4dbcbea481231caf89f6
              name: 'Port {#SNMPINDEX}: Outgoing traffic'
              type: SNMP_AGENT
              snmp_oid: 'get[1.3.6.1.2.1.31.1.1.1.10.{#SNMPINDEX}]'
              key: 'zyxel.3528.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: d7b17c5521a94b13b3ef6528fedcf5e0
              name: 'Port {#SNMPINDEX}: Outgoing unicast packages'
              type: SNMP_AGENT
              snmp_oid: 'get[1.3.6.1.2.1.31.1.1.1.11.{#SNMPINDEX}]'
              key: 'zyxel.3528.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: 3dd1d62e9cdb402b888b7ccbe3cbb182
              name: 'Port {#SNMPINDEX}: Outgoing utilization'
              type: CALCULATED
              key: 'zyxel.3528.net.if.out.util[{#SNMPINDEX}]'
              value_type: FLOAT
              units: '%'
              params: 'last(//zyxel.3528.net.if.out.traffic[{#SNMPINDEX}]) * (last(//zyxel.3528.net.if.highspeed[{#SNMPINDEX}]) <> 0) / ( last(//zyxel.3528.net.if.highspeed[{#SNMPINDEX}]) + (last(//zyxel.3528.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: 284e41a49397492590bbcf34e1881553
              name: 'Port {#SNMPINDEX}: Speed Duplex'
              type: SNMP_AGENT
              snmp_oid: 'get[1.3.6.1.4.1.890.1.5.8.51.24.1.1.1.{#SNMPINDEX}]'
              key: 'zyxel.3528.net.if.speed_duplex[{#SNMPINDEX}]'
              description: |
                MIB:  ZYXEL-MES3528-MIB
                Transmission mode
              valuemap:
                name: 'ZYXEL MES-3528 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: d021344604284e9ca127851ae1cb95ff
              name: 'ZYXEL MES-3528: Port {#SNMPINDEX}: Packets traffic'
              graph_items:
                - color: 199C0D
                  item:
                    host: 'ZYXEL MES-3528 by SNMP'
                    key: 'zyxel.3528.net.if.in.ucastpkts[{#SNMPINDEX}]'
                - sortorder: '1'
                  color: F63100
                  item:
                    host: 'ZYXEL MES-3528 by SNMP'
                    key: 'zyxel.3528.net.if.out.ucastpkts[{#SNMPINDEX}]'
                - sortorder: '2'
                  color: 00611C
                  item:
                    host: 'ZYXEL MES-3528 by SNMP'
                    key: 'zyxel.3528.net.if.in.multicastpkts[{#SNMPINDEX}]'
                - sortorder: '3'
                  color: F7941D
                  item:
                    host: 'ZYXEL MES-3528 by SNMP'
                    key: 'zyxel.3528.net.if.out.multicastpkts[{#SNMPINDEX}]'
                - sortorder: '4'
                  color: FC6EA3
                  item:
                    host: 'ZYXEL MES-3528 by SNMP'
                    key: 'zyxel.3528.net.if.in.broadcastpkts[{#SNMPINDEX}]'
                - sortorder: '5'
                  color: 6C59DC
                  item:
                    host: 'ZYXEL MES-3528 by SNMP'
                    key: 'zyxel.3528.net.if.out.broadcastpkts[{#SNMPINDEX}]'
            - uuid: 936c27e914044b0eb31f874995c0571c
              name: 'ZYXEL MES-3528: Port {#SNMPINDEX}: Traffic'
              graph_items:
                - color: 199C0D
                  item:
                    host: 'ZYXEL MES-3528 by SNMP'
                    key: 'zyxel.3528.net.if.in.traffic[{#SNMPINDEX}]'
                - sortorder: '1'
                  color: F63100
                  item:
                    host: 'ZYXEL MES-3528 by SNMP'
                    key: 'zyxel.3528.net.if.out.traffic[{#SNMPINDEX}]'
            - uuid: f50ceeef9c6446a685127383176fe811
              name: 'ZYXEL MES-3528: Port {#SNMPINDEX}: Utilization'
              ymin_type_1: FIXED
              ymax_type_1: FIXED
              graph_items:
                - color: 199C0D
                  item:
                    host: 'ZYXEL MES-3528 by SNMP'
                    key: 'zyxel.3528.net.if.out.util[{#SNMPINDEX}]'
                - sortorder: '1'
                  color: F63100
                  item:
                    host: 'ZYXEL MES-3528 by SNMP'
                    key: 'zyxel.3528.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: a4850c41f31a4bdfa3506c2ef3077d88
          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.51.117.2.1.5,{#ZYXEL.SFP.WARN.MIN},1.3.6.1.4.1.890.1.5.8.51.117.2.1.6,{#ZYXEL.SFP.DESCRIPTION},1.3.6.1.4.1.890.1.5.8.51.117.2.1.8]'
          key: zyxel.3528.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: 732084ce0daf4e8085c43e16982e4aba
              name: 'SFP {#ZYXEL.SFP.PORT}: {#ZYXEL.SFP.DESCRIPTION}'
              type: SNMP_AGENT
              snmp_oid: 'get[1.3.6.1.4.1.890.1.5.8.51.117.2.1.7.{#SNMPINDEX}]'
              key: 'zyxel.3528.sfp.ddm[{#SNMPINDEX}]'
              delay: '{$ZYXEL.LLD.SFP.UPDATE}'
              value_type: FLOAT
              units: '!{#ZYXEL.SFP.UNIT}'
              description: |
                MIB: ZYXEL-MES3528-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: f9e2991ea38343c8b2c9815bf733aef8
                  expression: 'last(/ZYXEL MES-3528 by SNMP/zyxel.3528.sfp.ddm[{#SNMPINDEX}]) > {#ZYXEL.SFP.WARN.MAX}'
                  name: 'ZYXEL: SFP {#ZYXEL.SFP.PORT}: High {#ZYXEL.SFP.DESCRIPTION}'
                  event_name: 'ZYXEL: 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: 341bff907cd943219bbed92773d9b005
                  expression: 'last(/ZYXEL MES-3528 by SNMP/zyxel.3528.sfp.ddm[{#SNMPINDEX}]) < {#ZYXEL.SFP.WARN.MIN}'
                  name: 'ZYXEL: SFP {#ZYXEL.SFP.PORT}: Low {#ZYXEL.SFP.DESCRIPTION}'
                  event_name: 'ZYXEL: 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: ed8f780aa61845309aebfa522e3e9f3d
              name: 'ZYXEL MES-3528: SFP {#ZYXEL.SFP.PORT}: {#ZYXEL.SFP.DESCRIPTION}'
              graph_items:
                - color: 199C0D
                  item:
                    host: 'ZYXEL MES-3528 by SNMP'
                    key: 'zyxel.3528.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: 0c1fabd98e134f9dab698bb0794afa93
          name: 'SFP without DDM discovery'
          type: SNMP_AGENT
          snmp_oid: 'discovery[{#ZYXEL.SFP.STATUS},1.3.6.1.4.1.890.1.5.8.51.117.1.1.2]'
          key: zyxel.3528.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: 2d09724ecd8147d298ae2a2486921ccb
              name: 'SFP {#SNMPINDEX}: Date code'
              type: SNMP_AGENT
              snmp_oid: 'get[1.3.6.1.4.1.890.1.5.8.51.117.1.1.7.{#SNMPINDEX}]'
              key: 'zyxel.3528.sfp.datecode[{#SNMPINDEX}]'
              delay: '{$ZYXEL.LLD.SFP.UPDATE}'
              value_type: CHAR
              description: |
                MIB: ZYXEL-MES3528-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: 9d9e08755fa444efb408d3db30843098
              name: 'SFP {#SNMPINDEX}: Part number'
              type: SNMP_AGENT
              snmp_oid: 'get[1.3.6.1.4.1.890.1.5.8.51.117.1.1.4.{#SNMPINDEX}]'
              key: 'zyxel.3528.sfp.part[{#SNMPINDEX}]'
              delay: '{$ZYXEL.LLD.SFP.UPDATE}'
              value_type: CHAR
              description: |
                MIB: ZYXEL-MES3528-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: 90952405b1504eabb6e5436eaa179f5a
              name: 'SFP {#SNMPINDEX}: Revision'
              type: SNMP_AGENT
              snmp_oid: 'get[1.3.6.1.4.1.890.1.5.8.51.117.1.1.6.{#SNMPINDEX}]'
              key: 'zyxel.3528.sfp.revision[{#SNMPINDEX}]'
              delay: '{$ZYXEL.LLD.SFP.UPDATE}'
              value_type: CHAR
              description: |
                MIB: ZYXEL-MES3528-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: 83d084e9a0554e8eae31b0bd38aefe72
              name: 'SFP {#SNMPINDEX}: Serial number'
              type: SNMP_AGENT
              snmp_oid: 'get[1.3.6.1.4.1.890.1.5.8.51.117.1.1.5.{#SNMPINDEX}]'
              key: 'zyxel.3528.sfp.serialnumber[{#SNMPINDEX}]'
              delay: '{$ZYXEL.LLD.SFP.UPDATE}'
              value_type: CHAR
              description: |
                MIB: ZYXEL-MES3528-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: 5cd22f26211a428099d2a41c5c41efab
                  expression: 'last(/ZYXEL MES-3528 by SNMP/zyxel.3528.sfp.serialnumber[{#SNMPINDEX}],#1)<>last(/ZYXEL MES-3528 by SNMP/zyxel.3528.sfp.serialnumber[{#SNMPINDEX}],#2) and length(last(/ZYXEL MES-3528 by SNMP/zyxel.3528.sfp.serialnumber[{#SNMPINDEX}]))>0'
                  name: 'ZYXEL: SFP {#SNMPINDEX} has been replaced'
                  event_name: 'ZYXEL: 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: ecbd3db41592408d8e9fe0d1d6078a3f
              name: 'SFP {#SNMPINDEX}: Status'
              type: SNMP_AGENT
              snmp_oid: 'get[1.3.6.1.4.1.890.1.5.8.51.117.1.1.2.{#SNMPINDEX}]'
              key: 'zyxel.3528.sfp.status[{#SNMPINDEX}]'
              delay: '{$ZYXEL.LLD.SFP.UPDATE}'
              description: |
                MIB: ZYXEL-MES3528-MIB
                Transceiver module status.
              valuemap:
                name: 'ZYXEL MES-3528 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: 049cbbcea720493f9638d08f928710cb
              name: 'SFP {#SNMPINDEX}: Transceiver'
              type: SNMP_AGENT
              snmp_oid: 'get[1.3.6.1.4.1.890.1.5.8.51.117.1.1.8.{#SNMPINDEX}]'
              key: 'zyxel.3528.sfp.transceiver[{#SNMPINDEX}]'
              delay: '{$ZYXEL.LLD.SFP.UPDATE}'
              value_type: CHAR
              description: |
                MIB: ZYXEL-MES3528-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: 5ece25cae49f47169a335be40dee744a
              name: 'SFP {#SNMPINDEX}: Vendor'
              type: SNMP_AGENT
              snmp_oid: 'get[1.3.6.1.4.1.890.1.5.8.51.117.1.1.3.{#SNMPINDEX}]'
              key: 'zyxel.3528.sfp.vendor[{#SNMPINDEX}]'
              delay: '{$ZYXEL.LLD.SFP.UPDATE}'
              value_type: CHAR
              description: |
                MIB: ZYXEL-MES3528-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}'
      tags:
        - tag: class
          value: network
        - tag: target
          value: mes-3528
        - tag: target
          value: switch
        - tag: target
          value: zyxel
      macros:
        - macro: '{$CPU.UTIL.CRIT}'
          value: '90'
          config:
            type: TEXT
            priority: '3'
            section_name: Thresholds
            label: 'Threshold for CPU utilization (critical)'
            description: 'In the range from 0 to 100 inclusive.'
            regex: '^-?([0-9]+|(([0-9]+)\.([0-9]+)))$'
        - macro: '{$SNMP.TIMEOUT}'
          value: 5m
          description: 'The time interval for SNMP agent availability trigger expression.'
          config:
            type: TEXT
            priority: '2'
            section_name: Thresholds
            label: 'Time interval'
            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'
          config:
            type: TEXT
            priority: '1'
            section_name: Filters
            label: 'Filter for interface control (include)'
            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
          config:
            type: TEXT
            priority: '6'
            section_name: Filters
            label: 'Filter for interface link-up type (include)'
            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.'
          config:
            type: TEXT
            priority: '7'
            section_name: Filters
            label: 'Filter for interface link-up type (exclude)'
            description: 'Filter to exclude discovered by link types.'
        - macro: '{$ZYXEL.LLD.FILTER.IF.NAME.MATCHES}'
          value: '.*'
          description: 'Filter by discoverable interface names.'
          config:
            type: TEXT
            priority: '4'
            section_name: Filters
            label: 'Filter for interface name (include)'
            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.'
          config:
            type: TEXT
            priority: '5'
            section_name: Filters
            label: 'Filter for interface name (exclude)'
            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
          config:
            type: TEXT
            priority: '8'
            section_name: Filters
            label: 'Filter for SFP status (include)'
            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.'
          config:
            type: TEXT
            priority: '9'
            section_name: Filters
            label: 'Filter for SFP status (exclude)'
            description: 'Filter to exclude discovered by status.'
        - macro: '{$ZYXEL.LLD.FILTER.SFPDDM.DESC.MATCHES}'
          value: '.*'
          description: 'Filter by discoverable SFP modules name.'
          config:
            type: TEXT
            priority: '10'
            section_name: Filters
            label: 'Filter for SFP DDM description (include)'
            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.'
          config:
            type: TEXT
            priority: '11'
            section_name: Filters
            label: 'Filter for SFP DDM description (exclude)'
            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.'
          config:
            type: TEXT
            priority: '12'
            section_name: Other
            label: 'Update inteval'
            description: 'Receiving data from the SFP module is slow, we do not recommend setting the interval less than 10 minutes.'
      dashboards:
        - uuid: db6fc11845d34e63af5423b5ad7cf539
          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 MES-3528 by SNMP'
                        name: 'ZYXEL MES-3528: Port {#SNMPINDEX}: Traffic'
                    - type: STRING
                      name: reference
                      value: AAAAA
                    - type: INTEGER
                      name: rows
                      value: '5'
      valuemaps:
        - uuid: ac3d8b1e51074733a8bce57814528d83
          name: 'SNMP available'
          mappings:
            - value: '0'
              newvalue: 'not available'
            - value: '1'
              newvalue: available
            - value: '2'
              newvalue: unknown
        - uuid: 042fc0ecdef34baab224062d4f746b96
          name: 'ZYXEL MES-3528 operational mode port link up type'
          mappings:
            - value: '0'
              newvalue: Down
            - value: '1'
              newvalue: Cooper
            - value: '2'
              newvalue: Fiber
        - uuid: cce63413576040fe8df5969886da993d
          name: 'ZYXEL MES-3528 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: 6220d70f35404dd6834674510e0ae9ea
          name: 'ZYXEL MES-3528 port admin status'
          mappings:
            - value: '1'
              newvalue: Up
            - value: '2'
              newvalue: Down
            - value: '3'
              newvalue: Testing
        - uuid: 36e992f6794a492e87c3c5a9749e26b3
          name: 'ZYXEL MES-3528 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: da9692b414de47d5bac9cd3287492e0b
          name: 'ZYXEL MES-3528 SFP status'
          mappings:
            - value: '1'
              newvalue: 'OK with DDM'
            - value: '2'
              newvalue: 'OK without DDM'
            - value: '3'
              newvalue: nonoperational
  triggers:
    - uuid: f278b8b4eb784107a6d8d3e8437e8a66
      expression: '(last(/Cisco IOS prior to 12.0_3_T by SNMP/system.hw.uptime[hrSystemUptime.0])>0 and last(/Cisco IOS prior to 12.0_3_T by SNMP/system.hw.uptime[hrSystemUptime.0])<10m) or (last(/Cisco IOS prior to 12.0_3_T by SNMP/system.hw.uptime[hrSystemUptime.0])=0 and last(/Cisco IOS prior to 12.0_3_T by SNMP/system.net.uptime[sysUpTime.0])<10m)'
      name: 'Cisco IOS: Host has been restarted'
      event_name: 'Cisco IOS: {HOST.NAME} has been restarted (uptime < 10m)'
      priority: WARNING
      description: 'Uptime is less than 10 minutes.'
      manual_close: 'YES'
      dependencies:
        - name: 'Cisco IOS: No SNMP data collection'
          expression: 'max(/Cisco IOS prior to 12.0_3_T by SNMP/zabbix[host,snmp,available],{$SNMP.TIMEOUT})=0'
      tags:
        - tag: scope
          value: notice
    - uuid: 4ac37991b2ca4edd9329fff1e752b05b
      expression: 'min(/GitLab by HTTP/gitlab.ruby.file_descriptors.max,5m)/last(/GitLab by HTTP/gitlab.ruby.process_max_fds)*100>{$GITLAB.OPEN.FDS.MAX.WARN}'
      name: 'GitLab: Current number of open files is too high'
      event_name: 'GitLab: Current number of open files is too high (over {$GITLAB.OPEN.FDS.MAX.WARN}% for 5m)'
      priority: WARNING
      tags:
        - tag: scope
          value: capacity
    - uuid: fd5dcb256d4547da9c432c1b9c01b0ae
      expression: '(last(/Morningstar SunSaver MPPT by SNMP/status.hw.uptime)>0 and last(/Morningstar SunSaver MPPT by SNMP/status.hw.uptime)<10m) or (last(/Morningstar SunSaver MPPT by SNMP/status.hw.uptime)=0 and last(/Morningstar SunSaver MPPT by SNMP/status.net.uptime)<10m)'
      name: 'Morningstar SunSaver MPPT: Status: Device has been restarted'
      event_name: 'Morningstar SunSaver MPPT: Status: Device has been restarted (uptime < 10m)'
      priority: INFO
      description: 'Uptime is less than 10 minutes.'
      manual_close: 'YES'
      tags:
        - tag: scope
          value: notice
    - uuid: aab5be196ac64dc69883c3109fcd094f
      expression: '(last(/Morningstar TriStar MPPT by SNMP/status.hw.uptime)>0 and last(/Morningstar TriStar MPPT by SNMP/status.hw.uptime)<10m) or (last(/Morningstar TriStar MPPT by SNMP/status.hw.uptime)=0 and last(/Morningstar TriStar MPPT by SNMP/status.net.uptime)<10m)'
      name: 'Morningstar TriStar MPPT: Status: Device has been restarted'
      event_name: 'Morningstar TriStar MPPT: Status: Device has been restarted (uptime < 10m)'
      priority: INFO
      description: 'Uptime is less than 10 minutes.'
      manual_close: 'YES'
      tags:
        - tag: scope
          value: notice
    - uuid: f0549419f015448497cd7d15a2bf96fa
      expression: '(last(/Morningstar TriStar PWM by SNMP/status.hw.uptime)>0 and last(/Morningstar TriStar PWM by SNMP/status.hw.uptime)<10m) or (last(/Morningstar TriStar PWM by SNMP/status.hw.uptime)=0 and last(/Morningstar TriStar PWM by SNMP/status.net.uptime)<10m)'
      name: 'Morningstar TriStar PWM: Status: Device has been restarted'
      event_name: 'Morningstar TriStar PWM: Status: Device has been restarted (uptime < 10m)'
      priority: INFO
      description: 'Uptime is less than 10 minutes.'
      manual_close: 'YES'
      tags:
        - tag: scope
          value: notice
    - uuid: cfd6ba0dbf294b9e9ab6afc7d44be7b3
      expression: 'min(/TiDB by HTTP/tidb.process_open_fds,5m)/last(/TiDB by HTTP/tidb.process_max_fds)*100>{$TIDB.OPEN.FDS.MAX.WARN}'
      name: 'TiDB: Current number of open files is too high'
      event_name: 'TiDB: Current number of open files is too high (over {$TIDB.OPEN.FDS.MAX.WARN}% for 5m)'
      priority: WARNING
      description: 'Heavy file descriptor usage (i.e., near the process''s file descriptor limit) indicates a potential file descriptor exhaustion issue.'
      tags:
        - tag: scope
          value: capacity
    - uuid: 53a97045bfd8473899849e429e3e7017
      expression: 'min(/Zookeeper by HTTP/zookeeper.open_file_descriptor_count,5m) * 100 / last(/Zookeeper by HTTP/zookeeper.max_file_descriptor_count) > {$ZOOKEEPER.FILE_DESCRIPTORS.MAX.WARN}'
      name: 'Zookeeper: Too many file descriptors used'
      event_name: 'Zookeeper: Too many file descriptors used (over {$ZOOKEEPER.FILE_DESCRIPTORS.MAX.WARN}% for 5 min)'
      priority: WARNING
      description: 'Number of file descriptors used more than {$ZOOKEEPER.FILE_DESCRIPTORS.MAX.WARN}% of the available number of file descriptors.'
      tags:
        - tag: scope
          value: capacity
    - uuid: 819190f68248439292fc4622c3eec5a9
      expression: '(last(/ZYXEL AAM1212-51 IES-612 by SNMP/zyxel.aam1212.hw.uptime)>0 and last(/ZYXEL AAM1212-51 IES-612 by SNMP/zyxel.aam1212.hw.uptime)<10m) or (last(/ZYXEL AAM1212-51 IES-612 by SNMP/zyxel.aam1212.hw.uptime)=0 and last(/ZYXEL AAM1212-51 IES-612 by SNMP/zyxel.aam1212.net.uptime)<10m)'
      name: 'ZYXEL: Host has been restarted'
      event_name: 'ZYXEL: {HOST.NAME} has been restarted (uptime < 10m)'
      priority: INFO
      description: 'Uptime is less than 10 minutes.'
      manual_close: 'YES'
      tags:
        - tag: scope
          value: notice
    - uuid: 93c70a5dd2504d0d9b13a17af942d45e
      expression: '(last(/ZYXEL GS-4012F by SNMP/zyxel.4012f.hw.uptime)>0 and last(/ZYXEL GS-4012F by SNMP/zyxel.4012f.hw.uptime)<10m) or (last(/ZYXEL GS-4012F by SNMP/zyxel.4012f.hw.uptime)=0 and last(/ZYXEL GS-4012F by SNMP/zyxel.4012f.net.uptime)<10m)'
      name: 'ZYXEL: Host has been restarted'
      event_name: 'ZYXEL: {HOST.NAME} has been restarted (uptime < 10m)'
      priority: INFO
      description: 'Uptime is less than 10 minutes.'
      manual_close: 'YES'
      tags:
        - tag: scope
          value: notice
    - uuid: d138c874f4de4f3a97a0c615d589826a
      expression: '(last(/ZYXEL MES-3528 by SNMP/zyxel.3528.hw.uptime)>0 and last(/ZYXEL MES-3528 by SNMP/zyxel.3528.hw.uptime)<10m) or (last(/ZYXEL MES-3528 by SNMP/zyxel.3528.hw.uptime)=0 and last(/ZYXEL MES-3528 by SNMP/zyxel.3528.net.uptime)<10m)'
      name: 'ZYXEL: Host has been restarted'
      event_name: 'ZYXEL: {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: a3998992f7504a12826e3c4d592836b5
      name: 'Apache: Requests per second'
      graph_items:
        - drawtype: GRADIENT_LINE
          color: 199C0D
          item:
            host: 'Apache by HTTP'
            key: apache.requests.rate
    - uuid: 1629062b5cd74b67af9a60226a79f8f1
      name: 'Apache: Worker states'
      graph_items:
        - color: 199C0D
          item:
            host: 'Apache by HTTP'
            key: apache.workers.dnslookup
        - sortorder: '1'
          color: F63100
          item:
            host: 'Apache by HTTP'
            key: apache.workers.cleanup
        - sortorder: '2'
          color: 00611C
          item:
            host: 'Apache by HTTP'
            key: apache.workers.logging
        - sortorder: '3'
          color: F7941D
          item:
            host: 'Apache by HTTP'
            key: apache.workers.reading
        - sortorder: '4'
          color: FC6EA3
          item:
            host: 'Apache by HTTP'
            key: apache.workers.sending
        - sortorder: '5'
          color: 6C59DC
          item:
            host: 'Apache by HTTP'
            key: apache.workers.starting
        - sortorder: '6'
          color: C7A72D
          item:
            host: 'Apache by HTTP'
            key: apache.workers.closing
        - sortorder: '7'
          color: BA2A5D
          item:
            host: 'Apache by HTTP'
            key: apache.workers.finishing
        - sortorder: '8'
          color: F230E0
          item:
            host: 'Apache by HTTP'
            key: apache.workers.keepalive
        - sortorder: '9'
          color: 5CCD18
          item:
            host: 'Apache by HTTP'
            key: apache.workers.slot
        - sortorder: '10'
          color: BB2A02
          item:
            host: 'Apache by HTTP'
            key: apache.workers.waiting
    - uuid: 78e59f1b5eb747019f92921ac5ef48b0
      name: 'Apache: Workers total'
      type: STACKED
      graph_items:
        - color: 199C0D
          item:
            host: 'Apache by HTTP'
            key: apache.workers_total.busy
        - sortorder: '1'
          color: F63100
          item:
            host: 'Apache by HTTP'
            key: apache.workers_total.idle
    - uuid: 6090c266226d431193b00fb3db49ae07
      name: 'Array: Voltage'
      graph_items:
        - drawtype: GRADIENT_LINE
          color: 199C0D
          item:
            host: 'Morningstar SunSaver MPPT by SNMP'
            key: 'array.sweep_vmp[arrayVmp.0]'
        - sortorder: '1'
          drawtype: GRADIENT_LINE
          color: F63100
          item:
            host: 'Morningstar SunSaver MPPT by SNMP'
            key: 'array.sweep_voc[arrayVoc.0]'
        - sortorder: '2'
          drawtype: GRADIENT_LINE
          color: 00611C
          item:
            host: 'Morningstar SunSaver MPPT by SNMP'
            key: 'array.voltage[arrayVoltage.0]'
    - uuid: 8cdd58f62fcc4ca89d114fbe7eddc26d
      name: 'Array: Voltage'
      graph_items:
        - drawtype: GRADIENT_LINE
          color: 199C0D
          item:
            host: 'Morningstar TriStar MPPT by SNMP'
            key: 'array.sweep_vmp[arrayVmpLastSweep.0]'
        - sortorder: '1'
          drawtype: GRADIENT_LINE
          color: F63100
          item:
            host: 'Morningstar TriStar MPPT by SNMP'
            key: 'array.sweep_voc[arrayVocLastSweep.0]'
        - sortorder: '2'
          drawtype: GRADIENT_LINE
          color: 00611C
          item:
            host: 'Morningstar TriStar MPPT by SNMP'
            key: 'array.voltage[arrayVoltage.0]'
    - uuid: 067062eca2b34488a9defc3aa002c88c
      name: 'Battery: Current'
      graph_items:
        - drawtype: GRADIENT_LINE
          color: 199C0D
          item:
            host: 'Morningstar TriStar MPPT by SNMP'
            key: 'charge.current[batteryCurrent.0]'
    - uuid: 1889ace5679d4f63b59237812b5d0718
      name: 'Battery: Output Power (Watts)'
      graph_items:
        - drawtype: GRADIENT_LINE
          color: 199C0D
          item:
            host: 'Morningstar TriStar MPPT by SNMP'
            key: 'charge.output_power[ outputPower.0]'
    - uuid: fac43ab599344f1da374bd091f6b618b
      name: 'Ceph: Cluster bandwidth'
      graph_items:
        - color: 199C0D
          item:
            host: 'Ceph by Zabbix agent 2'
            key: ceph.rd_bytes.rate
        - sortorder: '1'
          color: F63100
          item:
            host: 'Ceph by Zabbix agent 2'
            key: ceph.wr_bytes.rate
    - uuid: 4191a30a9a7c4e5aa48d96238ca8f20c
      name: 'Ceph: Cluster I/O'
      graph_items:
        - color: 199C0D
          item:
            host: 'Ceph by Zabbix agent 2'
            key: ceph.wr_ops.rate
        - sortorder: '1'
          color: F63100
          item:
            host: 'Ceph by Zabbix agent 2'
            key: ceph.rd_ops.rate
    - uuid: 515e2c5239f94ee7a52ecdb834079e06
      name: 'Ceph: Free space'
      type: STACKED
      graph_items:
        - color: 199C0D
          item:
            host: 'Ceph by Zabbix agent 2'
            key: ceph.total_used_bytes
        - sortorder: '1'
          color: F63100
          item:
            host: 'Ceph by Zabbix agent 2'
            key: ceph.total_avail_bytes
    - uuid: 8714a8cf50bd43c2b54e410a439d320b
      name: 'Ceph: Overall OSD latency'
      graph_items:
        - drawtype: BOLD_LINE
          color: 199C0D
          item:
            host: 'Ceph by Zabbix agent 2'
            key: ceph.osd_latency_commit.avg
        - sortorder: '1'
          color: F63100
          item:
            host: 'Ceph by Zabbix agent 2'
            key: ceph.osd_latency_commit.max
        - sortorder: '2'
          color: 00611C
          item:
            host: 'Ceph by Zabbix agent 2'
            key: ceph.osd_latency_commit.min
        - sortorder: '3'
          drawtype: BOLD_LINE
          color: F7941D
          item:
            host: 'Ceph by Zabbix agent 2'
            key: ceph.osd_latency_apply.avg
        - sortorder: '4'
          color: FC6EA3
          item:
            host: 'Ceph by Zabbix agent 2'
            key: ceph.osd_latency_apply.max
        - sortorder: '5'
          color: 6C59DC
          item:
            host: 'Ceph by Zabbix agent 2'
            key: ceph.osd_latency_apply.min
    - uuid: 716d959b255a47779b9aaf376be8ba03
      name: 'Ceph: Overall OSD utilization'
      graph_items:
        - drawtype: BOLD_LINE
          color: 199C0D
          item:
            host: 'Ceph by Zabbix agent 2'
            key: ceph.osd_fill.avg
        - sortorder: '1'
          color: F63100
          item:
            host: 'Ceph by Zabbix agent 2'
            key: ceph.osd_fill.max
        - sortorder: '2'
          color: 00611C
          item:
            host: 'Ceph by Zabbix agent 2'
            key: ceph.osd_fill.min
    - uuid: 8c8379b8b21048d4b2ba3781a2392b69
      name: 'Cisco IOS: CPU utilization'
      ymin_type_1: FIXED
      ymax_type_1: FIXED
      graph_items:
        - drawtype: GRADIENT_LINE
          color: 199C0D
          item:
            host: 'Cisco IOS prior to 12.0_3_T by SNMP'
            key: 'system.cpu.util[avgBusy5]'
    - uuid: afbfbcdb9b0949c7851fc809049d573f
      name: 'Control-M: Jobs statistics'
      graph_items:
        - color: 00FF00
          item:
            host: 'Control-M server by HTTP'
            key: controlm.jobs.statistics.returned
        - sortorder: '1'
          color: 0000FF
          item:
            host: 'Control-M server by HTTP'
            key: controlm.jobs.statistics.total
    - uuid: 349829f644cd472d8caeae0059ca8527
      name: 'Control-M: Server state'
      graph_items:
        - color: 00FF00
          item:
            host: 'Control-M server by HTTP'
            key: server.state
    - uuid: 9a3df2f49bf24b4597c6e488e1016f78
      name: 'CPU jumps'
      graph_items:
        - color: '009900'
          item:
            host: 'Solaris by Zabbix agent'
            key: system.cpu.switches
        - sortorder: '1'
          color: '000099'
          item:
            host: 'Solaris by Zabbix agent'
            key: system.cpu.intr
    - uuid: f66887f0152c484d80b8fe77d5fd2cdd
      name: 'CPU load'
      ymin_type_1: FIXED
      graph_items:
        - color: '009900'
          item:
            host: 'Solaris by Zabbix agent'
            key: 'system.cpu.load[percpu,avg1]'
        - sortorder: '1'
          color: '000099'
          item:
            host: 'Solaris by Zabbix agent'
            key: 'system.cpu.load[percpu,avg5]'
        - sortorder: '2'
          color: '990000'
          item:
            host: 'Solaris by Zabbix agent'
            key: 'system.cpu.load[percpu,avg15]'
    - uuid: 2b7e4221d79e4db8bf0463e0bb347eb0
      name: 'CPU utilization'
      show_triggers: 'NO'
      type: STACKED
      ymin_type_1: FIXED
      ymax_type_1: FIXED
      graph_items:
        - color: '999900'
          item:
            host: 'Solaris by Zabbix agent'
            key: 'system.cpu.util[,iowait]'
        - sortorder: '1'
          color: '990000'
          item:
            host: 'Solaris by Zabbix agent'
            key: 'system.cpu.util[,system]'
        - sortorder: '2'
          color: '000099'
          item:
            host: 'Solaris by Zabbix agent'
            key: 'system.cpu.util[,user]'
        - sortorder: '3'
          color: '009900'
          item:
            host: 'Solaris by Zabbix agent'
            key: 'system.cpu.util[,idle]'
    - uuid: ad5b73c7352747a6930c9d8647f70bf1
      name: 'Current: Charge/Load'
      graph_items:
        - drawtype: GRADIENT_LINE
          color: 199C0D
          item:
            host: 'Morningstar SunSaver MPPT by SNMP'
            key: 'charge.current[chargeCurrent.0]'
        - sortorder: '1'
          drawtype: GRADIENT_LINE
          color: F63100
          item:
            host: 'Morningstar SunSaver MPPT by SNMP'
            key: 'load.current[loadCurrent.0]'
    - uuid: f6c30e56b54e478ea2708e302197b83b
      name: 'GitLab: Database: Connection pool'
      graph_items:
        - color: 199C0D
          item:
            host: 'GitLab by HTTP'
            key: gitlab.database.connection_pool_busy
        - sortorder: '1'
          color: F63100
          item:
            host: 'GitLab by HTTP'
            key: gitlab.database.connection_pool_connections
        - sortorder: '2'
          color: 00611C
          item:
            host: 'GitLab by HTTP'
            key: gitlab.database.connection_pool_dead
        - sortorder: '3'
          color: F7941D
          item:
            host: 'GitLab by HTTP'
            key: gitlab.database.connection_pool_idle
        - sortorder: '4'
          color: FC6EA3
          item:
            host: 'GitLab by HTTP'
            key: gitlab.database.connection_pool_waiting
        - sortorder: '5'
          drawtype: BOLD_LINE
          color: 6C59DC
          item:
            host: 'GitLab by HTTP'
            key: gitlab.database.connection_pool_size
    - uuid: ebffb6f63cf5400ab6a518612c5e857f
      name: 'GitLab: HTTP requests rate'
      graph_items:
        - color: 199C0D
          item:
            host: 'GitLab by HTTP'
            key: gitlab.http.requests.4xx.rate
        - sortorder: '1'
          color: F63100
          item:
            host: 'GitLab by HTTP'
            key: gitlab.http.requests.5xx.rate
        - sortorder: '2'
          color: 00611C
          item:
            host: 'GitLab by HTTP'
            key: gitlab.http.requests.rate
    - uuid: 14d4a4cc843e4c15bd72b680c18ffdd6
      name: 'GitLab: Redis requests rate'
      graph_items:
        - drawtype: BOLD_LINE
          color: 199C0D
          item:
            host: 'GitLab by HTTP'
            key: gitlab.redis.client_requests.shared_state.rate
        - sortorder: '1'
          drawtype: BOLD_LINE
          color: F63100
          item:
            host: 'GitLab by HTTP'
            key: gitlab.redis.client_requests.cache.rate
        - sortorder: '2'
          drawtype: BOLD_LINE
          color: 00611C
          item:
            host: 'GitLab by HTTP'
            key: gitlab.redis.client_requests.queues.rate
        - sortorder: '3'
          color: F7941D
          yaxisside: RIGHT
          item:
            host: 'GitLab by HTTP'
            key: gitlab.redis.client_exceptions.shared_state.rate
        - sortorder: '4'
          color: FC6EA3
          yaxisside: RIGHT
          item:
            host: 'GitLab by HTTP'
            key: gitlab.redis.client_exceptions.cache.rate
        - sortorder: '5'
          color: 6C59DC
          yaxisside: RIGHT
          item:
            host: 'GitLab by HTTP'
            key: gitlab.redis.client_exceptions.queues.rate
    - uuid: 2eafabff82a240258c50a77655f77fd9
      name: 'GitLab: Ruby: File descriptors'
      graph_items:
        - color: 199C0D
          item:
            host: 'GitLab by HTTP'
            key: gitlab.ruby.file_descriptors.avg
        - sortorder: '1'
          color: F63100
          item:
            host: 'GitLab by HTTP'
            key: gitlab.ruby.file_descriptors.max
        - sortorder: '2'
          color: 00611C
          item:
            host: 'GitLab by HTTP'
            key: gitlab.ruby.file_descriptors.min
        - sortorder: '3'
          drawtype: BOLD_LINE
          color: F7941D
          item:
            host: 'GitLab by HTTP'
            key: gitlab.ruby.process_max_fds
    - uuid: 1c6b8a24e76f4b7390e8e8742afbedec
      name: 'GitLab: Ruby: RSS memory'
      graph_items:
        - color: 199C0D
          item:
            host: 'GitLab by HTTP'
            key: gitlab.ruby.process_resident_memory_bytes.avg
        - sortorder: '1'
          color: F63100
          item:
            host: 'GitLab by HTTP'
            key: gitlab.ruby.process_resident_memory_bytes.min
        - sortorder: '2'
          color: 00611C
          item:
            host: 'GitLab by HTTP'
            key: gitlab.ruby.process_resident_memory_bytes.max
    - uuid: 150f0e2062a844a9a8bfcaca92ffbf39
      name: 'Memory usage'
      ymin_type_1: FIXED
      ymax_type_1: ITEM
      ymax_item_1:
        host: 'Solaris by Zabbix agent'
        key: 'vm.memory.size[total]'
      graph_items:
        - drawtype: GRADIENT_LINE
          color: 00C800
          item:
            host: 'Solaris by Zabbix agent'
            key: 'vm.memory.size[available]'
    - uuid: 947de3b0729948b0ae2f03342a7e3f9f
      name: 'OpenBSD: CPU jumps'
      graph_items:
        - color: '009900'
          item:
            host: 'OpenBSD by Zabbix agent'
            key: system.cpu.switches
        - sortorder: '1'
          color: '000099'
          item:
            host: 'OpenBSD by Zabbix agent'
            key: system.cpu.intr
    - uuid: 765b83f3f7a246aa893eff4f19600326
      name: 'OpenBSD: CPU load'
      ymin_type_1: FIXED
      graph_items:
        - color: '009900'
          item:
            host: 'OpenBSD by Zabbix agent'
            key: 'system.cpu.load[percpu,avg1]'
        - sortorder: '1'
          color: '000099'
          item:
            host: 'OpenBSD by Zabbix agent'
            key: 'system.cpu.load[percpu,avg5]'
        - sortorder: '2'
          color: '990000'
          item:
            host: 'OpenBSD by Zabbix agent'
            key: 'system.cpu.load[percpu,avg15]'
    - uuid: 512ed29b170642d285b14a7e9b2d43de
      name: 'OpenBSD: CPU utilization'
      show_triggers: 'NO'
      type: STACKED
      ymin_type_1: FIXED
      ymax_type_1: FIXED
      graph_items:
        - color: '009999'
          item:
            host: 'OpenBSD by Zabbix agent'
            key: 'system.cpu.util[,interrupt]'
        - sortorder: '1'
          color: 2196F3
          item:
            host: 'OpenBSD by Zabbix agent'
            key: 'system.cpu.util[,spin]'
        - sortorder: '2'
          color: '990099'
          item:
            host: 'OpenBSD by Zabbix agent'
            key: 'system.cpu.util[,nice]'
        - sortorder: '3'
          color: '990000'
          item:
            host: 'OpenBSD by Zabbix agent'
            key: 'system.cpu.util[,system]'
        - sortorder: '4'
          color: '000099'
          item:
            host: 'OpenBSD by Zabbix agent'
            key: 'system.cpu.util[,user]'
        - sortorder: '5'
          color: '009900'
          item:
            host: 'OpenBSD by Zabbix agent'
            key: 'system.cpu.util[,idle]'
    - uuid: 18bbcc8bba0840fc8353b90caa3e657f
      name: 'OpenBSD: Memory usage'
      graph_items:
        - drawtype: GRADIENT_LINE
          color: 00C800
          item:
            host: 'OpenBSD by Zabbix agent'
            key: 'vm.memory.size[available]'
    - uuid: 8a422a49defb413ca16b1e8515b59e00
      name: 'OpenBSD: Swap usage'
      width: '600'
      height: '340'
      show_work_period: 'NO'
      show_triggers: 'NO'
      type: PIE
      show_3d: 'YES'
      graph_items:
        - color: AA0000
          type: GRAPH_SUM
          item:
            host: 'OpenBSD by Zabbix agent'
            key: 'system.swap.size[,total]'
        - sortorder: '1'
          color: 00AA00
          item:
            host: 'OpenBSD by Zabbix agent'
            key: 'system.swap.size[,free]'
    - uuid: 2d72cf70b71a414680cc667c27141653
      name: 'RabbitMQ: Connections'
      graph_items:
        - color: 199C0D
          item:
            host: 'RabbitMQ cluster by HTTP'
            key: rabbitmq.overview.object_totals.connections
        - sortorder: '1'
          color: F63100
          item:
            host: 'RabbitMQ cluster by HTTP'
            key: rabbitmq.overview.object_totals.channels
        - sortorder: '2'
          color: 00611C
          item:
            host: 'RabbitMQ cluster by HTTP'
            key: rabbitmq.overview.object_totals.consumers
    - uuid: 2dbd4f9285a34786a210c6e16d87ed85
      name: 'RabbitMQ: Connections'
      graph_items:
        - color: 199C0D
          item:
            host: 'RabbitMQ cluster by Zabbix agent'
            key: rabbitmq.overview.object_totals.connections
        - sortorder: '1'
          color: F63100
          item:
            host: 'RabbitMQ cluster by Zabbix agent'
            key: rabbitmq.overview.object_totals.channels
        - sortorder: '2'
          color: 00611C
          item:
            host: 'RabbitMQ cluster by Zabbix agent'
            key: rabbitmq.overview.object_totals.consumers
    - uuid: 6a66846adab54906800f80ac025b2003
      name: 'RabbitMQ: Messages'
      graph_items:
        - color: 199C0D
          item:
            host: 'RabbitMQ cluster by HTTP'
            key: rabbitmq.overview.queue_totals.messages
        - sortorder: '1'
          color: F63100
          item:
            host: 'RabbitMQ cluster by HTTP'
            key: rabbitmq.overview.queue_totals.messages.ready
        - sortorder: '2'
          color: 00611C
          item:
            host: 'RabbitMQ cluster by HTTP'
            key: rabbitmq.overview.queue_totals.messages.unacknowledged
    - uuid: dca08567e6ce4dcbb60f72a431de5ddf
      name: 'RabbitMQ: Messages'
      graph_items:
        - color: 199C0D
          item:
            host: 'RabbitMQ cluster by Zabbix agent'
            key: rabbitmq.overview.queue_totals.messages
        - sortorder: '1'
          color: F63100
          item:
            host: 'RabbitMQ cluster by Zabbix agent'
            key: rabbitmq.overview.queue_totals.messages.ready
        - sortorder: '2'
          color: 00611C
          item:
            host: 'RabbitMQ cluster by Zabbix agent'
            key: rabbitmq.overview.queue_totals.messages.unacknowledged
    - uuid: fe3139da95aa4fc7a7db4aac87c52c03
      name: 'RabbitMQ: Messages per second'
      graph_items:
        - color: 199C0D
          item:
            host: 'RabbitMQ cluster by HTTP'
            key: rabbitmq.overview.messages.publish.rate
        - sortorder: '1'
          color: F63100
          item:
            host: 'RabbitMQ cluster by HTTP'
            key: rabbitmq.overview.messages.ack.rate
        - sortorder: '2'
          color: 00611C
          item:
            host: 'RabbitMQ cluster by HTTP'
            key: rabbitmq.overview.messages.confirm.rate
        - sortorder: '3'
          color: F7941D
          item:
            host: 'RabbitMQ cluster by HTTP'
            key: rabbitmq.overview.messages.deliver_get.rate
        - sortorder: '4'
          color: FC6EA3
          item:
            host: 'RabbitMQ cluster by HTTP'
            key: rabbitmq.overview.messages.publish_in.rate
        - sortorder: '5'
          color: 6C59DC
          item:
            host: 'RabbitMQ cluster by HTTP'
            key: rabbitmq.overview.messages.publish_out.rate
        - sortorder: '6'
          color: C7A72D
          item:
            host: 'RabbitMQ cluster by HTTP'
            key: rabbitmq.overview.messages.redeliver.rate
        - sortorder: '7'
          color: BA2A5D
          item:
            host: 'RabbitMQ cluster by HTTP'
            key: rabbitmq.overview.messages.return_unroutable.rate
    - uuid: ad303b1816a84248a347ef4773bf2c44
      name: 'RabbitMQ: Messages per second'
      graph_items:
        - color: 199C0D
          item:
            host: 'RabbitMQ cluster by Zabbix agent'
            key: rabbitmq.overview.messages.publish.rate
        - sortorder: '1'
          color: F63100
          item:
            host: 'RabbitMQ cluster by Zabbix agent'
            key: rabbitmq.overview.messages.ack.rate
        - sortorder: '2'
          color: 00611C
          item:
            host: 'RabbitMQ cluster by Zabbix agent'
            key: rabbitmq.overview.messages.confirm.rate
        - sortorder: '3'
          color: F7941D
          item:
            host: 'RabbitMQ cluster by Zabbix agent'
            key: rabbitmq.overview.messages.deliver_get.rate
        - sortorder: '4'
          color: FC6EA3
          item:
            host: 'RabbitMQ cluster by Zabbix agent'
            key: rabbitmq.overview.messages.publish_in.rate
        - sortorder: '5'
          color: 6C59DC
          item:
            host: 'RabbitMQ cluster by Zabbix agent'
            key: rabbitmq.overview.messages.publish_out.rate
        - sortorder: '6'
          color: C7A72D
          item:
            host: 'RabbitMQ cluster by Zabbix agent'
            key: rabbitmq.overview.messages.redeliver.rate
        - sortorder: '7'
          color: BA2A5D
          item:
            host: 'RabbitMQ cluster by Zabbix agent'
            key: rabbitmq.overview.messages.return_unroutable.rate
    - uuid: a4a33e6004f34a8cb2709aae632f456d
      name: 'RabbitMQ: Messages status'
      graph_items:
        - color: 199C0D
          item:
            host: 'RabbitMQ cluster by HTTP'
            key: rabbitmq.overview.messages.publish
        - sortorder: '1'
          color: F63100
          item:
            host: 'RabbitMQ cluster by HTTP'
            key: rabbitmq.overview.messages.ack
        - sortorder: '2'
          color: 00611C
          item:
            host: 'RabbitMQ cluster by HTTP'
            key: rabbitmq.overview.messages.confirm
        - sortorder: '3'
          color: F7941D
          item:
            host: 'RabbitMQ cluster by HTTP'
            key: rabbitmq.overview.messages.deliver_get
        - sortorder: '4'
          color: FC6EA3
          item:
            host: 'RabbitMQ cluster by HTTP'
            key: rabbitmq.overview.messages.publish_in
        - sortorder: '5'
          color: 6C59DC
          item:
            host: 'RabbitMQ cluster by HTTP'
            key: rabbitmq.overview.messages.publish_out
        - sortorder: '6'
          color: C7A72D
          item:
            host: 'RabbitMQ cluster by HTTP'
            key: rabbitmq.overview.messages.redeliver
        - sortorder: '7'
          color: BA2A5D
          item:
            host: 'RabbitMQ cluster by HTTP'
            key: rabbitmq.overview.messages.return_unroutable
    - uuid: 94fa39136a0d42b2997dd3b9a7581621
      name: 'RabbitMQ: Messages status'
      graph_items:
        - color: 199C0D
          item:
            host: 'RabbitMQ cluster by Zabbix agent'
            key: rabbitmq.overview.messages.publish
        - sortorder: '1'
          color: F63100
          item:
            host: 'RabbitMQ cluster by Zabbix agent'
            key: rabbitmq.overview.messages.ack
        - sortorder: '2'
          color: 00611C
          item:
            host: 'RabbitMQ cluster by Zabbix agent'
            key: rabbitmq.overview.messages.confirm
        - sortorder: '3'
          color: F7941D
          item:
            host: 'RabbitMQ cluster by Zabbix agent'
            key: rabbitmq.overview.messages.deliver_get
        - sortorder: '4'
          color: FC6EA3
          item:
            host: 'RabbitMQ cluster by Zabbix agent'
            key: rabbitmq.overview.messages.publish_in
        - sortorder: '5'
          color: 6C59DC
          item:
            host: 'RabbitMQ cluster by Zabbix agent'
            key: rabbitmq.overview.messages.publish_out
        - sortorder: '6'
          color: C7A72D
          item:
            host: 'RabbitMQ cluster by Zabbix agent'
            key: rabbitmq.overview.messages.redeliver
        - sortorder: '7'
          color: BA2A5D
          item:
            host: 'RabbitMQ cluster by Zabbix agent'
            key: rabbitmq.overview.messages.return_unroutable
    - uuid: 987d5621410d4dc6b66fb72e9aca2357
      name: 'RabbitMQ: Queues'
      graph_items:
        - drawtype: GRADIENT_LINE
          color: 199C0D
          item:
            host: 'RabbitMQ cluster by HTTP'
            key: rabbitmq.overview.object_totals.queues
    - uuid: 3205b991eb5443e680b571b23b4a1721
      name: 'RabbitMQ: Queues'
      graph_items:
        - drawtype: GRADIENT_LINE
          color: 199C0D
          item:
            host: 'RabbitMQ cluster by Zabbix agent'
            key: rabbitmq.overview.object_totals.queues
    - uuid: 061e20f2db6e4a43b35780702b3ebbfa
      name: 'Swap usage'
      width: '600'
      height: '340'
      show_work_period: 'NO'
      show_triggers: 'NO'
      type: PIE
      show_3d: 'YES'
      graph_items:
        - color: AA0000
          type: GRAPH_SUM
          item:
            host: 'Solaris by Zabbix agent'
            key: 'system.swap.size[,total]'
        - sortorder: '1'
          color: 00AA00
          item:
            host: 'Solaris by Zabbix agent'
            key: 'system.swap.size[,free]'
    - uuid: 7b96265600a748728d881f5dfee485d2
      name: 'Temperature: Ambient/Battery/Heatsink'
      graph_items:
        - drawtype: GRADIENT_LINE
          color: 199C0D
          item:
            host: 'Morningstar SunSaver MPPT by SNMP'
            key: 'temp.ambient[ambientTemperature.0]'
        - sortorder: '1'
          drawtype: GRADIENT_LINE
          color: F63100
          item:
            host: 'Morningstar SunSaver MPPT by SNMP'
            key: 'temp.battery[batteryTemperature.0]'
        - sortorder: '2'
          drawtype: GRADIENT_LINE
          color: 00611C
          item:
            host: 'Morningstar SunSaver MPPT by SNMP'
            key: 'temp.heatsink[heatsinkTemperature.0]'
    - uuid: 87918502df2743e1be04a02b02c44b61
      name: 'Temperature: Battery/Heatsink'
      graph_items:
        - drawtype: GRADIENT_LINE
          color: 199C0D
          item:
            host: 'Morningstar TriStar MPPT by SNMP'
            key: 'temp.battery[batteryTemperature.0]'
        - sortorder: '1'
          drawtype: GRADIENT_LINE
          color: F63100
          item:
            host: 'Morningstar TriStar MPPT by SNMP'
            key: 'temp.heatsink[heatsinkTemperature.0]'
    - uuid: ce3aa40eac5f4ee199ed214752304e19
      name: 'Temperature: Battery/Heatsink'
      graph_items:
        - drawtype: GRADIENT_LINE
          color: 199C0D
          item:
            host: 'Morningstar TriStar PWM by SNMP'
            key: 'temp.battery[batteryTemperature.0]'
        - sortorder: '1'
          drawtype: GRADIENT_LINE
          color: F63100
          item:
            host: 'Morningstar TriStar PWM by SNMP'
            key: 'temp.heatsink[heatsinkTemperature.0]'
    - uuid: ee25671d0b5446348341be56967a74b2
      name: 'TiDB: File descriptors'
      graph_items:
        - drawtype: GRADIENT_LINE
          color: 199C0D
          item:
            host: 'TiDB by HTTP'
            key: tidb.process_open_fds
        - sortorder: '1'
          drawtype: BOLD_LINE
          color: F63100
          item:
            host: 'TiDB by HTTP'
            key: tidb.process_max_fds
    - uuid: fb29a5ea3a62416f8eeee804a6f83c46
      name: 'TiDB: Memory usage'
      graph_items:
        - color: 199C0D
          item:
            host: 'TiDB by HTTP'
            key: tidb.heap_bytes
        - sortorder: '1'
          color: F63100
          item:
            host: 'TiDB by HTTP'
            key: tidb.rss_bytes
    - uuid: 5ab746ad86ef4710948263d4d6157742
      name: 'TiDB: Server query rate'
      graph_items:
        - color: 199C0D
          item:
            host: 'TiDB by HTTP'
            key: tidb.server_query.rate
        - sortorder: '1'
          color: F63100
          item:
            host: 'TiDB by HTTP'
            key: tidb.server_query.ok.rate
        - sortorder: '2'
          color: 00611C
          item:
            host: 'TiDB by HTTP'
            key: tidb.server_query.error.rate
    - uuid: 0553c91abfac4f8fb452b6b367055261
      name: 'Zookeeper: File descriptors usage'
      graph_items:
        - color: 199C0D
          item:
            host: 'Zookeeper by HTTP'
            key: zookeeper.max_file_descriptor_count
        - sortorder: '1'
          color: F63100
          item:
            host: 'Zookeeper by HTTP'
            key: zookeeper.open_file_descriptor_count
    - uuid: e4a53bcc70fa4688832dce28ca5f9c4a
      name: 'Zookeeper: Latency'
      graph_items:
        - color: 199C0D
          item:
            host: 'Zookeeper by HTTP'
            key: zookeeper.max_latency
        - sortorder: '1'
          color: F63100
          item:
            host: 'Zookeeper by HTTP'
            key: zookeeper.min_latency
        - sortorder: '2'
          drawtype: BOLD_LINE
          color: 00611C
          item:
            host: 'Zookeeper by HTTP'
            key: zookeeper.avg_latency
    - uuid: 34d7f20585404aabac415c832c09a7ed
      name: 'Zookeeper: Nodes'
      graph_items:
        - color: 199C0D
          item:
            host: 'Zookeeper by HTTP'
            key: zookeeper.znode_count
        - sortorder: '1'
          color: F63100
          item:
            host: 'Zookeeper by HTTP'
            key: zookeeper.ephemerals_count
    - uuid: 8724517184844ee79c47f36b895cd564
      name: 'Zookeeper: Packets'
      graph_items:
        - color: 199C0D
          item:
            host: 'Zookeeper by HTTP'
            key: zookeeper.packets_sent
        - sortorder: '1'
          color: F63100
          item:
            host: 'Zookeeper by HTTP'
            key: zookeeper.packets_received.rate
    - uuid: 966ba518f4e045ed98d2edf65df45078
      name: 'ZYXEL GS-4012F: CPU utilization'
      ymin_type_1: FIXED
      ymax_type_1: FIXED
      graph_items:
        - drawtype: GRADIENT_LINE
          color: 199C0D
          item:
            host: 'ZYXEL GS-4012F by SNMP'
            key: zyxel.4012f.cpuusage
    - uuid: 6a05d499aec2421e9a7e758fba82255a
      name: 'ZYXEL MES-3528: CPU utilization'
      ymin_type_1: FIXED
      ymax_type_1: FIXED
      graph_items:
        - drawtype: GRADIENT_LINE
          color: 199C0D
          item:
            host: 'ZYXEL MES-3528 by SNMP'
            key: zyxel.3528.cpuusage
