HTML and Email Template Settings
When generating HTML files and HTML emails, Server Manager uses HTML templates to generate the
appropriate content. HTML templates are HTML files that define the styles and variable content by using special tags. For example, when a low free disk space alert is fired, Server Manager loads the appropriate disk space monitor HTML template, then parses the content and replaces tags such as {FREE_SPACE} with actual values.
The primary purpose of HTML templates is to enable you to fully customize the styles and content. The default HTML templates are located in the installation sub-directory, HtmlTemplates. The easiest way to learn how the HTML templates work is to view them within a text editor. Custom HTML templates must reside in the program data sub-directory, HtmlTemplates.
The default locations on Server 2012/2008 are:
C:\Program Files\SpectorSoft\Server Manager\HtmlTemplates C:\ProgramData\CornerBowl\Server Manager\HtmlTemplates
To configure the HTML and email templates:
1. Select Edit > Server Manager Properties. The Server Manager Properties view displays.
2. Select the HTML and Email Templates tab.
3. Locate then click the HTML template to override, then click browse '...' button. The Select HTML Template dialog displays.
4. Click Open With.
5. Choose an editing application to open the file.
6. Use the editor to make any changes, then save the file to another filename. This is important as changes to the default file will be overwritten the next time you install a new build.
7. Once you have created your new HTML template file, from the Select HTML Template dialog, check Override default HTML template then click .
8. Select the file you just created, click Open 9. Click OK.
To assign a custom HTML template to a specific HTML file or email action:
1. Create your own custom HTML template as described above; however, do not override the default HTML template.
2. Once you have created your custom HTML template, select File > New > Action. The Create New Action dialog displays.
3. From the Type drop-down select Email or File.
4. Fill out the appropriate fields, then check Override the default HTML template.
5. From the drop-down select the new HTML template you just created.
6. Click OK.
Variable Tags
For a detailed list of the available variable tags see Action Variable Tags.
Object Item Sections
Some functionality, such as Event Log Reports, include arrays of items. These HTML templates include
<ENTRY_ODD> and <ENTRY_EVEN> tags. See Action Variable Tags for a detailed list of available item variable tags. For free disk space alerts you can define the item variables tags like so:
<ENTRY_ODD>\\{HOST}\{DISK} {FREE} {USED} {CAPACITY}</ENTRY_ODD>
<ENTRY_EVEN>\\{HOST}\{DISK} {FREE} {USED} {CAPACITY}</ENTRY_EVEN>
Image Variable Tags
The following HTML specific image tags are also available (not available for text based emails):
STATE_IMG Draws the target object's state image.
HISTORY_IMG Draws a server monitor history chart.
DISK_BAR_IMG Draws a disk utilization horizontal bar image.
DISK_PIE_IMG Draws a disk utilization pie chart.
DISK_HISTORY_IMG Draws a disk utilization history chart.
DIRECTORY_BAR_IMG Draws a directory size horizontal bar image.
DIRECTORY_PIE_IMG Draws a directory size pie chart.
DIRECTORY_HISTORY_IMG Draws a directory size history chart.
FILE_COUNT_BAR_IMG Draws a file count horizontal bar image.
FILE_COUNT_HISTORY_IMG Draws a file count history chart.
FILE_SIZE_BAR_IMG Draws a file size horizontal bar image.
FILE_SIZE_HISTORY_IMG Draws a file size history chart.
To display the object state image define the variable tag like so:
<img src="{STATE_IMG}" border="0" width="16px" height="16px"/>
Group By HTML Templates
Some Log HTML templates have the capability of grouping entries by host, host then log, log then host, and log.
To add grouping to your HTML template wrap the <ENTRY_ODD> and <ENTRY_ODD> tags described above with one or both of the following tags:
The following variable tags are available:
{GROUP_BY_HOST} Displays the target hostname.
{GROUP_BY_LOG} Displays the target log.
The type of grouping (host then log, log then host, host, or log) depends on the order you insert the tags. For example, if you add the following section to an Event Log Report HTML Template, the software will group by host then log:
<GROUP_BY_HOST><GROUP_BY_LOG>
<div class="hostLogTable" >{GROUP_BY_HOST}\{GROUP_BY_LOG}</div>
HTML and Email Template Settings
<table class="log">
<tr class="hdr"><td>Level</td><td>Computer</td><td>Log</td><td>Date and Time</td><td>Source</td><td>Event</td></tr>
<ENTRY_ODD>
<tr class="light"><td>{LEVEL}</td><td>{HOST}</td><td>{LOG}</td><td>{DATE}
{TIME}</td><td>{SOURCE}</td><td>{EVENT}</td></tr>
<tr class="light"><td colspan="6" class="msg">{MESSAGE}</td></tr>
</ENTRY_ODD>
<ENTRY_EVEN>
<tr class="dark"><td>{LEVEL}</td><td>{HOST}</td><td>{LOG}</td><td>{DATE}
{TIME}</td><td>{SOURCE}</td><td>{EVENT}</td></tr>
<tr class="dark"><td colspan="6" class="msg">{MESSAGE}</td></tr>
</ENTRY_EVEN>
</table>
</GROUP_BY_LOG></GROUP_BY_HOST>
The styles used above are for illustrative purposes only.
Related Topics Action Variable Tags