VMware Cloud Community
mlantz
Contributor
Contributor

Understanding Hyperic Framework to provide accurate reporting

Greetings all,

I was looking at providing some custom reporting to answer key questions available in the Hyperic UI. One example is the Resource Hub which allows users to filter all available/unavailable Platforms, Servers, Services, etc to have an understanding on what Platforms need to be configured correctly.

My main goal is to have sql to provide a list of all unavailable platforms but a bonus would be understanding the basic framework logic.

Looking at the following Hyperic UI I thought it might be as easy as tracing the sql running on the central postgres database. It looks like it provides direction but doesn't paint a complete picture.

7-9-2014 12-39-46 PM.png

When filtering for unavailable platforms from the Hyperic UI the following sql is run in the background

select availabili0_.MEASUREMENT_ID as MEASUREM1_133_

, availabili0_.STARTIME as STARTIME133_

, availabili0_.ENDTIME as ENDTIME133_

, availabili0_.AVAILVAL as AVAILVAL133_

from HQ_AVAIL_DATA_RLE availabili0_

inner join EAM_MEASUREMENT measuremen1_

on availabili0_.MEASUREMENT_ID=measuremen1_.ID

inner join EAM_MEASUREMENT_TEMPL measuremen2_

on measuremen1_.TEMPLATE_ID=measuremen2_.ID

where availabili0_.ENDTIME=9223372036854775807

and (measuremen1_.RESOURCE_ID is not null)

and availabili0_.AVAILVAL=0.0 and upper(measuremen2_.ALIAS)='AVAILABILITY'

This sql returns over 15000+ rows

Adding the following joins limits the this resultset to 55 rows and I'm able to see most/all fqdn's close to the 13 I'm trying to find.

inner join EAM_RESOURCE res on measuremen1_.resource_id =  res.id

inner join EAM_PLATFORM platform ON res.instance_id = platform.id

Since my assumption is there is code firing after this initial select I started looking through the hq-web code to find the corresponding jsp that fires the sequence of events. From my understanding it uses strut and jsp to tie back to the java code firing. I'm completely new to jsp and strut so I'm a little lost here...

My hope is to set a breakpoint somewhere on the jsp on our remote central Hyperic server and follow the logic to understand what is being done before and after the sql call to understand the framework and potentially repeat similar activities for future reports. Would it be easier to read tutorials on strut and jsp to fill in my knowledge gaps to perform this or is there a easy way to tackle these issues and I'm just making this more complex than it needs to be?

Any help would be greatly appreciated!

0 Kudos
1 Reply
mlantz
Contributor
Contributor

Did a bit more digging...Apparently my understanding of the schema may have been based on old documentation. Making some assumptions based on the data pattern I was able to get a resultset using sql that matches the UI.

select platform.fqdn

from HQ_AVAIL_DATA_RLE availabili0_

inner join EAM_MEASUREMENT measuremen1_ on availabili0_.MEASUREMENT_ID=measuremen1_.ID

inner join EAM_MEASUREMENT_TEMPL measuremen2_ on measuremen1_.TEMPLATE_ID=measuremen2_.ID

left join EAM_RESOURCE res on measuremen1_.resource_id =  res.id

left join EAM_SERVER srv on res.id = srv.resource_id

left join EAM_PLATFORM platform ON srv.platform_id = platform.id

where availabili0_.ENDTIME=9223372036854775807 and (measuremen1_.RESOURCE_ID is not null)

and availabili0_.AVAILVAL=0.0

and upper(measuremen2_.ALIAS)='AVAILABILITY'

and monitorable_type_id = 10184

Wasn't able to get this info through debugging which is unfortunate, however I was able to find out that the getUnavilResMap method is called in AvailabilityManagerImpl