<name>BackupPC: {#BPCHOST}: First quartile of new sizes</name>
<type>DEPENDENT</type>
<key>backuppc.host[{#BPCHOST},new_size_q1]</key>
<delay>0</delay>
<trends>1825d</trends>
<units>B</units>
<applications>
<application>
<name>BackupPC</name>
</application>
</applications>
<preprocessing>
<step>
<type>JSONPATH</type>
<params>$.new_size_q1</params>
</step>
</preprocessing>
<master_item>
<key>backuppc.host[{#BPCHOST},all]</key>
</master_item>
</item_prototype>
<item_prototype>
<name>BackupPC: {#BPCHOST}: Third quartile of new sizes</name>
<type>DEPENDENT</type>
<key>backuppc.host[{#BPCHOST},new_size_q3]</key>
<delay>0</delay>
<trends>1825d</trends>
<units>B</units>
<applications>
<application>
<name>BackupPC</name>
</application>
</applications>
<preprocessing>
<step>
<type>JSONPATH</type>
<params>$.new_size_q3</params>
</step>
</preprocessing>
<master_item>
<key>backuppc.host[{#BPCHOST},all]</key>
</master_item>
</item_prototype>
<item_prototype>
<name>BackupPC: {#BPCHOST}: Total backups size</name>
<type>DEPENDENT</type>
<key>backuppc.host[{#BPCHOST},total_size]</key>
<delay>0</delay>
<trends>1825d</trends>
<units>B</units>
<applications>
<application>
<name>BackupPC</name>
</application>
</applications>
<preprocessing>
<step>
<type>JSONPATH</type>
<params>$.total_size</params>
</step>
</preprocessing>
<master_item>
<key>backuppc.host[{#BPCHOST},all]</key>
</master_item>
</item_prototype>
</item_prototypes>
<trigger_prototypes>
<trigger_prototype>
<expression>{Template_App_BackupPC:backuppc.host[{#BPCHOST},age].last(0)}>{#BPCNOBACKUPWARNING}*24*3600 and {Template_App_BackupPC:backuppc.host[{#BPCHOST},enabled].last()}=1</expression>
<name>No backup for {#BPCHOST} since {ITEM.LASTVALUE1}</name>
<priority>WARNING</priority>
</trigger_prototype>
<trigger_prototype>
<expression>{Template_App_BackupPC:backuppc.host[{#BPCHOST},enabled].last()}=1 and {Template_App_BackupPC:backuppc.host[{#BPCHOST},bkp].last()}>4 and {Template_App_BackupPC:backuppc.host[{#BPCHOST},new_size].last()} < ({Template_App_BackupPC:backuppc.host[{#BPCHOST},new_size_q1].last()} - ({Template_App_BackupPC:backuppc.host[{#BPCHOST},new_size_q3].last()} - {Template_App_BackupPC:backuppc.host[{#BPCHOST},new_size_q1].last()}) * 1.5) and {Template_App_BackupPC:backuppc.host[{#BPCHOST},new_size].last()} < {Template_App_BackupPC:backuppc.host[{#BPCHOST},new_size_avg].last()}/{#BPC_TOO_SMALL_FACTOR} and ({Template_App_BackupPC:backuppc.host[{#BPCHOST},new_size].dayofweek()} <> 6 or {Template_App_BackupPC:backuppc.host[{#BPCHOST},new_size].time()} < 120000) and {Template_App_BackupPC:backuppc.host[{#BPCHOST},new_size].dayofweek()} <> 7 and {Template_App_BackupPC:backuppc.host[{#BPCHOST},new_size].dayofweek()} <> 1 and ({Template_App_BackupPC:backuppc.host[{#BPCHOST},new_size].dayofweek()} <> 2 or {Template_App_BackupPC:backuppc.host[{#BPCHOST},new_size].time()} > 080000)</expression>
<recovery_expression>{Template_App_BackupPC:backuppc.host[{#BPCHOST},enabled].last()}=0 or {Template_App_BackupPC:backuppc.host[{#BPCHOST},bkp].last()}<=4 or {Template_App_BackupPC:backuppc.host[{#BPCHOST},new_size].last()} >= ({Template_App_BackupPC:backuppc.host[{#BPCHOST},new_size_q1].last()} - ({Template_App_BackupPC:backuppc.host[{#BPCHOST},new_size_q3].last()} - {Template_App_BackupPC:backuppc.host[{#BPCHOST},new_size_q1].last()}) * 1.5) or {Template_App_BackupPC:backuppc.host[{#BPCHOST},new_size].last()} >= {Template_App_BackupPC:backuppc.host[{#BPCHOST},new_size_avg].last()}/{#BPC_TOO_SMALL_FACTOR}</recovery_expression>
<name>Suspiciously small ({ITEM.VALUE3}) backups for {#BPCHOST}</name>
<priority>WARNING</priority>
</trigger_prototype>
<trigger_prototype>
<expression>{Template_App_BackupPC:backuppc.host[{#BPCHOST},enabled].last()}=1 and {Template_App_BackupPC:backuppc.host[{#BPCHOST},bkp].last()}>4 and {Template_App_BackupPC:backuppc.host[{#BPCHOST},new_size].last()} > ({Template_App_BackupPC:backuppc.host[{#BPCHOST},new_size_q3].last()} + ({Template_App_BackupPC:backuppc.host[{#BPCHOST},new_size_q3].last()} - {Template_App_BackupPC:backuppc.host[{#BPCHOST},new_size_q1].last()}) * 1.5) and {Template_App_BackupPC:backuppc.host[{#BPCHOST},new_size].last()} > {Template_App_BackupPC:backuppc.host[{#BPCHOST},new_size_avg].last()}*{#BPC_TOO_BIG_FACTOR} and {Template_App_BackupPC:backuppc.host[{#BPCHOST},new_size].dayofweek()} <> 7 and {Template_App_BackupPC:backuppc.host[{#BPCHOST},new_size].dayofweek()} <> 1 and ({Template_App_BackupPC:backuppc.host[{#BPCHOST},new_size].dayofweek()} <> 2 or {Template_App_BackupPC:backuppc.host[{#BPCHOST},new_size].time()} > 060000)</expression>
<recovery_expression>{Template_App_BackupPC:backuppc.host[{#BPCHOST},enabled].last()}=0 or {Template_App_BackupPC:backuppc.host[{#BPCHOST},bkp].last()}<=4 or {Template_App_BackupPC:backuppc.host[{#BPCHOST},new_size].last()} <= ({Template_App_BackupPC:backuppc.host[{#BPCHOST},new_size_q3].last()} + ({Template_App_BackupPC:backuppc.host[{#BPCHOST},new_size_q3].last()} - {Template_App_BackupPC:backuppc.host[{#BPCHOST},new_size_q1].last()}) * 1.5) or {Template_App_BackupPC:backuppc.host[{#BPCHOST},new_size].last()} <= {Template_App_BackupPC:backuppc.host[{#BPCHOST},new_size_avg].last()}*{#BPC_TOO_BIG_FACTOR}</recovery_expression>
<name>Suspuciously big ({ITEM.VALUE3}) backup for {#BPCHOST}</name>
<priority>INFO</priority>
</trigger_prototype>
<trigger_prototype>
<expression>{Template_App_BackupPC:backuppc.host[{#BPCHOST},errors].last(0)}>{#BPCMAXERROR} and {Template_App_BackupPC:backuppc.host[{#BPCHOST},enabled].last()}=1</expression>
<name>{ITEM.LASTVALUE1} xfer errors in last backup of {#BPCHOST}</name>
<description>If set to a positive duration, can alert if no raidsync backups has been made recently</description>
</macro>
</macros>
</template>
</templates>
<triggers>
<trigger>
<expression>{Template_App_BackupPC:proc.num[,backuppc,,BackupPC].sum(#2)}=0 and {Template_App_BackupPC:proc.num[,root,,BackupPC_raidsync].sum(#2)}=0</expression>