PowerCLI

  • 1.  script to find esxi host configuration issues.

    Posted Apr 22, 2012 03:59 AM

    Need a script to find if any host configuration issues on all the esxi host in the vCenter..

    example: alert, warning.



  • 2.  RE: script to find esxi host configuration issues.
    Best Answer

    Posted Apr 22, 2012 06:35 AM

    Hello, nareshunik-

    You can check out the TriggeredAlarmState and ConfigIssue properties for the HostSystem View objects for the VMHost, like:

    Get-View -ViewType HostSystem -Property Name,TriggeredAlarmState,ConfigIssue | ?{$_.TriggeredAlarmState -or $_.ConfigIssue} | `
       
    select name,
            @{n
    ="NumConfigIssues"; e={($_.ConfigIssue | Measure-Object).Count}},
            @{n
    ="NumAlarms"; e={($_.TriggeredAlarmState | Measure-Object).Count}}

    This will just return all hosts with a triggered alarm, a configuration issue, or both (and the couns of each):

    Name       NumConfigIssues  NumAlarms
    ----       ---------------  ---------
    myHost001                1          0
    myHost122                2          0
    myHost212                1          1

    How does that do for you?



  • 3.  RE: script to find esxi host configuration issues.

    Posted Feb 12, 2025 10:49 AM

    That works like a charm actually!

    Is there a way to get the description of the issues/alarms in the final table?