{
    "zabbix_export": {
        "version": "6.0",
        "date": "2025-12-26T16:24:03Z",
        "groups": [
            {
                "uuid": "a571c0d144b14fd4a87a9d9b2aa9fcd6",
                "name": "Templates/Applications"
            }
        ],
        "templates": [
            {
                "uuid": "ff010bd77ad449c487951af0d515b7b9",
                "template": "Continual-sync source sets",
                "name": "Continual-sync source sets",
                "description": "Autodiscovery of directory synchronisation sets managed by continual-sync",
                "groups": [
                    {
                        "name": "Templates/Applications"
                    }
                ],
                "discovery_rules": [
                    {
                        "uuid": "a21f62f06f944d8ca397cc82bf54e153",
                        "name": "Sync sections",
                        "type": "ZABBIX_ACTIVE",
                        "key": "vfs.file.contents[{$CONTINUAL_SYNC_SECTION_LIST_FILE}]",
                        "delay": "10m",
                        "item_prototypes": [
                            {
                                "uuid": "29576ade155246829e749fdca618193e",
                                "name": "Sync set {#NAME} - current action",
                                "type": "ZABBIX_ACTIVE",
                                "key": "vfs.file.regexp[{#STATUS_FILE},\"^current action * : (.+)$\",,,,\\1]",
                                "history": "1d",
                                "trends": "0",
                                "value_type": "CHAR",
                                "description": "The current action being performed on this section, or \"-\" if nothing is happening.",
                                "tags": [
                                    {
                                        "tag": "component",
                                        "value": "continual-sync"
                                    },
                                    {
                                        "tag": "section",
                                        "value": "{#NAME}"
                                    }
                                ]
                            },
                            {
                                "uuid": "3d961f137c3247e3abde76171d74cecd",
                                "name": "Sync set {#NAME} - consecutive full sync failures",
                                "type": "ZABBIX_ACTIVE",
                                "key": "vfs.file.regexp[{#STATUS_FILE},\"^full sync failures * : ([0-9]+)\",,,,\\1]",
                                "delay": "5m",
                                "description": "How many full sync attempts have failed in a row, or zero if the last full sync succeeded.",
                                "tags": [
                                    {
                                        "tag": "component",
                                        "value": "continual-sync"
                                    },
                                    {
                                        "tag": "section",
                                        "value": "{#NAME}"
                                    }
                                ],
                                "trigger_prototypes": [
                                    {
                                        "uuid": "2654eeea54dc4e6d9711ca572e127a7f",
                                        "expression": "last(/Continual-sync source sets/vfs.file.regexp[{#STATUS_FILE},\"^full sync failures * : ([0-9]+)\",,,,\\1])>{$CONTINUAL_SYNC_MAX_FULL_SYNC_FAILURES}",
                                        "name": "Sync set {#NAME} - full sync failing",
                                        "priority": "HIGH",
                                        "description": "The continual-sync section \"{#NAME}\" has failed its full sync too many times in a row - more than {$CONTINUAL_SYNC_MAX_FULL_SYNC_FAILURES}.",
                                        "tags": [
                                            {
                                                "tag": "scope",
                                                "value": "availability"
                                            }
                                        ]
                                    }
                                ]
                            },
                            {
                                "uuid": "7edd90fb869d4b7aa2911cdbf6bbc62a",
                                "name": "Sync set {#NAME} - last successful full sync",
                                "type": "ZABBIX_ACTIVE",
                                "key": "vfs.file.regexp[{#STATUS_FILE},\"^last full sync   * : .* .@([0-9]+)\",,,,\\1]",
                                "history": "1d",
                                "trends": "0",
                                "units": "unixtime",
                                "description": "The time of the last successful full sync.",
                                "tags": [
                                    {
                                        "tag": "component",
                                        "value": "continual-sync"
                                    },
                                    {
                                        "tag": "section",
                                        "value": "{#NAME}"
                                    }
                                ],
                                "trigger_prototypes": [
                                    {
                                        "uuid": "6c97a585e6104434b93a02f05b95f0a5",
                                        "expression": "(now()-last(/Continual-sync source sets/vfs.file.regexp[{#STATUS_FILE},\"^last full sync   * : .* .@([0-9]+)\",,,,\\1]))>{$CONTINUAL_SYNC_FULL_SYNC_OVERDUE_MULTIPLIER}*{#FULL_SYNC_INTERVAL}",
                                        "name": "Sync set {#NAME} - full sync overdue",
                                        "priority": "HIGH",
                                        "description": "The continual-sync section \"{#NAME}\" has not had a successful full sync for more than {$CONTINUAL_SYNC_FULL_SYNC_OVERDUE_MULTIPLIER} times the full sync interval of {#FULL_SYNC_INTERVAL} seconds.",
                                        "tags": [
                                            {
                                                "tag": "scope",
                                                "value": "availability"
                                            }
                                        ]
                                    }
                                ]
                            },
                            {
                                "uuid": "993b1527ec2c42fbb10d0a8f3c0b86cc",
                                "name": "Sync set {#NAME} - last full sync status",
                                "type": "ZABBIX_ACTIVE",
                                "key": "vfs.file.regexp[{#STATUS_FILE},\"^last full sync status * : (.+)$\",,,,\\1]",
                                "history": "1d",
                                "trends": "0",
                                "value_type": "CHAR",
                                "description": "Whether the last full sync succeeded (\"OK\") or failed (\"FAILED\"), or \"-\" if none was run yet.",
                                "tags": [
                                    {
                                        "tag": "component",
                                        "value": "continual-sync"
                                    },
                                    {
                                        "tag": "section",
                                        "value": "{#NAME}"
                                    }
                                ]
                            },
                            {
                                "uuid": "ca21b53fa0fb4bebb1cb20d4f8129b4c",
                                "name": "Sync set {#NAME} - last successful partial sync",
                                "type": "ZABBIX_ACTIVE",
                                "key": "vfs.file.regexp[{#STATUS_FILE},\"^last partial sync   * : .* .@([0-9]+)\",,,,\\1]",
                                "history": "1d",
                                "trends": "0",
                                "units": "unixtime",
                                "description": "The time of the last successful partial sync.",
                                "tags": [
                                    {
                                        "tag": "component",
                                        "value": "continual-sync"
                                    },
                                    {
                                        "tag": "section",
                                        "value": "{#NAME}"
                                    }
                                ],
                                "trigger_prototypes": [
                                    {
                                        "uuid": "e6b2fc6dd0534df2b9d94dc03ce52d80",
                                        "expression": "(now()-last(/Continual-sync source sets/vfs.file.regexp[{#STATUS_FILE},\"^last partial sync   * : .* .@([0-9]+)\",,,,\\1]))>{$CONTINUAL_SYNC_PARTIAL_SYNC_OVERDUE_MULTIPLIER}*{#PARTIAL_SYNC_INTERVAL}",
                                        "name": "Sync set {#NAME} - partial sync overdue",
                                        "priority": "AVERAGE",
                                        "description": "The continual-sync section \"{#NAME}\" has not had a successful partial sync for more than {$CONTINUAL_SYNC_PARTIAL_SYNC_OVERDUE_MULTIPLIER} times the partial sync interval of {#PARTIAL_SYNC_INTERVAL} seconds.",
                                        "tags": [
                                            {
                                                "tag": "scope",
                                                "value": "availability"
                                            }
                                        ]
                                    }
                                ]
                            },
                            {
                                "uuid": "b5997cee13c64d60854f010e1a013f93",
                                "name": "Sync set {#NAME} - last partial sync status",
                                "type": "ZABBIX_ACTIVE",
                                "key": "vfs.file.regexp[{#STATUS_FILE},\"^last partial sync status * : (.+)$\",,,,\\1]",
                                "history": "1d",
                                "trends": "0",
                                "value_type": "CHAR",
                                "description": "Whether the last partial sync succeeded (\"OK\") or failed (\"FAILED\"), or \"-\" if none was run yet.",
                                "tags": [
                                    {
                                        "tag": "component",
                                        "value": "continual-sync"
                                    },
                                    {
                                        "tag": "section",
                                        "value": "{#NAME}"
                                    }
                                ]
                            },
                            {
                                "uuid": "22b5c52405804041a264a1c4171fe9ac",
                                "name": "Sync set {#NAME} - next full sync due",
                                "type": "ZABBIX_ACTIVE",
                                "key": "vfs.file.regexp[{#STATUS_FILE},\"^next full sync   * : .* .@([0-9]+)\",,,,\\1]",
                                "history": "1d",
                                "trends": "0",
                                "units": "unixtime",
                                "description": "The time when the next full sync will be attempted.",
                                "tags": [
                                    {
                                        "tag": "component",
                                        "value": "continual-sync"
                                    },
                                    {
                                        "tag": "section",
                                        "value": "{#NAME}"
                                    }
                                ]
                            },
                            {
                                "uuid": "928638d5f678428395651a09b21f9be4",
                                "name": "Sync set {#NAME} - next partial sync due",
                                "type": "ZABBIX_ACTIVE",
                                "key": "vfs.file.regexp[{#STATUS_FILE},\"^next partial sync   * : .* .@([0-9]+)\",,,,\\1]",
                                "history": "1d",
                                "trends": "0",
                                "units": "unixtime",
                                "description": "The time when the next partial sync will be attempted.",
                                "tags": [
                                    {
                                        "tag": "component",
                                        "value": "continual-sync"
                                    },
                                    {
                                        "tag": "section",
                                        "value": "{#NAME}"
                                    }
                                ]
                            },
                            {
                                "uuid": "d615f5d910994b6f88d29f0e83a67224",
                                "name": "Sync set {#NAME} - consecutive partial sync failures",
                                "type": "ZABBIX_ACTIVE",
                                "key": "vfs.file.regexp[{#STATUS_FILE},\"^partial sync failures * : ([0-9]+)\",,,,\\1]",
                                "delay": "5m",
                                "description": "How many partial sync attempts have failed in a row, or zero if the last partial sync succeeded.",
                                "tags": [
                                    {
                                        "tag": "component",
                                        "value": "continual-sync"
                                    },
                                    {
                                        "tag": "section",
                                        "value": "{#NAME}"
                                    }
                                ],
                                "trigger_prototypes": [
                                    {
                                        "uuid": "02d2847331d64ca4a760188e1f0f8b9c",
                                        "expression": "last(/Continual-sync source sets/vfs.file.regexp[{#STATUS_FILE},\"^partial sync failures * : ([0-9]+)\",,,,\\1])>{$CONTINUAL_SYNC_MAX_PARTIAL_SYNC_FAILURES}",
                                        "name": "Sync set {#NAME} - partial sync failing",
                                        "priority": "AVERAGE",
                                        "description": "The continual-sync section \"{#NAME}\" has failed its partial sync too many times in a row - more than {$CONTINUAL_SYNC_MAX_PARTIAL_SYNC_FAILURES}.",
                                        "tags": [
                                            {
                                                "tag": "scope",
                                                "value": "availability"
                                            }
                                        ]
                                    }
                                ]
                            }
                        ],
                        "lld_macro_paths": [
                            {
                                "lld_macro": "{#FULL_SYNC_INTERVAL}",
                                "path": "$.fullSyncInterval"
                            },
                            {
                                "lld_macro": "{#FULL_SYNC_RETRY}",
                                "path": "$.fullSyncRetry"
                            },
                            {
                                "lld_macro": "{#FULL_SYNC_TIMEOUT}",
                                "path": "$.fullSyncTimeout"
                            },
                            {
                                "lld_macro": "{#NAME}",
                                "path": "$.name"
                            },
                            {
                                "lld_macro": "{#PARTIAL_SYNC_INTERVAL}",
                                "path": "$.partialSyncInterval"
                            },
                            {
                                "lld_macro": "{#PARTIAL_SYNC_RETRY}",
                                "path": "$.partialSyncRetry"
                            },
                            {
                                "lld_macro": "{#PARTIAL_SYNC_TIMEOUT}",
                                "path": "$.partialSyncTimeout"
                            },
                            {
                                "lld_macro": "{#STATUS_FILE}",
                                "path": "$.statusFile"
                            }
                        ]
                    }
                ],
                "tags": [
                    {
                        "tag": "class",
                        "value": "software"
                    },
                    {
                        "tag": "source",
                        "value": "local"
                    },
                    {
                        "tag": "target",
                        "value": "continual-sync"
                    }
                ],
                "macros": [
                    {
                        "macro": "{$CONTINUAL_SYNC_FULL_SYNC_OVERDUE_MULTIPLIER}",
                        "value": "2",
                        "description": "How many full sync intervals to allow without a completed full sync before a warning is raised."
                    },
                    {
                        "macro": "{$CONTINUAL_SYNC_MAX_FULL_SYNC_FAILURES}",
                        "value": "2",
                        "description": "How many full sync failures are allowed before a warning is raised."
                    },
                    {
                        "macro": "{$CONTINUAL_SYNC_MAX_PARTIAL_SYNC_FAILURES}",
                        "value": "4",
                        "description": "How many partial sync failures are allowed before a warning is raised."
                    },
                    {
                        "macro": "{$CONTINUAL_SYNC_PARTIAL_SYNC_OVERDUE_MULTIPLIER}",
                        "value": "10",
                        "description": "How many partial sync intervals to allow without a completed partial sync before a warning is raised."
                    },
                    {
                        "macro": "{$CONTINUAL_SYNC_SECTION_LIST_FILE}",
                        "value": "/var/run/continual-sync/sections.json",
                        "description": "The path to the section list file written by continual-sync."
                    }
                ]
            }
        ]
    }
}