Automatically start Windows Server 2003 Perfmon counter log upon reboot

12,055

Solution 1

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

Solution 2

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

Solution 3

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).

Solution 4

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.

Share:
12,055

Related videos on Youtube

BradC
Author by

BradC

Updated on September 17, 2022

Comments

  • BradC
    BradC over 1 year

    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?

    • Suncatcher
      Suncatcher almost 7 years
      Were you able to resolve the problem on later OSes, like Windows 10? Native PLA tasks don't work.
    • BradC
      BradC almost 7 years
      @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
    BradC almost 15 years
    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
    BradC over 14 years
    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.
  • Daniel H
    Daniel H over 14 years
    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)