The Apptio Datalink Connector for connecting to the VMware VCenter includes some recommended SQL to pull the attributes used by our configuration.
I tested the SQL suggestion for the Hypervisor Hosts against my customer's VCenter. Once I connected I got an empty set back (no rows!).
I went back and tested each of the subqueries that are joined using inner joins. I found that this particular INNER JOIN had an empty set return on the subquery.
INNER JOIN
(
select substring(ENTITY, 6, 100) as HOSTID,
(max(stat_value)/(SAMPLE_INTERVAL*1000))*100 as PEAK_TOTAL_CPU_READY_PERCENT,
(avg(stat_value)/(SAMPLE_INTERVAL*1000))*100 as AVG_TOTAL_CPU_READY_PERCENT
from dbo.VPXV_HIST_STAT_MONTHLY
where ENTITY like 'host-%' and stat_group='cpu' and STAT_NAME='ready'
GROUP BY ENTITY, SAMPLE_INTERVAL
) AS cpuUsage ON vh.HOSTID = cpuUsage.HOSTID
When I commented out the where clause, and added the ENTITY, stat_group, and stat_name into the query, I found that, at least for this client, there was no stat_name called "ready". there was usage, and usagemhz.
Is it possible that not every vCenter is configured to capture the stat_name "ready"? If so, maybe making this join a LEFT JOIN would make it so if these particular stat's fail it doesn't torpedo the entire query.
What do the experts say?