Solved

Scheduling Perfmon

Posted on 2008-06-16
6
3,123 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

It is a common problem that often server suffers from the lack of space on system volume. Old servers or new ones from vendors come with preformatted small volume - 5-6GB in total and after installing updates or applications the free space on system…
I use more than 1 computer in my office for various reasons. Multiple keyboards and mice take up more than just extra space, they make working a little more complicated. Using one mouse and keyboard for all of my computers makes life easier. This co…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

710 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