SiteScope User's Guide


Working with Monitor Set Templates

SiteScope Monitor Set Templates are used to define a set of different monitors for server or machine types or classes of servers. Monitor Set Template can then be replicated to speed deployment of monitoring in your data center environment.

This section describes:

Working with Monitor Set Templates

Monitor set templates are located in the <SiteScope install path>/SiteScope/templates.sets directory. You may create as many templates as you need. In order for SiteScope to use the templates they must be stored in this directory.

All monitor set template files end with the .mset extension. SiteScope will not look for monitor set templates with any other file extension.

The easiest way to create a monitor set template is:

  1. Use SiteScope to create a new group.
  2. Add the monitors to that group that you want in your monitor set
  3. Once you have added the different monitor types to the group, copy the group file (for example, SiteScope/groups/groupname.mg) from the <SiteScope install path>/SiteScope/groups directory to the <SiteScope install path>/SiteScope/templates.sets directory.
  4. Rename the file so it has a .mset extension (for example: webservergroup.mset).
  5. Edit the .mset file to replace the monitor configuration values that will vary to a $variablename$ syntax.
  6. Add descriptor and labels at the top of the template file for display when accessing the template in SiteScope.

Format and Syntax of Monitor Set Templates

A monitor set template file is composed of frames (or records). The frames are delimited by a line containing a single #. The last record is not terminated with a # sign. Comments may be embedded in the file by beginning a line with a double slash "//".

The first frame, named "frame 0", contains information that describe the contents of the template file and the variables used.

The remaining frames (frames 1 through n) in the file contain monitor definition frames. There can be one or more monitor frames. You can also include frames that subgroups.

Values in all of the frames are defined by name-value pairs. The name is on the lefthand side of the equal sign and the value is on the right hand side. For example, _server=$servername$. These name/value pairs define properties. Property names begin with an underscore (for example, _name), but there are some exceptions. Most properties contain simple values. But in some cases property values may contain other properties - as in the case of a template variable.

Template Description

Frame 0 of the template file contains properties that define the template. The following describes these properties:

Property Name

Description

_monitorTemplateName The name used to identify the monitor set template. This is displayed in the Name column when adding monitor sets to a group.
_monitorTemplateDescription This is an optional description text used to provide more information about what the template does. For example, you can use the _monitorTemplateDescription to indicate what types of monitors are created by the template and what are the default monitor configuration parameters.

Template Variables

Frame 0 is also where template variables are defined. Template variable names begin and end with a dollar sign (for example, $var$). You may define as many variables as you need. A variable's property value contains the following subproperties:

  • _description
  • _type
  • _value

Variable Subproperties

Description

_description Describes the variable. Text in the _description must not contain blank spaces between individual words. Use the underscore character ( _ ) to separate words in the description (see example below).
_type (Not currently used)
_value Optional, defines a default value for variable

Note that the _type subproperty is not currently used and may safely be omitted from any variable definition.

The following are examples of template variables:

$server$=_description=the_server_to_monitor _type=server
$host$=_description=the_host_to_monitor _type=host _value=web01
$url$=_description=the_url_for_monitor _type=host

Subproperties may contain multiple words if the spaces are replaced by underscore ($var$= _description=This_is_a_test)

Using Variables in the Template

Once defined, variables may be used throughout the monitor set template. For example, take the following variable definition:

$hostname$= _description=hostname _type=server

In the monitor definitions, this variable may be used:

_class=URLMonitor
_name=URL Monitor for $hostname$
_URL=http://$hostname$/

Monitor Properties

The properties that define a monitor vary from monitor to monitor. There are a few that are common across all monitors: _class, _frequency, _name and a few other. Most properties it is generally evident what their is purpose by their property name. However there are a few that require explanation.

_class

The _class property defines the monitor type. It is important that you only use valid monitor type names in the _class property, otherwise the monitor definition will cause SiteScope to throw an exception when the monitor is instantiated.

_classifier

The _classifier property is used to define the Error if, Warning if, and Good if conditions. If _classifier property does not exist, then the monitor is using its default conditions for error, warning and good. The format of a classifier is:

        _classfier=param<space>condition<space>threshold<tab>what

Notice that param, condition and tthreshold/b> are delimited by a space, but what is delimited by a tab.

Here are some sample classifiers:

_classifier= timeout > 90 Error
_classifier= value2 == 20 Error
_classifier= utilization > 80 Warning
_classifier= idleTime > 90 Good

Unused Monitor Properties

