Created
February 19, 2024 22:00
-
-
Save wheel5up/7f0e1b5eb4afe003408ba6405beafce1 to your computer and use it in GitHub Desktop.
Zabbix template to capture borg backup status
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"zabbix_export": { | |
"version": "6.4", | |
"template_groups": [ | |
{ | |
"uuid": "7df96b18c230490a9a0a9e2307226338", | |
"name": "Templates" | |
} | |
], | |
"templates": [ | |
{ | |
"uuid": "ed843f719c0b424282a5f93ac97a9774", | |
"template": "borg backup", | |
"name": "borg backup", | |
"description": "used to capture output from borg backup", | |
"groups": [ | |
{ | |
"name": "Templates" | |
} | |
], | |
"items": [ | |
{ | |
"uuid": "0463ea9edd1346f9a86ec5a74d849886", | |
"name": "Borg backup amazon photos", | |
"type": "TRAP", | |
"key": "borg.backup.photos", | |
"delay": "0", | |
"trends": "0", | |
"value_type": "TEXT", | |
"description": "Borg backup stats", | |
"tags": [ | |
{ | |
"tag": "component", | |
"value": "backup" | |
}, | |
{ | |
"tag": "vendor", | |
"value": "borg" | |
} | |
], | |
"triggers": [ | |
{ | |
"uuid": "741c449d4c6f490394e47f4dcfb6a34a", | |
"expression": "nodata(/borg backup/borg.backup.photos,25h)", | |
"name": "Borg backup of {HOST.NAME} no backup for 24 hours", | |
"priority": "HIGH" | |
} | |
] | |
}, | |
{ | |
"uuid": "5608194d789c4505acbc14c8ae8105e9", | |
"name": "Borg photo backup duration", | |
"type": "DEPENDENT", | |
"key": "borg.backup.photos.duration", | |
"delay": "0", | |
"value_type": "FLOAT", | |
"units": "s", | |
"preprocessing": [ | |
{ | |
"type": "JSONPATH", | |
"parameters": [ | |
"$.archives[0].duration" | |
] | |
} | |
], | |
"master_item": { | |
"key": "borg.backup.photos" | |
}, | |
"tags": [ | |
{ | |
"tag": "component", | |
"value": "backup" | |
}, | |
{ | |
"tag": "vendor", | |
"value": "borg" | |
} | |
] | |
}, | |
{ | |
"uuid": "f3d1adc852f54899a628f0ae5aa70a5b", | |
"name": "Borg photo backup end", | |
"type": "DEPENDENT", | |
"key": "borg.backup.photos.end", | |
"delay": "0", | |
"units": "unixtime", | |
"preprocessing": [ | |
{ | |
"type": "JSONPATH", | |
"parameters": [ | |
"$.archives[0].end" | |
] | |
}, | |
{ | |
"type": "JAVASCRIPT", | |
"parameters": [ | |
"const unixTimeZero = Date.parse(value);\nreturn unixTimeZero/1000" | |
] | |
} | |
], | |
"master_item": { | |
"key": "borg.backup.photos" | |
}, | |
"tags": [ | |
{ | |
"tag": "component", | |
"value": "backup" | |
}, | |
{ | |
"tag": "vendor", | |
"value": "borg" | |
} | |
] | |
}, | |
{ | |
"uuid": "c4e55110f9bd4e2bbf0c0e0afbd97b1e", | |
"name": "Borg photo backup number of files", | |
"type": "DEPENDENT", | |
"key": "borg.backup.photos.nfiles", | |
"delay": "0", | |
"preprocessing": [ | |
{ | |
"type": "JSONPATH", | |
"parameters": [ | |
"$.archives[0].stats.nfiles" | |
] | |
} | |
], | |
"master_item": { | |
"key": "borg.backup.photos" | |
}, | |
"tags": [ | |
{ | |
"tag": "component", | |
"value": "backup" | |
}, | |
{ | |
"tag": "vendor", | |
"value": "borg" | |
} | |
] | |
}, | |
{ | |
"uuid": "fffa30659bfe40d48102a08edf1c46f4", | |
"name": "Borg photo backup size", | |
"type": "DEPENDENT", | |
"key": "borg.backup.photos.size", | |
"delay": "0", | |
"units": "B", | |
"preprocessing": [ | |
{ | |
"type": "JSONPATH", | |
"parameters": [ | |
"$.archives[0].stats.original_size" | |
] | |
} | |
], | |
"master_item": { | |
"key": "borg.backup.photos" | |
}, | |
"tags": [ | |
{ | |
"tag": "component", | |
"value": "backup" | |
}, | |
{ | |
"tag": "vendor", | |
"value": "borg" | |
} | |
] | |
}, | |
{ | |
"uuid": "d6c69f7355e149c2a80efba80a711410", | |
"name": "Borg photo backup start", | |
"type": "DEPENDENT", | |
"key": "borg.backup.photos.start", | |
"delay": "0", | |
"units": "unixtime", | |
"preprocessing": [ | |
{ | |
"type": "JSONPATH", | |
"parameters": [ | |
"$.archives[0].start" | |
] | |
}, | |
{ | |
"type": "JAVASCRIPT", | |
"parameters": [ | |
"const unixTimeZero = Date.parse(value);\nreturn unixTimeZero/1000" | |
] | |
} | |
], | |
"master_item": { | |
"key": "borg.backup.photos" | |
}, | |
"tags": [ | |
{ | |
"tag": "component", | |
"value": "backup" | |
}, | |
{ | |
"tag": "vendor", | |
"value": "borg" | |
} | |
] | |
}, | |
{ | |
"uuid": "f78cd8217d6a46019c863ba6cb9937dc", | |
"name": "Borg backup amazon photos status", | |
"type": "TRAP", | |
"key": "borg.backup.photos.status", | |
"delay": "0", | |
"description": "Borg backup status zero is passed", | |
"tags": [ | |
{ | |
"tag": "component", | |
"value": "backup" | |
}, | |
{ | |
"tag": "vendor", | |
"value": "borg" | |
} | |
] | |
} | |
], | |
"tags": [ | |
{ | |
"tag": "component", | |
"value": "backup" | |
}, | |
{ | |
"tag": "vendor", | |
"value": "borg" | |
} | |
] | |
} | |
], | |
"graphs": [ | |
{ | |
"uuid": "2ef2371e41044585b3ece305875ea19a", | |
"name": "backup status", | |
"graph_items": [ | |
{ | |
"color": "1A7C11", | |
"calc_fnc": "ALL", | |
"item": { | |
"host": "borg backup", | |
"key": "borg.backup.photos.nfiles" | |
} | |
}, | |
{ | |
"sortorder": "1", | |
"color": "274482", | |
"yaxisside": "RIGHT", | |
"calc_fnc": "ALL", | |
"item": { | |
"host": "borg backup", | |
"key": "borg.backup.photos.size" | |
} | |
} | |
] | |
} | |
] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment