Seems trivial... Until it isn't.
We're trying to create a modern widget showing the count of hosts in either ManagedStatus = 3 (warning) or ManagedStatus = 14 (critical) in a specific cluster. I'm running this down because this metric seems to give a more accurate ESX host status. Before you ask, this is an elastic environment so hosts are regularly spinning up and down based on cluster load which makes added the hosts as monitored nodes not practical.
Thoughts?
In database manager, this query works as expected:
SELECT count(hostname) FROM [dbo].[VIM_Hosts]
where clusterid = '<Cluster ID>' and ManagedStatus = '<1/3/14>'
Creating custom SWQL in the widget:
SELECT COUNT (HostName) AS Value FROM Orion.VIM.Hosts WHERE ( ( ClusterID = '<Cluster ID' ) ) and ManagedStatus = '<1/3/14>'
Fails with the error - "Provided SWQL query is not valid. Details: RunQuery failed, check fault information. Cannot resolve property ManagedStatus"