The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Special Forums > Windows & DOS: Issues & Discussions
Google UNIX.COM


Windows & DOS: Issues & Discussions Questions involving Unix to Windows (Desktop or Server) go here. Any Windows/DOS questions should go here as well.

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 11-25-2003
Registered User
 

Join Date: Aug 2001
Posts: 179
perfmon

Hi

I need to run perfmon repeatedly while running tests. Is there any i can configure the counters once and start and stop from command line.

Thanks
Reply With Quote
Forum Sponsor
  #2  
Old 11-25-2003
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,666
In XP you set up the counters and then click "file" and "save as".

If you name it perderabo.msc, then to run it from the command line, you would use:
mmc \path\perderabo.msc
Reply With Quote
  #3  
Old 11-26-2003
Registered User
 

Join Date: Aug 2001
Posts: 179
Thanks for the solution. Actually i am looking for this on windows2000. WIndows NT resource kit has some tools to do this..But they work on NT only. I have found out a command from sysinternals which is some thing like Unix ps command. That is giving few details i need.
Reply With Quote
  #4  
Old 11-26-2003
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,666
On XP, we have tasklist which is very close to ps. The docs says "tasklist is a replacement for the tlist tool". So i would expect that you would have tlist on win2k.

I think that there is another option for you. I'm pretty sure that win2k has the windows scripting host and vbscript. When vbscript is running under wsh, it can access just about *any* com object. XP has a package called WMI and I think win2k has it too.

I don't understand everything that wmi can do yet, but I've download the technet script repository. You should do the same, or at least scan it. Here is one script that microsoft says will run on win2k....
Code:
Set objDictionary = CreateObject("Scripting.Dictionary")
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colProcesses = objWMIService.ExecQuery _
    ("Select * from Win32_Process")
For each objProcess in colProcesses 
    objDictionary.Add objProcess.ProcessID, objProcess.Name 
Next
Set colThreads = objWMIService.ExecQuery _
    ("Select * from Win32_Thread")
For each objThread in colThreads
    intProcessID = CInt(objThread.ProcessHandle)
    strProcessName = objDictionary.Item(intProcessID) 
    Wscript.Echo strProcessName & VbTab & objThread.ProcessHandle & _
        VbTab & objThread.Handle & VbTab & objThread.ThreadState 
Next
This will list all threads on the system. Quite a few of the monitoring script won't run on win2k. And I see a few that won't even run on xp. Or at least they're not supported.

But anyway, take a look at vbscript. It is an interesting tool.
Reply With Quote
  #5  
Old 12-05-2003
Registered User
 

Join Date: Aug 2001
Posts: 179
Thanks for the pointer. I will take a look wsh and vbscripting
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 09:43 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0