<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The Demand Technology FAQ &#187; SMF Files</title>
	<atom:link href="http://faq.demandtech.com/category/smf-files/feed/" rel="self" type="application/rss+xml" />
	<link>http://faq.demandtech.com</link>
	<description>Help and Support for the Performance Sentry Product Line</description>
	<lastBuildDate>Wed, 30 Jun 2010 19:33:21 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.5</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Will you please explain Cycle End Processing?</title>
		<link>http://faq.demandtech.com/2010/03/04/will-you-please-explain-cycle-end-processing/</link>
		<comments>http://faq.demandtech.com/2010/03/04/will-you-please-explain-cycle-end-processing/#comments</comments>
		<pubDate>Thu, 04 Mar 2010 16:05:21 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[NTSMF - Collection Service]]></category>
		<category><![CDATA[Performance Sentry]]></category>
		<category><![CDATA[SMF Files]]></category>
		<category><![CDATA[Sentry Administration]]></category>

		<guid isPermaLink="false">http://faq.demandtech.com/?p=188</guid>
		<description><![CDATA[This discussion of Cycle End processing also considers the following subtopics:
 Processing multiple files
 Using ftp
 Summarization utility
  Historical files
  Using Windows Script Host (WSH) scripts
At the end of each collection cycle, the Collection service closes the current collection file to make it available for processing. The end of a cycle normally is [...]]]></description>
			<content:encoded><![CDATA[<p><span style="font-family: book antiqua,times new roman,times;">This discussion of Cycle End processing also considers the following subtopics:</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span> </span><a href="#Processing_multiple_files">Processing multiple files</a></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span> </span><a href="#Using_ftp_">Using ftp</a></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span> </span><a href="#Invoking_the_Summarization_utility">Summarization utility</a></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Book Antiqua;"> <span> </span><a href="#Historical_files">Historical files</a></span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Book Antiqua;"> <span> </span><a href="#Using_WSH_scripts_">Using Windows Script Host (WSH) scripts</a></span></p>
<p>At the end of each collection cycle, the Collection service closes the current collection file to make it available for processing. The end of a cycle normally is used to initiate processing of the collection files in SAS or MXG. Cycle end processing normally consists of scheduling a process to consolidate Performance SeNTry data files at a central location. This section discusses automating cycle end processing.</p>
<p>The Collection service stores data collection logs in the \Data subdirectory under the NTSMF24 program directory by default. The location of the data directory can also be changed using the SeNTry Administration program by modifying the Directory where SMF files are stored start-up parameter.</p>
<p>Hierarchical file management sets up Current, Previous and Archive Folders under the \Data directory and manages collection files according to the criteria you specify. The hierarchical file management option is specifically designed to simplify your cycle end procedures. By default, old collection files are moved immediately from the Current Folder to the Previous Folder. After the number of days you specify, they are then migrated to the Archive Folder. Files are kept in the Archive Folder for an additional period of time and then deleted automatically according to your specifications. Because all automatic file management is performed prior to issuing the Cycle End Command, the cycle end procedure you execute can be as simple as a COPY *.* command pointing to the Previous Folder.</p>
<p>Unique collection data log file names are automatically generated of the form</p>
<p align="center"><span style="font-family: Courier;"><em>systemname.yyyymmddhhmmCustomQualifier</em>.smf</span></p>
<p>where<span> </span><em>yyyymmddhhmm</em><span> </span>is a date/time stamp identifying when the file was created. During the collection cycle, the Collection service can lock the current data file so that no other application can access it. Or the current data file can be Shared so that it can be processed by other Windows NT/2000 programs or commands while collection is occurring and the file is open. The collection file is closed at Cycle End and is available for processing.</p>
<p>The Collection service automatically launches the Cycle End Command you specify after all file management actions have been completed. You can specify commands directly or execute a .BAT file script, PERL script, or other command processing program. By default, the Cycle End command is launched immediately. Or you can specify that the Cycle End command be launched at a random time within a defined processing window (up to 60 minutes in duration).</p>
<h3><span style="font-family: Book Antiqua,Times New Roman,Times;"><a name="Processing_multiple_files">Processing multiple files.</a></span></h3>
<p>If the Collection service was restarted (due to a re-boot, for example) during the last collection cycle, there will be multiple .smf collection files in the<strong>\data\Previous</strong><span> </span>folder at the time the Cycle End Command you specified is launched. Consequently, the Cycle End processing you perform should allow for the fact that multiple collection files may be available for processing. A wildcard in your filespec normally accomplishes this.<span> </span></p>
<p>For ease of processing in MXG, you will normally consolidate collection files representing many different machines into one file. Use the COPY command available in Windows NT/2000 with the /B option to consolidate multiple Performance SeNTry collection data files into one large file for processing:</p>
<p align="center"><span style="font-family: Courier;">COPY /B C:\NTSMF24\data\Previous\*.SMF C:\NTSMF\Daily\NTDaily.SMF</span></p>
<p>The<span> </span><strong>/B</strong><span> </span>option of the COPY command concatenates multiple files without terminating each file with a x’3F’ end of file character. In the above example the file named<span> </span><strong>NTDaily.SMF</strong><span> </span>is associated with the MXG NTSMF input file name, for example. To process this data file in MXG, you would code a SAS language<span> </span><strong>FILENAME NTSMF</strong><span> </span>specification that references<span> </span><strong>C:\NTSMF\Daily\NTDaily.SMF</strong><span> </span>if you are running SAS under Windows NT/2000.</p>
<p>If you are copying files to send to an MVS mainframe for processing using SAS, use a combination of<span> </span><strong>/A</strong><span> </span>and<span> </span><strong>/B</strong><span> </span>switches, as follows to prevent embedded EOFs in the concatenated file:</p>
<p align="center"><span style="font-family: Courier;">copy /a f1.smf+f2.smf+f3.smf bigfile /b</span></p>
<p>Using the<span> </span><strong>/a</strong><span> </span>will cause the EOF mark to be removed from each of the source files<span> </span><strong>f1.smf</strong><span> </span>through<span> </span><strong>f3.smf</strong><span> </span>as they are concatenated into the destination file<span> </span><strong>bigfile</strong>. the<span> </span><strong>/b</strong><span> </span>following the destination file<span> </span><strong>bigfile</strong><span> </span>ensures that an EOF mark is not appended to<span> </span><strong>bigfile</strong><span> </span>and subsequently transmitted to MVS.</p>
<p>More generally, to create a concatenated file usable under MVS:</p>
<p align="center"><span style="font-family: Courier;">copy /a *.smf bigfile /b</span></p>
<h3><span style="font-family: Book Antiqua,Times New Roman,Times;"><a name="Using_ftp_">Using ftp</a></span></h3>
<p>If you need to send daily .smf files to a non-Windows host machine for processing or the machine you need to transfer the files to is separated by a firewall, you may need to use the ftp utility to copy the files. Here is an example of a simple .bat command file that utilizes ftp:</p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier;">COPY /B C:\NTSMF24\Data\Previous\*.SMF C:\NTSMF24\Data\Consolidated\Consolidated.SMF</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier;">ftp -v -i -s:Transfer.ftp</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier;">exit</span></p>
<p>The following example script connects to a remote server, uses a valid Username and Password to log into the remote system. Once logged unto the remote system, the program changes directory (CD) to the remote directory<span> </span><span style="font-family: Courier;">C:\Consolidated</span><span> </span>and sends the file from the originating folder<span style="font-family: Courier;">C:\NTSMF24\Data\Consolidated\Consolidated.smf</span><span> </span>to the remote file<span> </span><span style="font-family: Courier;">Consolidated.smf</span><span> </span>on the remote server. Both origination and remote servers have to have FTP enabled, with common Usernames and Passwords defined. In the script, replace the keywords Remote, Username, and Password with parameters that are valid for your environment.</p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier;">open Remote</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier;">Username</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier;">Password</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier;">cd C:\Consolidated</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier;">send C:\NTSMF24\Data\Consolidated\Consolidated.SMF Consolidated.SMF</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier;">Bye</span></p>
<p>You can also using ftp wild cards to transfer multiple files in a single command execution stream. The easiest way to do this to create an ftp script that uses the<span> </span><strong>mput<span> </span></strong>subcommand to send multiple .smf files contained in the<span> </span><strong>\Previous</strong><span> </span>folder.</p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier;">CD C:\NTSMF24\DATA\PREVIOUS\</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier;">ftp -v -i -s:C:\FTPROCESS\transfersmf.txt</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier;">exit</span></p>
<p>where<strong><span> </span>transfersmf.txt</strong><span> </span>is a text file containing the following ftp script:</p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier;">Rem Transfersmf.ftp sends multiple files to a remote central server</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier;">open Remote</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier;">Username</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier;">Password</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier;">prompt</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier;">mput *</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier;">Bye</span></p>
<p>The<span> </span><strong>prompt</strong><span> </span>subcommand turns off ftp interactive mode. The<span> </span><strong>*</strong><span> </span>wildcard filespec means that all data files located in the<span> </span><strong>\Previous</strong><span> </span>folder will be transferred.</p>
<h3><span style="font-family: Book Antiqua,Times New Roman,Times;"><a name="Invoking_the_Summarization_utility">Invoking the Summarization utility</a></span></h3>
<p>The Summarization utility is designed to run at Cycle End, although it can also execute in a standalone environment. Letting the Summarization utility perform aggregation of the detailed collection files, you can distribute a good deal of the load involved in post-processing .smf files across your network.</p>
<p>In this example, the Summary utility is invoked in the Cycle End command script after a step that consolidates multiple detail files, prior to invoking<strong>ftp</strong><span> </span>to transfer the .sum.smf summarized file to a consolidation folder on a remote server:</p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier;">copy /b C:\NTSMFv24\Data\Previous\*.SMF C:\NTSMFv24\Data\Previous\Allprevious.smf</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier;">rem Next run summarization rtn to summarize in 60 minute intervals</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier;">cd ..</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier;">cd ..</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier;">dmsumsmf.exe -fAllprevious.smf -s60</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier;">rem Next execute FTP transfer bat file to upload file</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier;">ftp -v -i -s:Transfer.ftp</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier;">exit</span></p>
<p>where<span> </span><strong>Transfer.ftp</strong><span> </span>consists of the following script:</p>
<p><span style="font-family: Courier;">open 10.0.0.7<span> </span><br />
ftpguest<br />
password<br />
cd transfersmf<span> </span><br />
send<span> </span><br />
C:\NTSMFv24\Data\previous\Allprevious.sum.SMF<span> </span><br />
Allprevious.sum.SMF<br />
Bye</span></p>
<h3><span style="font-family: Book Antiqua,Times New Roman,Times;"><span style="font-family: Book Antiqua;"><a name="Historical_files">Historical files</a></span></span></h3>
<p><span style="font-family: Book Antiqua;">You can also take advantage of a roll-up feature in the Summarization utility to create and maintain historical data files that can streamline your reporting procedures. To use the roll-up feature, concatenate the current data file with the previous historical data file. When you invoke the Summary Utility on the combined file, specify the number of consecutive days worth of data that you want to keep. Any data older than the number of days you specify will be dropped from the summarized output file. Using the Summarization utility, you can create and maintain as many historical files as you want, as the example below illustrates. The sample script below maintains a daily historical roll-up file that spans the last 14 days, a weekly roll-up that spans 26 weeks, and a monthly roll-up that spans the last two years.</span></p>
<p><span style="font-family: Book Antiqua;">At Cycle End, issue the following command:</span></p>
<p><span style="font-family: Courier;">summary-example1.bat @LastDataFile:p @StartupDir</span></p>
<p><span style="font-family: Book Antiqua;">where<span> </span><strong>summary-example1.bat</strong><span> </span>is coded as follows:</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier; font-size: x-small;">rem Summay utility example</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier; font-size: x-small;">rem Cycle End command: summary-example1.bat @LastDataFile:p @StartupDir</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier; font-size: x-small;">rem Maintains daily, weekly, and monthly history files</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier; font-size: x-small;">rem Daily roll-up file: keeps 14 days of history, summarized to 10 minute intervals</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier; font-size: x-small;">rem Weekly roll-up file: keeps 26 weeks of history, summarized to 1 hour intervals</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier; font-size: x-small;">rem Monthly roll-up file: keeps 24 months of history, summarized to 4 hour intervals</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier; font-size: x-small;">rem ******************************************************************</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier; font-size: x-small;">rem</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier; font-size: x-small;">rem Utilizes the following Directory structure:</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier; font-size: x-small;">rem &lt;ntsmf root&gt;\data\</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier; font-size: x-small;">rem &#8211; \Archive</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier; font-size: x-small;">rem &#8211; \Backup  &#8212; backup History files first</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier; font-size: x-small;">rem &#8211; \Current</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier; font-size: x-small;">rem &#8211; \History &#8212; current History roll-up files</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier; font-size: x-small;">rem &#8211; \Previous</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier; font-size: x-small;">rem &#8211; \Work    &#8212; for temporary files</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier; font-size: x-small;">rem</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier; font-size: x-small;">rem summarize the contents of the \data\previous folder &#8212; yesterday&#8217;s smf data files</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier; font-size: x-small;">copy /B %1\*.smf %2\data\Work\%COMPUTERNAME%.combined.smf</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier; font-size: x-small;">%2\dmsumsmf.exe -f%2\data\Work\%COMPUTERNAME%.combined.smf -k2 -H&#8221;%2&#8243; -s10</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier; font-size: x-small;">rem Delete old backups</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier; font-size: x-small;">del del %2\data\Backup\*.old.sum.smf</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier; font-size: x-small;">rem Backup History files</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier; font-size: x-small;">ren %2\data\Backup\%COMPUTERNAME%.daily.sum.smf %2\data\Backup\%COMPUTERNAME%.daily.old.sum.smf</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier; font-size: x-small;">ren %2\data\Backup\%COMPUTERNAME%.weekly.sum.smf %2\data\Backup\%COMPUTERNAME%.weekly.old.sum.smf</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier; font-size: x-small;">ren %2\data\Backup\%COMPUTERNAME%.monthly.sum.smf %2\data\Backup\%COMPUTERNAME%.monthly.old.sum.smf</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier; font-size: x-small;">copy %2\data\History\*.smf %2\data\Backup\</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier; font-size: x-small;">rem</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier; font-size: x-small;">rem Keep 14 days worth of Daily data</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier; font-size: x-small;">rem</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier; font-size: x-small;">rem Step 1: move the Daily summary file to \Work</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier; font-size: x-small;">move %2\data\History\%COMPUTERNAME%.daily.history.sum.smf %2\data\Work\</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier; font-size: x-small;">rem Step 2: Concatenate yesterday&#8217;s data with the current Daily history roll-up</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier; font-size: x-small;">copy /B %2\data\Work\%COMPUTERNAME%.combined.sum.smf+%2\data\Work\%COMPUTERNAME%.daily.sum.smf %2\data\History\%COMPUTERNAME%.daily.smf</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier; font-size: x-small;">rem Step 3: Run the Summarization utility on the combined file</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier; font-size: x-small;">%2\dmsumsmf.exe -f%2\data\History\%COMPUTERNAME%.daily.smf -k14 -H%2 -s10</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier; font-size: x-small;">rem</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier; font-size: x-small;">rem Keep 26 weeks worth of Weekly data</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier; font-size: x-small;">rem</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier; font-size: x-small;">move %2\data\History\%COMPUTERNAME%.weekly.sum.smf %2\data\Work\</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier; font-size: x-small;">copy /B %2\data\Work\%COMPUTERNAME%.combined.sum.smf+%2\data\Work\%COMPUTERNAME%.weekly.sum.smf %2\data\History\%COMPUTERNAME%.weekly.smf</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier; font-size: x-small;">%2\dmsumsmf.exe -f%2\data\History\%COMPUTERNAME%.weekly.smf -k182 -H%2 -s60</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier; font-size: x-small;">rem</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier; font-size: x-small;">rem Keep 24 months worth of Monthly data</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier; font-size: x-small;">rem</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier; font-size: x-small;">move %2\data\History\%COMPUTERNAME%.monthly.sum.smf %2\data\Work\</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier; font-size: x-small;">copy /B %2\data\Work\%COMPUTERNAME%.combined.sum.smf+%2\data\Work\%COMPUTERNAME%.monthly.sum.smf %2\data\History\%COMPUTERNAME%.monthly.smf</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier; font-size: x-small;">%2\dmsumsmf.exe -f%2\data\History\%COMPUTERNAME%.monthly.smf -k730 -H%2 -s240</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier; font-size: x-small;">rem</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier; font-size: x-small;">rem Clean up Work &amp; History folders</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier; font-size: x-small;">del %2\data\Work\*.smf</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier; font-size: x-small;">del %2\data\History\%COMPUTERNAME%.daily.smf</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier; font-size: x-small;">del %2\data\History\%COMPUTERNAME%.weekly.smf</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier; font-size: x-small;">del %2\data\History\%COMPUTERNAME%.monthly.smf</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;">
<h3 style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Book Antiqua,Times New Roman,Times;"><a name="Using_WSH_scripts_">Using WSH scripts</a></span></h3>
<p style="margin-top: 0px; margin-bottom: 0px;">
<p style="margin-top: 0px; margin-bottom: 1px; margin-right: 0px;">Windows Script Host (WSH) scripts written in either VBscript or Javascript provide a flexible alternative to shell scripts. You can specify that a WSH script be launched at Cycle End. Launching WSH scripts at Cycle End requires<span> </span><a href="pr13.htm">the 2.4.7.3 version of the collection agent</a>.</p>
<p style="margin-top: 0px; margin-bottom: 1px; margin-right: 0px;">
<p style="margin-top: 0px; margin-bottom: 1px; margin-right: 0px;">The<span> </span><a href="http://www.microsoft.com/technet/scriptcenter/hubs/win2003.mspx">Script Center</a><span> </span>on the Microsoft TechNet web site is an excellent resource for anyone that wants to learn about WSH script basics. If you have access to the Microsoft Developer Network (MSDN) web, you can access many<span> </span><a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnanchor/html/scriptinga.asp">additional resources for developing WSH scripts</a>.</p>
<p style="margin-top: 0px; margin-bottom: 1px; margin-right: 0px;">
<p style="margin-top: 0px; margin-bottom: 1px; margin-right: 0px;">WSH technology is built into Windows 2000 and above, so there is no extra software you need to start developing WSH scripts. Utilizing built-in scripting objects like Wscript, WshShell, WshEnvironment, and WshArguments, your script can execute other programs, access environment variables and retrieve script arguments. A file system scripting object allows your script to manipulate folders and files. Finally, using WMI, your script can access any of the configuration information that is accessible in the vast WMI repository.</p>
<p style="margin-top: 0px; margin-bottom: 1px; margin-right: 0px;">
<p style="margin-top: 0px; margin-bottom: 1px; margin-right: 0px;"><strong>WARNING:<span> </span></strong>When you specify the execution of a WSH script at Cycle End, make sure you specify the<span> </span><strong>//B</strong><span> </span>runtime parameter when you invoke wscript.exe or cscript.exe. The<span> </span><strong>//B</strong><span> </span>runtime parameter runs your script in batch mode, suppressing all screen output and keyboard interaction. If you do not specify the<span> </span><strong>//B</strong><span> </span>runtime parameter and your WSH script issues a Wscript.Echo statement that writes to the display or initiates any other interaction with the screen, your script will hang.</p>
<p style="margin-top: 0px; margin-bottom: 1px; margin-right: 0px;">
<p style="margin-top: 0px; margin-bottom: 1px; margin-right: 0px;">For example, specify the following Cycle End command in your DCS parameters:</p>
<p style="margin-top: 0px; margin-bottom: 1px; margin-right: 0px;">
<p style="margin-top: 0px; margin-bottom: 1px; margin-right: 0px;"><span style="font-family: Courier New;"><strong>Wscript.exe //B &#8220;@StartupDir\CycleEndscript1.vbs&#8221; /datapath:@LastDataFile:p /rootdir:@StartupDir</strong></span></p>
<p style="margin-top: 0px; margin-bottom: 1px; margin-right: 0px;">
<p style="margin-top: 0px; margin-bottom: 1px; margin-right: 0px;">For tips on configuring the collection service in order to debug a Cycle End WSH script, see the section entitled<span> </span><strong><a href="#Debugging_WSH_scripts.">Debugging WSH scripts</a><span> </span></strong>below.</p>
<p style="margin-top: 0px; margin-bottom: 1px; margin-right: 0px;">
<p style="margin-top: 0px; margin-bottom: 1px; margin-right: 0px;">The following VBscript example illustrates the functions typically performed in a Cycle End script using WSH. It performs the following processing steps:</p>
<p style="margin-top: 0px; margin-bottom: 1px; margin-right: 0px;">
<ol>
<li>
<p style="margin-top: 0px; margin-bottom: 1px; margin-right: 0px;">It performs some string manipulation of today&#8217;s date to create a unique file name.</p>
</li>
<li>
<p style="margin-top: 0px; margin-bottom: 1px; margin-right: 0px;">It validates the arguments<span> </span><strong>/datapath<span> </span></strong>and<span> </span><strong>/rootdir<span> </span></strong>arguments that are passed to it from the command line invocation.</p>
</li>
<li>
<p style="margin-top: 0px; margin-bottom: 1px; margin-right: 0px;">It calls the NtDACmd utility to update the NTSMF PDB Sql Server database.</p>
</li>
<li>
<p style="margin-top: 0px; margin-bottom: 1px; margin-right: 0px;">It then uses the Copy command with the /B option to consolidate multiple files into a single daily file, embedding the current date into the consolidated file&#8217;s name. (The file system scripting object has no comparable function.)</p>
</li>
<li>
<p style="margin-top: 0px; margin-bottom: 1px; margin-right: 0px;">It calls the DmSumsmf utility to create a summarized version of the consolidated daily data file.</p>
</li>
<li>
<p style="margin-top: 0px; margin-bottom: 1px; margin-right: 0px;">Finally, it copies the consolidated daily data file somewhere &#8212; Step 6 is the section of the Cycle End script that requires customization for your environment.</p>
</li>
</ol>
<p style="margin-top: 0px; margin-bottom: 1px; margin-right: 0px;">
<p style="margin-top: 0px; margin-bottom: 1px; margin-right: 0px;">VBscript comment statements &#8212; any statement that starts with a &#8216; character &#8211;  are shown in an alternate color in this listing.</p>
<p style="margin-top: 0px; margin-bottom: 0px;">
<p style="margin-top: 0px; margin-bottom: 0px;"><span style="font-family: Courier New; font-size: x-small;"><span style="color: #008080;">&#8216; VBScript source code<br />
&#8216; Creates consolidated daily .smf file in /Previous folder<br />
&#8216; Creates summarized daily .smf file from consolidated file<br />
&#8216; Calls NtDACmd to initiate an NTSMF PDB database update<span> </span><br />
&#8216; Finally, copies the summarized file to a designated location<br />
&#8216;<br />
&#8216; The script accepts two parameters:<br />
&#8216; /datapath &#8212; the fully qualified path to the \data\Previous\ folder<span> </span><br />
&#8216; where yesterday&#8217;s .smf collection files are located<br />
&#8216; /rootdir &#8212; the fully qualified path to the NTSMF root folder<span> </span><br />
&#8216; where the DmSumsmf and NtDACmd utilities are located<br />
&#8216; Sample invokation at CycleEnd:<br />
&#8216;<br />
&#8216; Wscript.exe //B &#8220;@StartupDir\CycleEndscript1.vbs&#8221; /datapath:@LastDataFile:p<span> </span><br />
&#8216; /rootdir:@StartupDir</span></span></p>
<p>&#8216;Step 1 &#8212; Create a unique file name</p>
<p>Dim CreatedTodayDate<br />
Dim CreatedTodayDateAsString<br />
Dim EditDate &#8216;mmddyy format from standard Date function in VBscript<br />
CreateTodayDate = Date<br />
CreatedTodayDateAsString = CStr(CreateTodayDate)<br />
<span style="color: #008080;">&#8216;Wscript.Echo &#8220;Today&#8217;s Date String is &#8221; &amp; CreatedTodayDateAsString<br />
</span><br />
dim datestrlen<span> </span><br />
datestrlen = Len(CreatedTodayDateAsString)</p>
<p>dim loc<br />
loc = InStr(CreatedTodayDateAsString,&#8221;/&#8221;)<br />
EditDate = Left(CreatedTodayDateAsString,loc-1)<br />
if len(EditDate) = 1 then<br />
EditDate = &#8220;0&#8243; &amp; EditDate<br />
End if<br />
CreatedTodayDateAsString = Right(CreatedTodayDateAsString,datestrlen-loc)<br />
datestrlen = datestrlen &#8211; loc<br />
loc = InStr(CreatedTodayDateAsString,&#8221;/&#8221;)<br />
EditDate = EditDate &amp; &#8220;-&#8221; &amp; Left(CreatedTodayDateAsString,loc-1)<br />
CreatedTodayDateAsString = Right(CreatedTodayDateAsString,datestrlen-loc)<br />
datestrlen = datestrlen &#8211; loc<br />
EditDate = EDitDate &amp; &#8220;-&#8221; &amp; CreatedTodayDateAsString<br />
&#8216;Wscript.Echo &#8220;EditDate is &#8221; &amp; EditDate</p>
<p><span style="color: #008080;">&#8216;Step 2 &#8212; Validate the arguments passed to the script</span><br />
Set WshShell = CreateObject(&#8221;Wscript.Shell&#8221;)<br />
Set objEnv = WshShell.Environment(&#8221;Process&#8221;)<br />
LogonServer = objENV(&#8221;COMPUTERNAME&#8221;)</p>
<p>Dim namedArgs<br />
Dim PrevFolder, RootFolder<br />
Dim objFSO1,objPreviousFolder,fc1,allthefilenames<span> </span></p>
<p>Set objFSO1 = CreateObject(&#8221;Scripting.FileSystemObject&#8221;)<br />
Set namedArgs = WScript.Arguments.Named<br />
<span style="color: #008080;">&#8216;WScript.Echo &#8220;datapath specified: &#8221; &amp; namedArgs.Item(&#8221;datapath&#8221;)<br />
&#8216;WScript.Echo &#8220;rootdir specified: &#8221; &amp; namedArgs.Item(&#8221;rootdir&#8221;)<br />
</span><br />
PrevFolder = namedArgs.Item(&#8221;datapath&#8221;)<br />
RootFolder = namedArgs.Item(&#8221;rootdir&#8221;)</p>
<p><span style="color: #008080;">&#8216;Change the next assignment statement to generate a different name for consolidated data file<span> </span></span><br />
DailyFileName = PrevFolder &amp; &#8220;\&#8221; &amp; LogonServer &amp; &#8220;.&#8221; &amp; _<br />
&#8220;consolidated_daily_filefor&#8221; &amp; &#8220;.&#8221; &amp; EditDate &amp; &#8220;.smf&#8221;<span> </span></p>
<p><span style="color: #008080;">&#8216;WScript.Echo DailyFileName</span></p>
<p>If objFSO1.FolderExists(PrevFolder) then<br />
Else<br />
<span style="color: #008080;"> &#8216;WScript.Echo &#8220;Invalid datapath argument: &#8221; &amp; PrevFolder<br />
<span> </span></span>Return<br />
End If</p>
<p>If objFSO1.FolderExists(RootFolder) then<br />
Else<br />
<span> </span><span style="color: #008080;">&#8216;WScript.Echo &#8220;Invalid root directory argument: &#8221; &amp; RootFolder<br />
<span> </span></span>Return<br />
End If</p>
<p><span style="color: #008080;">&#8216;Step 3 &#8212; Call the NtDACmd to update the NTSMF PDB database</span></p>
<p>command = RootFolder &amp; &#8220;/&#8221; &amp; &#8220;ntdacmd.exe -d &#8221; &amp; PrevFolder &amp; &#8221; -threads 2&#8243;<br />
Dim execCommand2<br />
Set execCommand2 = WshShell.Exec(command)</p>
<p><span style="color: #008080;">&#8216;Wscript.Echo execCommand2.StdOut.ReadAll</span></p>
<p><span style="color: #008080;">&#8216;Step 4 &#8212; Execute the Copy coammnd to consolidate the daily .smf data files<span> </span></span></p>
<p>dim copyspec<br />
copyspec = &#8220;&#8221;"&#8221; &amp; PrevFolder &amp; &#8220;\*.smf&#8221; &amp; &#8220;&#8221;"&#8221;<br />
<span style="color: #008080;">&#8216;Wscript.Echo &#8220;Copy .smf Files in Previous Folder to: &#8221; &amp; DailyFileName<br />
</span><br />
dim command<span> </span><br />
command = &#8220;cmd.exe /c &#8221; &amp; &#8220;&#8221;"&#8221; &amp; &#8220;copy /b &#8221; &amp; copyspec &amp; &#8221; &#8221; &amp; DailyFileName &amp; &#8220;&#8221;"&#8221;<br />
<span style="color: #008080;">&#8216;Wscript.Echo &#8220;Copy command string: &#8221; &amp; command</span></p>
<p>Dim execCommand<br />
Set execCommand = WshShell.Exec(command)</p>
<p><span style="color: #008080;">&#8216;Wscript.Echo execCommand.StdOut.ReadAll</span></p>
<p><span style="color: #008080;">&#8216;Step 5 &#8212; Execute the DmSumsmf utility to summarize the daily .smf data files<span> </span><br />
</span><br />
command = RootFolder &amp; &#8220;/&#8221; &amp; &#8220;dmsumsmf -f&#8221; &amp; DailyFileName &amp; &#8221; -h&#8221; &amp; RootFolder<span> </span><br />
<span style="color: #008080;">&#8216;Wscript.Echo &#8220;Dmsumsmf command string: &#8221; &amp; command</span><br />
Dim execCommand1<br />
Set execCommand1 = WshShell.Exec(command)</p>
<p><span style="color: #008080;">&#8216;Wscript.Echo execCommand.StdOut.ReadAll</span></p>
<p><span style="color: #008080;">&#8216;Step 6 &#8212; Finally, copy the consolidated summary file somewhere ===&gt;<br />
&#8216;Careful. Multiple sum.smf output files may be created<br />
</span>command = &#8220;cmd.exe /c &#8221; &amp; &#8220;&#8221;"&#8221; &amp; &#8220;copy &#8221; &amp; PrevFolder &amp; &#8220;\*.sum.smf \\STPUTL04\NTSMF&#8221; &amp; &#8220;&#8221;"&#8221;<br />
<span style="color: #008080;">&#8216;Wscript.Echo &#8220;Copy command string: &#8221; &amp; command</span><br />
&#8216;Dim execCommand3<br />
&#8216;Set execCommand3 = WshShell.Exec(command)<br />
<span style="color: #008080;">&#8216;Wscript.Echo execCommand3.StdOut.ReadAll</span></p>
<p style="margin-top: 0px; margin-bottom: 0px;"><strong><a name="Debugging_WSH_scripts.">Debugging WSH scripts.</a><span> </span></strong>An old fashioned, but effective, way to debug WSH scripts is to use the Wscript.Echo method to write to the screen to trace the flow of program execution. This sample script is laced with Wscript.Echo  statements that were used in debugging, but subsequently have been commented out. In order to view the output from Wscript.Echo statements while you test your script during Cycle End processing, you must</p>
<p style="margin-top: 0px; margin-bottom: 0px;">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
<td width="42" valign="baseline"><img src="_themes/expeditn/expbul1a.gif" alt="bullet" hspace="13" width="15" height="15" /></td>
<td width="100%" valign="top"><span style="font-family: book antiqua,times new roman,times;"></p>
<p style="margin-top: 0px; margin-bottom: 0px;">remove the<span> </span><strong>//B</strong><span> </span>parameter that suppresses interactive output from the Wscript invocation statement on the Cycle End command line,</p>
<p></span></td>
</tr>
<tr>
<td width="42" valign="baseline"><img src="_themes/expeditn/expbul1a.gif" alt="bullet" hspace="13" width="15" height="15" /></td>
<td width="100%" valign="top"><span style="font-family: book antiqua,times new roman,times;"></p>
<p style="margin-top: 0px; margin-bottom: 0px;">allow the Performance SeNTry collection service to interact with the desktop (as illustrated below), and</p>
<p></span></td>
</tr>
</tbody>
</table>
<p><span style="font-family: book antiqua,times new roman,times;"> </span></p>
<p style="margin-top: 0px; margin-bottom: 0px;">
<p style="margin-top: 0px; margin-bottom: 0px;"><img src="cycle_1.jpg" border="0" alt="" width="410" height="461" align="center" /></p>
<p style="margin-top: 0px; margin-bottom: 0px;">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr>
<td width="42" valign="baseline"><img src="_themes/expeditn/expbul1a.gif" alt="bullet" hspace="13" width="15" height="15" /></td>
<td width="100%" valign="top"><span style="font-family: book antiqua,times new roman,times;"></p>
<p style="margin-top: 0px; margin-bottom: 0px;">restart the Performance SeNTry collection service after you have applied this Service Control Manager parameter change so that it can take effect.</p>
<p></span></td>
</tr>
</tbody>
</table>
<p><span style="font-family: book antiqua,times new roman,times;"> </span></p>
<p style="margin-top: 0px; margin-bottom: 0px;">
<p style="margin-top: 0px; margin-bottom: 0px;">This will allow you to view all Wscript.Echo output when the script executes during Cycle End command processing.</p>
<p style="margin-top: 0px; margin-bottom: 0px;">
<p style="margin-top: 0px; margin-bottom: 0px;">When you execute Wcsript.exe or ccript.exe to run your script, the <span> </span><strong>//B</strong><span> </span>parameter indicates batch execution mode. Batch mode suppresses command-line display of user prompts and script errors, which is important when you run a script during Cycle End command processing. Without the the<span> </span><strong>//B</strong>parameter, your script will hang, waiting for user input if you execute a Wscript.Echo statement that writes to the screen.</p>
<p style="margin-top: 0px; margin-bottom: 0px;">
<p style="margin-top: 0px; margin-bottom: 0px;"><strong>WARNING</strong>: When you have finished debugging your script, make sure you restore the<span> </span><strong>//B</strong><span> </span>parameter to the script invocation command line before you distribute to a production server. If you do not allow the collection service to interact with the desktop, as illustrated above, any attempts to write to the screen using Wscript.Echo statements will be invisible. In this case, not only will the script hang, but you will not be able to tell that it is hung.</p>
<p style="margin-top: 0px; margin-bottom: 0px;">
]]></content:encoded>
			<wfw:commentRss>http://faq.demandtech.com/2010/03/04/will-you-please-explain-cycle-end-processing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>What is the format of the Performance Sentry data files?</title>
		<link>http://faq.demandtech.com/2009/09/29/what-is-the-format-of-the-performance-sentry-data-files/</link>
		<comments>http://faq.demandtech.com/2009/09/29/what-is-the-format-of-the-performance-sentry-data-files/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 17:33:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Performance Sentry]]></category>
		<category><![CDATA[SMF Files]]></category>
		<category><![CDATA[ASCII]]></category>
		<category><![CDATA[Data Format]]></category>

		<guid isPermaLink="false">http://faq.demandtech.com/?p=43</guid>
		<description><![CDATA[Performance Sentry data files are ASCII text files, comma delimited by default, in an open, documented format that can be easily read in almost any application. To make it easy for third party products to process our data, we developed a self-defining file format. At the start of each file, we write Configuration records and [...]]]></description>
			<content:encoded><![CDATA[<p>Performance Sentry data files are ASCII text files, comma delimited by default, in an open, documented format that can be easily read in almost any application. To make it easy for third party products to process our data, we developed a self-defining file format. At the start of each file, we write Configuration records and other identifying data. Then we write the discovery records (or Format Records) which describe the contents of the file to follow. Then we write the actual data records that are collected each measurement interval. Each Object instance is written as a separate data record. Data fields have a default precision of two decimal places, but whenever more precision is required, we write the data field with an explicit decimal point.</p>
<p>Appendix B of the Performance Sentry User Manual provides a complete description of the Performance Sentry file format.</p>
]]></content:encoded>
			<wfw:commentRss>http://faq.demandtech.com/2009/09/29/what-is-the-format-of-the-performance-sentry-data-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
