Sunday, April 22, 2012

Hyperic HQApi and the Groovy Console

HQApi documentation here

"HQApi allows you to circumvent the Hyperic user interface and directly access Hyperic Server functionality. " ... great, I love it!

Let's get our hands dirty....

On HQ Console, Click on Administration, Groovy Console...

type:
print 'ciao'
return 'pippo'

and click "execute"... great, in the "result" tab I see "pippo".... where is "ciao" though? I can't find the stdout of "Server for Hyperic HQ" Windows service.

Scripts are stored in a temporary file C:\pierre\hypericserver\server-4.6.5-EE\hq-engine\hq-server\temp\gcon3792879954783360219.tmp

I click on "HQ Web Services Api" and download the hqapi1-client-5.0.0.tar.gz

The most common useful classes to run the examples in Hyperic site are in

<classpathentry kind="lib" path="C:/pierre/workspace/Hyperic/lib/hqapi1-client-5.0.0/hqapi1-5.0.0.jar"/>
<classpathentry kind="lib" path="C:/pierre/workspace/Hyperic/lib/hqapi1-client-5.0.0/hqapi1-tools-5.0.0.jar"/>
<classpathentry kind="lib" path="C:/pierre/hypericserver/server-4.6.5-EE/hq-engine/hq-server/webapps/ROOT/WEB-INF/lib/hq-rendit-4.6.5.jar"/>
<classpathentry kind="lib" path="C:/pierre/hypericserver/server-4.6.5-EE/hq-engine/hq-server/webapps/ROOT/WEB-INF/lib/hq-server-4.6.5.jar"/>
<classpathentry kind="lib" path="C:/pierre/hypericserver/server-4.6.5-EE/hq-engine/hq-server/webapps/ROOT/WEB-INF/lib/httpclient-4.1.1.jar"/>
<classpathentry kind="lib" path="C:/pierre/hypericserver/server-4.6.5-EE/hq-engine/hq-server/webapps/ROOT/WEB-INF/lib/httpcore-4.1.jar"/>
<classpathentry kind="lib" path="C:/pierre/hypericagent/agent-4.6.5-EE/bundles/agent-4.6.5/pdk/lib/httpmime-4.1.1.jar"/>
<classpathentry kind="lib" path="C:/pierre/hypericserver/server-4.6.5-EE/hq-engine/hq-server/webapps/ROOT/WEB-INF/lib/activemq-all-5.3.0.jar"/>
<classpathentry kind="lib" path="C:/pierre/workspace/Hyperic/lib/hqapi1-client-4.3.0/lib/spring-core-3.0.1.RELEASE.jar"/>
<classpathentry kind="lib" path="C:/pierre/hypericserver/server-4.6.5-EE/lib/commons-codec-1.1.jar"/>



Some Groovy Console samples are here:

http://support.hyperic.com/display/hyperforge/Groovy+Snippets

No comments: