Total Pageviews

7 Oct 2016

PowerShell script for monitoring SharePoint WFE's and SQL Server back-ends​​​​

#counters.txt contains a list of performance counters
#collect 
$fileName = "test{0:yyyyMMdd-HHmmss}.xml" -f (Get-Date) 
​get-counter -content (get-content counters.txt) -MaxSamples 2 -sampleinterval 5 |  Export-clixml $fileName

#save the results to the blg format. This will allow opening it with Performance Monitor
$fileName = "test{0:yyyyMMdd-HHmmss}.blg" -f (Get-Date) 
​get-counter -content (get-content counters.txt) -MaxSamples 2 -sampleinterval 5 |  Export-Counter $fileName
counters.txt contents:
\.NET CLR Memory(*)\% Time in GC 
\ASP.NET\Application Restarts 
\ASP.NET\Request Execution Time 
\ASP.NET\Requests Rejected 
\ASP.NET\Requests Queued 
\ASP.NET\Worker Process Restarts 
\ASP.NET\Request Wait Time 
\ASP.NET Applications(*)\Requests/Sec 
\LogicalDisk(*)\% Idle Time 
\Memory\Available MBytes 
\Memory\% Committed Bytes In Use 
\Memory\Page Faults/sec 
\Memory\Pages Input/sec 
\Memory\Page Reads/sec 
\Memory\Pages/sec 
\Memory\Pool Nonpaged Bytes 
\Network Interface(*)\Bytes Total/sec 
\Network Interface(*)\Packets/sec 
\Paging File(*)\% Usage 
\PhysicalDisk(*)\Current Disk Queue Length 
\PhysicalDisk(*)\% Disk Time 
\PhysicalDisk(*)\Disk Transfers/sec 
\PhysicalDisk(*)\Avg. Disk sec/Transfer 
\Process(*)\% Processor Time 
\Process(*)\Page Faults/sec 
\Process(*)\Page File Bytes Peak 
\Process(*)\Page File Bytes 
\Process(*)\Private Bytes 
\Process(*)\Virtual Bytes Peak 
\Process(*)\Virtual Bytes 
\Process(*)\Working Set Peak 
\Process(*)\Working Set 
\Processor(*)\% Processor Time 
\Processor(*)\Interrupts/sec 
\Redirector\Server Sessions Hung 
\Server\Work Item Shortages 
\System\Context Switches/sec 
\System\Processor Queue Length 
\Web Service(*)\Bytes Received/sec 
\Web Service(*)\Bytes Sent/sec 
\Web Service(*)\Total Connection Attempts (all instances) 
\Web Service(*)\Current Connections 
\Web Service(*)\Get Requests/sec

No comments:

Post a Comment