I am having difficulty in setting an alert if SSH or ESXi Shell on a VMWare ESX Server is enabled.
Anyone able to provide some kind of guide please.
Thanks.
I don't think I've seen that configuration setting pulled over on the virtualization (VIM) level or node level. In theory if you are doing SNMP based monitoring on the ESX server, there maybe a process or service that is triggered when SSH is enabled, but I never went down that rabbit hole before.
The other route would be to utilize powercli.
You would need to add your method of connecting to the host in here as well, but Get-VMHost | Get-VMHostServer | Where {$_.Label -eq "SSH"} gets the SSH status
Try {$SSHStatus = Get-VMHost ${Node.SysName} -ErrorAction Stop | Get-VMHostServer | Where {$_.Label -eq "SSH"}} Catch {Write-Host "Message: $($Error[0].Exception)Exit 4}If ($SSHStatus.Running -eq $True) {Exit 3} Else {Exit 0}
Setup the alarm on the Vcenter, VMAN is going to collect the alert and store on the following view Ctx_C_Orion_Virtualization_TriggeredAlarmState, create the alert with the vmware Triggered alarm condition and display name containing the name of the alarm that you setup on Vmware..