zabbix_export: version: '5.4' date: '2021-11-21T22:04:36Z' groups: - uuid: 0e85f601c04d44aab171b49f61c986a9 name: Templates/Custom templates: - uuid: 543f342b117d4f9da2442c9bc59316f8 template: 'Housekeeping Metrics' name: 'Housekeeping Metrics' description: | ## Description Language: English Autor: Bernardo Lankheet Blog: www.bernardolankheet.com.br Repositorio: https://github.com/bernardolankheet/Zabbix-Monitor-Housekeeper ## Overview Project Name: Zabbix-Monitor-Housekeeper Author: Bernardo Lankheet Telegram: [@bernardolankheet](https://t.me/bernardolankheet) Description BR: Coleta de métricas sobre a execução do Housekeeper. *Não se aplica em ambientes que utiliza particionamento de tabelas ou outras rotinas para manutenção do banco de dados.* Description EN: Collect Metrics on Housekeeper Execution. *It does not apply in environments that use table partitioning or other routines for maintaining the bank.* OBS EN: Based on projet Diego Cavalcante [ZAKEEP.zabbix.housekeeper.monitor](https://github.com/suportecavalcante/zabbix.templates/tree/master/linux/ZAKEEP.zabbix.housekeeper.monitor) OBS BR: Ideia retirada do projeto do Diego Cavalcante [ZAKEEP.zabbix.housekeeper.monitor](https://github.com/suportecavalcante/zabbix.templates/tree/master/linux/ZAKEEP.zabbix.housekeeper.monitor) #### **## Usage** EN: Import your Template into Zabbix, link to the Host "Zabbix server" and wait for the items to be collected, collection is carried out according to the housekeeping schedule. Image 03 BR: Importe seu Template para o Zabbix, vincula o template ao Host "Zabbix server" e aguarde os itens serem coletados, a coleta é realizada conforme a programação do housekeeping. Imagem 03 #### **## How it works?** EN: Whenever housekeeping is performed by zabbix-server, a line is generated containing the information deleted from zabbix\_server.log. The item Syslog Housekeeping, of the log type, captures the information via active checking and the other dependent items are pre-filled according to parent item information. BR: Sempre que a manutenção é realizada pelo zabbix-server, uma linha é gerada contendo as informações excluídas do zabbix\_server.log. O item Syslog Housekeeping, do tipo log, captura as informações por meio de verificação ativa e os demais itens dependentes são pré-preenchidos de acordo com as informações do item pai. #### **## Macros** * {$ PATHLOG} - /var/log/zabbix/zabbix\_server.log - Path to zabbix\_server.log\ * {$ REGEXLOG} -. * Deleted. * [0-9] + hist \ /trends.* - Regex to capture the line for housekepping inside the log #### **## Homolog** * Zabbix 4.4 * Zabbix 5.0.6 #### **## Templates** * Template Housekeeping Metrics-EN-US - English version (on github) * Template Housekeeping Metricas - PT-BR (no github) ## Author Bernardo Lankheet groups: - name: Templates/Custom items: - uuid: e6e79def6d9a438ebbd99062e4d240ad name: 'Records deleted in Alarms' type: DEPENDENT key: dep.housekeeper.alarms delay: '0' history: 7d trends: 120d preprocessing: - type: REGEX parameters: - 'sessions, (.*) alarms' - \1 error_handler: CUSTOM_VALUE error_handler_params: '-1' master_item: key: 'log[{$PATHLOG},"{$REGEXLOG}",,,skip,,]' tags: - tag: Application value: '02 - Housekeeping - Metrics' - uuid: 04663549495641988d8d35960ae31bb3 name: 'Records deleted in Audit' type: DEPENDENT key: dep.housekeeper.audit delay: '0' history: 7d trends: 120d preprocessing: - type: REGEX parameters: - 'alarms, (.*) audit' - \1 error_handler: CUSTOM_VALUE error_handler_params: '-1' master_item: key: 'log[{$PATHLOG},"{$REGEXLOG}",,,skip,,]' tags: - tag: Application value: '02 - Housekeeping - Metrics' - uuid: 38cd0e0732f44203a4304c90c47b6c72 name: 'Duration of the last executed Housekeeper' type: DEPENDENT key: dep.housekeeper.duration delay: '0' history: 7d trends: 120d value_type: FLOAT units: uptime preprocessing: - type: REGEX parameters: - 'records in (.*) sec' - \1 error_handler: CUSTOM_VALUE error_handler_params: '-1' master_item: key: 'log[{$PATHLOG},"{$REGEXLOG}",,,skip,,]' tags: - tag: Application value: '02 - Housekeeping - Metrics' - uuid: e9bb2dc5d2614878ae0d1011a3ce11e7 name: 'Records deleted in Events' type: DEPENDENT key: dep.housekeeper.events delay: '0' history: 7d trends: 120d preprocessing: - type: REGEX parameters: - 'triggers, (.*) events' - \1 error_handler: CUSTOM_VALUE error_handler_params: '-1' master_item: key: 'log[{$PATHLOG},"{$REGEXLOG}",,,skip,,]' tags: - tag: Application value: '02 - Housekeeping - Metrics' - uuid: c521a45cdbe44bcd83f799422393d855 name: 'Records deleted in Hist/Trends' type: DEPENDENT key: dep.housekeeper.histtrends delay: '0' history: 7d trends: 120d preprocessing: - type: REGEX parameters: - 'deleted (.*) hist' - \1 error_handler: CUSTOM_VALUE error_handler_params: '-1' master_item: key: 'log[{$PATHLOG},"{$REGEXLOG}",,,skip,,]' tags: - tag: Application value: '02 - Housekeeping - Metrics' - uuid: 156b2ead97724afebdaf7b3c185f2909 name: 'Records deleted in Items-Triggers' type: DEPENDENT key: dep.housekeeper.itemstriggers delay: '0' history: 7d trends: 120d preprocessing: - type: REGEX parameters: - ', (.*) items\/triggers' - \1 error_handler: CUSTOM_VALUE error_handler_params: '-1' master_item: key: 'log[{$PATHLOG},"{$REGEXLOG}",,,skip,,]' tags: - tag: Application value: '02 - Housekeeping - Metrics' - uuid: 91255e8bd3e6431c9eaaefd7bb9bc1d7 name: 'Records deleted in Problems' type: DEPENDENT key: dep.housekeeper.problems delay: '0' history: 7d trends: 120d preprocessing: - type: REGEX parameters: - 'events, (.*) problems' - \1 error_handler: CUSTOM_VALUE error_handler_params: '-1' master_item: key: 'log[{$PATHLOG},"{$REGEXLOG}",,,skip,,]' tags: - tag: Application value: '02 - Housekeeping - Metrics' - uuid: 8faafb351124453a9774271675dabe7a name: 'Records deleted in Sessions' type: DEPENDENT key: dep.housekeeper.sessions delay: '0' history: 7d trends: 120d preprocessing: - type: REGEX parameters: - 'problems, (.*) sessions' - \1 error_handler: CUSTOM_VALUE error_handler_params: '-1' master_item: key: 'log[{$PATHLOG},"{$REGEXLOG}",,,skip,,]' tags: - tag: Application value: '02 - Housekeeping - Metrics' - uuid: 2e2129dd1e8b4d05bdd771d6923abf21 name: 'Syslog Housekeeping' type: ZABBIX_ACTIVE key: 'log[{$PATHLOG},"{$REGEXLOG}",,,skip,,]' delay: 1s history: '0' trends: '0' value_type: LOG tags: - tag: Application value: '01 - Housekeeping - Log' tags: - tag: Zabbix value: Housekeeping macros: - macro: '{$PATHLOG}' value: /var/log/zabbix/zabbix_server.log description: 'Path Log zabbix_server.log' - macro: '{$REGEXLOG}' value: '.*deleted.*[0-9]+ hist\/trends.*' description: 'Regex Housekeeping line' graphs: - uuid: aaebced1e3ee412cab49905f9cc54551 name: 'Housekeeper - Duration' graph_items: - color: 1A7C11 yaxisside: RIGHT calc_fnc: ALL item: host: 'Housekeeping Metrics' key: dep.housekeeper.duration - uuid: d7945f5b35d4488491785ef441479004 name: 'Housekeeper - Metrics' ymin_type_1: FIXED graph_items: - drawtype: DASHED_LINE color: F63100 calc_fnc: ALL item: host: 'Housekeeping Metrics' key: dep.housekeeper.alarms - sortorder: '1' drawtype: DASHED_LINE color: 2774A4 calc_fnc: ALL item: host: 'Housekeeping Metrics' key: dep.housekeeper.audit - sortorder: '2' drawtype: DASHED_LINE color: A54F10 calc_fnc: ALL item: host: 'Housekeeping Metrics' key: dep.housekeeper.events - sortorder: '3' drawtype: DASHED_LINE color: 5A5A5A calc_fnc: ALL item: host: 'Housekeeping Metrics' key: dep.housekeeper.histtrends - sortorder: '4' drawtype: DASHED_LINE color: 4DB6AC calc_fnc: ALL item: host: 'Housekeeping Metrics' key: dep.housekeeper.itemstriggers - sortorder: '5' drawtype: DASHED_LINE color: AC8C14 calc_fnc: ALL item: host: 'Housekeeping Metrics' key: dep.housekeeper.problems - sortorder: '6' drawtype: DASHED_LINE color: 611F27 calc_fnc: ALL item: host: 'Housekeeping Metrics' key: dep.housekeeper.sessions