Retrieving recommendations

The Get-OMRecommendation cmdlet retrieves recommendations from the specified vRealize Operations Manager server. The syntax of the Get-OMRecommendation cmdlet is as follows:

The first parameter set is required to retrieve recommendations by ID:

Get-OMRecommendation [-Id <String[]>] [-Server <OMServer[]>] 
    [<CommonParameters>]

The second parameter set is required to retrieve recommendations by alert:

Get-OMRecommendation -Alert <OMAlert[]> [-Server <OMServer[]>] 
    [<CommonParameters>]

The third parameter set is required to retrieve recommendations by alert definition:

Get-OMRecommendation -AlertDefinition <OMAlertDefinition[]>
    [-Server <OMServer[]>] [<CommonParameters>]

The Get-OMRecommendation cmdlet has no required parameters.

If you use the Get-OMRecommendation cmdlet without parameters, it retrieves all of the recommendation definitions. The following example retrieves the recommendations, selects only the first one, and displays the output in a list view:

PowerCLI C:> Get-OMRecommendation | Select-Object -First 1
    | Format-List

The output of the preceding example is as follows:

AlertDefinition :
ExtensionData   : VMware.VimAutomation.VROps.Views.Recommendation
Id              : Recommendation-df-VMWARE-CheckStorageIOControl
Description     : Check whether you have enabled Storage IO Control
                  on the datastores connected to the virtual machine
Alert           :
Client          : VMware.VimAutomation.vROps.Impl.V1.OMClientImpl
Uid             : /[email protected]:443/OMAlertRecommenda
                  tion=Recommendation-df-VMWARE-
                  CheckStorageIOControl/

It is more interesting to retrieve the recommendations for the current alerts. This will give you recommendations about how to solve the alert. In the following example, we will retrieve the current alerts, pipe the output to the Get-OMRecommendation cmdlet to retrieve the recommendations for the alerts, select only the Alert and Description properties, and format the output in a list view:

PowerCLI C:> Get-OMAlert | Get-OMRecommendation | 
    Select-Object -Property Alert,Description | Format-List

The preceding command has the following output:

Alert       : NTP Servers are not reachable
Description : Examine connectivity to the defined NTP server from th
              e affected machine


    Alert       : Adapter instance Object is down
Description : Verify that the adapter configuration and credentials
              are correct. Ensure that the remote endpoint of the da
              ta source is available and can be reached from the Col
              lector where this adapter instance is running


    Alert       : Host has lost connection to vCenter Server
Description : Click "Open Host in vSphere Web Client" in the Actions
               menu at the top of Alert details page to connect to t
              he vCenter managing this host and manually reconnect t
              he host to vCenter Server. After the connection to the
               host is restored by vCenter Server, the alert will be
               canceled.


    Alert       : License will soon expire
Description : Contact VMware or solution vendor to renew the license

You can see in the preceding output that I have some problems to fix in my home lab.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.216.239.46