Knowledge Base

Embedding a File in a Monitoring Studio X Template

KB1265 - Mar 30, 2020

Type: Best Practice

Description: Monitoring Studio X: How to embed a file in a Template configuration which will be used later by a Monitor.

Additional Keywords: Monitoring Studio X, Script, Embedded File

Related Topics


Embedded Files are files that are saved in the Template configuration itself (i.e. as a PATROL configuration variable). Embedding a file (like a script file to be executed, for example), in a Template guarantees that the file is distributed along with the Template configuration (through TrueSight CMA, or just with a classic configuration export) and used through the related Monitor.

Use Case

This article explains how to embed a script in a Template configuration which will be used by a Command Line Monitor.


In this example we will use a PowerShell script which runs a Microsoft SharePoint cmdlet. This script will be embedded in a Template and executed by a Command Line Monitor.

To embed a file (script) in a Template:

  • From the Studio page of Monitoring Studio X, edit the template you wish to use
  • Scroll down to the Embedded Files section and click Add File
  • Choose the script you wish to embed in your template and click SAVE

    Embedding a file in a Template

  • Use the macro %{FILE:<FILENAME>} to refer to the script in the monitor

    Using the ```%{FILE:<FILENAME>}``` macro

  • Perform a DRY RUN to make sure the script is successfully executed.