My notes and ramblings, normally about automation

PowerCLI 6.0 R2 - Announcing vROps Integration

· Read in about 3 min · (436 Words)
PowerCLI VMware PowerShell vROps

For those that have been requesting some vCOps and/or vROps integration into PowerCLI, as I have been, we finally have our solution! PowerCLI 6.0 R2 brings that to the table in the form of a new module:VMware.VimAutomation.vROps

The following functions are featured in the module:Connect-OMServer Disconnect-OMServer Get-OMAlert Get-OMAlertDefinition Get-OMAlertSubType Get-OMAlertType Get-OMRecommendation Get-OMResource Get-OMStat Get-OMStatKey Set-OMAlert Here’s a couple tips to get started using it:To begin pulling stats you will need to authenticate to the vROps instance via Connect-OMServer: Connect-OMServer

After getting connected, and being connected to an associated vCenter, check out the resources via Get-OMResource by piping it a VMHost, VM, or so forth: get-omresource](/images/2015/08/OM-resource.jpg)

As you can see, I pulled the resources for a VMHost. Some of the basic, higher level, information is in there such as Health status and value, whether or not vROps is receiving any data about it, and how far back data has been collecting for the resource. The following is pulling the same information for the vROps VM in my lab environment: get-omresource](/images/2015/08/OM-resource1.jpg)

If you want to go straight to the stats, I don’t blame you one bit. However just running the Get-OMStat command is going to fill your PoSh window with every single stat available for that resource at all the time points available. Overwhelming would be putting it lightly, so you’ll want to also familiarize yourself with Get-OMStatKey. This function allows you to see what all stats you can actually pull: get-omstatkey](/images/2015/08/om-statkey.jpg)

Couple things I feel the need to point out:

  • Include both the AdapterKind and ResourceKind objects when calling this function, it returns every possible stat key possible without it… All 17,646 of them.
  • Even when including the AdapterKind and ResourceKind, I would highly recommend filtering out what what you’re looking for. The HostSystem ResourceKind has 2225 stat keys alone.

Finally, lets select a stat key and pull some detailed stats by way of the Get-OMStat function. In this scenario, I’m pulling CPU Ready Summation values: Get-OMStat](/images/2015/08/OM-stat.jpg)

Some of the other functions included surround alerting. The Get-OMAlert function pulls all of the vROps alerts: get-omalert](/images/2015/08/OM-alert.jpg)

Since there happens to be some alerts, let’s check out two abilities of the Set-OMAlert function. The first option being cancelling of an alert: set-omalert -Cancel](/images/2015/08/OM-alert1.jpg)

If you notice in the example, the alert still exists but it’s status is changed to «Inactive». Next up, let’s check out the suspend function of the Set-OMAlert function: Set-OMAlert -SuspendMinutes](/images/2015/08/OM-alert2.jpg)

Overall, the new module definitely gets my stamp of approval! Thanks to the PowerCLI team for listening to the users and getting this integrated! Additional information is available at the following link:PowerCLI 6.0 R2 is now Generally Available