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