- 13 minutes to read

Alarm Plugin Object

Create visually engaging, actionable email alerts for your business with Nodinite Alarm Plugin and XSLT. This guide shows you how to leverage XML alarm data, custom metadata, and built-in functions to deliver clear, business-relevant notifications that drive action and keep your team informed.

✅ Style your alerts with XSLT for professional, branded HTML emails
✅ Use real alarm data and custom metadata for context-rich notifications
✅ Empower your team with actionable links and business insights
✅ Preview and test your stylesheets directly in Nodinite or Visual Studio

Below is an example of the XML data structure pushed in alerts (Alarms) from the Nodinite Monitoring Service.

Use this data to customize the default Stylesheet for the Email Alarm Plugin. Preview your changes using the built-in tool in Nodinite or in Visual Studio for rapid iteration.

RAW data (XML)

<?xml version="1.0" encoding="utf-8" ?>
<AlarmObject xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <MonitorViews>
    <MonitorView>
      <MonitorViewId>1</MonitorViewId>
      <Name>Test View</Name>
      <Description>Simple unit testing view.</Description>
      <StatusCode>
        <StatusCode>0</StatusCode>
        <Name>OK</Name>
      </StatusCode>
      <NumberOfMonitoredResources>2</NumberOfMonitoredResources>
      <Integrations>
        <Integration>
          <IntegrationId>1</IntegrationId>
          <Name>INT001 - Simple Integration</Name>
          <Description>Integration for unit testing.</Description>
          <WebSite>https://www.nodinite.com/</WebSite>
          <CustomFields>
            <CustomField>
              <CustomFieldId>1</CustomFieldId>
              <Name>SLA</Name>
              <Description>SLA Level are Gold, Silver and Bronze</Description>
              <WebSite>https://www.nodinite.com/SLA/</WebSite>
              <ValueType>
                <CustomFieldTypeId>1</CustomFieldTypeId>
                <Name>Text</Name>
                <Description>Custom Value are plain text values with optional Description and Web Site.</Description>
                <WebSite></WebSite>
              </ValueType>
              <CustomValues>
                <CustomValue>
                  <CustomValueId>1</CustomValueId>
                  <Value>Gold</Value>
                  <Description>Gold</Description>
                  <WebSite>https://www.nodinite.com/SLA/Gold</WebSite>
                  <ValueType>
                    <CustomFieldTypeId>1</CustomFieldTypeId>
                    <Name>Text</Name>
                    <Description>Custom Value are plain text values with optional Description and Web Site.</Description>
                    <WebSite></WebSite>
                  </ValueType>
                </CustomValue>
              </CustomValues>
            </CustomField>
            <CustomField>
              <CustomFieldId>2</CustomFieldId>
              <Name>INT Images</Name>
              <Description>Images of the integrations</Description>
              <WebSite></WebSite>
              <ValueType>
                <CustomFieldTypeId>2</CustomFieldTypeId>
                <Name>File</Name>
                <Description>Custom Value are represented as uploaded files with optional Description.</Description>
                <WebSite></WebSite>
              </ValueType>
              <CustomValues>
                <CustomValue>
                  <CustomValueId>4</CustomValueId>
                  <Value>home.png</Value>
                  <Description>Home for integration</Description>
                  <WebSite></WebSite>
                  <ValueType>
                    <CustomFieldTypeId>2</CustomFieldTypeId>
                    <Name>File</Name>
                    <Description>Custom Value are represented as uploaded files with optional Description.</Description>
                    <WebSite></WebSite>
                  </ValueType>
                </CustomValue>
              </CustomValues>
            </CustomField>
          </CustomFields>          
        </Integration>
      </Integrations>
      <ChangedResources>
        <Resource>
          <ResourceId>1</ResourceId>
          <Name>First Resource - Send Port</Name>
          <WebSite>https://www.nodinite.com/resource/send-port</WebSite>
          <Source>
            <SourceId>1</SourceId>
            <Name>Test Monitoring Agent Configuration</Name>
            <Description>Simple Monitoring Agent Configuration for testing purposes only.</Description>
            <WebSite>https://www.nodinite.com/</WebSite>
          </Source>
          <Category>
            <CategoryId>1</CategoryId>
            <Name>Send Ports</Name>
            <Description>Send ports category.</Description>
          </Category>
          <Application>
            <ApplicationId>1</ApplicationId>
            <Name>BizTalk System</Name>
            <Description>Default biztalk application</Description>
            <WebSite>https://www.nodinite.com/application/biztalk-system</WebSite>
          </Application>
          <StatusCode>
            <StatusCode>0</StatusCode>
            <Name>OK</Name>
          </StatusCode>
          <LogText>All OK!</LogText>
          <CustomMetaDatas>
            <CustomMetaData>
              <CustomMetaDataId>4</CustomMetaDataId>
              <Name>Log View Link</Name>
              <Description />
              <DataType>Link</DataType>
              <CustomValues>
                <CustomValue>
                  <CustomValueId>21</CustomValueId>
                  <Value>https://nodinite.com/</Value>
                  <Description />
                  <WebSite />
                </CustomValue>
              </CustomValues>
            </CustomMetaData>
          </CustomMetaDatas>
        </Resource>
        <Resource>
          <ResourceId>2</ResourceId>
          <Name>Second Resource - Receive Port</Name>
          <Source>
            <SourceId>1</SourceId>
            <Name>Test Monitoring Agent Configuration</Name>
            <Description>Simple Monitoring Agent Configuration for testing purposes only.</Description>
            <WebSite>https://www.nodinite.com/</WebSite>
          </Source>
          <Category>
            <CategoryId>2</CategoryId>
            <Name>Receive Ports</Name>
            <Description>Receive ports category.</Description>
            <WebSite>https://www.nodinite.com/category/receive-ports</WebSite>
          </Category>
          <Application>
            <ApplicationId>1</ApplicationId>
            <Name>BizTalk System</Name>
            <Description>Default biztalk application</Description>
            <WebSite>https://www.nodinite.com/application/biztalk-system</WebSite>
          </Application>
          <StatusCode>
            <StatusCode>0</StatusCode>
            <Name>OK</Name>
          </StatusCode>
          <LogText>All OK!</LogText>
        </Resource>
      </ChangedResources>
    </MonitorView>
    <MonitorView>
      <MonitorViewId>2</MonitorViewId>
      <Name>Second View</Name>
      <Description>Simple test view (second).</Description>
      <WebSite>https://www.nodinite.com/</WebSite>
      <StatusCode>
        <StatusCode>2</StatusCode>
        <Name>ERROR</Name>
      </StatusCode>
      <NumberOfMonitoredResources>2</NumberOfMonitoredResources>
      <Integrations />
      <ChangedResources>
        <Resource>
          <ResourceId>10</ResourceId>
          <Name>LogAPI Queue</Name>
          <Description>Queue for Nodinite's LogAPI.</Description>
          <Source>
            <SourceId>2</SourceId>
            <Name>MSMQ</Name>
            <Description>Monitoring Agent Configuration to monitor MSMQ queues.</Description>
            <Server>IBSS-BUILD02</Server>
            <Environment>Production</Environment>
            <Version>1.0</Version>
          </Source>
          <Category>
            <CategoryId>10</CategoryId>
            <Name>MSMQ Queue</Name>
            <Description>MSMQ Queues category</Description>
            <WebSite>https://msdn.microsoft.com/en-us/library/ms711472%28v=vs.85%29.aspx</WebSite>
          </Category>
          <Application>
            <ApplicationId>0</ApplicationId>
          </Application>
          <StatusCode>
            <StatusCode>2</StatusCode>
            <Name>ERROR</Name>
          </StatusCode>
          <LogText>Number of messages in queue exceeded error limit.</LogText>
        </Resource>
        <Resource>
          <ResourceId>11</ResourceId>
          <Name>LogAPI Test Queue</Name>
          <Description />
          <Source>
            <SourceId>2</SourceId>
            <Name>MSMQ</Name>
            <Description>Monitoring Agent Configuration to monitor MSMQ queues.</Description>
            <Server>IBSS-BUILD02</Server>
            <Environment>Production</Environment>
            <Version>1.0</Version>
          </Source>
          <Category>
            <CategoryId>10</CategoryId>
            <Name>MSMQ Queue</Name>
            <Description>MSMQ Queues category</Description>
            <WebSite>https://msdn.microsoft.com/en-us/library/ms711472%28v=vs.85%29.aspx</WebSite>
          </Category>
          <Application>
            <ApplicationId>0</ApplicationId>
          </Application>
          <StatusCode>
            <StatusCode>1</StatusCode>
            <Name>WARNING</Name>
          </StatusCode>
          <LogText>Number of messages in queue exceeded warning limit, but not error limit.</LogText>
        </Resource>
      </ChangedResources>
    </MonitorView>
  </MonitorViews>
  <Version>5.0.0.0</Version>
  <Environment>Test</Environment>
  <Customer>Nodinite</Customer>
  <Created>2019-08-11T09:45:00.000000Z</Created>
  <WebClientUrl>http://localhost/Nodinite/WebClient/</WebClientUrl>
