From 92ebc26cbc7209537b2150974145da26b80929bb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Pedro?= Date: Mon, 26 Jan 2026 12:17:16 -0300 Subject: [PATCH] chore: add pending debug scripts and finalize docs --- debug_macros.py | 17 +++++++++++++++++ find_regexp.py | 16 ++++++++++++++++ .../template_pfsense_hybrid_gold.yaml | 2 +- 3 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 debug_macros.py create mode 100644 find_regexp.py diff --git a/debug_macros.py b/debug_macros.py new file mode 100644 index 0000000..aebab53 --- /dev/null +++ b/debug_macros.py @@ -0,0 +1,17 @@ +import yaml + +file_path = r'C:\Users\joao.goncalves\Desktop\zabbix-itguys\templates_gold\pfsense_hybrid_snmp_agent\template_pfsense_hybrid_gold.yaml' + +try: + with open(file_path, 'r', encoding='utf-8') as f: + data = yaml.safe_load(f) + + macros = data['zabbix_export']['templates'][0]['macros'] + + print(f"Total macros: {len(macros)}") + for i, m in enumerate(macros): + val = m.get('value') + print(f"Macro {i+1} ({m['macro']}): Type={type(val)} Value='{val}'") + +except Exception as e: + print(f"Error: {e}") diff --git a/find_regexp.py b/find_regexp.py new file mode 100644 index 0000000..c60aec5 --- /dev/null +++ b/find_regexp.py @@ -0,0 +1,16 @@ +import yaml +import sys + +file_path = r'C:\Users\joao.goncalves\Desktop\zabbix-itguys\templates_gold\pfsense_hybrid_snmp_agent\template_pfsense_hybrid_gold.yaml' +try: + with open(file_path, 'r', encoding='utf-8') as f: + lines = f.readlines() + found = False + for i, line in enumerate(lines): + if 'REGEXP' in line: + print(f"Line {i+1}: {line.strip()}") + found = True + if not found: + print("String 'REGEXP' not found in file.") +except Exception as e: + print(f"Error: {e}") diff --git a/templates_gold/pfsense_hybrid_snmp_agent/template_pfsense_hybrid_gold.yaml b/templates_gold/pfsense_hybrid_snmp_agent/template_pfsense_hybrid_gold.yaml index a78416d..5c97444 100644 --- a/templates_gold/pfsense_hybrid_snmp_agent/template_pfsense_hybrid_gold.yaml +++ b/templates_gold/pfsense_hybrid_snmp_agent/template_pfsense_hybrid_gold.yaml @@ -2105,7 +2105,7 @@ zabbix_export: expression: change(/PFSense by SNMP/openvpn.user.real_address.new[{#VPN.USER}])<>0 and last(/PFSense by SNMP/openvpn.user.status[{#VPN.USER}])=1 name: 'OpenVPN [{#VPN.USER}]: IP Alterado Durante Sessão (Possível Hijacking)' event_name: '🛡️ SEGURANÇA: IP de {#VPN.USER} alterou para {ITEM.LASTVALUE1} enquanto conectado' - priority: HIGH + priority: AVERAGE description: 'O IP real do usuário mudou enquanto a sessão VPN ainda está ativa. Isso pode indicar: