Solved

Scheduling Perfmon

Posted on 2008-06-16
6
3,115 Views
Last Modified: 2013-12-01
I would like to setup a schedule for perfmon to start and stop at a certain time, currently i have about 20 servers and i am doing this manually, the schedule only give you the option for the day, I would like to schedule on a M-F 9AM - 2PM, exclude holidays etc, the way you can schedule in windows backup, does anyone know how to do this ? If i am not being clear please let me know to clarify thanks!
0
Comment
Question by:z969307
  • 3
  • 2
6 Comments
 
LVL 38

Assisted Solution

by:Shift-3
Shift-3 earned 250 total points
ID: 21797454
The easiest method would probably be to create Scheduled Tasks to run LOGMAN START and LOGMAN STOP commands at the desired times.
http://support.microsoft.com/kb/303133

You can script the creation of tasks on multiple servers with FOR /F and the SCHTASKS command.
http://www.ss64.com/nt/for_f.html
http://support.microsoft.com/kb/814596

Holidays are trickier.  You might have to exclude those manually.

0
 
LVL 38

Accepted Solution

by:
Shift-3 earned 250 total points
ID: 21797667
As an example, paste the script below into a text file with a .cmd extension.  Customize the value of the "logname" variable with the name of the Perfmon collection.  Create a text file named serverlist.txt in the same directory containing a list of servers to run the script against, one per line.

Running the script will create tasks on each server to start the collection at 9 am and stop it at 2 pm on weekdays.


@echo off
setlocal
 
set logname=Test
 
for /F %%G in (serverlist.txt) do (
 schtasks /Create /S \\%%G /RU "NT AUTHORITY\SYSTEM" /SC WEEKLY /D MON,TUE,WED,THU,FRI /TN "Start Perfmon %logname%" /TR "logman start %logname%" /ST 09:00:00
 schtasks /Create /S \\%%G /RU "NT AUTHORITY\SYSTEM" /SC WEEKLY /D MON,TUE,WED,THU,FRI /TN "Stop Perfmon %logname%" /TR "logman stop %logname%" /ST 14:00:00
)

Open in new window

0
 

Author Comment

by:z969307
ID: 21807683
Thank You.
 I will give this a try, if it works I'll double the points.
0
 

Author Comment

by:z969307
ID: 21827170
I just got around to doing this, when i ran the cmd, it finished very quickly and i did see some success, but when i went over to the server i didn't see the counter log created, do i need to manually create one on all servers and name it under "logname" ? also to make sure the script ran fine can it be written to a log txt file ? thanks
0
 
LVL 38

Expert Comment

by:Shift-3
ID: 21827690
You can use LOGMAN to copy the collection to other machines.  Type "LOGMAN /?" for the syntax.

Append ">> log.txt 2>>&1" to lines 7 and 8 to create a log file.
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I've always wanted to allow a user to have a printer no matter where they login. The steps below will show you how to achieve just that. In this Article I'll show how to deploy printers automatically with group policy and then using security fil…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

825 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question