</AlarmObject>

How to use embedded scripts in XSLT

New 7.x

There are several built-in functions in Nodinite that you can use in your XSLT stylesheets. These functions are available in the Nodinite namespace and can be used to manipulate data, format dates, and more. For example, you can modfify static data in c values to add business value to alerts.

Important

In Nodinite versions prior to 7.x, custom scripts were supported in XSLT stylesheets, but this feature has been deprecated in version 7.x. Instead, you must use the built-in functions provided by Nodinite to achieve similar functionality. If you have existing stylesheets that use custom scripts, you will need to update them to use the built-in functions instead. Also, you must with any obligations gift the code for your c# functions to us at Nodinite. We will then make them available in the Nodinite namespace for you to use in your XSLT stylesheets. These generic functions are available for all Nodinite customers to use in their XSLT stylesheets. The change ensures that all customers have access to the same functionality and can benefit from the built-in features without needing to maintain custom scripts. Also, from a security perspective, this change reduces the risk of executing arbitrary code in XSLT stylesheets, which can lead to security vulnerabilities. By using built-in functions, you can ensure that your stylesheets are secure and maintainable.

Replace start and end date in a Log View

This example shows how to replace the start and end date in a Log View using XSLT. The XsltExtensionHelper:editSearchApiUrl function is used to replace the placeholders with the actual start and end dates.

