Creating a Source Monitor Config File
Table of Contents
- 1 Services Tag
- 2 Filters Tag
- 3 Example Source Monitor Config File
- 4 Adding a Service to a Source Monitor Config File
- 5 Adding a Filter to a Source Monitor Config File
- 6 Removing a Service from a Source Monitor Config File
- 7 Removing a Filter from a Source Monitor Config File
- 8 Displaying a Source Monitor Config File
The Source Monitor config file is an XML file that defines which services and applications you want to monitor on the source machine.
A Source Monitor config file must be in place on the source machine to enable Source Monitor.
Services Tag
The Services tag defines the services that you want to monitor. Each Service under the Services tag is identified by the service name.
Filters Tag
The Filters tag defines the filters that the Source Monitor runtime DLL uses to determine which processes to monitor.
Each Filter is defined by three attributes:
ProcessAttr - the attribute of the process to be monitored. Only ExecPath is supported, which denotes the process image path.
Comparision - the comparison operation. Three operations are supported:
Is
BeginsWith
Contains
Value - the value that ProcessAttr compares against. The value is case insensitive.
Example Source Monitor Config File
<?xml version="1.0" encoding="UTF-8"?>
<VirtaMove feature="monitor_config" version="1">
<Services>
<Service>
<Name>mssqlserver</Name>
</Service>
<Service>
<Name>sqlbrowser</Name>
</Service>
</Services>
<Filters>
<Filter>
<ProcessAttr>ExecPath</ProcessAttr>
<Comparison>Is</Comparison>
<Value>C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Binn\sqlservr.exe</Value>
</Filter>
<Filter>
<ProcessAttr>ExecPath</ProcessAttr>
<Comparison>Is</Comparison>
<Value>C:\Program Files\Microsoft SQL Server\90\Shared\sqlbrowser.exe</Value>
</Filter>
<Filter>
<ProcessAttr>ExecPath</ProcessAttr>
<Comparison>BeginsWith</Comparison>
<Value>C:\Program Files\Tomcat\</Value>
</Filter>
<Filter>
<ProcessAttr>ExecPath</ProcessAttr>
<Comparison>Contains</Comparison>
<Value>ORACLE</Value>
</Filter>
</Filters>
</VirtaMove>
In this example, the following services are defined:
mssqlserver
sqlbrowser
In this example, four filters define Source Monitor processes whose executable path:
is "C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Binn\sqlservr.exe"
is "C:\Program Files\Microsoft SQL Server\90\Shared\sqlbrowser.exe"
begins with "C:\Program Files\Tomcat\"
contains "ORACLE"
Adding a Service to a Source Monitor Config File
Run the following command:
virtamonitor [/host hostname] [/conf config-file] /add-service service-name
The /host option is optional. If it is not provided, the operation will take place on the local machine. If it is provided, the operation will take place on the machine 'hostname" on which the VirtaMove Source Agent service must be up and running.
The /conf option is also optional. If it is not provided, the default config file will be used, which is located at <VirtaMove Install Path>\Monitor\MonitorConfig.xml
.
Example:
virtamonitor.exe /host 10.0.105.1 /conf C:\myapps\x86\debug\Monitor\myconfig.xml /add-service sqlwriter
This command adds service sqlwriter to Source Monitor config file C:\myapps\x86\debug\Monitor\myconfig.xml
on machine 10.0.105.1. The following Service and Filter sections will be added to myconfig.xml
:
When you add a service to the Source Monitor config file, virtamonitor.exe automatically adds a filter to monitor the service's executable.
Adding a Filter to a Source Monitor Config File
Run the following command:
filter-desc is the filter descriptor. It is a comma-delimited string in the form "ExecPath,<Is|BeginsWith|Contains>,<Value>"
. See Filters Tag for information about each part of the descriptor.
Example:
This command adds filter "ExecPath,Contains,Apache"
to the Source Monitor config file C:\myapps\x86\debug\Monitor\myconfig.xml
on machine 10.0.105.1. The following Filter section is added to myconfig.xml
:
Removing a Service from a Source Monitor Config File
Run the following command:
Removing a Filter from a Source Monitor Config File
To remove a filter from Monitor config file, run the following command:
Displaying a Source Monitor Config File
Run the following command: