From 0827fddaa563970a6ef19fe595d725d4d4910252 Mon Sep 17 00:00:00 2001 From: Ivo Oskamp Date: Mon, 9 Feb 2026 15:36:40 +0100 Subject: [PATCH] Add Synology DSM update parser and remove customer names from registry MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added parser registry entry for Synology DSM automatic update cancelled notifications. These are informational messages that don't participate in schedule learning or reporting logic. Also removed real customer names from parser registry examples to prevent customer information from being stored in the codebase. Replaced with generic placeholders like NAS-HOSTNAME, SERVER-HOSTNAME, VM-HOSTNAME. Changes: - Added synology_dsm_update parser entry in registry.py (order 236) - Parser matches on DSM-update/DSM update in subject and automatic/automatische in body - Returns backup_software: Synology, backup_type: Updates, informational status - Replaced customer names in NTFS Auditing example (bouter.nl → example.local) - Replaced customer names in QNAP example (BETSIES-NAS01 → NAS-HOSTNAME) - Replaced customer names in NAKIVO example (kuiperbv.nl → VM-HOSTNAME) - Updated changelog Co-Authored-By: Claude Sonnet 4.5 --- .../src/backend/app/parsers/registry.py | 44 +++++++++++++++---- docs/changelog-claude.md | 2 + 2 files changed, 37 insertions(+), 9 deletions(-) diff --git a/containers/backupchecks/src/backend/app/parsers/registry.py b/containers/backupchecks/src/backend/app/parsers/registry.py index b2fc100..1ea80b4 100644 --- a/containers/backupchecks/src/backend/app/parsers/registry.py +++ b/containers/backupchecks/src/backend/app/parsers/registry.py @@ -50,13 +50,13 @@ PARSER_DEFINITIONS = [ }, "description": "Parses NTFS Auditing file audit report mails (attachment-based HTML reports).", "example": { - "subject": "Bouter btr-dc001.bouter.nl file audits → 6 ↑ 12", - "from_address": "auditing@bouter.nl", + "subject": "SERVER-HOSTNAME file audits → 6 ↑ 12", + "from_address": "auditing@example.local", "body_snippet": "(empty body, HTML report in attachment)", "parsed_result": { "backup_software": "NTFS Auditing", "backup_type": "Audit", - "job_name": "btr-dc001.bouter.nl file audits", + "job_name": "SERVER-HOSTNAME file audits", "objects": [], }, }, @@ -73,16 +73,42 @@ PARSER_DEFINITIONS = [ }, "description": "Parses QNAP Notification Center firmware update notifications (informational; excluded from reporting and missing logic).", "example": { - "subject": "[Info][Firmware Update] Notification from your device: BETSIES-NAS01", + "subject": "[Info][Firmware Update] Notification from your device: NAS-HOSTNAME", "from_address": "notifications@customer.tld", - "body_snippet": "NAS Name: BETSIES-NAS01\n...\nMessage: ...", + "body_snippet": "NAS Name: NAS-HOSTNAME\n...\nMessage: ...", "parsed_result": { "backup_software": "QNAP", "backup_type": "Firmware Update", "job_name": "Firmware Update", "overall_status": "Warning", "objects": [ - {"name": "BETSIES-NAS01", "status": "Warning", "error_message": None} + {"name": "NAS-HOSTNAME", "status": "Warning", "error_message": None} + ], + }, + }, + }, + { + "name": "synology_dsm_update", + "backup_software": "Synology", + "backup_types": ["Updates"], + "order": 236, + "enabled": True, + "match": { + "subject_contains_any": ["DSM-update", "DSM update"], + "body_contains_any": ["automatische DSM-update", "automatic DSM update", "Automatic update of DSM"], + }, + "description": "Parses Synology DSM automatic update cancelled notifications (informational; excluded from reporting and missing logic).", + "example": { + "subject": "Synology NAS-HOSTNAME - Automatische DSM-update op NAS-HOSTNAME is geannuleerd door het systeem", + "from_address": "backup@example.local", + "body_snippet": "Het systeem heeft de automatische DSM-update op NAS-HOSTNAME geannuleerd...", + "parsed_result": { + "backup_software": "Synology", + "backup_type": "Updates", + "job_name": "Synology Automatic Update", + "overall_status": "Warning", + "objects": [ + {"name": "NAS-HOSTNAME", "status": "Warning"} ], }, }, @@ -383,16 +409,16 @@ PARSER_DEFINITIONS = [ }, "description": "Parses NAKIVO Backup & Replication reports for VMware backup jobs.", "example": { - "subject": '"exchange01.kuiperbv.nl" job: Successful', + "subject": '"VM-HOSTNAME" job: Successful', "from_address": "NAKIVO Backup & Replication ", "body_snippet": "Job Run Report... Backup job for VMware ... Successful", "parsed_result": { "backup_software": "NAKIVO", "backup_type": "Backup job for VMware", - "job_name": "exchange01.kuiperbv.nl", + "job_name": "VM-HOSTNAME", "objects": [ { - "name": "exchange01.kuiperbv.nl", + "name": "VM-HOSTNAME", "status": "Success", "error_message": "", } diff --git a/docs/changelog-claude.md b/docs/changelog-claude.md index 2bc0cab..f5eaf46 100644 --- a/docs/changelog-claude.md +++ b/docs/changelog-claude.md @@ -8,9 +8,11 @@ This file documents all changes made to this project via Claude Code. - Added "Cleanup orphaned jobs" maintenance option in Settings → Maintenance to delete jobs without valid customer links and their associated emails/runs permanently from database (useful when customers are removed) - Added "Preview orphaned jobs" button to show detailed list of jobs to be deleted with run/email counts before confirming deletion (verification step for safety) - Added "Generate test emails" feature in Settings → Maintenance with three separate buttons to create fixed test email sets (success/warning/error) in inbox for testing parsers and maintenance operations (each set contains exactly 3 Veeam Backup Job emails with the same job name "Test-Backup-Job" and different dates/objects/statuses for reproducible testing and proper status flow testing) +- Added parser registry entry for Synology DSM automatic update cancelled notifications (backup software: Synology, backup type: Updates, informational only, no schedule learning) ### Changed - Removed customer name from Autotask ticket title to keep titles concise (format changed from "[Backupchecks] Customer - Job Name - Status" to "[Backupchecks] Job Name - Status") +- Replaced real customer names in parser registry examples with generic placeholders (NTFS Auditing, QNAP Firmware Update, NAKIVO) to prevent customer information in codebase ### Fixed - Fixed Autotask ticket description being set to NULL when resolving tickets via `update_ticket_resolution_safe` by adding "description" to the optional_fields list, ensuring the original description is preserved during PUT operations