Tip

The XML example above is a sample of the data pushed in alerts (Alarms) from the Nodinite Monitoring Service. Use this data to customize the default Stylesheet for Email Alarm Plugin using the preview tool within Nodinite or Visual Studio if you prefer. The data can be used in this example as is to test the functionality replacing the start and end date in a Log View.

If not already present, add a new Custom Metadata field of Link type to the Resource with the name Log View Link and set the URL. This will be used in the e-mail alert to create a link to the Log View.
Resource with Custom Metadata
This image shows the Resource with Custom Metadata for Log View Link.

Copy the actual URL from the Log View in Nodinite and paste it into the Value field of the Custom Metadata. The URL should look like this: 'https://localhost:7139/Log/LogView/2?searchJson=%7B%22FilterGroups%22%3A%5B%5D%2C%22NumberOfItems%22%3A100%2C%22Page%22%3A1%2C%22From%22%3A%222025-07-11T22%3A00%3A00Z%22%2C%22To%22%3A%222025-07-18T21%3A59%3A59Z%22%2C%22PostGroupFilterGroups%22%3A%5B%5D%2C%22GroupSortByDescending%22%3Atrue%2C%22GroupHeaderLastEvent%22%3Atrue%2C%22DisplayGroupSummary%22%3Afalse%2C%22DataSource%22%3A%7B%7D%2C%22GroupCountFilter%22%3A%7B%22From%22%3A0%2C%22To%22%3A0%7D%7D'.

Note

Obviously, if you change the name of the Custom Metadata field, you must also change the name in the XSLT stylesheet.

XSLT Stylesheet

As you must modify the existing Stylesheet for any of the Email Alarm Plugins, ensure you are working with a copy. Whenever a new version of Nodinite is released, we may update the default stylesheets, and you will lose your changes if you have not made a copy.

Modify the copy and change the following code in the <xsl:when test="DataType = 'Link'"> section of the XSLT stylesheet:

<xsl:when test="DataType = 'Link'">
  <xsl:for-each select="CustomValues/CustomValue">
    <xsl:sort order="ascending" select="Value"/>
    <div>
      <xsl:choose>
        <xsl:when test="position() > 1">
          <xsl:attribute name="style">
            font-family:Arial,sans-serif;padding-top:0.62em; padding-bottom:0.62em; border-top: 0.0626em solid #ccc;
          </xsl:attribute>
        </xsl:when>
        <xsl:otherwise>
          <xsl:attribute name="style">
            font-family:Arial,sans-serif;padding-top:0.62em; padding-bottom:0.62em;
          </xsl:attribute>
        </xsl:otherwise>
      </xsl:choose>
      <xsl:choose>                                                                
      <xsl:when test="../../Name = 'Log View Link'">        
        <xsl:variable name="date" select="XsltExtensionHelper:datenow(//Created)" />
        <a target="_blank" style="color: #e15046;">
            <xsl:attribute name="href">
                <xsl:value-of select="XsltExtensionHelper:editSearchApiUrl(Value, $date, 3600)" />
            </xsl:attribute>
            Name of Log View
        </a>
      </xsl:when>

      <xsl:otherwise>
          <a target="_blank" style="color: #e15046;">
              <xsl:attribute name="href">
                  <xsl:value-of select="Value"/>
              </xsl:attribute>
              <xsl:value-of select="Value" />
          </a>                                                                      
      </xsl:otherwise>
  </xsl:choose>
    <br/>

This code uses the XsltExtensionHelper:editSearchApiUrl function to replace the start and end dates in the URL with the actual dates from the Created element in the XML data. The datenow function is used to get the current date, which is then passed to the editSearchApiUrl function along with a time span of 3600 seconds (1 hour). This will create a new URL that points to the Log View with the correct start and end dates, in this case subtract one hour from the Created for start date and add one hour as end date.

Use the Stylesheet in the Monitor View

To use the modified Stylesheet, you must select it in the Monitor View where you want to apply it. This will ensure that the alerts generated for that Monitor View will use your custom XSLT stylesheet.
Custom Stylesheet in Monitor View
This image shows the Monitor View with a custom Stylesheet selected for the Email Alarm Plugin.


Next Step