If you have created a monitor set template from a monitor group file, there are a number of properties that will not be used and should be removed from your monitor set template for sake of clarity. The following properties may generally be removed from your template file:

  • _nextID
  • _parent
  • _dependsOn
  • _id

Sample Monitor Set Templates

This section presents several example templates that can be used as a basis for creating your own templates.

Creating Server Resource Monitors with a Template

The following monitor set template contains four monitors: CPU, Disk, Memory and URL monitors The template contains two variables: $server$ and $url$. Notice how the variables are used in the monitor definitions. Notice the $url$ variable is given a default value that may be changed when creating the monitor set.

_monitorTemplateName=Example Monitor Set
_monitorTemplateDescription=Example monitor set template
$server$= _description=the_server_to_monitor
$url$= _description=the_url_for_monitor _value=www.$host$.com
#
_class=CPUMonitor
_frequency=600
_name=CPU Utilization on \\$server$
_machine=\\$server$
#
_class=MemoryMonitor
_frequency=600
_name=Memory monitor for $host$
_machine=\\$server$
#
_class=DiskSpaceMonitor
_frequency=600
_disk=C
_machine=\\$server$
_name=Disk Space: C on \\$server$
#
_class=URLMonitor
_frequency=600
_url=http://$url$/index.html
_name=URL on http://$url$/index.html

Using the Remote UNIX Host Selection Menu

The following example is a monitor set template designed to set up three server resource monitors on a remote UNIX server. Two important things to remeber for setting up monitors to use Remote UNIX servers are:

  1. Use the drop-down list for the $server$ entry instead of entering a server or host name manually in the text box. The remote host drop-down list is normally displayed as an option for each entry with the default entry of other. This is necessary due to the way SiteScope handles UNIX remote connection profiles.
  2. Use the special variable $serverName$ to have the name or address of the remote server displayed in the monitor description field (_name). SiteScope translates the remote host selected using the drop-down list to the text description assigned to the applicable server connection profile.

    Note: Do not use $serverName$ as a variable in the upper section of the template. Doing so will cause the internal SiteScope variable to be overwritten. In the example below, this variable is used to create the _name setting but is not presented to the user for modification.

_monitorTemplateName=Remote UNIX Monitor Template
_monitorTemplateDescription=Monitor Set using Remote UNIX/Linux selection menu
$server$=_description=For_remote_UNIX_use_the_Dropdown_to_select_remote_server_profile
$frequency$=_description=Update_frequency_in_seconds
#
_class=CPUMonitor
_id=1
_encoding=Cp1252
_frequency=$frequency$
_dependsCondition=good
_machine=$server$
_classifier=utilizationPercentage1 >= 80	error
_classifier=utilizationPercentage2 >= 70	warning
_name=CPU_system on $serverName$
#
_class=MemoryMonitor
_id=4
_encoding=Cp1252
_frequency=$frequency$
_dependsCondition=good
_machine=$server$
_name=Memory on $serverName$
#
_disk=/dev/hda5
_class=DiskSpaceMonitor
_id=5
_encoding=Cp1252
_frequency=$frequency$
_dependsCondition=good
_machine=$server$
_name=Disk space on $serverName$

Creating Subgroups as part of a Monitor Set

The following template creates two subgroups within the monitor group where it is invoked along with the four monitors used in the example above. In this example, all of the variables are given a default value that should be edited when using the template set. Notice also the use of the $frequency$ variable that allows this value to be set for each set of monitors.

_monitorTemplateName=Example Set with Subgroups
_monitorTemplateDescription=Adds 2 subgroups, CPU, Disk, Memory monitors
$server$=_description=Server_to_monitor_(UNC_name) _value=\\servername
$frequency$=_description=Run_frequency_for_the_monitors_(msec) _value=600
$subgroup$=_description=Name_of_subgroup _value=mySubgroup
$group2$=_description=Name_of_2nd_subgroup _value=my2Subgroup
#
_class=SubGroup
_name=$subgroup$
_group=$subgroup$
#
_class=SubGroup
_name=$group2$
_group=$group2$
#
_class=CPUMonitor
_frequency=$frequency$
_dependsCondition=good
_name=CPU Utilization on $server$
_machine=$server$
#
_class=MemoryMonitor
_frequency=$frequency$
_name=Memory
_machine=$server$
#
_class=DiskSpaceMonitor
_disk=C
_frequency=$frequency$
_machine=$server$
_name=Disk Space: C on $server$