diff --git a/app/borg/template_app_borg.yaml b/app/borg/template_app_borg.yaml new file mode 100644 index 0000000..2269d61 --- /dev/null +++ b/app/borg/template_app_borg.yaml @@ -0,0 +1,245 @@ +zabbix_export: + version: '7.0' + template_groups: + - uuid: cd6848345eb04289b2d5260c10e0d269 + name: devloop + templates: + - uuid: 3077e7298167465b96d30503bcff4769 + template: 'Template Borg Backup Passive' + name: 'Borg Backup Passive' + description: 'Check the last Borg Backup Archive, Visualize the sizes and checks if the backup older than one day' + vendor: + name: devloop + version: '1.0' + groups: + - name: devloop + items: + - uuid: 336cb21ab1d94ccd8c467554b2ac737f + name: 'Borg Archives Duration' + type: DEPENDENT + key: borg.duration + delay: '0' + history: 90d + value_type: FLOAT + units: s + preprocessing: + - type: JSONPATH + parameters: + - '$.archives[0].duration' + master_item: + key: 'vfs.file.contents[/tmp/borg.json]' + tags: + - tag: Application + value: Backup + triggers: + - uuid: 9106b7035dd44b9794d052a70a9fec37 + expression: 'last(/Template Borg Backup Passive/borg.duration)>{$BORG_BACKUP_CREATE_TIMEOUT}' + name: 'Borg Backup takes to long ({$BORG_BACKUP_CREATE_TIMEOUT})' + priority: WARNING + description: 'Check why, this should not normal. Only for the first backup.' + manual_close: 'YES' + - uuid: 87dcf43716a74a21b65feddce3d0f064 + name: 'Borg Archives End Time' + type: DEPENDENT + key: borg.endtime + delay: '0' + history: 90d + units: unixtime + preprocessing: + - type: JSONPATH + parameters: + - '$.archives[0].end' + - type: JAVASCRIPT + parameters: + - | + var datum = Date.parse(value); + return datum/1000; + - type: DISCARD_UNCHANGED + parameters: + - '' + master_item: + key: 'vfs.file.contents[/tmp/borg.json]' + tags: + - tag: Application + value: Backup + triggers: + - uuid: d6df5c18fbd14732bda75638a6922f79 + expression: 'last(/Template Borg Backup Passive/borg.endtime)48h)' + priority: HIGH + description: 'Backup ist zu alt!' + manual_close: 'YES' + - uuid: 1d41273ecf814024aab9a39db820ef53 + name: 'Borg Archives Hostname' + type: DEPENDENT + key: borg.hostname + delay: '0' + history: 90d + value_type: TEXT + trends: '0' + preprocessing: + - type: JSONPATH + parameters: + - '$.archives[0].hostname' + - type: DISCARD_UNCHANGED + parameters: + - '' + master_item: + key: 'vfs.file.contents[/tmp/borg.json]' + tags: + - tag: Application + value: Backup + - uuid: 7ccd45201b76457aac950f3b78cb6f65 + name: 'Borg Archives Name' + type: DEPENDENT + key: borg.name + delay: '0' + history: 90d + value_type: TEXT + trends: '0' + preprocessing: + - type: JSONPATH + parameters: + - '$.archives[0].name' + - type: DISCARD_UNCHANGED + parameters: + - '' + master_item: + key: 'vfs.file.contents[/tmp/borg.json]' + tags: + - tag: Application + value: Backup + - uuid: 3eb83727e37e4776985bbd03c7162be5 + name: 'Borg Archives Stats Compressed Size' + type: DEPENDENT + key: borg.stats.compressedsize + delay: '0' + history: 90d + units: b + preprocessing: + - type: JSONPATH + parameters: + - '$.archives[0].stats.compressed_size' + master_item: + key: 'vfs.file.contents[/tmp/borg.json]' + tags: + - tag: Application + value: Backup + - uuid: d450490ae0cc4ec1a0742e4699338257 + name: 'Borg Archives Stats Deduplicated Size' + type: DEPENDENT + key: borg.stats.deduplicated_size + delay: '0' + history: 90d + units: b + preprocessing: + - type: JSONPATH + parameters: + - '$.archives[0].stats.deduplicated_size' + master_item: + key: 'vfs.file.contents[/tmp/borg.json]' + tags: + - tag: Application + value: Backup + - uuid: 0f7496d82a1e42d99ca5ad0b9a6e142d + name: 'Borg Archives Stats Number Files' + type: DEPENDENT + key: borg.stats.nfiles + delay: '0' + history: 90d + preprocessing: + - type: JSONPATH + parameters: + - '$.archives[0].stats.nfiles' + master_item: + key: 'vfs.file.contents[/tmp/borg.json]' + tags: + - tag: Application + value: Backup + - uuid: 1247416a5ecb443d87839be21ebbf9a3 + name: 'Borg Archives Stats Original Size' + type: DEPENDENT + key: borg.stats.original_size + delay: '0' + history: 90d + units: b + preprocessing: + - type: JSONPATH + parameters: + - '$.archives[0].stats.original_size' + master_item: + key: 'vfs.file.contents[/tmp/borg.json]' + tags: + - tag: Application + value: Backup + - uuid: fb86659de9b749e9b7067c36c7c156f0 + name: Borg.Json + key: 'vfs.file.contents[/tmp/borg.json]' + delay: 2h + history: 2d + value_type: TEXT + trends: '0' + description: 'Get the last archive as JSON' + - uuid: 0b42b36f90f04847847c47d8745c5615 + name: 'Borg Json File Exists' + key: 'vfs.file.exists[/tmp/borg.json]' + delay: 2h + history: 90d + tags: + - tag: Application + value: Backup + - uuid: 560085948d5d4362babe4149c0fdc442 + name: 'Borg Json File Size' + key: 'vfs.file.size[/tmp/borg.json]' + delay: 2h + history: 90d + tags: + - tag: Application + value: Backup + macros: + - macro: '{$BORG_BACKUP_CREATE_TIMEOUT}' + value: 15m + description: 'Maximal Duration of creating the Backup in Minutes' + triggers: + - uuid: 17ef68f9bfd949a39a6d5a940f33bf9f + expression: 'last(/Template Borg Backup Passive/vfs.file.exists[/tmp/borg.json],#2)=0 or last(/Template Borg Backup Passive/vfs.file.size[/tmp/borg.json])<200' + name: 'Invalid Borg JSON File' + priority: WARNING + description: 'Check if backup script is executed via cron' + manual_close: 'YES' + graphs: + - uuid: 65f56ed68e92403da4957f4ae45b81f6 + name: 'Backup Archive Size' + show_triggers: 'NO' + ymin_type_1: FIXED + graph_items: + - color: 42A5F5 + item: + host: 'Template Borg Backup Passive' + key: borg.stats.compressedsize + - sortorder: '1' + color: 1B5E20 + item: + host: 'Template Borg Backup Passive' + key: borg.stats.deduplicated_size + - sortorder: '2' + color: FF0000 + item: + host: 'Template Borg Backup Passive' + key: borg.stats.original_size + - uuid: 17d5a2ac075748ff899bca3c1374de6b + name: 'Backup Duration' + ymin_type_1: FIXED + graph_items: + - color: 1A7C11 + item: + host: 'Template Borg Backup Passive' + key: borg.duration + - uuid: 8e582251b8544534bad0cfeaa5ecb802 + name: 'Backuped Files' + ymin_type_1: FIXED + graph_items: + - color: 1A7C11 + item: + host: 'Template Borg Backup Passive' + key: borg.stats.nfiles diff --git a/app/borg/template_app_borg_active.yaml b/app/borg/template_app_borg_active.yaml new file mode 100644 index 0000000..5001a87 --- /dev/null +++ b/app/borg/template_app_borg_active.yaml @@ -0,0 +1,248 @@ +zabbix_export: + version: '7.0' + template_groups: + - uuid: cd6848345eb04289b2d5260c10e0d269 + name: devloop + templates: + - uuid: 0ae56f6a7bc94b48891d4aa22e16c0d4 + template: 'Template Borg Backup Active' + name: 'Borg Backup Active' + description: 'Check the last Borg Backup Archive, Visualize the sizes and checks if the backup older than one day' + vendor: + name: devloop + version: '1.0' + groups: + - name: devloop + items: + - uuid: 767935b5d6304e2d8abf2b8ae81c176a + name: 'Borg Archives Duration' + type: DEPENDENT + key: borg.duration + delay: '0' + history: 90d + value_type: FLOAT + units: s + preprocessing: + - type: JSONPATH + parameters: + - '$.archives[0].duration' + master_item: + key: 'vfs.file.contents[/tmp/borg.json]' + tags: + - tag: Application + value: Backup + triggers: + - uuid: 1edb990e68cd4774a54a687d0e665ddb + expression: 'last(/Template Borg Backup Active/borg.duration)>{$BORG_BACKUP_CREATE_TIMEOUT}' + name: 'Borg Backup takes to long ({$BORG_BACKUP_CREATE_TIMEOUT})' + priority: WARNING + description: 'Check why, this should not normal. Only for the first backup.' + manual_close: 'YES' + - uuid: 18a28e85e3994bf4be1625c131525ea1 + name: 'Borg Archives End Time' + type: DEPENDENT + key: borg.endtime + delay: '0' + history: 90d + units: unixtime + preprocessing: + - type: JSONPATH + parameters: + - '$.archives[0].end' + - type: JAVASCRIPT + parameters: + - | + var datum = Date.parse(value); + return datum/1000; + - type: DISCARD_UNCHANGED + parameters: + - '' + master_item: + key: 'vfs.file.contents[/tmp/borg.json]' + tags: + - tag: Application + value: Backup + triggers: + - uuid: ab4fce53507145a39d207a7500ad231c + expression: 'last(/Template Borg Backup Active/borg.endtime)48h)' + priority: HIGH + description: 'Backup ist zu alt!' + manual_close: 'YES' + - uuid: 7aa227f7fb804db6b999a736ab472c71 + name: 'Borg Archives Hostname' + type: DEPENDENT + key: borg.hostname + delay: '0' + history: 90d + value_type: TEXT + trends: '0' + preprocessing: + - type: JSONPATH + parameters: + - '$.archives[0].hostname' + - type: DISCARD_UNCHANGED + parameters: + - '' + master_item: + key: 'vfs.file.contents[/tmp/borg.json]' + tags: + - tag: Application + value: Backup + - uuid: a0ddfc714a6940489efc01277b2aa206 + name: 'Borg Archives Name' + type: DEPENDENT + key: borg.name + delay: '0' + history: 90d + value_type: TEXT + trends: '0' + preprocessing: + - type: JSONPATH + parameters: + - '$.archives[0].name' + - type: DISCARD_UNCHANGED + parameters: + - '' + master_item: + key: 'vfs.file.contents[/tmp/borg.json]' + tags: + - tag: Application + value: Backup + - uuid: f0002944e5c44fddad366690011c239a + name: 'Borg Archives Stats Compressed Size' + type: DEPENDENT + key: borg.stats.compressedsize + delay: '0' + history: 90d + units: b + preprocessing: + - type: JSONPATH + parameters: + - '$.archives[0].stats.compressed_size' + master_item: + key: 'vfs.file.contents[/tmp/borg.json]' + tags: + - tag: Application + value: Backup + - uuid: 96fd6a922d66499ba9b7c6db1e2c4ae4 + name: 'Borg Archives Stats Deduplicated Size' + type: DEPENDENT + key: borg.stats.deduplicated_size + delay: '0' + history: 90d + units: b + preprocessing: + - type: JSONPATH + parameters: + - '$.archives[0].stats.deduplicated_size' + master_item: + key: 'vfs.file.contents[/tmp/borg.json]' + tags: + - tag: Application + value: Backup + - uuid: 51d34f6bc162424bbe6867e2469c0ba9 + name: 'Borg Archives Stats Number Files' + type: DEPENDENT + key: borg.stats.nfiles + delay: '0' + history: 90d + preprocessing: + - type: JSONPATH + parameters: + - '$.archives[0].stats.nfiles' + master_item: + key: 'vfs.file.contents[/tmp/borg.json]' + tags: + - tag: Application + value: Backup + - uuid: 8eba451c79a14d74922b2144f81df926 + name: 'Borg Archives Stats Original Size' + type: DEPENDENT + key: borg.stats.original_size + delay: '0' + history: 90d + units: b + preprocessing: + - type: JSONPATH + parameters: + - '$.archives[0].stats.original_size' + master_item: + key: 'vfs.file.contents[/tmp/borg.json]' + tags: + - tag: Application + value: Backup + - uuid: 752052a6e898406cbf136a36856a024d + name: Borg.Json + type: ZABBIX_ACTIVE + key: 'vfs.file.contents[/tmp/borg.json]' + delay: 2h + history: 2d + value_type: TEXT + trends: '0' + description: 'Get the last archive as JSON' + - uuid: 8d594ca9d98c40cfaf91ba276d20beaa + name: 'Borg Json File Exists' + type: ZABBIX_ACTIVE + key: 'vfs.file.exists[/tmp/borg.json]' + delay: 2h + history: 90d + tags: + - tag: Application + value: Backup + - uuid: f1a2e23b87024ccfb630bd72b1e0d929 + name: 'Borg Json File Size' + type: ZABBIX_ACTIVE + key: 'vfs.file.size[/tmp/borg.json]' + delay: 2h + history: 90d + tags: + - tag: Application + value: Backup + macros: + - macro: '{$BORG_BACKUP_CREATE_TIMEOUT}' + value: 15m + description: 'Maximal Duration of creating the Backup in Minutes' + triggers: + - uuid: 167b925b72b14095bffc297acfd70a75 + expression: 'last(/Template Borg Backup Active/vfs.file.exists[/tmp/borg.json],#2)=0 or last(/Template Borg Backup Active/vfs.file.size[/tmp/borg.json])<200' + name: 'Check Borg Result File' + priority: WARNING + description: 'Check if backup script is executed via cron and created a status file with relevant information in json format' + manual_close: 'YES' + graphs: + - uuid: 77a4bb2baacc4886800509954bd4b28b + name: 'Backup Archive Size' + show_triggers: 'NO' + ymin_type_1: FIXED + graph_items: + - color: 42A5F5 + item: + host: 'Template Borg Backup Active' + key: borg.stats.compressedsize + - sortorder: '1' + color: 1B5E20 + item: + host: 'Template Borg Backup Active' + key: borg.stats.deduplicated_size + - sortorder: '2' + color: FF0000 + item: + host: 'Template Borg Backup Active' + key: borg.stats.original_size + - uuid: 6f229b97476543a9bfb769a7fa4f5645 + name: 'Backup Duration' + ymin_type_1: FIXED + graph_items: + - color: 1A7C11 + item: + host: 'Template Borg Backup Active' + key: borg.duration + - uuid: e1735b27eee9446ab6a37dfeb52afa80 + name: 'Backuped Files' + ymin_type_1: FIXED + graph_items: + - color: 1A7C11 + item: + host: 'Template Borg Backup Active' + key: borg.stats.nfiles