VMware Cloud Community
vreikine
Contributor
Contributor
Jump to solution

Is groovy available on agent side ?

I couldn't find groovy-n.n.n.jar on the agent system. Is it part of the agent install base ?
That would be neat to have - groovy is way better than perl.
And the question to people who have more experience with groovy - are there other considerations against using groovy on agent side ? Say, if I drop groovy-1.5.6.jar into agent lib folder and then use scripts (for control actions and monitoring). I could use bytecode compiled scripts to avoid performance penalty on initial startup, but there is still overhead with loading JVM.
Reply
0 Kudos
1 Solution

Accepted Solutions
dougm_hyperic
VMware Employee
VMware Employee
Jump to solution

Hi Vlad,

We added in-process groovy plugin support to the agent in 4.0:
http://jira.hyperic.com/browse/HHQ-1996

There's a recent thread in the dev forum where it's used to extend the NetworkDeviceMeasurementPlugin. And the original example, adding service discovery to the msmq-plugin:
http://svn.hyperic.org/trunk/plugins/examples/msmq-plugin.xml?root=Hyperic+HQ&r1=8378&r2=8987

You can implement/extend any plugin type this way, give it a try and let us know what you think!

View solution in original post

Reply
0 Kudos
3 Replies
jvalkeal_hyperi
Jump to solution

Could you be a bit more spesific what you are trying to do? Just running groovy scripts which are not related to HQ? Or do you mean some interaction to HQ framework from groovy?

Little mind game here... Hmm, I've used java to create custom plugins. It's always need some work to get your plugin compiled. I wonder would there be any benefits to create custom plugins using groovy.
Reply
0 Kudos
vreikine
Contributor
Contributor
Jump to solution

Just running scripts not related to HQ but run them by HQ agent.
Here is the example of what I want to use it for.
I configured a monitor for a specific process ( using Process Service). It monitors process, log file and properties file . Very nice and useful. The only problem is that log file created by process has date and time stamp in the name so every time it is restarted the name of the log file is changed. I don't know how to make Log tracking to use the right file. So I created hardlink (on Windows 2003 it's " fsutil hardlink create " command, btw) and monitor that instead. I want to have a script that would delete and create new hardlink every time the process is restarted so I can create custom control action in HQ . I can write as DOS batch or VB Script but I like groovy more.
Basically, I want Control Actions to be groovy scripts. Not sure how much of HQ functionality is there involved
Now you've got me thinking into custom plugins idea, I think that custom Groovy Script plugin would be nice or better yet have a dedicated thread in the agent that would be devoted to scripting. If there are no scripts then it's idle, but if there is a script to run it would be fast - JVM is already loaded, groovy.jar is loaded , just feed it with bytecode compiled script.
Reply
0 Kudos
dougm_hyperic
VMware Employee
VMware Employee
Jump to solution

Hi Vlad,

We added in-process groovy plugin support to the agent in 4.0:
http://jira.hyperic.com/browse/HHQ-1996

There's a recent thread in the dev forum where it's used to extend the NetworkDeviceMeasurementPlugin. And the original example, adding service discovery to the msmq-plugin:
http://svn.hyperic.org/trunk/plugins/examples/msmq-plugin.xml?root=Hyperic+HQ&r1=8378&r2=8987

You can implement/extend any plugin type this way, give it a try and let us know what you think!
Reply
0 Kudos