Jump to content

calamari

Members
  • Posts

    5
  • Joined

  • Last visited

Everything posted by calamari

  1. So I'm running the following powershell script to monitor processor useage over a five minute interval on multiple servers, and on one of them I get one to four samples before it errors out with the error below. Get-Counter -Counter “\Processor(_Total)\% Processor Time” -SampleInterval 1 -MaxSamples 300 | Select -ExpandProperty CounterSamples | Select CookedValue | Out-File -Append $loglocation\results-$name-$date.csv Error: This is occurring on the only 2k8 R2 server in the group being monitored, the script runs fine on 2k3, 2k3 R2, and 2k8 servers. The processor is a Xeon E31230 3.2 GHz. Anyone have any thoughts on why this might be occuring?
  2. I'm trying to locate the wscsvc.dll file in the CAB's on the install disk and not finding it anywhere. Anyone know which CAB holds that file or where I might be able to locate and index of file locations for a 2k3 R2 disk. Thanks!
  3. Ok, so I've got the output going to a csv file using Export-Csv and am now trying to trim off the output I don't need. Here's my line of script- Get-Counter "\Processor(_Total)\% Processor Time" -SampleInterval 1 -MaxSamples 10 | Export-Csv c:\data.csv The output I'm getting is this- ##-Edit: The formatting of my original post didn't come across. When viewed in Excel the file 1) is the first line, 2) the second, etc. The columns are Readings, Timestamp, and CounterSamples, with the appropriate data filling out the rest of each column. 1) #TYPE Microsoft.PowerShell.Commands.GetCounter.PerformanceCounterSampleSet 2) Readings Timestamp CounterSamples 3) \\computer\processor(_total)\% processor time: 5/29/2012 8:59 Microsoft.PowerShell.(etc) 1.560698633212 4) \\computer\processor(_total)\% processor time: 5/29/2012 8:59 Microsoft.PowerShell.(etc) 0.4782.... And so forth. What I'm trying to do now is get just the processor usage number from the first cell. I'm thinking that I can achieve this by piping the output from Get-Counter through a Where-Object on the way to Export-Csv and doing some string manipulation in there as well. I'm just not sure what object I need to get. I've tried Title and Heading to no effect. Any ideas on what object I should be trying to get or a way I can determine the appropriate object? Am I barking up the wrong tree altogether?
  4. I'm trying to develop a script which will grab performance counters and output the results into a csv file for processing. As the target machines are running XP or server 2k3 export-counter is not available to me. Any tips on how I might achieve this? I'm about as green as it gets when it comes to scripting in powershell, so be gentle. Thanks!
×
×
  • Create New...