zabbix_export:
  version: '7.4'
  host_groups:
    - uuid: 6f6799aa69e844b4b3918f779f2abf08
      name: 'Zabbix servers'
  hosts:
    - host: 'Zabbix server'
      name: 'Zabbix server'
      templates:
        - name: 'Zabbix server health'
      groups:
        - name: 'Zabbix servers'
      items:
        - name: 'Utilization of housekeeper internal processes, in seconds'
          type: CALCULATED
          key: 'zabbix[process,housekeeper,busytime]'
          delay: '60'
          units: s
          params: |
            (60 + last(//zabbix[process,housekeeper,busytime]))
             * last(//zabbix[process,housekeeper,avg,busy]) / 100
          description: |
            The cumulated time during which the housekeeper processes have been busy.
            Increments by 60 every minute housekeeper is busy, resets to zero when idle.
          preprocessing:
            - type: CHECK_NOT_SUPPORTED
              parameters:
                - '0'
                - '^Cannot evaluate function: item "/[^/]*/zabbix\[process,housekeeper,busytime]" is not supported'
              error_handler: CUSTOM_VALUE
              error_handler_params: '0'
            - type: CHECK_NOT_SUPPORTED
              parameters:
                - '0'
                - '^Cannot evaluate function: not enough data'
              error_handler: CUSTOM_VALUE
              error_handler_params: '0'
          tags:
            - tag: component
              value: internal-process
          triggers:
            - expression: 'last(/Zabbix server/zabbix[process,housekeeper,busytime])>{$ZABBIX.SERVER.UTIL.MAXTIME:"housekeeper"}'
              recovery_mode: RECOVERY_EXPRESSION
              recovery_expression: 'change(/Zabbix server/zabbix[process,housekeeper,busytime])<0 and last(/Zabbix server/zabbix[process,housekeeper,busytime],#2)<{$ZABBIX.SERVER.UTIL.MAXTIME:"housekeeper"}'
              name: 'Zabbix server: Utilization of housekeeper processes is high'
              event_name: 'Zabbix server: Utilization of housekeeper processes over {$ZABBIX.SERVER.UTIL.MAXTIME:"housekeeper"} seconds'
              priority: AVERAGE
              description: 'Indicates potential performance issues with the housekeeper, which may affect monitoring efficiency and response times.'
              tags:
                - tag: scope
                  value: performance
      macros:
        - macro: '{$ZABBIX.SERVER.UTIL.MAXTIME}'
          value: '300'
          description: 'Default maximum threshold for busytime utilization triggers (use macro context for specification).'
