This discussion has been locked. The information referenced herein may be inaccurate due to age, software updates, or external references.
You can no longer post new replies to this discussion. If you have a similar question you can start a new discussion in this forum.

SAM - VMware ESX Host (swql)

The VMware ESX Host template is great for pulling meaningful information, but presenting it is cumbersome.

This script will pull out the values which are needed.

cscoengineer_1-1596632594643.png

select DISTINCT

TOUPPER(SUBSTRING(n.caption,1,case when charindex('.',n.caption,1) <=4 then length(n.caption) else (charindex('.',n.caption,1)-1) end)) as [Node]
,n.DetailsURL as [_LinkFor_Node]
,'/Orion/images/StatusIcons/Small-' + n.StatusIcon AS [_IconFor_Node]

,concat (round(cup_cpu_usage_avg.data,0),'%') as [CPU]
,case when (memory_memory_active.data/1024/1024) > 1 then concat(round(memory_memory_active.data/1024/1024,0),' GB')
when memory_memory_active.data/1024 > 1 then concat(round(memory_memory_active.data/1024,0),' MB')
else concat(round(memory_memory_active.data/1024,0),' KB') end as [Memory Active]

from Orion.nodes n
join Orion.APM.Application a on a.NodeID=n.NodeID
join orion.apm.Component c on c.ApplicationID=a.ApplicationID

left join
(SELECT DISTINCT n.caption, n.nodeid, n.Applications.Name, c.Name, c.ComponentID, c.ApplicationID ,c.CurrentStatistics.ComponentStatisticData as [data]
,c.DetailsUrl,ct.ThresholdStatisticWarning, ct.ThresholdStatisticCritical
from Orion.Nodes n join Orion.APM.Component c on c.ApplicationID=n.Applications.ApplicationID
join orion.APM.ComponentAlertThresholds ct on ct.ComponentID=c.ComponentID
where c.name like 'Memory.Memory Active%') memory_memory_active on memory_memory_active.applicationid=a.ApplicationID and memory_memory_active.nodeid=n.nodeid

left join
(SELECT DISTINCT n.caption, n.nodeid, n.Applications.Name, c.Name, c.ComponentID, c.ApplicationID ,c.CurrentStatistics.ComponentStatisticData as [data]
,c.DetailsUrl,ct.ThresholdStatisticWarning, ct.ThresholdStatisticCritical
from Orion.Nodes n join Orion.APM.Component c on c.ApplicationID=n.Applications.ApplicationID
join orion.APM.ComponentAlertThresholds ct on ct.ComponentID=c.ComponentID
where c.name like 'CPU.CPU Usage (Average)%') cup_cpu_usage_avg on cup_cpu_usage_avg.applicationid=a.ApplicationID and cup_cpu_usage_avg.nodeid=n.nodeid

where n.vendor like '%VMware%' and memory_memory_active.data >0

order by 1

Thank you
Amit

email: ashah@loop1.com

Loop1 Systems - SolarWinds Training and Professional Services