You can easily use the Get-Counter cmdlet to check the value of a performance counter. If you use the -Continuous switch, the up-to-date value will be displayed. Simply pass the name of the counter you want to view and the server the counter should be monitored on. For example, to monitor the IO Writes counter on CSV Volume 1 on the server SAVDALVS01, run the following command. PS C:\> Get-Counter '\\savdalvs01\Cluster Shared Volumes(\ClusterStorage\Volume1)\IO Writes' -Continuous Timestamp CounterSamples --------- -------------- 3/18/2009 1:23:35 PM \\savdalvs01\cluster shared volumes(\clusterstorage\volume1)\io writes : 1545503 3/18/2009 1:23:36 PM \\savdalvs01\cluster shared volumes(\clusterstorage\volume1)\io writes : 1545504 3/18/2009 1:23:37 PM \\savdalvs01\cluster shared volumes(\clusterstorage\volume1)\io writes : 1545512
Note that you can easily monitor a value on any server, not just the local server. Related Reading: PowerShell 101, Lesson 1 PowerShell Got Smart About Smart Quotes Q. How can I use Windows PowerShell to return a list of machine services in a designated state? VMware and PowerShell: Managing ESX Server from the Command Lin.
Source: http://windowsitpro.com/mobile/pda/Article.cfm?ArticleID=101749&FAQ=1
Thursday, March 26, 2009
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment