PowerCLI for vROps

 

Connect to Vcenter

Connect-viserver vc01.vmlab.com.pl -User Administrator@vsphere.local -Password *********:)

Connect to Operation Menager Resources

Connect-OMServer vrops01.vmlab.com.pl -User Admin -Password *********:)

 

1. Check Virtual Machines status connected to Operation Menager Resources
Get-VM |Get-OMResource

 

2. List Virtual Machines with  Health issues

Get-VM | Get-OMResource |where { $_.Health -ne "Green" }

 

3. Check datastores status connected to Operation Menager Resources

Get-Datstore | Get-OMResource

 

4. List the Datastores with Health issues

Get-Datastores | Get-OMResource |where { $_.Health -ne "Green" }

 

5. Check what is the issue with alerting datastores

Get-Datastore | Get-OMResource | where { $_.Health -ne "Green" } | Get-OMALert | FT -Autosize

 

6. List Active Alerts

Get-OMAlert  -Status Acitve | FT -AutoSize

 

7. List the CPU stats for important Virtual server

Get-VM "Server_name" | GetOMresource | Get-OMStat -cpu

 

8. List the VMs who has CPU above 30%

Get-VM | Get_OMResource | Get-OMStat -cpu  |  Where { $_.value -gt 30 } | FT  -AutoSize

In this case screen shot will be looks  same 🙂

 

 

9. collect avg CPU performance report for a particular virtual machine of last 24 hours (or 1 day) and store it in .csv format.

$D = Get-OMStat -Resource 'psvcenter' -Key 'cpu|capacity_usagepct_average'-From ( [DateTime]::Now).AddDays(-1)
$D | Export-Csv -Path "C:\Users\sidharths\Desktop\test1.csv"




Please Subscribe

 1,048 total views,  3 views today