VMware Cloud Community
nareshunik
Enthusiast
Enthusiast
Jump to solution

script to find esxi host configuration issues.

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

example: alert, warning.

0 Kudos
1 Solution

Accepted Solutions
mattboren
Expert
Expert
Jump to solution

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?

View solution in original post

0 Kudos
1 Reply
mattboren
Expert
Expert
Jump to solution

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?

0 Kudos