3

Trying to figure out how to make sure a specific Windows Perfmon Counter Log resumes logging automatically when the server is rebooted.

This is a Windows 2003 Server, so likely won't have anyone logging on to it immediately upon reboot. I saw this similar question, but didn't think that Scheduled Tasks execute without someone logging on...

Edit: Ok, looks like Scheduled Tasks can be set to run a command each server start, but a couple of remaining questions:

  • On the "Schedule" tab, should I leave both the "Start log" and "Stop Log" to "manual"? Then use the LOGMAN START command?
  • I saw some other web references to instead setting the "Stop Log" to 1 day, and checking the "When a log file closes: Start a new log file" checkbox. Any benefits to this approach? Does it recognize and survive a reboot without the explicit LOGMAN START command?
  • The task scheduler UI, on the Settings tab, has a box marked "Stop the task if it runs for..." that defaults to 72 hours. If I don't remove this check, will it stop my log once the server is up for 72 hrs?

And a final strategy question: If I want to monitor a handful of servers in this manner, for a short period of time, am I better off setting these monitors up directly on each server, or to run directly on my workstation, gathering data remotely?

BradC
  • 2,200
  • 4
  • 25
  • 35
  • Were you able to resolve the problem on later OSes, like Windows 10? Native PLA tasks don't work. – Suncatcher Aug 17 '17 at 15:03
  • @Suncatcher Sorry, haven't tried it on Win 10 or the server equivalent, you might have to ask your own version of the question. – BradC Aug 17 '17 at 15:14

5 Answers5

5

OK - I remember how to do this now!

Set the START TIME to now (or the past). Set the STOP AFTER to 9999 days. This will restart the counter automatically after each reboot without the need for a scheduled start script

Guy
  • 2,658
  • 2
  • 20
  • 24
  • Ding, ding, ding! We have winner! Thanks, Guy! Not sure 100% if it requires it, but I'm also going to set the "Run As" to make sure the user has the proper privileges to read the SQL perfmon counters. – BradC Sep 29 '09 at 15:20
  • We log the counters to a SQL server database (just create a machine ODBC link to a SQL Server database) and then set the username/password there. Set this up as the local machine administrator (or equivalent). Then you can use PerfMon "Load Log File" from ODBC (same as before) to show the data - or just use Excel and a Pivot table (as I do yo create pretty reports for the PHB's) – Guy Sep 30 '09 at 15:25
2

Scheduled tasks can run even with no user logged on. You provide a username and password for the task (preferably a service account so the password does not expire).

Guy
  • 2,658
  • 2
  • 20
  • 24
2

Create a scheduled task that runs Logman.exe to start your performance counter log.

shufler
  • 962
  • 1
  • 6
  • 18
1

Update: In the "schedule" tab, select some date in the past( and not manaully!). I think that this should be enough. But I didn't test it lately. To make this more complete choose some reasnoble stop condition, and also select start a new log file in the "when a log file is closed" box. I believe this should solve your problem.

Before Update: What do you mean by "performance counter restars?". Performance counter are always available when the system is up and running. If you want to log the data from the counter than you can use the "counter log" feature. You create a new log with the counters you are intrested in. and can configure the scheduling of the logging. It will autostart if the computer reboots.

Igal Serban
  • 1,575
  • 10
  • 6
  • That's the point, I already had a counter log set up, and it did NOT autostart after the reboot. What "schedule" settings are necessary for it to do so? – BradC Sep 09 '09 at 00:05
-1

You can record a non-interactive performance log.

On Windows 7 (and, I assume, Vista) define a "Data Collector Set".

On XP: define a "Counter Log"

(In both cases start by running "perfmon".)

Set up a schedule that runs continuously.

The file created is available in a number of formats, including CSV and suitable for import into the interactive display.

Richard
  • 5,309
  • 1
  • 22
  • 20