zabbix_export:
  version: '5.4'
  date: '2021-11-21T21:33:25Z'
  groups:
    -
      uuid: 7df96b18c230490a9a0a9e2307226338
      name: Templates
  templates:
    -
      uuid: fb4ac192a5f049c2a2c335ba5ced3583
      template: 'App Zookeeper'
      name: 'App Zookeeper'
      description: |
        ## Description
        
        Zookeper Monitoring Need this userparameter in zabbix_agentd.conf: UserParameter=echo2nc[*],echo $1 | nc $2 $3
        
        ## Overview
        
        System requirements
        -------------------
        
        
        * [zabbix](http://www.zabbix.com/downloads/) >= 3.4 (preprocessing used by this template)
        * [zookeeper](https://zookeeper.apache.org/releases.html) >= 3.4 (mntr stats)
        * netcat
        
        
        Features
        --------
        
        
        * ruok check , mntr stats , graphs, screen
        
        
        Zabbix Configuration
        --------------------
        
        
        UserParameter=echo2nc[*],echo $1 | nc $2 $3
        
        
        
        ## Author
        
        Patrick Fouquet
        
        
      groups:
        -
          name: Templates
      items:
        -
          uuid: f0a564d47d1c4748aeaaa141d3529c8c
          name: 'zk - $1'
          type: ZABBIX_ACTIVE
          key: 'echo2nc[mntr,{$ZOO_IP},{$ZOO_PORT}]'
          delay: 5m
          trends: '0'
          value_type: TEXT
          tags:
            -
              tag: Application
              value: Zookeeper
        -
          uuid: 31da499f63874a949cbacc8c597099b3
          name: 'zk - $1'
          type: ZABBIX_ACTIVE
          key: 'echo2nc[ruok,{$ZOO_IP},{$ZOO_PORT}]'
          trends: '0'
          value_type: TEXT
          tags:
            -
              tag: Application
              value: Zookeeper
          triggers:
            -
              uuid: 5fba7771acdd43e89d93b00928823a19
              expression: 'find(/App Zookeeper/echo2nc[ruok,{$ZOO_IP},{$ZOO_PORT}],,"like","imok")=0'
              name: 'zk - Node is not OK'
              priority: HIGH
              description: '{ITEM.VALUE}'
        -
          uuid: 280004eb1bab42649c35238c43817413
          name: 'zk - $1'
          type: DEPENDENT
          key: 'zookeeper[Alive Connections]'
          delay: '0'
          description: 'Number of connections to ZooKeeper that are currently alive.'
          preprocessing:
            -
              type: REGEX
              parameters:
                - 'zk_num_alive_connections\s([0-9]+)'
                - \1
          master_item:
            key: 'echo2nc[mntr,{$ZOO_IP},{$ZOO_PORT}]'
          tags:
            -
              tag: Application
              value: Zookeeper
          triggers:
            -
              uuid: d5e5807a20344b17ab3825b2cc8ed1f1
              expression: 'last(/App Zookeeper/zookeeper[Alive Connections])=0'
              name: 'zk - Node have no alive connection'
              priority: AVERAGE
        -
          uuid: e03803fdf432401aa714ad9f742534ac
          name: 'zk - $1'
          type: DEPENDENT
          key: 'zookeeper[Approximate Data Size]'
          delay: '0'
          units: B
          description: 'zk_approximate_data_size is the approximate memory consumption for all znodes stored in the ZooKeeper ensemble'
          preprocessing:
            -
              type: REGEX
              parameters:
                - 'zk_approximate_data_size\s([0-9]+)'
                - \1
          master_item:
            key: 'echo2nc[mntr,{$ZOO_IP},{$ZOO_PORT}]'
          tags:
            -
              tag: Application
              value: Zookeeper
        -
          uuid: 3ededbd6d17f4085ad537da58404f841
          name: 'zk - $1'
          type: DEPENDENT
          key: 'zookeeper[Ephemerals Count]'
          delay: '0'
          description: 'Number of ephemeral znodes.'
          preprocessing:
            -
              type: REGEX
              parameters:
                - 'zk_ephemerals_count\s([0-9]+)'
                - \1
          master_item:
            key: 'echo2nc[mntr,{$ZOO_IP},{$ZOO_PORT}]'
          tags:
            -
              tag: Application
              value: Zookeeper
        -
          uuid: 7db20fd6ae88491fa38eaf08d1b93f6f
          name: 'zk - $1'
          type: DEPENDENT
          key: 'zookeeper[Latency (avg)]'
          delay: '0'
          value_type: FLOAT
          units: s
          description: 'Average latency between ensemble hosts'
          preprocessing:
            -
              type: REGEX
              parameters:
                - 'zk_avg_latency\s([0-9]+)'
                - \1
            -
              type: MULTIPLIER
              parameters:
                - '0.001'
          master_item:
            key: 'echo2nc[mntr,{$ZOO_IP},{$ZOO_PORT}]'
          tags:
            -
              tag: Application
              value: Zookeeper
        -
          uuid: f7dfa624a3194f4f850cc983e34f3bfa
          name: 'zk - $1'
          type: DEPENDENT
          key: 'zookeeper[Latency (max)]'
          delay: '0'
          value_type: FLOAT
          units: s
          description: 'Maximum latency'
          preprocessing:
            -
              type: REGEX
              parameters:
                - 'zk_max_latency\s([0-9]+)'
                - \1
            -
              type: MULTIPLIER
              parameters:
                - '0.001'
          master_item:
            key: 'echo2nc[mntr,{$ZOO_IP},{$ZOO_PORT}]'
          tags:
            -
              tag: Application
              value: Zookeeper
        -
          uuid: 6971c825bb0d4bd9aea9c6c86db33190
          name: 'zk - $1'
          type: DEPENDENT
          key: 'zookeeper[Latency (min)]'
          delay: '0'
          value_type: FLOAT
          units: s
          description: 'Minimum latency'
          preprocessing:
            -
              type: REGEX
              parameters:
                - 'zk_min_latency\s([0-9]+)'
                - \1
            -
              type: MULTIPLIER
              parameters:
                - '0.001'
          master_item:
            key: 'echo2nc[mntr,{$ZOO_IP},{$ZOO_PORT}]'
          tags:
            -
              tag: Application
              value: Zookeeper
        -
          uuid: c1400e341a8b44979a7696fa5c47fd8c
          name: 'zk - $1'
          type: DEPENDENT
          key: 'zookeeper[Max File Descriptor Count]'
          delay: '0'
          description: 'Maximum number of file descriptors allowed for the ZooKeeper process.'
          preprocessing:
            -
              type: REGEX
              parameters:
                - 'zk_max_file_descriptor_count\s([0-9]+)'
                - \1
          master_item:
            key: 'echo2nc[mntr,{$ZOO_IP},{$ZOO_PORT}]'
          tags:
            -
              tag: Application
              value: Zookeeper
        -
          uuid: d86430cea5d5419e9b4c5f7af44965c1
          name: 'zk - $1'
          type: DEPENDENT
          key: 'zookeeper[Open File Descriptor Count]'
          delay: '0'
          description: 'Number of file descriptors open by the ZooKeeper process.'
          preprocessing:
            -
              type: REGEX
              parameters:
                - 'zk_open_file_descriptor_count\s([0-9]+)'
                - \1
          master_item:
            key: 'echo2nc[mntr,{$ZOO_IP},{$ZOO_PORT}]'
          tags:
            -
              tag: Application
              value: Zookeeper
        -
          uuid: 7d5c50fd885f40aea93186a0d727b5f5
          name: 'zk - $1'
          type: DEPENDENT
          key: 'zookeeper[Outstanding requests]'
          delay: '0'
          description: 'Number of outstanding requests that need to be processed by the cluster.'
          preprocessing:
            -
              type: REGEX
              parameters:
                - 'zk_outstanding_requests\s([0-9]+)'
                - \1
          master_item:
            key: 'echo2nc[mntr,{$ZOO_IP},{$ZOO_PORT}]'
          tags:
            -
              tag: Application
              value: Zookeeper
        -
          uuid: f056da768fbd4ec49b9d5ff44d1166f5
          name: 'zk - $1'
          type: DEPENDENT
          key: 'zookeeper[Packets Received / second]'
          delay: '0'
          value_type: FLOAT
          units: packet/s
          description: 'Number of ZooKeeper network packets received by second'
          preprocessing:
            -
              type: REGEX
              parameters:
                - 'zk_packets_received\s([0-9]+)'
                - \1
            -
              type: CHANGE_PER_SECOND
              parameters:
                - ''
          master_item:
            key: 'echo2nc[mntr,{$ZOO_IP},{$ZOO_PORT}]'
          tags:
            -
              tag: Application
              value: Zookeeper
        -
          uuid: 96a2e68fe2b94557ada6db9e30b83011
          name: 'zk - $1'
          type: DEPENDENT
          key: 'zookeeper[Packets Sent / second]'
          delay: '0'
          value_type: FLOAT
          units: packet/s
          description: 'Number of ZooKeeper network packets sent by second'
          preprocessing:
            -
              type: REGEX
              parameters:
                - 'zk_packets_sent\s([0-9]+)'
                - \1
            -
              type: CHANGE_PER_SECOND
              parameters:
                - ''
          master_item:
            key: 'echo2nc[mntr,{$ZOO_IP},{$ZOO_PORT}]'
          tags:
            -
              tag: Application
              value: Zookeeper
        -
          uuid: 602fd3bbe70d4c3ba0c8a118d283203c
          name: 'zk - $1'
          type: DEPENDENT
          key: 'zookeeper[Server State]'
          delay: '0'
          trends: '0'
          value_type: TEXT
          preprocessing:
            -
              type: REGEX
              parameters:
                - 'zk_server_state\s(.*)'
                - \1
          master_item:
            key: 'echo2nc[mntr,{$ZOO_IP},{$ZOO_PORT}]'
          tags:
            -
              tag: Application
              value: Zookeeper
          triggers:
            -
              uuid: 0f2d933509bc4f27b517f3b05954e7d6
              expression: '(last(/App Zookeeper/zookeeper[Server State],#1)<>last(/App Zookeeper/zookeeper[Server State],#2))=1'
              name: 'zk - Node State change to {ITEM.VALUE}'
              priority: INFO
        -
          uuid: 084ec2f7b7554ae2b739e5696715b182
          name: 'zk - $1'
          type: DEPENDENT
          key: 'zookeeper[Version]'
          delay: '0'
          trends: '0'
          value_type: TEXT
          preprocessing:
            -
              type: REGEX
              parameters:
                - 'zk_version\s(.*)'
                - \1
          master_item:
            key: 'echo2nc[mntr,{$ZOO_IP},{$ZOO_PORT}]'
          tags:
            -
              tag: Application
              value: Zookeeper
        -
          uuid: 2ff583feef6b488bb65eb5334d3c5ae8
          name: 'zk - $1'
          type: DEPENDENT
          key: 'zookeeper[Watch Count]'
          delay: '0'
          description: 'Number of watches currently set on the local ZooKeeper process.'
          preprocessing:
            -
              type: REGEX
              parameters:
                - 'zk_watch_count\s([0-9]+)'
                - \1
          master_item:
            key: 'echo2nc[mntr,{$ZOO_IP},{$ZOO_PORT}]'
          tags:
            -
              tag: Application
              value: Zookeeper
        -
          uuid: d2b97a03f556411086049aec9f802d5e
          name: 'zk - $1'
          type: DEPENDENT
          key: 'zookeeper[Znode Count]'
          delay: '0'
          description: 'zk_znode_count is the total count of znodes stored in the ZooKeeper ensemble. Every time a client creates a new znode, this counter will increment. Every time a client deletes a new znode (either explicitly or by dropping its ephemeral znodes after disconnection), this counter will decrement.'
          preprocessing:
            -
              type: REGEX
              parameters:
                - 'zk_znode_count\s([0-9]+)'
                - \1
          master_item:
            key: 'echo2nc[mntr,{$ZOO_IP},{$ZOO_PORT}]'
          tags:
            -
              tag: Application
              value: Zookeeper
      macros:
        -
          macro: '{$ZOO_IP}'
          value: 127.0.0.1
        -
          macro: '{$ZOO_PORT}'
          value: '2181'
      dashboards:
        -
          uuid: 9dceba2202e04fb2a3cd78e8c4dc8b5e
          name: Zookeeper
          pages:
            -
              widgets:
                -
                  type: PLAIN_TEXT
                  width: '12'
                  fields:
                    -
                      type: INTEGER
                      name: show_lines
                      value: '1'
                    -
                      type: INTEGER
                      name: show_as_html
                      value: '0'
                    -
                      type: ITEM
                      name: itemids
                      value:
                        key: 'zookeeper[Server State]'
                        host: 'App Zookeeper'
                -
                  type: PLAIN_TEXT
                  x: '12'
                  width: '12'
                  fields:
                    -
                      type: INTEGER
                      name: show_lines
                      value: '1'
                    -
                      type: INTEGER
                      name: show_as_html
                      value: '0'
                    -
                      type: ITEM
                      name: itemids
                      value:
                        key: 'zookeeper[Version]'
                        host: 'App Zookeeper'
                -
                  type: GRAPH_CLASSIC
                  'y': '2'
                  width: '12'
                  height: '5'
                  fields:
                    -
                      type: INTEGER
                      name: source_type
                      value: '0'
                    -
                      type: GRAPH
                      name: graphid
                      value:
                        name: Latency
                        host: 'App Zookeeper'
                -
                  type: GRAPH_CLASSIC
                  x: '12'
                  'y': '2'
                  width: '12'
                  height: '5'
                  fields:
                    -
                      type: INTEGER
                      name: source_type
                      value: '0'
                    -
                      type: GRAPH
                      name: graphid
                      value:
                        name: 'Packets / second'
                        host: 'App Zookeeper'
                -
                  type: GRAPH_CLASSIC
                  'y': '7'
                  width: '12'
                  height: '5'
                  fields:
                    -
                      type: INTEGER
                      name: source_type
                      value: '0'
                    -
                      type: GRAPH
                      name: graphid
                      value:
                        name: 'Actives Watches'
                        host: 'App Zookeeper'
                -
                  type: GRAPH_CLASSIC
                  x: '12'
                  'y': '7'
                  width: '12'
                  height: '5'
                  fields:
                    -
                      type: INTEGER
                      name: source_type
                      value: '0'
                    -
                      type: GRAPH
                      name: graphid
                      value:
                        name: 'File Descriptor Count'
                        host: 'App Zookeeper'
                -
                  type: GRAPH_CLASSIC
                  'y': '12'
                  width: '12'
                  height: '5'
                  fields:
                    -
                      type: INTEGER
                      name: source_type
                      value: '0'
                    -
                      type: GRAPH
                      name: graphid
                      value:
                        name: Znodes
                        host: 'App Zookeeper'
                -
                  type: GRAPH_CLASSIC
                  x: '12'
                  'y': '12'
                  width: '12'
                  height: '5'
                  fields:
                    -
                      type: INTEGER
                      name: source_type
                      value: '0'
                    -
                      type: GRAPH
                      name: graphid
                      value:
                        name: 'Alive Connections'
                        host: 'App Zookeeper'
                -
                  type: GRAPH_CLASSIC
                  'y': '17'
                  width: '12'
                  height: '5'
                  fields:
                    -
                      type: INTEGER
                      name: source_type
                      value: '0'
                    -
                      type: GRAPH
                      name: graphid
                      value:
                        name: 'Data Size'
                        host: 'App Zookeeper'
  triggers:
    -
      uuid: cae1158b4e384b4aae02724a1a9f01fd
      expression: '(last(/App Zookeeper/zookeeper[Open File Descriptor Count])/last(/App Zookeeper/zookeeper[Max File Descriptor Count]))>0.8'
      name: 'zk - Open File Descriptor near the Max File Descriptor'
      priority: AVERAGE
      description: |
        Open File Descriptor Count: {ITEM.VALUE1}
        Max File Descriptor Count: {ITEM.VALUE2}
  graphs:
    -
      uuid: ef0c6d0daaee46b295824e4c2ea270c9
      name: 'Actives Watches'
      graph_items:
        -
          color: '777777'
          item:
            host: 'App Zookeeper'
            key: 'zookeeper[Watch Count]'
    -
      uuid: 631f53a931eb455c80275aa0f674c175
      name: 'Alive Connections'
      graph_items:
        -
          drawtype: GRADIENT_LINE
          color: 6666FF
          calc_fnc: ALL
          item:
            host: 'App Zookeeper'
            key: 'zookeeper[Alive Connections]'
    -
      uuid: 20b0ef9d5ce84aaaa6b6a5ce2f486489
      name: 'Data Size'
      graph_items:
        -
          color: 1A7C11
          calc_fnc: ALL
          item:
            host: 'App Zookeeper'
            key: 'zookeeper[Approximate Data Size]'
    -
      uuid: 16db2fb2ca3242ddb8297ac5d2fccb9c
      name: 'File Descriptor Count'
      ymax_type_1: ITEM
      ymax_item_1:
        host: 'App Zookeeper'
        key: 'zookeeper[Max File Descriptor Count]'
      graph_items:
        -
          drawtype: FILLED_REGION
          color: 1A7C11
          item:
            host: 'App Zookeeper'
            key: 'zookeeper[Max File Descriptor Count]'
        -
          sortorder: '1'
          drawtype: FILLED_REGION
          color: F63100
          item:
            host: 'App Zookeeper'
            key: 'zookeeper[Open File Descriptor Count]'
    -
      uuid: 96ec214a90894317ab53ce8e437095e3
      name: Latency
      graph_items:
        -
          color: 1A7C11
          item:
            host: 'App Zookeeper'
            key: 'zookeeper[Latency (avg)]'
        -
          sortorder: '1'
          drawtype: DASHED_LINE
          color: F63100
          item:
            host: 'App Zookeeper'
            key: 'zookeeper[Latency (max)]'
        -
          sortorder: '2'
          drawtype: DASHED_LINE
          color: 2774A4
          item:
            host: 'App Zookeeper'
            key: 'zookeeper[Latency (min)]'
    -
      uuid: 7fc4b6d5822a4ab2bbf5c6f04994cd13
      name: 'Packets / second'
      graph_items:
        -
          color: 1A7C11
          item:
            host: 'App Zookeeper'
            key: 'zookeeper[Packets Received / second]'
        -
          sortorder: '1'
          color: F63100
          item:
            host: 'App Zookeeper'
            key: 'zookeeper[Packets Sent / second]'
    -
      uuid: 7ba988b139d147848a2a9dff1e1a5bea
      name: Znodes
      graph_items:
        -
          color: DD00DD
          item:
            host: 'App Zookeeper'
            key: 'zookeeper[Znode Count]'
