Alert Template can be personalized by including dynamic variables that are turned to the current system values upon sending an alert.

Syntax of Dynamic Templates

Dotcom-Monitor supports dynamic templates built upon Microsoft’s Razor parsing engine.

Introduction to Razor syntax can be found here.

Dotcom-Monitor ObjectModel

Find the Dotcom-Monitor ObjectModel class diagram with the classes’s source code below. Use the attributes as dynamic variables in the Alert Template script.

  • Dotcom-Monitor ObjectModel

  • MVTemplateModel (MetricsView Platform)

  • SVTemplateModel (ServerView Platform)

  • UVTemplateModel (UserView/BrowserView Platform)

  • Response

  • Device

  • Monitor

  • Task

Examples of Alert Templates

For example, let’s create a sample of a basic alert template:

"devicename" : "@Model.Site_Name",
"taskName" : "@Model.FirstErrorResponse.Task.Name",
"error" : "Error Type:@Model.FirstErrorResponse.AllErrors[0].ErrorType;Error Code:@Model.FirstErrorResponse.AllErrors[0].ErrorCode;Reason:@Model.FirstErrorResponse.AllErrors[0].Reason",
"StartMonitorDowntime" : @(((long)Model.StartMonitorDowntime.Subtract(new DateTime(1970, 1, 1)).TotalMilliseconds))

In this case, the resulting alert will have the following layout:

Subject: DOTCOM-MONITOR: Problem found in device

"devicename" : "",
"taskName" : "",
"error" : "Error Type:Validation;Error Code:300;Reason:Task maximum timeout expired. Configured Timeout: 0.010 sec. Actual Response: 13.125 sec.",
"StartMonitorDowntime" : 1558991488950 

Find more examples of the different monitoring platforms’ tasks below.

  • UserView/BrowserView Device

  • ServerView Device

  • MetricsView Device

For more real examples or questions, create a ticket.