HOME|NEWS|CONTACT|FORUM|SEARCH | |EN / DE
 
Zurück   Forum icomasoft > PowerScripter > PowerScriptor Scripts

Antwort
 
Themen-Optionen Ansicht
  #1  
Alt 24.06.2010, 09:47
sven.kempf sven.kempf ist offline
Neuer Benutzer
 
Registriert seit: 24.06.2010
Beiträge: 1
Standard get a view of the mem- situation of our VMs

This script shows a point of Time Situation of your selectet VMs. It helps to find VMs with paging or balooning memory.

#--name Memory Situation
#--multi --hideoutput
$tabelle= @()
foreach ($vmin ($multi|Get-View)){
$line=""|select Name, GuestMemoryUsage, PrivateMemory, SharedMemory, SwappedMemory, BalloonedMemory, ConsumedOverheadMemory
$line.name =$vm.Name
$line.GuestMemoryUsage =$vm.Summary.QuickStats.GuestMemoryUsage
$line.PrivateMemory =$vm.Summary.QuickStats.PrivateMemory
$line.SharedMemory =$vm.Summary.QuickStats.SharedMemory
$line.SwappedMemory =$vm.Summary.QuickStats.SwappedMemory
$line.BalloonedMemory =$vm.Summary.QuickStats.BalloonedMemory
$line.ConsumedOverheadMemory =$vm.Summary.QuickStats.ConsumedOverheadMemory

$tabelle+=$line
}
$tabelle|Out-GridViewIS

Have fun with it
Sven
Mit Zitat antworten
  #2  
Alt 24.06.2010, 10:28
PatrickDreyer PatrickDreyer ist offline
Administrator
 
Registriert seit: 23.04.2009
Beiträge: 5
Standard Have it the pipeline way

Thanks Sven, that's great!

For those of you preferring the pipe-oriented style (note the back-tickets at the line ends):

PHP-Code:
#--name Memory Situation
#--multi --hideoutput
$multi `
    | Get-View 
`
    | % {
        
$row '' select NameGuestMemoryUsagePrivateMemorySharedMemorySwappedMemoryBalloonedMemoryConsumedOverheadMemory
        $row
.Name $_.Name
        $row
.GuestMemoryUsage $_.Summary.QuickStats.GuestMemoryUsage
        $row
.PrivateMemory $_.Summary.QuickStats.PrivateMemory
        $row
.SharedMemory $_.Summary.QuickStats.SharedMemory
        $row
.SwappedMemory $_.Summary.QuickStats.SwappedMemory
        $row
.BalloonedMemory $_.Summary.QuickStats.BalloonedMemory
        $row
.ConsumedOverheadMemory $_.Summary.QuickStats.ConsumedOverheadMemory
        $row
    
} `
    | Out-GridViewIS 
Mit Zitat antworten
Antwort

Lesezeichen

Themen-Optionen
Ansicht

Forumregeln
Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Gehe zu



 
  icomasoft © is a registered trade mark of Icomasoft AG, Switzerland