Working with Monitor Set TemplatesSiteScope 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 TemplatesMonitor 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:
Format and Syntax of Monitor Set TemplatesA 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 DescriptionFrame 0 of the template file contains properties that define the template. The following describes these properties:
Template VariablesFrame 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:
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 Subproperties may contain multiple words if the spaces are replaced by underscore ($var$= _description=This_is_a_test) Using Variables in the TemplateOnce 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 Monitor PropertiesThe 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. _classThe _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. _classifierThe _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 PropertiesIf 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:
Sample Monitor Set TemplatesThis 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:
_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$
|