Need a script to find if any host configuration issues on all the esxi host in the vCenter..
example: alert, warning.
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?
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?