11 08 2011
[PowerCLI] Script d’inventaire sur les datastores
datastore-report.ps1 :
Get-Datacenter | %{
$dc = $_
$_ | Get-Datastore | `
select @{N="Datacenter";E={$dc.Name}},
Name,
@{N="Capacite MB";E={"{0:f0}" -f ($_.CapacityMB)}},
@{N="Libre MB";E={"{0:f0}" -f ($_.FreeSpaceMB)}},
@{N="Libre%";E={"{0:P0}" -f ($_.FreeSpaceMB/$_.CapacityMB)}},
@{N="Utilise MB";E={"{0:f0}" -f ($_.CapacityMB - $_.FreeSpaceMB)}},
@{N="Utilise%";E={"{0:P0}" -f (($_.CapacityMB - $_.FreeSpaceMB)/$_.CapacityMB)}}
} | Export-Csv "datastore-report.csv" –NoTypeInformation
Le résultat :
« Datacenter », »Name », »Capacite MB », »Libre MB », »Libre% », »Utilise MB », »Utilise% »
« Mon-Datacenter », »Storage_ESX3″, »137984″, »122815″, »89 % », »15169″, »11 % »
« Mon-Datacenter », »Storage_ESX2″, »137984″, »102338″, »74 % », »35646″, »26 % »
« Mon-Datacenter », »Storage_ESX1″, »137984″, »54022″, »39 % », »83962″, »61 % »
« Mon-Datacenter », »VMFS_SAN1″, »2887680″, »309640″, »11 % », »2578040″, »89 % »
« Mon-Datacenter », »VMFS_SAN_SAV », »5118976″, »563664″, »11 % », »4555312″, »89 % »
[Linux] Vider la mémoire cache [Linux] Script de surveillance de processus