There is no way to do this currently. There has been alot of talk in the past on how to support this - its called "dynamic metadata". See this design wiki page for how far the discussions got (though nothing is planned for implementation right now):
http://rhq-project.org/display/RHQ/Design-Dynamic+Metadata
On Tue, 2011-12-20 at 15:36 -0600, Al Amyot wrote:
Is there any way for a Script plugin to “find” and add new metrics? Normally, these are hardcoded in the xml configuration file of course. For example, let’s say the script queries a database “where name like ‘metric%’” Then for each returned row, returns a value for ‘metric1’, metric2’ etc.. As the returned list changes, new metric collection would begin and deprecated ones might stop.