I submitted this as an issue to github, but after submitting the document went to 404 and disappeared out the issues list immedately, which is a shame because I spent some time on it. Same thing happened when I tried open a new repository to house the template I’m working on. So, I’m going to post an earlier draft of the message here and hope it doesn’t get lost.
Edit: Looks like Github is having issues. Apologies if my issue is duplicated.
The JSON serializer and HTTP output modules are great tools to build a remote monitoring platform on. Having spent the last few days building a solution, I have a few recommendations to make the monitoring part a lot easier to setup. The current JSON output based on the HTTP template is kind of messy with duplicated fields in different formats, incorrect data, and one or two unhelpful key names.
Common output (all templates should have this) :
Generate GUID field to globally identify backup instance.
Provide for setting instance “friendly name” during initial setup
Backup ID name that is the same as DB name for that backup set.
JSON output standardization and tweaks:
Disassociate JSON template from standard HTTP message template and give it a new template
Output all timestamps in epoch format
Output all duration times in milliseconds
Backup & Verify operations should not be concatenated in output, and POSTed as separate events, even if run consecutively. On my end, it looks like after every backup is run, a Verify op is run and included, doubling up a lot of data.
Should probably have something like an API key field, or at least give the JSON output an option to include extra parameters, but that can wait.
Here is my suggestion for a new JSON Template:
"Data": {
"Instance": {
"GUID": "xxxxxx-xxxxxx",
"Name": "string"
},
"Set": {
"ID": "string", #Same as internal DB name for set
"Name": "string"
},
"Operation": {
"Type": "string", #('Backup','Restore','Verify','Compact','Repair')
"BeginTime": epoch,
"EndTime": epoch,
"Duration": millisecond,
"Success": Boolean,
"Dryrun": Boolean,
"LastRun": epoch, #Last time any operation was run
"LastRunSuccess": Boolean, #Was the last run above successful?
"NextRun": epoch, #Next scheduled operation
},
"Storage": {
"SourceSize": bytes,
"RemoteSize": bytes,
"TotalFiles": number,
"Provider": "string", #Where is the backup being stored
"QuotaSize": bytes,
"QuotaExceeded": Boolean
"RemoteCalls": number,
"SizeUp": bytes,
"SizeDown": bytes
},
"Backup": {
"FilesAdded": number,
"FilesDeleted": number,
"SizeAdded": bytes,
"SizeDeleted": bytes,
"VersionsStored": number,
"VersionsDeleted": number,
"LastVersion": epoch, #should be a timestamp of the last time the backup executed without warnings/errors — should match most recent restore date available
"PartialBackup": boolean
},
"Restore": {
"FilesRestored": number,
"FilesFailed": number,
"SizeRestored": bytes,
"SizeFailed": bytes
},
"Compact": {
"Change": number #Expressed as percentage diff i.e. 97 =97%
},
"Database": {
"Size": bytes #Duplicati main DB size
},
"Messages": {
"Message": "string" #Delimited
}
}
Written more plainly:
Data.Instance.GUID xxxx-xxxxx
Data.Instance.Name string
Data.Set.ID string same as dB name
Data.Set.Name string
Data.Operation.Type “Backup”,”Restore”,”Verify”,”Compact”,”Repair”
Data.Operation.BeginTime epoch
Data.Operation.EndTime epoch
Data.Operation.Duration millisecond
Data.Operation.Success Boolean
Data.Operation.Dryrun Boolean
Data.Operation.LastRun epoch last time any operation was run
Data.Operation.LastRunSuccess Boolean was the last run above successful
Data.Operation.NextRun epoch Next scheduled op
Data.Storage.SourceSize bytes
Data.Storage.RemoteSize bytes
Data.Storage.TotalFiles number
Data.Storage.Provider string Where is the backup being stored
Data.Storage.QuotaSize bytes
Data.Storage.QuotaExceeded Boolean
Data.Backup.FilesAdded number
Data.Backup.FilesDeleted number
Data.Backup.SizeAdded bytes
Data.Backup.SizeDeleted bytes
Data.Backup.VersionsStored number
Data.Backup.VersionsDeleted number
Data.Backup.LastVersion epoch — should be a timestamp of the last time the backup executed without warnings/errors — should match most recent restore date available
Data.Restore.FilesRestored number
Data.Restore.FilesFailed number
Data.Restore.SizeRestored bytes
Data.Restore.SizeFailed bytes
Data.Compact.Change number expressed as percentage diff i.e. 97 =97%
Data.Database.Size bytes Duplicati main DB size
Data.Operation.Messages delimited string