Setting up Counter Log Files
You can specify the location, size, and format of the counter
log file(s), how often the counter values are polled, as well as filter
which counters are written to the files.
In the
Install_Dir\bin directory, enter the following command:
- On Windows:
opencounterslogger.bat ServerName ContextName
-d LogDirectory -l LogOutputStyle -s MaxLogSize -r PollingInterval -f FilterExpression
- On Unix:
opencounterslogger.sh ServerName ContextName
-d LogDirectory -l LogOutputStyle -s MaxLogSize -r PollingInterval -f FilterExpression
Where these parameters are:
- ServerName - The name of the server where the
portal you want to monitor is installed, for example: ptserver2. The
value of this name is set in the opencounters:application-name element in the configuration.xml file (in Install_Dir\settings). This value is
case-sensitive.
- ContextName - The name of the AquaLogic User
Interaction application you want to monitor, for example: portal.
The value of this name is set in the context element
in the configuration.xml file. This value is
case-sensitive.
- -d LogDirectory - (Optional) The local directory
in which to create counter log files. The directory must exist prior
to executing the opencounterslogger.bat command.
- -l LogOutputStyle - (Optional) The log output
style can be any combination of the following:
- c - Log counter values in a .csv file, with counters sorted by
counter name. CSV signifies a comma-delimited file, which can be read
by applications like Excel, for convenient graphing of the values.
- t - Log counter values in a .csv file, with counters sorted by
time stamp.
- f - Stream counter information to the file, with each line consisting
of a counter name/value pair
- s - Stream counter information to the screen, with each line consisting
of a counter name/value pair.
- -s MaxLogSize - (Optional) An integer that
specifies the maximum size of any log file in kilobytes. Once this
log file size is reached, the log is rolled over to a new file.
- -r PollingInterval - (Optional) The rate, in
seconds, at which counter values should be logged to file.
Note: Decreasing
the polling interval (for example, increasing the polling rate) can
affect overall portal performance. Retaining the out-of-the-box setting
should only affect performance by a maximum of 2%.
- -f FilterExpression - (Optional) An expression
that filters which counters are logged. Expressions are case-insensitive.
Refer to Key Performance Counters for Category, Instance, and Counter names,
then write the expression in the following format:
CategoryNameContains:InstanceNameContains:CounterNameContains
Each condition
in the above expression is optional, and is used to limit the counter
values returned. For example, -f Cache::Num will
match all counters with a category name that contains “Cache” and
a counter name that contains “Num”. The instance name will not be
filtered.
Example of the opencounterslogger command:
opencounterslogger.bat PtServer2admin collab -d C:\logdir -l t -s 1000 -r 10 -f open:sql:
This command does the following:
- Listens to the “collab” application on “PtServer2admin” (in this
example, AquaLogic Interaction Collaboration is installed)
- Logs all counters to C:\logdir
- Generates a log file sorted by timestamp
- Has a maximum log size of one megabyte, or 1000 kilobytes
- Logs values every 10 seconds
- Limits output to log counters with category names that contain
“open” and with instance names that contain “sql” (for example, category:
Opendb_SQLstats, instance: SQLSelectStats)
When you enter this command, you should see the following:
Starting counter logger...
Log files will be written to directory: C:\logdir
Logging rate (seconds): 10
Log file rollover size (kilobytes): 1000
Logging from host: PtServer2.collab
At this point, if
the logger is able to successfully connect to the server, you will
see the following:
Logging counters...
You can
now check the logging directory for log files. Log files will not
appear until there is at least one counter created on the counter
server.