Make your own free website on Tripod.com

Requirements

All the requirements are to have a PC that is connected to the network, and Windows 2000 installed as an operating system. Every thing else is built into Windows 2000.

Also it is important that the user account used to monitor the servers has administrative privileges in all servers that he intends to monitor. There is a way to overcome that, which will be mentioned in the setup step number 9 below.

 

Preliminaries

With Windows 2000’s highly enhanced performance monitor program (perfmon), all the problems of automating perfmon are solved. However, it cannot read log files generated by Windows NT 4’s perfmon. The performance Monitor of Windows 2000 has the following additional features:

·        It has the feature of saving the logs into a .csv text file directly, rather than saving it to a log file that can only be read by the pefmon, then exporting it to a .csv file, as used to be the case with the NT 4 pefmon. In addition to the mentioned advantage, this feature will also save a very big deal of storage space, for the perfmon log files took trice the space that a .csv file would take.

·        It has the feature of scheduling the process of collecting data to start at a certain time and terminate at a certain time, and one can also specify how frequently to do this process, whether every day, every week, or every month, rather than using the scheduling of windows NT and batch files, as were the case in the old method. In our case, the log is terminated every day.

·        It has the feature of starting a new log after terminating the old one, with a different name, such as a number increment or adding the date to the file name, which was not possible in the old method. In our case, the new log starts every day, as the old log terminates.

·        Finally, it allows having a script run as the log is terminated by scheduling, if one needed to do so. This feature is not used in our case for the time being.

Setup

1.      Right-click the task bar

2.      Click properties

3.      Click the advanced tab

4.      In the “Start Menu Settings”, check the “Display Administrative Tools” check box

5.      Click Ok

6.      Open the Start menu->Programs->Administrative Tools->Services

7.      Scroll down until you find the “Performance Logs and Alerts” service, and double-click it

8.      Click on the “Log On” tab

9.      Provide the user name and password of the user responsible for monitoring the servers. (Note that if the user should not have administrative privileges, an administrator could provide his user name and password here. It will not be changed if the user logs off or shuts down the computer)

10.  Be sure the service is set to run automatically, by clicking on the General tab, and choose the “Start up” type to be Automatic

11.  Click Ok

12.  Open the Start menu->Programs->Administrative Tools->Performance

13.  Expand “Performance Logs and Alerts” from the console tree

14.  Right-click “Counter Logs”, and click “New log settings”

15.  Give a name to the log, for example, the name of the server being monitored

16.  A dialog box appears. In the General tab, click “Add”

17.  Click the “Select counters from computer” radio button

18.  In the box below it, type: \\server, where “server” is the server name. Replace it with the server name you intend to monitor. You can specify counters from several servers in the same log file, however, it is preferred to have each server in a separate log file.

19.  Select the object from which the counters should be monitored; for example, to monitor the percentage time of the processor, select the Processor object, then select the “% Processor Time” counter from the list below it. Note the instances in the box to the right. In the case of the processor, if the server has only one processor, it will show only one instance, if it had two processors, it will show two instances, and so forth. You can monitor each instance, e.g. each processor, individually.

20.  The counters used in our case are the following:

Object

Counter

Processor

% Processor Time (total to all processors)

Logical Disk

% Free Space (per logical drive)

Free Megabytes (per logical drive)

Memory

% Committed Bytes In Use

Pages/sec

Network Interface

Bytes Sent/sec (per network interface)

Bytes Received/sec (per network interface)

Current Bandwidth (per network interface)

Additional objects and counters may be monitored depending upon the purpose of the server; for example, if the server is a proxy server, one my monitor the “Transactions/sec” counter in the “Active Server Pages” object.

21.  Specify the sampling rate, in the interval box and the unit in the Units box. In our case, the sampling rate used is every 10 minutes.

22.  In the “Log Files” tab, specify the location to which the log files are to be saved. In the “Log file type” pull-down menu, select “Text File – CSV”. No need to specify a size limit of the log file. The CSV file can be directly opened by Microsoft Excel, without the need to export the data to an Excel format.

23.  In the “Schedule” tab, schedule the log to start at 12:10:00 AM, and to stop after one day.

24.  Under “When a log file closes”, check the “Start a new log file” check box. Now the log files will be named sequentially for every day.

25.  Click Ok

Now since you have already specified a time from which the log file will start collecting data, you don’t need to start it manually. All you have to do is sit back and mind your own business, then start analyzing the data after one month with Excel.

Analyzing data

Automating Average Retrieval for MS Excel

 

Now, the time has come to find a way to retrieve the .csv log files generated by the Win2K Performance Monitor. We have developed a visual basic script that opens all logs of a certain server, calculates the averages of each file (which represents each day), then saves them to a separate Excel worksheet. The procedure is as follows:

 

First of all, download the average.vbs by clicking on its name, and running the auto-extract exe file.

1.      Open Microsoft Excel, and create an empty worksheet.

2.      Save it as “D:\perflogs\Averages.xls”. The file must be in this particular path, or else the script should be edited, and the path should be changed to the one appropriate. It should be in the same directory of the log files.

3.      Close Microsoft Excel. You must do this step; it is not optional, if it is not done, you will encounter a file sharing violation error, because while the file is open, it is set as “Read only”, and the script will not be able to write to it.

4.      Open the command prompt, or the DOS window.

5.      Go to the location of the Visual Basic script file “average.vbs”. It is preferred to keep it in the same location of the log files, so that it would not get lost.

6.      type: “D:\perflogs\>average server” where “server” is the server’s name.

7.      Now, your file “averages.xls” is loaded with the averages of the server you provided, each row represents a day. Rename the file, then create another Excel file with the same name, to continue calculating the averages of other servers.

8.      Continue from step 2, if you wish to carry on with calculating averages of other servers.

9.      One final step. After the end of the month, you should copy all of your log files to an archive folder, or delete them, and reset the log file names back to 0.

Now, that most of the steps are over, all what is left is to use the graphing utilities of Excel to analyze the data graphically according to your requirements.

Back to home