You can subscribe to this list here.
| 2007 |
Jan
|
Feb
|
Mar
(927) |
Apr
(419) |
May
(352) |
Jun
(431) |
Jul
(463) |
Aug
(345) |
Sep
(304) |
Oct
(596) |
Nov
(466) |
Dec
(414) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2008 |
Jan
(348) |
Feb
(313) |
Mar
(665) |
Apr
(688) |
May
(434) |
Jun
(311) |
Jul
(540) |
Aug
(554) |
Sep
(467) |
Oct
(341) |
Nov
(365) |
Dec
(272) |
| 2009 |
Jan
(386) |
Feb
(293) |
Mar
(279) |
Apr
(239) |
May
(229) |
Jun
(199) |
Jul
(186) |
Aug
(111) |
Sep
(196) |
Oct
(146) |
Nov
(116) |
Dec
(140) |
| 2010 |
Jan
(170) |
Feb
(159) |
Mar
(151) |
Apr
(161) |
May
(90) |
Jun
(56) |
Jul
(28) |
Aug
(22) |
Sep
(5) |
Oct
|
Nov
(23) |
Dec
(12) |
| 2011 |
Jan
(8) |
Feb
(8) |
Mar
(22) |
Apr
(24) |
May
(4) |
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
| 2012 |
Jan
(5) |
Feb
(1) |
Mar
|
Apr
(1) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2013 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <jt...@hy...> - 2007-03-22 20:29:42
|
Author: jtravis Date: 2007-03-22 12:29:33 -0800 (Thu, 22 Mar 2007) New Revision: 3821 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=3821 Added: trunk/src/org/hyperic/hq/ui/rendit/rendit_sys/org/hyperic/hq/ui/rendit/helpers/ trunk/src/org/hyperic/hq/ui/rendit/rendit_sys/org/hyperic/hq/ui/rendit/helpers/BaseHelper.groovy trunk/src/org/hyperic/hq/ui/rendit/rendit_sys/org/hyperic/hq/ui/rendit/helpers/LiveDataHelper.groovy trunk/src/org/hyperic/hq/ui/rendit/rendit_sys/org/hyperic/hq/ui/rendit/helpers/ResourceHelper.groovy Log: Add helpers for dealing with the backend Added: trunk/src/org/hyperic/hq/ui/rendit/rendit_sys/org/hyperic/hq/ui/rendit/helpers/BaseHelper.groovy =================================================================== --- trunk/src/org/hyperic/hq/ui/rendit/rendit_sys/org/hyperic/hq/ui/rendit/helpers/BaseHelper.groovy (rev 0) +++ trunk/src/org/hyperic/hq/ui/rendit/rendit_sys/org/hyperic/hq/ui/rendit/helpers/BaseHelper.groovy 2007-03-22 20:29:33 UTC (rev 3821) @@ -0,0 +1,17 @@ +package org.hyperic.hq.ui.rendit.helpers + +import org.hyperic.hq.authz.shared.AuthzSubjectValue +import org.hyperic.hq.authz.server.session.AuthzSubject + +abstract class BaseHelper { + private user + private userVal + + BaseHelper(user) { + this.user = user + this.userVal = user.valueObject + } + + protected AuthzSubject getUser() { user } + protected AuthzSubjectValue getUserVal() { userVal } +} \ No newline at end of file Added: trunk/src/org/hyperic/hq/ui/rendit/rendit_sys/org/hyperic/hq/ui/rendit/helpers/LiveDataHelper.groovy =================================================================== --- trunk/src/org/hyperic/hq/ui/rendit/rendit_sys/org/hyperic/hq/ui/rendit/helpers/LiveDataHelper.groovy (rev 0) +++ trunk/src/org/hyperic/hq/ui/rendit/rendit_sys/org/hyperic/hq/ui/rendit/helpers/LiveDataHelper.groovy 2007-03-22 20:29:33 UTC (rev 3821) @@ -0,0 +1,23 @@ +package org.hyperic.hq.ui.rendit.helpers + +import org.hyperic.hq.livedata.server.session.LiveDataManagerEJBImpl +import org.json.JSONArray + +class LiveDataHelper + extends BaseHelper +{ + LiveDataHelper(user) { + super(user) + } + + private getDataMan() { LiveDataManagerEJBImpl.one } + + String[] getCommands(resource) { + dataMan.getCommands(resource.entityId) + } + + JSONArray getData(resource, command) { + new JSONArray(dataMan.getData(resource.entityId, command)) + } +} + Added: trunk/src/org/hyperic/hq/ui/rendit/rendit_sys/org/hyperic/hq/ui/rendit/helpers/ResourceHelper.groovy =================================================================== --- trunk/src/org/hyperic/hq/ui/rendit/rendit_sys/org/hyperic/hq/ui/rendit/helpers/ResourceHelper.groovy (rev 0) +++ trunk/src/org/hyperic/hq/ui/rendit/rendit_sys/org/hyperic/hq/ui/rendit/helpers/ResourceHelper.groovy 2007-03-22 20:29:33 UTC (rev 3821) @@ -0,0 +1,60 @@ +package org.hyperic.hq.ui.rendit.helpers + +import org.hyperic.hq.appdef.shared.AppdefResourceValue +import org.hyperic.hq.appdef.server.session.PlatformManagerEJBImpl + +class ResourceHelper + extends BaseHelper +{ + private final NAME_FINDERS = [ + platform: [ + str: {name -> platMan.getPlatformByName(userVal, name)}, + int: {id -> platMan.getPlatformValueById(userVal, id)}], + platformType: [ + str: {name -> platMan.findPlatformTypeByName(name)}, + int: {id -> platMan.findPlatformTypeValueById(id)}], + ] + + ResourceHelper(user) { + super(user) + } + + private getPlatMan() { PlatformManagerEJBImpl.one } + + /** + * Generic method to find resources. + * + * args: The arguments are a map of options. Currently the only + * options are to find a platform or platformType by name or id. + * + * Examples: + * + * To find a platform by name: + * > find platform:'My Platform' + * + * To find a platform by id: + * > find platform:44123 + */ + AppdefResourceValue find(args) { + def resourceType + for (i in args) { + if (NAME_FINDERS.containsKey(i.key)) { + if (resourceType != null) { + throw new IllegalArgumentException("""Cannot specify more + than one resource type [$resourceType] and + [$i.key]""") + } + resourceType = i.key + } + } + + if (resourceType == null) + throw new IllegalArgumentException(""""No resource type specified. + Must be one of + $NAME_FINDERS.keySet()""") + + def resourceVal = args[resourceType] + def argType = (resourceVal instanceof String) ? 'str' : 'int' + NAME_FINDERS[resourceType][argType].call(resourceVal) + } +} |
|
From: <jt...@hy...> - 2007-03-22 20:14:58
|
Author: jtravis Date: 2007-03-22 12:14:53 -0800 (Thu, 22 Mar 2007) New Revision: 3820 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=3820 Modified: trunk/src/org/hyperic/hq/appdef/shared/AppdefEntityID.java trunk/src/org/hyperic/hq/appdef/shared/AppdefResourceValue.java Log: Import serializable Modified: trunk/src/org/hyperic/hq/appdef/shared/AppdefEntityID.java =================================================================== --- trunk/src/org/hyperic/hq/appdef/shared/AppdefEntityID.java 2007-03-22 19:51:15 UTC (rev 3819) +++ trunk/src/org/hyperic/hq/appdef/shared/AppdefEntityID.java 2007-03-22 20:14:53 UTC (rev 3820) @@ -25,6 +25,7 @@ package org.hyperic.hq.appdef.shared; +import java.io.Serializable; import java.util.List; import org.hyperic.hq.authz.shared.AuthzConstants; @@ -37,7 +38,7 @@ */ public class AppdefEntityID - implements java.io.Serializable + implements Serializable { protected int entityType; // APPDEF_TYPE_* from AppdefEntityConstants protected int entityID; // ID from the database Modified: trunk/src/org/hyperic/hq/appdef/shared/AppdefResourceValue.java =================================================================== --- trunk/src/org/hyperic/hq/appdef/shared/AppdefResourceValue.java 2007-03-22 19:51:15 UTC (rev 3819) +++ trunk/src/org/hyperic/hq/appdef/shared/AppdefResourceValue.java 2007-03-22 20:14:53 UTC (rev 3820) @@ -34,6 +34,7 @@ import org.hyperic.hq.appdef.shared.ServiceLightValue; import org.hyperic.hq.appdef.shared.ServiceValue; +import java.io.Serializable; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; @@ -54,7 +55,7 @@ * */ public abstract class AppdefResourceValue - implements java.io.Serializable, Comparable + implements Serializable, Comparable { // they all have id's |
|
From: <cl...@hy...> - 2007-03-22 19:51:24
|
Author: clee Date: 2007-03-22 11:51:15 -0800 (Thu, 22 Mar 2007) New Revision: 3819 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=3819 Modified: branches/HQ_3_0/src/org/hyperic/hq/bizapp/client/shell/ClientShell_alertdef_create.java branches/HQ_3_0/src/org/hyperic/hq/events/EventConstants.java branches/HQ_3_0/src/org/hyperic/util/config/EnumerationConfigOption.java Log: [HQ-588] An Alert Fired condition is not a valid condition, it's a hidden one used for Recovery Alerts. Remove from CLI. [merge from HEAD] Modified: branches/HQ_3_0/src/org/hyperic/hq/bizapp/client/shell/ClientShell_alertdef_create.java =================================================================== --- branches/HQ_3_0/src/org/hyperic/hq/bizapp/client/shell/ClientShell_alertdef_create.java 2007-03-22 19:43:07 UTC (rev 3818) +++ branches/HQ_3_0/src/org/hyperic/hq/bizapp/client/shell/ClientShell_alertdef_create.java 2007-03-22 19:51:15 UTC (rev 3819) @@ -111,7 +111,7 @@ throws ShellCommandExecException { try { - metrics = this.getEntityFetcher().getMetricsForID(id); + metrics = getEntityFetcher().getMetricsForID(id); if (metrics.size() == 0) return ""; } catch (Exception exc) { @@ -223,7 +223,7 @@ public void processCommand(ParseResult parseRes) throws ShellCommandUsageException, ShellCommandExecException { - ClientShellEntityFetcher fetcher = this.getEntityFetcher(); + ClientShellEntityFetcher fetcher = getEntityFetcher(); // build a list of resource objects List resources = new PageList(); @@ -234,11 +234,11 @@ .getValue(ClientShellParseUtil.KEY_RESOURCE); resources.add(fetcher.findResourceByID(eid)); - createResp = this.getClientShell().processConfigSchema( - this.getDefCreateSchema()); + createResp = getClientShell().processConfigSchema( + getDefCreateSchema()); } catch (EOFException exc) { - this.getOutStream().println("\nAlert definition creation aborted"); + getOutStream().println("\nAlert definition creation aborted"); return; } catch (Exception exc) { throw new ShellCommandExecException(exc.getMessage(), exc); @@ -266,8 +266,8 @@ boolean req = true; try { // Need to find out what type of alert the user wants - typeResp = this.getClientShell() - .processConfigSchema(this.getCondTypeSchema()); + typeResp = getClientShell() + .processConfigSchema(getCondTypeSchema()); int type = EventConstants.getType(typeResp.getValue(PROP_OPTION)); @@ -280,7 +280,7 @@ reqMap.put(condResp, Boolean.valueOf(req)); // get the email and user ids for the alertdef from the user - ConfigSchema emailActionSchema = this.getEntityFetcher() + ConfigSchema emailActionSchema = getEntityFetcher() .getActionConfigSchema(new EmailActionConfig() .getImplementor()); getClientShell().getOutStream() @@ -294,7 +294,7 @@ // to supply a proper value while ( true ) { try { - if (this.getEntityFetcher().ensureNamesAreIds(actionResp)) { + if (getEntityFetcher().ensureNamesAreIds(actionResp)) { break; } actionResp = getClientShell() @@ -323,7 +323,7 @@ "An invalid option was entered.", e); } catch (Exception e) { throw new ShellCommandExecException( - "An exception has occured creating alert definition.", e); + "An exception has occured creating alert definition." + e.getMessage(), e); } } @@ -375,7 +375,7 @@ try { // now save the alert definition in the backend - clone = this.getEntityFetcher().createAlertDefinition(clone); + clone = getEntityFetcher().createAlertDefinition(clone); getShell().sendToOutStream("Alert Definition '" + def.getName() + "' (ID: " + clone.getId() + ") has been added to resource '" + @@ -418,14 +418,14 @@ case EventConstants.TYPE_BASELINE : case EventConstants.TYPE_CHANGE: // Print out metrics - this.getOutStream().println(getMetricAliases(id)); + getOutStream().println(getMetricAliases(id)); break; default: break; } ConfigResponse condResp = - this.getClientShell().processConfigSchema(condSchema); + getClientShell().processConfigSchema(condSchema); return condResp; } @@ -457,7 +457,7 @@ public String getUsageHelp(String[] args) { return " " - + this.getUsageShort() + + getUsageShort() + ".\n" + "\n The command will prompt for alert definition properties." + "\n Adding measurement related conditions requires the alias of" Modified: branches/HQ_3_0/src/org/hyperic/hq/events/EventConstants.java =================================================================== --- branches/HQ_3_0/src/org/hyperic/hq/events/EventConstants.java 2007-03-22 19:43:07 UTC (rev 3818) +++ branches/HQ_3_0/src/org/hyperic/hq/events/EventConstants.java 2007-03-22 19:51:15 UTC (rev 3819) @@ -40,11 +40,11 @@ public static final int TYPE_LOG = 7; private static final String[] TYPES = { - "Measurement Threshold", - "Measurement Baseline", + "Metric Threshold", + "Metric Baseline", "Control Action", - "Measurement Value Change", - "Alert Fired", + "Metric Value Change", + "", // Don't want Recovery Alert condition to be visible "Custom Property Value Change", "Log Event", }; Modified: branches/HQ_3_0/src/org/hyperic/util/config/EnumerationConfigOption.java =================================================================== --- branches/HQ_3_0/src/org/hyperic/util/config/EnumerationConfigOption.java 2007-03-22 19:43:07 UTC (rev 3818) +++ branches/HQ_3_0/src/org/hyperic/util/config/EnumerationConfigOption.java 2007-03-22 19:51:15 UTC (rev 3819) @@ -31,7 +31,7 @@ public class EnumerationConfigOption extends ConfigOption implements Serializable { - private ArrayList values = new ArrayList(); /* Values the enum holds */ + private ArrayList _values = new ArrayList(); // Values the enum holds public EnumerationConfigOption(String optName, String optDesc, String defValue) @@ -47,16 +47,18 @@ String defValue, String[] enumValues) { super(optName, optDesc, defValue); - for(int i=0; i<enumValues.length; i++){ - this.values.add(enumValues[i]); + for (int i = 0; i < enumValues.length; i++) { + if (enumValues[i] != null && enumValues[i].length() > 0) { + _values.add(enumValues[i]); + } } } public void checkOptionIsValid(String value) throws InvalidOptionValueException { - if (!this.values.contains(value)) { - throw invalidOption("must be one of: " + this.values); + if (!_values.contains(value)) { + throw invalidOption("must be one of: " + _values); } } @@ -64,9 +66,9 @@ String defVal = super.getDefault(); //if no default was specified, use the first in the list if ((defVal == null) && - (this.values.size() != 0)) + (_values.size() != 0)) { - defVal = (String)this.values.get(0); + defVal = (String)_values.get(0); } return defVal; } @@ -76,10 +78,10 @@ **********************/ public void addValue(String option){ - this.values.add(option); + _values.add(option); } public List getValues(){ - return this.values; + return _values; } } |
|
From: Ryan M. <rm...@hy...> - 2007-03-22 19:45:32
|
Can you tell us how you are starting the agent? If you could post the output from your console window that would be helpful. -Ryan |
|
From: <cl...@hy...> - 2007-03-22 19:43:21
|
Author: clee Date: 2007-03-22 11:43:07 -0800 (Thu, 22 Mar 2007) New Revision: 3818 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=3818 Modified: trunk/src/org/hyperic/hq/bizapp/client/shell/ClientShell_alertdef_create.java trunk/src/org/hyperic/hq/events/EventConstants.java trunk/src/org/hyperic/util/config/EnumerationConfigOption.java Log: [HQ-588] An Alert Fired condition is not a valid condition, it's a hidden one used for Recovery Alerts. Remove from CLI. Modified: trunk/src/org/hyperic/hq/bizapp/client/shell/ClientShell_alertdef_create.java =================================================================== --- trunk/src/org/hyperic/hq/bizapp/client/shell/ClientShell_alertdef_create.java 2007-03-22 18:38:31 UTC (rev 3817) +++ trunk/src/org/hyperic/hq/bizapp/client/shell/ClientShell_alertdef_create.java 2007-03-22 19:43:07 UTC (rev 3818) @@ -111,7 +111,7 @@ throws ShellCommandExecException { try { - metrics = this.getEntityFetcher().getMetricsForID(id); + metrics = getEntityFetcher().getMetricsForID(id); if (metrics.size() == 0) return ""; } catch (Exception exc) { @@ -223,7 +223,7 @@ public void processCommand(ParseResult parseRes) throws ShellCommandUsageException, ShellCommandExecException { - ClientShellEntityFetcher fetcher = this.getEntityFetcher(); + ClientShellEntityFetcher fetcher = getEntityFetcher(); // build a list of resource objects List resources = new PageList(); @@ -234,11 +234,11 @@ .getValue(ClientShellParseUtil.KEY_RESOURCE); resources.add(fetcher.findResourceByID(eid)); - createResp = this.getClientShell().processConfigSchema( - this.getDefCreateSchema()); + createResp = getClientShell().processConfigSchema( + getDefCreateSchema()); } catch (EOFException exc) { - this.getOutStream().println("\nAlert definition creation aborted"); + getOutStream().println("\nAlert definition creation aborted"); return; } catch (Exception exc) { throw new ShellCommandExecException(exc.getMessage(), exc); @@ -266,8 +266,8 @@ boolean req = true; try { // Need to find out what type of alert the user wants - typeResp = this.getClientShell() - .processConfigSchema(this.getCondTypeSchema()); + typeResp = getClientShell() + .processConfigSchema(getCondTypeSchema()); int type = EventConstants.getType(typeResp.getValue(PROP_OPTION)); @@ -280,7 +280,7 @@ reqMap.put(condResp, Boolean.valueOf(req)); // get the email and user ids for the alertdef from the user - ConfigSchema emailActionSchema = this.getEntityFetcher() + ConfigSchema emailActionSchema = getEntityFetcher() .getActionConfigSchema(new EmailActionConfig() .getImplementor()); getClientShell().getOutStream() @@ -294,7 +294,7 @@ // to supply a proper value while ( true ) { try { - if (this.getEntityFetcher().ensureNamesAreIds(actionResp)) { + if (getEntityFetcher().ensureNamesAreIds(actionResp)) { break; } actionResp = getClientShell() @@ -323,7 +323,7 @@ "An invalid option was entered.", e); } catch (Exception e) { throw new ShellCommandExecException( - "An exception has occured creating alert definition.", e); + "An exception has occured creating alert definition." + e.getMessage(), e); } } @@ -375,7 +375,7 @@ try { // now save the alert definition in the backend - clone = this.getEntityFetcher().createAlertDefinition(clone); + clone = getEntityFetcher().createAlertDefinition(clone); getShell().sendToOutStream("Alert Definition '" + def.getName() + "' (ID: " + clone.getId() + ") has been added to resource '" + @@ -418,14 +418,14 @@ case EventConstants.TYPE_BASELINE : case EventConstants.TYPE_CHANGE: // Print out metrics - this.getOutStream().println(getMetricAliases(id)); + getOutStream().println(getMetricAliases(id)); break; default: break; } ConfigResponse condResp = - this.getClientShell().processConfigSchema(condSchema); + getClientShell().processConfigSchema(condSchema); return condResp; } @@ -457,7 +457,7 @@ public String getUsageHelp(String[] args) { return " " - + this.getUsageShort() + + getUsageShort() + ".\n" + "\n The command will prompt for alert definition properties." + "\n Adding measurement related conditions requires the alias of" Modified: trunk/src/org/hyperic/hq/events/EventConstants.java =================================================================== --- trunk/src/org/hyperic/hq/events/EventConstants.java 2007-03-22 18:38:31 UTC (rev 3817) +++ trunk/src/org/hyperic/hq/events/EventConstants.java 2007-03-22 19:43:07 UTC (rev 3818) @@ -40,11 +40,11 @@ public static final int TYPE_LOG = 7; private static final String[] TYPES = { - "Measurement Threshold", - "Measurement Baseline", + "Metric Threshold", + "Metric Baseline", "Control Action", - "Measurement Value Change", - "Alert Fired", + "Metric Value Change", + "", // Don't want Recovery Alert condition to be visible "Custom Property Value Change", "Log Event", }; Modified: trunk/src/org/hyperic/util/config/EnumerationConfigOption.java =================================================================== --- trunk/src/org/hyperic/util/config/EnumerationConfigOption.java 2007-03-22 18:38:31 UTC (rev 3817) +++ trunk/src/org/hyperic/util/config/EnumerationConfigOption.java 2007-03-22 19:43:07 UTC (rev 3818) @@ -31,7 +31,7 @@ public class EnumerationConfigOption extends ConfigOption implements Serializable { - private ArrayList values = new ArrayList(); /* Values the enum holds */ + private ArrayList _values = new ArrayList(); // Values the enum holds public EnumerationConfigOption(String optName, String optDesc, String defValue) @@ -47,16 +47,18 @@ String defValue, String[] enumValues) { super(optName, optDesc, defValue); - for(int i=0; i<enumValues.length; i++){ - this.values.add(enumValues[i]); + for (int i = 0; i < enumValues.length; i++) { + if (enumValues[i] != null && enumValues[i].length() > 0) { + _values.add(enumValues[i]); + } } } public void checkOptionIsValid(String value) throws InvalidOptionValueException { - if (!this.values.contains(value)) { - throw invalidOption("must be one of: " + this.values); + if (!_values.contains(value)) { + throw invalidOption("must be one of: " + _values); } } @@ -64,9 +66,9 @@ String defVal = super.getDefault(); //if no default was specified, use the first in the list if ((defVal == null) && - (this.values.size() != 0)) + (_values.size() != 0)) { - defVal = (String)this.values.get(0); + defVal = (String)_values.get(0); } return defVal; } @@ -76,10 +78,10 @@ **********************/ public void addValue(String option){ - this.values.add(option); + _values.add(option); } public List getValues(){ - return this.values; + return _values; } } |
|
From: black <hq-...@hy...> - 2007-03-22 18:41:39
|
Hi Ryan, Thank you for your reply. Now the agent is started with -Xmx8m and on my centos4.4 with ps I see it consumes about 77Mb (it's quite a lot and larger then your 48mb). I understand that the differece is in library and virtual memory Have you any idea on how to further lower my 77Mb ? Thank you again, Black |
Author: rmorgan Date: 2007-03-22 10:38:31 -0800 (Thu, 22 Mar 2007) New Revision: 3817 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=3817 Modified: trunk/plugins/system/src/org/hyperic/hq/plugin/system/SystemLiveDataPlugin.java trunk/src/org/hyperic/hq/bizapp/client/shell/ClientShellEntityFetcher.java trunk/src/org/hyperic/hq/bizapp/server/session/LiveDataBossEJBImpl.java trunk/src/org/hyperic/hq/livedata/agent/client/LiveDataClient.java trunk/src/org/hyperic/hq/livedata/agent/commands/LiveData_args.java trunk/src/org/hyperic/hq/livedata/agent/server/LiveDataCommandsServer.java trunk/src/org/hyperic/hq/livedata/server/session/LiveDataManagerEJBImpl.java trunk/src/org/hyperic/hq/product/LiveDataPlugin.java trunk/src/org/hyperic/hq/product/LiveDataPluginManager.java trunk/src/org/hyperic/hq/product/jmx/MxLiveDataPlugin.java Log: Pass measurement ConfigResponse into LiveData plugins. Modified: trunk/plugins/system/src/org/hyperic/hq/plugin/system/SystemLiveDataPlugin.java =================================================================== --- trunk/plugins/system/src/org/hyperic/hq/plugin/system/SystemLiveDataPlugin.java 2007-03-22 16:35:47 UTC (rev 3816) +++ trunk/plugins/system/src/org/hyperic/hq/plugin/system/SystemLiveDataPlugin.java 2007-03-22 18:38:31 UTC (rev 3817) @@ -30,6 +30,7 @@ import org.hyperic.hq.livedata.shared.LiveDataTranslator; import org.hyperic.sigar.Sigar; import org.hyperic.sigar.SigarException; +import org.hyperic.util.config.ConfigResponse; import org.json.JSONArray; public class SystemLiveDataPlugin extends LiveDataPlugin { @@ -46,7 +47,9 @@ CMD_FILESYSTEM }; - public Object getData(String command) throws PluginException { + public Object getData(String command, ConfigResponse config) + throws PluginException + { Sigar sigar = new Sigar(); try { @@ -72,10 +75,10 @@ public static void main(String[] args) throws Exception { SystemLiveDataPlugin p = new SystemLiveDataPlugin(); - + ConfigResponse emtpy = new ConfigResponse(); for (int i = 0; i < _COMMANDS.length; i++) { System.out.println("Running command " + _COMMANDS[i]); - Object o = p.getData(_COMMANDS[i]); + Object o = p.getData(_COMMANDS[i], emtpy); JSONArray js = LiveDataTranslator.encode(o); System.out.println(js.toString(2)); } Modified: trunk/src/org/hyperic/hq/bizapp/client/shell/ClientShellEntityFetcher.java =================================================================== --- trunk/src/org/hyperic/hq/bizapp/client/shell/ClientShellEntityFetcher.java 2007-03-22 16:35:47 UTC (rev 3816) +++ trunk/src/org/hyperic/hq/bizapp/client/shell/ClientShellEntityFetcher.java 2007-03-22 18:38:31 UTC (rev 3817) @@ -1163,7 +1163,8 @@ throws NamingException, ClientShellAuthenticationException, PermissionException, AgentConnectionException, RemoteException, AgentRemoteException, AgentNotFoundException, LiveDataException, - AppdefEntityNotFoundException + AppdefEntityNotFoundException, SessionTimeoutException, + SessionNotFoundException { LiveDataBoss boss; @@ -1174,7 +1175,8 @@ public String[] getLiveDataCommands(AppdefEntityID id) throws RemoteException, NamingException, - ClientShellAuthenticationException, PluginException + ClientShellAuthenticationException, PluginException, + SessionTimeoutException, SessionNotFoundException { LiveDataBoss boss; Modified: trunk/src/org/hyperic/hq/bizapp/server/session/LiveDataBossEJBImpl.java =================================================================== --- trunk/src/org/hyperic/hq/bizapp/server/session/LiveDataBossEJBImpl.java 2007-03-22 16:35:47 UTC (rev 3816) +++ trunk/src/org/hyperic/hq/bizapp/server/session/LiveDataBossEJBImpl.java 2007-03-22 18:38:31 UTC (rev 3817) @@ -29,13 +29,16 @@ import org.hyperic.hq.appdef.shared.AgentNotFoundException; import org.hyperic.hq.appdef.shared.AppdefEntityNotFoundException; import org.hyperic.hq.authz.shared.PermissionException; +import org.hyperic.hq.authz.shared.AuthzSubjectValue; import org.hyperic.hq.agent.AgentConnectionException; import org.hyperic.hq.agent.AgentRemoteException; import org.hyperic.hq.livedata.shared.LiveDataException; import org.hyperic.hq.livedata.shared.LiveDataManagerLocal; import org.hyperic.hq.livedata.server.session.LiveDataManagerEJBImpl; -import org.hyperic.hq.product.PluginNotFoundException; import org.hyperic.hq.product.PluginException; +import org.hyperic.hq.auth.shared.SessionManager; +import org.hyperic.hq.auth.shared.SessionTimeoutException; +import org.hyperic.hq.auth.shared.SessionNotFoundException; import javax.ejb.SessionBean; import javax.ejb.CreateException; @@ -56,6 +59,8 @@ public class LiveDataBossEJBImpl implements SessionBean { + protected SessionManager _manager = SessionManager.getInstance(); + /** @ejb:create-method */ public void ejbCreate() throws CreateException {} public void ejbActivate() throws EJBException, RemoteException {} @@ -77,11 +82,13 @@ public String getLiveData(int sessionId, AppdefEntityID id, String command) throws PermissionException, AgentConnectionException, - AgentRemoteException, AgentNotFoundException, - AppdefEntityNotFoundException, LiveDataException + AgentRemoteException, AgentNotFoundException, + AppdefEntityNotFoundException, LiveDataException, + SessionTimeoutException, SessionNotFoundException { + AuthzSubjectValue subject = _manager.getSubject(sessionId); LiveDataManagerLocal manager = LiveDataManagerEJBImpl.getOne(); - return manager.getData(id, command); + return manager.getData(subject, id, command); } /** @@ -90,10 +97,11 @@ * @ejb:interface-method */ public String[] getLiveDataCommands(int sessionId, AppdefEntityID id) - throws PluginException + throws PluginException, + SessionTimeoutException, SessionNotFoundException { + AuthzSubjectValue subject = _manager.getSubject(sessionId); LiveDataManagerLocal manager = LiveDataManagerEJBImpl.getOne(); - - return manager.getCommands(id); + return manager.getCommands(subject, id); } } Modified: trunk/src/org/hyperic/hq/livedata/agent/client/LiveDataClient.java =================================================================== --- trunk/src/org/hyperic/hq/livedata/agent/client/LiveDataClient.java 2007-03-22 16:35:47 UTC (rev 3816) +++ trunk/src/org/hyperic/hq/livedata/agent/client/LiveDataClient.java 2007-03-22 18:38:31 UTC (rev 3817) @@ -33,9 +33,8 @@ import org.hyperic.hq.agent.AgentConnectionException; import org.hyperic.hq.agent.AgentRemoteException; import org.hyperic.hq.agent.AgentRemoteValue; +import org.hyperic.util.config.ConfigResponse; -import java.util.Properties; - public class LiveDataClient { private LiveDataCommandsAPI _api; @@ -46,13 +45,13 @@ _api = new LiveDataCommandsAPI(); } - public String getData(String type, String command, Properties props) + public String getData(String type, String command, ConfigResponse config) throws AgentConnectionException, AgentRemoteException, LiveDataException { LiveData_args args = new LiveData_args(); - args.setConfig(type, command); + args.setConfig(type, command, config); AgentRemoteValue res = _agentConnection.sendCommand(LiveDataCommandsAPI.command_getData, Modified: trunk/src/org/hyperic/hq/livedata/agent/commands/LiveData_args.java =================================================================== --- trunk/src/org/hyperic/hq/livedata/agent/commands/LiveData_args.java 2007-03-22 16:35:47 UTC (rev 3816) +++ trunk/src/org/hyperic/hq/livedata/agent/commands/LiveData_args.java 2007-03-22 18:38:31 UTC (rev 3817) @@ -26,26 +26,57 @@ package org.hyperic.hq.livedata.agent.commands; import org.hyperic.hq.agent.AgentRemoteValue; +import org.hyperic.hq.agent.AgentRemoteException; +import org.hyperic.util.config.ConfigResponse; +import org.hyperic.util.config.EncodingException; +import org.hyperic.util.encoding.Base64; public class LiveData_args extends AgentRemoteValue { private static final String PARAM_PLUGIN = "plugin"; private static final String PARAM_COMMAND = "command"; + private static final String PARAM_CONFIG = "config"; public LiveData_args() { super(); } - public LiveData_args(AgentRemoteValue val) { + public LiveData_args(AgentRemoteValue val) + throws AgentRemoteException + { String type = val.getValue(PARAM_PLUGIN); String command = val.getValue(PARAM_COMMAND); + String configStr = val.getValue(PARAM_CONFIG); - setConfig(type, command); + ConfigResponse config; + try { + config = ConfigResponse.decode(Base64.decode(configStr)); + } catch (EncodingException e) { + throw new AgentRemoteException("Unable to decode plugin " + + "configuration: " + + e.getMessage()); + } + + setConfig(type, command, config); } - public void setConfig(String type, String command) { + public void setConfig(String type, String command, ConfigResponse config) + throws AgentRemoteException + { + String configStr; + + try { + configStr = Base64.encode(config.encode()); + + } catch (EncodingException e) { + throw new AgentRemoteException("Unable to encode plugin " + + "configuration: " + + e.getMessage()); + } + super.setValue(PARAM_PLUGIN, type); super.setValue(PARAM_COMMAND, command); + super.setValue(PARAM_CONFIG, configStr); } public String getPlugin() { @@ -55,4 +86,21 @@ public String getCommand() { return getValue(PARAM_COMMAND); } + + public ConfigResponse getConfig() + throws AgentRemoteException + { + String configStr = getValue(PARAM_CONFIG); + ConfigResponse config; + + try { + config = ConfigResponse.decode(Base64.decode(configStr)); + } catch (EncodingException e) { + throw new AgentRemoteException("Unable to decode plugin " + + "configuration: " + + e.getMessage()); + } + + return config; + } } Modified: trunk/src/org/hyperic/hq/livedata/agent/server/LiveDataCommandsServer.java =================================================================== --- trunk/src/org/hyperic/hq/livedata/agent/server/LiveDataCommandsServer.java 2007-03-22 16:35:47 UTC (rev 3816) +++ trunk/src/org/hyperic/hq/livedata/agent/server/LiveDataCommandsServer.java 2007-03-22 18:38:31 UTC (rev 3817) @@ -91,7 +91,8 @@ _log.info("Asked to invoke cmdGetData for " + args.getPlugin()); try { - JSONArray o = _manager.getData(args.getPlugin(), args.getCommand()); + JSONArray o = _manager.getData(args.getPlugin(), args.getCommand(), + args.getConfig()); LiveData_result res = new LiveData_result(); res.setResult(o.toString()); return res; Modified: trunk/src/org/hyperic/hq/livedata/server/session/LiveDataManagerEJBImpl.java =================================================================== --- trunk/src/org/hyperic/hq/livedata/server/session/LiveDataManagerEJBImpl.java 2007-03-22 16:35:47 UTC (rev 3816) +++ trunk/src/org/hyperic/hq/livedata/server/session/LiveDataManagerEJBImpl.java 2007-03-22 18:38:31 UTC (rev 3817) @@ -40,16 +40,17 @@ import org.hyperic.hq.appdef.shared.ConfigManagerLocal; import org.hyperic.hq.appdef.server.session.ConfigManagerEJBImpl; import org.hyperic.hq.authz.shared.PermissionException; +import org.hyperic.hq.authz.shared.AuthzSubjectValue; import org.hyperic.hq.agent.AgentConnectionException; import org.hyperic.hq.agent.AgentRemoteException; import org.hyperic.hq.common.SystemException; import org.hyperic.hq.livedata.shared.LiveDataManagerLocal; import org.hyperic.hq.livedata.shared.LiveDataManagerUtil; import org.hyperic.hq.livedata.shared.LiveDataException; +import org.hyperic.util.config.ConfigResponse; import javax.ejb.SessionContext; import javax.ejb.SessionBean; -import java.util.Properties; /** * @ejb:bean name="LiveDataManager" @@ -90,7 +91,7 @@ public void ejbRemove() {} public void setSessionContext(SessionContext ctx) {} - private String getPlugin(AppdefEntityID id) + private String getPluginName(AppdefEntityID id) throws AppdefEntityNotFoundException { ConfigManagerLocal cManager = ConfigManagerEJBImpl.getOne(); @@ -99,21 +100,41 @@ } /** + * Live data subsystem uses measurement configs. + */ + private ConfigResponse getMeasurementConfig(AuthzSubjectValue subject, + AppdefEntityID id) + throws LiveDataException + { + ConfigManagerLocal cManager = ConfigManagerEJBImpl.getOne(); + + try { + return cManager.getMergedConfigResponse(subject, + ProductPlugin.TYPE_MEASUREMENT, + id, true); + } catch (Exception e) { + throw new LiveDataException(e); + } + } + + /** * Get live data for a given resource. * * @ejb:interface-method */ - public String getData(AppdefEntityID id, String command) + public String getData(AuthzSubjectValue subject, + AppdefEntityID id, String command) throws PermissionException, AgentNotFoundException, AgentConnectionException, AgentRemoteException, AppdefEntityNotFoundException, LiveDataException { LiveDataClient client = new LiveDataClient(AgentConnectionUtil.getClient(id)); - Properties props = new Properties(); + String plugin = getPluginName(id); - String plugin = getPlugin(id); - return client.getData(plugin, command, props); + ConfigResponse config = getMeasurementConfig(subject, id); + + return client.getData(plugin, command, config); } /** @@ -121,11 +142,11 @@ * * @ejb:interface-method */ - public String[] getCommands(AppdefEntityID id) + public String[] getCommands(AuthzSubjectValue subject, AppdefEntityID id) throws PluginException { try { - String plugin = getPlugin(id); + String plugin = getPluginName(id); return _manager.getCommands(plugin); } catch (AppdefEntityNotFoundException e) { throw new PluginNotFoundException("No plugin found for " + id, e); Modified: trunk/src/org/hyperic/hq/product/LiveDataPlugin.java =================================================================== --- trunk/src/org/hyperic/hq/product/LiveDataPlugin.java 2007-03-22 16:35:47 UTC (rev 3816) +++ trunk/src/org/hyperic/hq/product/LiveDataPlugin.java 2007-03-22 18:38:31 UTC (rev 3817) @@ -25,9 +25,12 @@ package org.hyperic.hq.product; +import org.hyperic.util.config.ConfigResponse; + public abstract class LiveDataPlugin extends GenericPlugin { - public abstract Object getData(String command) throws PluginException; + public abstract Object getData(String command, ConfigResponse config) + throws PluginException; public abstract String[] getCommands(); } Modified: trunk/src/org/hyperic/hq/product/LiveDataPluginManager.java =================================================================== --- trunk/src/org/hyperic/hq/product/LiveDataPluginManager.java 2007-03-22 16:35:47 UTC (rev 3816) +++ trunk/src/org/hyperic/hq/product/LiveDataPluginManager.java 2007-03-22 18:38:31 UTC (rev 3817) @@ -26,6 +26,7 @@ package org.hyperic.hq.product; import org.hyperic.hq.livedata.shared.LiveDataTranslator; +import org.hyperic.util.config.ConfigResponse; import org.json.JSONArray; import java.util.Properties; @@ -57,11 +58,12 @@ return p; } - public JSONArray getData(String plugin, String command) + public JSONArray getData(String plugin, String command, + ConfigResponse config) throws PluginException { LiveDataPlugin p = getLiveDataPlugin(plugin); - Object o = p.getData(command); + Object o = p.getData(command, config); try { return LiveDataTranslator.encode(o); Modified: trunk/src/org/hyperic/hq/product/jmx/MxLiveDataPlugin.java =================================================================== --- trunk/src/org/hyperic/hq/product/jmx/MxLiveDataPlugin.java 2007-03-22 16:35:47 UTC (rev 3816) +++ trunk/src/org/hyperic/hq/product/jmx/MxLiveDataPlugin.java 2007-03-22 18:38:31 UTC (rev 3817) @@ -27,10 +27,11 @@ import org.hyperic.hq.product.LiveDataPlugin; import org.hyperic.hq.product.PluginException; +import org.hyperic.util.config.ConfigResponse; public class MxLiveDataPlugin extends LiveDataPlugin { - public Object getData(String command) + public Object getData(String command, ConfigResponse config) throws PluginException { return new Object(); |
|
From: Ryan M. <rm...@hy...> - 2007-03-22 18:29:11
|
Yes, it's safe to lower the -Xmx setting to something lower. With the Sun JRE it will not allocate all the heap space unless it's necessary. In my dev setup with the agent monitoring Tomcat, JBoss, Mac OSX and Postgres the agent only is using 5 MB of heap space. As for the overall memory footprint, most of the memory is virtual and is shared with the system. My agent on OSX consumes about 48MB of real memory. Admittedly this is still a still a pretty large number, but that's the tradeoff we had to make to allow us to manage the largest set of applications. Depending on what you are trying to monitor, it's also possible to run the agent on a different machine and do the checks remotely. This limits our ability to autodiscover the applications and narrows the depth of metrics we can collect, but it's an option. Hope that helps, -Ryan |
|
From: Gary B. <gb...@gb...> - 2007-03-22 18:21:55
|
Well, that was of course a really good question. I had already been out looking for it and was having a hard time finding it. I still haven't actually found one directly from APC, however I have found a note that says there is a standard UPS MIB published by the IETF and that the APC supports that MIB. Indeed, there is an RFC for it, it's RFC 1628 and can be found here. It contains the UPS MIB. http://tools.ietf.org/html/rfc1628 Hope that helps. Gary |
|
From: Charles L. <cl...@hy...> - 2007-03-22 16:38:17
|
This bug has been fixed in trunk and in the 3.0 branch. It will be resolved with the next release of HQ. |
Author: rmorgan Date: 2007-03-22 08:35:47 -0800 (Thu, 22 Mar 2007) New Revision: 3816 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=3816 Removed: trunk/src/org/hyperic/hq/bizapp/client/shell/ClientShell_sigar.java trunk/src/org/hyperic/hq/measurement/agent/commands/SigarCmd_args.java trunk/src/org/hyperic/hq/measurement/agent/commands/SigarCmd_result.java Modified: trunk/src/org/hyperic/hq/bizapp/client/shell/ClientShell.java trunk/src/org/hyperic/hq/bizapp/server/session/MeasurementBossEJBImpl.java trunk/src/org/hyperic/hq/measurement/agent/MeasurementCommandsAPI.java trunk/src/org/hyperic/hq/measurement/agent/client/MeasurementCommandsClient.java trunk/src/org/hyperic/hq/measurement/agent/server/MeasurementCommandsServer.java Log: Remove old sigar measurement commands. Replaced by livedata. Modified: trunk/src/org/hyperic/hq/bizapp/client/shell/ClientShell.java =================================================================== --- trunk/src/org/hyperic/hq/bizapp/client/shell/ClientShell.java 2007-03-22 16:35:19 UTC (rev 3815) +++ trunk/src/org/hyperic/hq/bizapp/client/shell/ClientShell.java 2007-03-22 16:35:47 UTC (rev 3816) @@ -133,7 +133,6 @@ registerCommandHandler("resourcetype", new ClientShell_resourcetype(this)); registerCommandHandler("set", new ClientShell_set(this)); registerCommandHandler("scheduler", new ClientShell_scheduler(this)); - registerCommandHandler("sigar", new ClientShell_sigar(this)); registerCommandHandler("time", new ClientShell_time(this)); registerCommandHandler("transfer", new ClientShell_transfer(this)); registerCommandHandler("trigger", new ClientShell_trigger(this)); @@ -144,7 +143,6 @@ this.setHandlerHidden(".", true); this.setHandlerHidden("exit", true); this.setHandlerHidden("scheduler", true); - this.setHandlerHidden("sigar", true); this.setHandlerHidden("transfer", true); this.setHandlerHidden("trigger", true); this.setHandlerHidden("vacuum", true); Deleted: trunk/src/org/hyperic/hq/bizapp/client/shell/ClientShell_sigar.java =================================================================== --- trunk/src/org/hyperic/hq/bizapp/client/shell/ClientShell_sigar.java 2007-03-22 16:35:19 UTC (rev 3815) +++ trunk/src/org/hyperic/hq/bizapp/client/shell/ClientShell_sigar.java 2007-03-22 16:35:47 UTC (rev 3816) @@ -1,119 +0,0 @@ -/* - * NOTE: This copyright does *not* cover user programs that use HQ - * program services by normal system calls through the application - * program interfaces provided as part of the Hyperic Plug-in Development - * Kit or the Hyperic Client Development Kit - this is merely considered - * normal use of the program, and does *not* fall under the heading of - * "derived work". - * - * Copyright (C) [2004, 2005, 2006], Hyperic, Inc. - * This file is part of HQ. - * - * HQ is free software; you can redistribute it and/or modify - * it under the terms version 2 of the GNU General Public License as - * published by the Free Software Foundation. This program is distributed - * in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A - * PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - */ - -package org.hyperic.hq.bizapp.client.shell; - -import java.io.PrintStream; -import java.util.Iterator; -import java.util.List; - -import org.hyperic.hq.appdef.shared.AppdefEntityID; -import org.hyperic.hq.bizapp.shared.MeasurementBoss; -import org.hyperic.util.PrintfFormat; -import org.hyperic.util.StringUtil; -import org.hyperic.util.shell.ShellCommandBase; -import org.hyperic.util.shell.ShellCommandExecException; -import org.hyperic.util.shell.ShellCommandUsageException; - -public class ClientShell_sigar - extends ShellCommandBase -{ - private static final int[] PARAM_VALID_RESOURCE = { - ClientShell_resource.PARAM_PLATFORM, - }; - - private ClientShellEntityFetcher entityFetcher; - private ClientShell shell= null; - - public ClientShell_sigar(ClientShell shell){ - this.shell = shell; - this.entityFetcher = - new ClientShellEntityFetcher(shell.getBossManager(), - shell.getAuthenticator()); - } - - public void processCommand(String[] args) - throws ShellCommandUsageException, ShellCommandExecException - { - PrintStream out = getOutStream(); - PrintStream err = getErrStream(); - AppdefEntityID id; - int type; - - if(args.length != 3) - throw new ShellCommandUsageException(this.getSyntaxEx()); - - type = ClientShell_resource.paramToEntityType(args[0]); - - try { - id = this.entityFetcher.getID(type, args[1]); - } catch(Exception exc){ - throw new ShellCommandExecException(exc); - } - - int authToken = this.shell.getAuthenticator().getAuthToken(); - - try { - MeasurementBoss boss; - - out.println("Running command " + args[2]); - - boss = this.shell.getBossManager().getMeasurementBoss(); - List res = boss.sigarCmd(authToken, id, args[2]); - - for (Iterator i = res.iterator(); i.hasNext(); ) { - List row = (List)i.next(); - for (Iterator j = row.iterator(); j.hasNext(); ) { - String item = (String)j.next(); - out.print(item); - out.print(" "); - } - out.print("\n"); - } - - } catch (Exception e) { - throw new ShellCommandExecException(e); - } - } - - public String getSyntaxEx(){ - return "Use 'help " + this.getCommandName() + "' for details"; - } - - public String getUsageShort(){ - return "Run a sigar command on a remote agent"; - } - - public String getUsageHelp(String[] args) { - String cmdSpace; - - cmdSpace = StringUtil.repeatChars(' ', this.getCommandName().length()); - return " " + this.getUsageShort() + ".\n\n" + - " Command syntax:\n" + - " " + this.getCommandName() + " <" + - ClientShell_resource.generateArgList(PARAM_VALID_RESOURCE) + ">" + - " <resource> <cmd>\n\n"; - } -} Modified: trunk/src/org/hyperic/hq/bizapp/server/session/MeasurementBossEJBImpl.java =================================================================== --- trunk/src/org/hyperic/hq/bizapp/server/session/MeasurementBossEJBImpl.java 2007-03-22 16:35:19 UTC (rev 3815) +++ trunk/src/org/hyperic/hq/bizapp/server/session/MeasurementBossEJBImpl.java 2007-03-22 16:35:47 UTC (rev 3816) @@ -3954,20 +3954,6 @@ } - /** - * Invoke a sigar cmd on a remote agent - * - * @ejb:interface-method - */ - public List sigarCmd(int sessionId, AppdefEntityID id, String cmd) - throws SessionTimeoutException, SessionNotFoundException, - PermissionException, AgentNotFoundException, - AgentRemoteException, AgentConnectionException - { - MeasurementCommandsClient client = getClient(id); - return client.sigarCmd(cmd); - } - /** @ejb:create-method */ public void ejbCreate() throws CreateException {} public void ejbActivate() throws EJBException, RemoteException {} Modified: trunk/src/org/hyperic/hq/measurement/agent/MeasurementCommandsAPI.java =================================================================== --- trunk/src/org/hyperic/hq/measurement/agent/MeasurementCommandsAPI.java 2007-03-22 16:35:19 UTC (rev 3815) +++ trunk/src/org/hyperic/hq/measurement/agent/MeasurementCommandsAPI.java 2007-03-22 16:35:47 UTC (rev 3816) @@ -64,11 +64,6 @@ public static final String command_trackRemove = trackPrefix + "trackRemove"; - // Sigar commands - public static final String command_sigarCmd = - "sigar:sigarCmd"; - - public static final String[] commandSet = { command_scheduleMeasurements, command_unscheduleMeasurements, @@ -76,8 +71,7 @@ command_setProperties, command_deleteProperties, command_trackAdd, - command_trackRemove, - command_sigarCmd + command_trackRemove }; public MeasurementCommandsAPI(){ Modified: trunk/src/org/hyperic/hq/measurement/agent/client/MeasurementCommandsClient.java =================================================================== --- trunk/src/org/hyperic/hq/measurement/agent/client/MeasurementCommandsClient.java 2007-03-22 16:35:19 UTC (rev 3815) +++ trunk/src/org/hyperic/hq/measurement/agent/client/MeasurementCommandsClient.java 2007-03-22 16:35:47 UTC (rev 3816) @@ -25,8 +25,6 @@ package org.hyperic.hq.measurement.agent.client; -import java.util.List; - import org.hyperic.hq.agent.AgentConnectionException; import org.hyperic.hq.agent.AgentRemoteException; import org.hyperic.hq.agent.AgentRemoteValue; @@ -36,12 +34,8 @@ import org.hyperic.hq.measurement.agent.commands.DeleteProperties_result; import org.hyperic.hq.measurement.agent.commands.GetMeasurements_args; import org.hyperic.hq.measurement.agent.commands.GetMeasurements_result; -import org.hyperic.hq.measurement.agent.commands.SigarCmd_args; -import org.hyperic.hq.measurement.agent.commands.SigarCmd_result; import org.hyperic.hq.measurement.agent.commands.TrackPluginAdd_args; -import org.hyperic.hq.measurement.agent.commands.TrackPluginAdd_result; import org.hyperic.hq.measurement.agent.commands.TrackPluginRemove_args; -import org.hyperic.hq.measurement.agent.commands.TrackPluginRemove_result; import org.hyperic.hq.measurement.agent.commands.ScheduleMeasurements_args; import org.hyperic.hq.measurement.agent.commands.ScheduleMeasurements_result; import org.hyperic.hq.measurement.agent.commands.SetProperties_args; @@ -193,23 +187,4 @@ this.verAPI.command_trackRemove, this.verAPI.getVersion(), args); } - - public List sigarCmd(String cmd) - throws AgentRemoteException, - AgentConnectionException - { - SigarCmd_args args; - SigarCmd_result res; - AgentRemoteValue rval; - - args = new SigarCmd_args(); - args.setCmd(cmd); - - rval = this.agentConn.sendCommand(this.verAPI.command_sigarCmd, - this.verAPI.getVersion(), args); - - res = new SigarCmd_result(rval); - - return res.getList(); - } } Deleted: trunk/src/org/hyperic/hq/measurement/agent/commands/SigarCmd_args.java =================================================================== --- trunk/src/org/hyperic/hq/measurement/agent/commands/SigarCmd_args.java 2007-03-22 16:35:19 UTC (rev 3815) +++ trunk/src/org/hyperic/hq/measurement/agent/commands/SigarCmd_args.java 2007-03-22 16:35:47 UTC (rev 3816) @@ -1,60 +0,0 @@ -/* - * NOTE: This copyright does *not* cover user programs that use HQ - * program services by normal system calls through the application - * program interfaces provided as part of the Hyperic Plug-in Development - * Kit or the Hyperic Client Development Kit - this is merely considered - * normal use of the program, and does *not* fall under the heading of - * "derived work". - * - * Copyright (C) [2004, 2005, 2006], Hyperic, Inc. - * This file is part of HQ. - * - * HQ is free software; you can redistribute it and/or modify - * it under the terms version 2 of the GNU General Public License as - * published by the Free Software Foundation. This program is distributed - * in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A - * PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - */ - -package org.hyperic.hq.measurement.agent.commands; - -import org.hyperic.hq.agent.AgentRemoteException; -import org.hyperic.hq.agent.AgentRemoteValue; - -public class SigarCmd_args extends AgentRemoteValue { - - private static final String PARAM_CMD = "cmd"; // Command - - public SigarCmd_args() - { - super(); - } - - public SigarCmd_args(AgentRemoteValue args) - throws AgentRemoteException - { - String cmd = args.getValue(PARAM_CMD); - - if (cmd == null) { - throw new AgentRemoteException("No command given"); - } - - setCmd(cmd); - } - - public void setCmd(String cmd) { - super.setValue(PARAM_CMD, cmd); - } - - public String getCmd() - { - return this.getValue(PARAM_CMD); - } -} Deleted: trunk/src/org/hyperic/hq/measurement/agent/commands/SigarCmd_result.java =================================================================== --- trunk/src/org/hyperic/hq/measurement/agent/commands/SigarCmd_result.java 2007-03-22 16:35:19 UTC (rev 3815) +++ trunk/src/org/hyperic/hq/measurement/agent/commands/SigarCmd_result.java 2007-03-22 16:35:47 UTC (rev 3816) @@ -1,96 +0,0 @@ -/* - * NOTE: This copyright does *not* cover user programs that use HQ - * program services by normal system calls through the application - * program interfaces provided as part of the Hyperic Plug-in Development - * Kit or the Hyperic Client Development Kit - this is merely considered - * normal use of the program, and does *not* fall under the heading of - * "derived work". - * - * Copyright (C) [2004, 2005, 2006], Hyperic, Inc. - * This file is part of HQ. - * - * HQ is free software; you can redistribute it and/or modify - * it under the terms version 2 of the GNU General Public License as - * published by the Free Software Foundation. This program is distributed - * in the hope that it will be useful, but WITHOUT ANY WARRANTY; without - * even the implied warranty of MERCHANTABILITY or FITNESS FOR A - * PARTICULAR PURPOSE. See the GNU General Public License for more - * details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - */ - -package org.hyperic.hq.measurement.agent.commands; - -import java.util.List; - -import java.io.IOException; -import java.io.ByteArrayOutputStream; -import java.io.ByteArrayInputStream; -import java.io.ObjectOutputStream; -import java.io.ObjectInputStream; - -import org.hyperic.util.encoding.Base64; - -import org.hyperic.hq.agent.AgentRemoteException; -import org.hyperic.hq.agent.AgentRemoteValue; - -public class SigarCmd_result extends AgentRemoteValue { - - private static final String PROP_LIST = "list"; - - public SigarCmd_result() - { - super(); - } - - public void setList(List list) - throws AgentRemoteException - { - try { - ByteArrayOutputStream bs = new ByteArrayOutputStream(); - ObjectOutputStream os = new ObjectOutputStream(bs); - String propStr; - - os.writeObject(list); - propStr = Base64.encode(bs.toByteArray()); - - super.setValue(PROP_LIST, propStr); - - } catch (IOException e) { - throw new AgentRemoteException("Unable to set list: " + e); - } - } - - public List getList() - throws AgentRemoteException - { - String propStr = this.getValue(PROP_LIST); - List res; - - try { - byte[] data = Base64.decode(propStr); - ByteArrayInputStream bs = new ByteArrayInputStream(data); - ObjectInputStream os = new ObjectInputStream(bs); - - res = (List)os.readObject(); - return res; - } catch (IOException e) { - throw new AgentRemoteException("Unable to get list: " + e); - } catch (ClassNotFoundException e) { - throw new AgentRemoteException("Unable to get list: " + e); - } - } - - public SigarCmd_result(AgentRemoteValue args) - throws AgentRemoteException - { - String res = args.getValue(PROP_LIST); - - // XXX: should validate the list (e.g. all have the same # of cols) - super.setValue(PROP_LIST, res); - } -} Modified: trunk/src/org/hyperic/hq/measurement/agent/server/MeasurementCommandsServer.java =================================================================== --- trunk/src/org/hyperic/hq/measurement/agent/server/MeasurementCommandsServer.java 2007-03-22 16:35:19 UTC (rev 3815) +++ trunk/src/org/hyperic/hq/measurement/agent/server/MeasurementCommandsServer.java 2007-03-22 16:35:47 UTC (rev 3816) @@ -61,8 +61,6 @@ import org.hyperic.hq.measurement.agent.commands.ScheduleMeasurements_result; import org.hyperic.hq.measurement.agent.commands.SetProperties_args; import org.hyperic.hq.measurement.agent.commands.SetProperties_result; -import org.hyperic.hq.measurement.agent.commands.SigarCmd_args; -import org.hyperic.hq.measurement.agent.commands.SigarCmd_result; import org.hyperic.hq.measurement.agent.commands.TrackPluginAdd_args; import org.hyperic.hq.measurement.agent.commands.TrackPluginAdd_result; import org.hyperic.hq.measurement.agent.commands.TrackPluginRemove_args; @@ -439,39 +437,6 @@ return new TrackPluginRemove_result(); } - //XXX: Needs to be hooked up with sigar. - private SigarCmd_result sigarCmd(SigarCmd_args args) - throws AgentRemoteException - { - - ArrayList table = new ArrayList(); - String cmd = args.getCmd(); - - this.log.info("Invoking sigar cmd=" + cmd); - - // Headers - ArrayList headers = new ArrayList(); - headers.add("Col1"); - headers.add("Col2"); - headers.add("Col3"); - - table.add(headers); - - // Add row data - for (int i = 0; i < 10; i++) { - ArrayList row = new ArrayList(); - row.add("row" + i); - row.add("row" + i); - row.add("row" + i); - table.add(row); - } - - SigarCmd_result res = new SigarCmd_result(); - res.setList(table); - - return res; - } - public AgentRemoteValue dispatchCommand(String cmd, AgentRemoteValue args, InputStream in, OutputStream out) throws AgentRemoteException @@ -509,11 +474,6 @@ TrackPluginRemove_args ta = new TrackPluginRemove_args(args); return this.trackPluginRemove(ta); - } else if(cmd.equals(this.verAPI.command_sigarCmd)) { - SigarCmd_args sa = - new SigarCmd_args(args); - - return this.sigarCmd(sa); } else { throw new AgentRemoteException("Unknown command: " + cmd); } |
|
From: <rm...@hy...> - 2007-03-22 16:35:24
|
Author: rmorgan Date: 2007-03-22 08:35:19 -0800 (Thu, 22 Mar 2007) New Revision: 3815 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=3815 Modified: trunk/src/org/hyperic/hq/bizapp/client/shell/ClientShell_livedata.java Log: Fix cut-n-paste. Modified: trunk/src/org/hyperic/hq/bizapp/client/shell/ClientShell_livedata.java =================================================================== --- trunk/src/org/hyperic/hq/bizapp/client/shell/ClientShell_livedata.java 2007-03-22 16:34:50 UTC (rev 3814) +++ trunk/src/org/hyperic/hq/bizapp/client/shell/ClientShell_livedata.java 2007-03-22 16:35:19 UTC (rev 3815) @@ -52,6 +52,6 @@ } public String getUsageShort(){ - return "Control resources in HQ"; + return "Get live data from resources"; } } |
|
From: <cl...@hy...> - 2007-03-22 16:34:58
|
Author: clee Date: 2007-03-22 08:34:50 -0800 (Thu, 22 Mar 2007) New Revision: 3814 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=3814 Modified: branches/HQ_3_0/src/org/hyperic/hq/authz/server/session/ResourceGroupDAO.java Log: [HQ-603] Fix HQL that did not return results for available groups for role [merge from HEAD] Modified: branches/HQ_3_0/src/org/hyperic/hq/authz/server/session/ResourceGroupDAO.java =================================================================== --- branches/HQ_3_0/src/org/hyperic/hq/authz/server/session/ResourceGroupDAO.java 2007-03-22 16:29:40 UTC (rev 3813) +++ branches/HQ_3_0/src/org/hyperic/hq/authz/server/session/ResourceGroupDAO.java 2007-03-22 16:34:50 UTC (rev 3814) @@ -150,9 +150,7 @@ { return getSession() .createQuery("from ResourceGroup g " + - "join fetch g.roles r " + - "where r.id = ? and g.id not in " + - "(select id from r.resourceGroups) and " + + "where ? not in (select id from g.roles) and " + "g.system = false order by g.sortName " + (asc ? "asc" : "desc")) .setInteger(0, roleId.intValue()) |
|
From: <cl...@hy...> - 2007-03-22 16:29:44
|
Author: clee Date: 2007-03-22 08:29:40 -0800 (Thu, 22 Mar 2007) New Revision: 3813 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=3813 Modified: trunk/src/org/hyperic/hq/authz/server/session/ResourceGroupDAO.java Log: [HQ-603] Fix HQL that did not return results for available groups for role Modified: trunk/src/org/hyperic/hq/authz/server/session/ResourceGroupDAO.java =================================================================== --- trunk/src/org/hyperic/hq/authz/server/session/ResourceGroupDAO.java 2007-03-22 15:46:07 UTC (rev 3812) +++ trunk/src/org/hyperic/hq/authz/server/session/ResourceGroupDAO.java 2007-03-22 16:29:40 UTC (rev 3813) @@ -150,9 +150,7 @@ { return getSession() .createQuery("from ResourceGroup g " + - "join fetch g.roles r " + - "where r.id = ? and g.id not in " + - "(select id from r.resourceGroups) and " + + "where ? not in (select id from g.roles) and " + "g.system = false order by g.sortName " + (asc ? "asc" : "desc")) .setInteger(0, roleId.intValue()) |
|
From: Brad F. <br...@br...> - 2007-03-22 15:52:56
|
I have 3.0.1 installed on the HQ server. Agent, Shell, Server, all reporting for duty. I wished to use the server platform's agent to ping a remote system. Accordingly, I copied the ping-plugin.xml from $HQ_AGENT_DIR/pdk/examples to $HQ_AGENT_DIR/pdk/plugins. I restarted HQ server and agent. The ICMP Ping service now shows up as something you can create in the Inventory tab of the server platform's agent. Goody! I can successfully create a service of type ICMP Ping, but upon visiting the Configuration Properties area, I am presented with "Configuration Properties for the server are not set.Please configure the server before configuring this service.". I freely admit I have absolutely no idea what it's asking for. In v2.7.x, I simply copied the plugin and it worked out-of-the-box. I have searched the v3.x online documentation, and the only hits for "ping" related to the shell. Has v3.x introduced further configuration requirements for this plugin? |
|
From: <rm...@hy...> - 2007-03-22 15:46:10
|
Author: rmorgan Date: 2007-03-22 07:46:07 -0800 (Thu, 22 Mar 2007) New Revision: 3812 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=3812 Modified: trunk/src/org/hyperic/hq/bizapp/client/shell/ClientShellEntityFetcher.java trunk/src/org/hyperic/hq/bizapp/server/session/LiveDataBossEJBImpl.java trunk/src/org/hyperic/hq/livedata/server/session/LiveDataManagerEJBImpl.java Log: Fix build. Modified: trunk/src/org/hyperic/hq/bizapp/client/shell/ClientShellEntityFetcher.java =================================================================== --- trunk/src/org/hyperic/hq/bizapp/client/shell/ClientShellEntityFetcher.java 2007-03-22 11:35:31 UTC (rev 3811) +++ trunk/src/org/hyperic/hq/bizapp/client/shell/ClientShellEntityFetcher.java 2007-03-22 15:46:07 UTC (rev 3812) @@ -1174,7 +1174,7 @@ public String[] getLiveDataCommands(AppdefEntityID id) throws RemoteException, NamingException, - ClientShellAuthenticationException, PluginNotFoundException + ClientShellAuthenticationException, PluginException { LiveDataBoss boss; Modified: trunk/src/org/hyperic/hq/bizapp/server/session/LiveDataBossEJBImpl.java =================================================================== --- trunk/src/org/hyperic/hq/bizapp/server/session/LiveDataBossEJBImpl.java 2007-03-22 11:35:31 UTC (rev 3811) +++ trunk/src/org/hyperic/hq/bizapp/server/session/LiveDataBossEJBImpl.java 2007-03-22 15:46:07 UTC (rev 3812) @@ -35,6 +35,7 @@ import org.hyperic.hq.livedata.shared.LiveDataManagerLocal; import org.hyperic.hq.livedata.server.session.LiveDataManagerEJBImpl; import org.hyperic.hq.product.PluginNotFoundException; +import org.hyperic.hq.product.PluginException; import javax.ejb.SessionBean; import javax.ejb.CreateException; @@ -89,7 +90,7 @@ * @ejb:interface-method */ public String[] getLiveDataCommands(int sessionId, AppdefEntityID id) - throws PluginNotFoundException + throws PluginException { LiveDataManagerLocal manager = LiveDataManagerEJBImpl.getOne(); Modified: trunk/src/org/hyperic/hq/livedata/server/session/LiveDataManagerEJBImpl.java =================================================================== --- trunk/src/org/hyperic/hq/livedata/server/session/LiveDataManagerEJBImpl.java 2007-03-22 11:35:31 UTC (rev 3811) +++ trunk/src/org/hyperic/hq/livedata/server/session/LiveDataManagerEJBImpl.java 2007-03-22 15:46:07 UTC (rev 3812) @@ -30,6 +30,7 @@ import org.hyperic.hq.product.LiveDataPluginManager; import org.hyperic.hq.product.ProductPlugin; import org.hyperic.hq.product.PluginNotFoundException; +import org.hyperic.hq.product.PluginException; import org.hyperic.hq.product.server.session.ProductManagerEJBImpl; import org.hyperic.hq.livedata.agent.client.LiveDataClient; import org.hyperic.hq.appdef.shared.AgentConnectionUtil; @@ -121,7 +122,7 @@ * @ejb:interface-method */ public String[] getCommands(AppdefEntityID id) - throws PluginNotFoundException + throws PluginException { try { String plugin = getPlugin(id); |
|
From: Brad F. <br...@br...> - 2007-03-22 15:31:57
|
In order to accomplish your tasks, you will need to be running the HQ server on a different system than the one you wish to monitor. My recommendations below are based upon that premise. 1) Set up an alert for Platform "Availability" > "0". 2) Set up an alert for Platform "Availability" = "0". 3) Is this not a repeat of #1? 4) This can be done by piggybacking the server's agent and setting up a ping to the remote system. I would be glad to expound, but it appears that the ping plugin isn't working in my 3.0.1 install. I am off to post another thread on that topic. |
|
From: leonTY <jam...@ho...> - 2007-03-22 14:20:55
|
I have installed both hyperic server3.0.1 and agent3.0.1 successfully on pc of windows 2000 and windows xp , but when I try to install the agent3.0.1 on a DELL2850 server of os 2000 server , I get these words below.Could anyone tell me what this trace is saying?thank you
running Hyperic 3.0.1
java.lang.ClassNotFoundException: org.apache.tools.ant.Main
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:244)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
Deleting temporary JRE
|
|
From: exile <hq-...@hy...> - 2007-03-22 12:48:49
|
Hi, To keep the naming conventions coherent, I would like to rename some of the services that has been auto-discovered. It is possible to do this for platforms and servers but for some reason not for services. The only way through the server would be to delete the service and create a new one. I did try to manually edit the service name changing it in eam_service table (using Postgre for backend) but it did not have any immediate effect when looking at the gui. Where would it need to be changed or what needs to be done to get the changed name visible? It would be quite tedious to start deleting and re-creating the services just for the sake of correcting the names. Hopefully someone can help me with this. Thanks! |
|
From: <bo...@hy...> - 2007-03-22 11:35:38
|
Author: bob Date: 2007-03-22 03:35:31 -0800 (Thu, 22 Mar 2007) New Revision: 3811 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=3811 Modified: branches/HQ_3_0/etc/version.properties Log: Release 3.0.3 build #349 Modified: branches/HQ_3_0/etc/version.properties =================================================================== --- branches/HQ_3_0/etc/version.properties 2007-03-22 04:17:56 UTC (rev 3810) +++ branches/HQ_3_0/etc/version.properties 2007-03-22 11:35:31 UTC (rev 3811) @@ -1,3 +1,3 @@ -#Wed Mar 21 17:41:19 PDT 2007 +#Thu Mar 22 04:10:45 PDT 2007 version=3.0.3 -build=348 +build=349 |
|
From: Venkat K. <rea...@ya...> - 2007-03-22 09:40:34
|
Hello In HQ for Lunux - how shall I monitor following events. 1. Node up 2. Node down 3. Any cold start 4. Network inteface down Your answers will help me a lot. |
|
From: Venkat K. <rea...@ya...> - 2007-03-22 07:06:45
|
Hello In HQ for Lunux - how shall I monitor following events. 1. Node up 2. Node down 3. Any cold start 4. Network inteface down Your answers will help me a lot. Regards Venkat |
|
From: Venkat K. <rea...@ya...> - 2007-03-22 07:02:37
|
Thankyou verymuch Stacey -Venkat |
|
From: deeboh <mic...@gm...> - 2007-03-22 05:09:36
|
Right on dudes. Thanks for all your responses. l8s, Deeboh |
Author: rmorgan Date: 2007-03-21 20:17:56 -0800 (Wed, 21 Mar 2007) New Revision: 3810 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=3810 Added: trunk/plugins/system/src/org/hyperic/hq/plugin/system/SystemLiveDataPlugin.java trunk/src/org/hyperic/hq/bizapp/client/shell/ClientShell_livedata.java trunk/src/org/hyperic/hq/bizapp/client/shell/ClientShell_livedata_get.java trunk/src/org/hyperic/hq/bizapp/client/shell/ClientShell_livedata_list.java trunk/src/org/hyperic/hq/bizapp/server/session/LiveDataBossEJBImpl.java trunk/src/org/hyperic/hq/livedata/ trunk/src/org/hyperic/hq/livedata/agent/ trunk/src/org/hyperic/hq/livedata/agent/LiveDataCommandsAPI.java trunk/src/org/hyperic/hq/livedata/agent/client/ trunk/src/org/hyperic/hq/livedata/agent/client/LiveDataClient.java trunk/src/org/hyperic/hq/livedata/agent/commands/ trunk/src/org/hyperic/hq/livedata/agent/commands/LiveData_args.java trunk/src/org/hyperic/hq/livedata/agent/commands/LiveData_result.java trunk/src/org/hyperic/hq/livedata/agent/server/ trunk/src/org/hyperic/hq/livedata/agent/server/LiveDataCommandsServer.java trunk/src/org/hyperic/hq/livedata/server/ trunk/src/org/hyperic/hq/livedata/server/session/ trunk/src/org/hyperic/hq/livedata/server/session/LiveDataManagerEJBImpl.java trunk/src/org/hyperic/hq/livedata/shared/ trunk/src/org/hyperic/hq/livedata/shared/LiveDataException.java trunk/src/org/hyperic/hq/livedata/shared/LiveDataTranslator.java trunk/src/org/hyperic/hq/product/LiveDataPlugin.java trunk/src/org/hyperic/hq/product/LiveDataPluginManager.java trunk/src/org/hyperic/hq/product/jmx/MxLiveDataPlugin.java Modified: trunk/build.xml trunk/plugins/system/src/org/hyperic/hq/plugin/system/SystemPlugin.java trunk/src/org/hyperic/hq/bizapp/client/shell/ClientShell.java trunk/src/org/hyperic/hq/bizapp/client/shell/ClientShellBossManager.java trunk/src/org/hyperic/hq/bizapp/client/shell/ClientShellEntityFetcher.java trunk/src/org/hyperic/hq/product/ProductPlugin.java trunk/src/org/hyperic/hq/product/ProductPluginManager.java Log: Begin new livedata plugin framework for collecting arbitrary data. Currently only the system plugin is supported. Modified: trunk/build.xml =================================================================== --- trunk/build.xml 2007-03-22 02:11:21 UTC (rev 3809) +++ trunk/build.xml 2007-03-22 04:17:56 UTC (rev 3810) @@ -742,6 +742,8 @@ <include name="org/hyperic/hq/common/shared/ProductProperties.class"/> <!-- workaround for StackOverflow w/ WLS 9.x --> <include name="weblogic/net/file/Handler.class"/> + <!-- Livedata shared classes --> + <include name="org/hyperic/hq/livedata/shared/**"/> </jar> <!-- Pack version info --> @@ -799,6 +801,8 @@ <include name="dnsjava-2.0.3.jar"/> <!-- for JMX based plugins --> <include name="mx4j/*.jar"/> + <!-- for live data translation --> + <include name="json.jar"/> </fileset> </copy> @@ -1020,6 +1024,14 @@ </manifest> </jar> + <jar basedir="${build.dir}/classes" + jarfile="${agent.dir}/lib/LiveDataServer.jar"> + <include name="org/hyperic/hq/livedata/**"/> + <manifest> + <attribute name="Main-Class" value="org.hyperic.hq.livedata.agent.server.LiveDataCommandsServer" /> + </manifest> + </jar> + <jar basedir="${build.dir}/classes" jarfile="${agent.dir}/lib/AgentClient.jar"> <exclude name="org/hyperic/hq/agent/server/**"/> <include name="org/hyperic/hq/agent/**"/> Added: trunk/plugins/system/src/org/hyperic/hq/plugin/system/SystemLiveDataPlugin.java =================================================================== --- trunk/plugins/system/src/org/hyperic/hq/plugin/system/SystemLiveDataPlugin.java (rev 0) +++ trunk/plugins/system/src/org/hyperic/hq/plugin/system/SystemLiveDataPlugin.java 2007-03-22 04:17:56 UTC (rev 3810) @@ -0,0 +1,83 @@ +/* + * NOTE: This copyright does *not* cover user programs that use HQ + * program services by normal system calls through the application + * program interfaces provided as part of the Hyperic Plug-in Development + * Kit or the Hyperic Client Development Kit - this is merely considered + * normal use of the program, and does *not* fall under the heading of + * "derived work". + * + * Copyright (C) [2004, 2005, 2006], Hyperic, Inc. + * This file is part of HQ. + * + * HQ is free software; you can redistribute it and/or modify + * it under the terms version 2 of the GNU General Public License as + * published by the Free Software Foundation. This program is distributed + * in the hope that it will be useful, but WITHOUT ANY WARRANTY; without + * even the implied warranty of MERCHANTABILITY or FITNESS FOR A + * PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA. + */ + +package org.hyperic.hq.plugin.system; + +import org.hyperic.hq.product.LiveDataPlugin; +import org.hyperic.hq.product.PluginException; +import org.hyperic.hq.livedata.shared.LiveDataTranslator; +import org.hyperic.sigar.Sigar; +import org.hyperic.sigar.SigarException; +import org.json.JSONArray; + +public class SystemLiveDataPlugin extends LiveDataPlugin { + + private static final String CMD_CPUINFO = "cpuinfo"; + private static final String CMD_CPU = "cpu"; + private static final String CMD_CPUPERC = "cpuperc"; + private static final String CMD_FILESYSTEM = "filesystem"; + + private static final String _COMMANDS[] = { + CMD_CPUINFO, + CMD_CPU, + CMD_CPUPERC, + CMD_FILESYSTEM + }; + + public Object getData(String command) throws PluginException { + Sigar sigar = new Sigar(); + + try { + if (command.equals(CMD_CPUINFO)) { + return sigar.getCpuInfoList(); + } else if (command.equals(CMD_CPU)) { + return sigar.getCpuList(); + } else if (command.equals(CMD_CPUPERC)) { + return sigar.getCpuPercList(); + } else if (command.equals(CMD_FILESYSTEM)) { + return sigar.getFileSystemList(); + } else { + throw new PluginException("Unknown command '" + command + "'"); + } + } catch (SigarException e) { + throw new PluginException("Error getting system data", e); + } + } + + public String[] getCommands() { + return _COMMANDS; + } + + public static void main(String[] args) throws Exception { + SystemLiveDataPlugin p = new SystemLiveDataPlugin(); + + for (int i = 0; i < _COMMANDS.length; i++) { + System.out.println("Running command " + _COMMANDS[i]); + Object o = p.getData(_COMMANDS[i]); + JSONArray js = LiveDataTranslator.encode(o); + System.out.println(js.toString(2)); + } + } +} Modified: trunk/plugins/system/src/org/hyperic/hq/plugin/system/SystemPlugin.java =================================================================== --- trunk/plugins/system/src/org/hyperic/hq/plugin/system/SystemPlugin.java 2007-03-22 02:11:21 UTC (rev 3809) +++ trunk/plugins/system/src/org/hyperic/hq/plugin/system/SystemPlugin.java 2007-03-22 04:17:56 UTC (rev 3810) @@ -198,6 +198,9 @@ return new LogFileTailPlugin(); } } + else if (type.equals(ProductPlugin.TYPE_LIVE_DATA)) { + return new SystemLiveDataPlugin(); + } return null; } Modified: trunk/src/org/hyperic/hq/bizapp/client/shell/ClientShell.java =================================================================== --- trunk/src/org/hyperic/hq/bizapp/client/shell/ClientShell.java 2007-03-22 02:11:21 UTC (rev 3809) +++ trunk/src/org/hyperic/hq/bizapp/client/shell/ClientShell.java 2007-03-22 04:17:56 UTC (rev 3810) @@ -139,6 +139,7 @@ registerCommandHandler("trigger", new ClientShell_trigger(this)); registerCommandHandler("vacuum", new ClientShell_vacuum(this)); registerCommandHandler("version", new ClientShell_version(this)); + registerCommandHandler("livedata", new ClientShell_livedata(this)); this.setHandlerHidden(".", true); this.setHandlerHidden("exit", true); Modified: trunk/src/org/hyperic/hq/bizapp/client/shell/ClientShellBossManager.java =================================================================== --- trunk/src/org/hyperic/hq/bizapp/client/shell/ClientShellBossManager.java 2007-03-22 02:11:21 UTC (rev 3809) +++ trunk/src/org/hyperic/hq/bizapp/client/shell/ClientShellBossManager.java 2007-03-22 04:17:56 UTC (rev 3810) @@ -42,6 +42,8 @@ import org.hyperic.hq.bizapp.shared.ProductBossUtil; import org.hyperic.hq.bizapp.shared.AIBoss; import org.hyperic.hq.bizapp.shared.AIBossUtil; +import org.hyperic.hq.bizapp.shared.LiveDataBoss; +import org.hyperic.hq.bizapp.shared.LiveDataBossUtil; import java.util.Hashtable; import javax.naming.NamingException; @@ -55,6 +57,7 @@ private ConfigBoss configBoss; private EventsBoss eventsBoss; private AIBoss aiBoss; + private LiveDataBoss liveDataBoss; protected ClientShellAuthenticator auth; @@ -75,6 +78,7 @@ this.measurementBoss = null; this.eventsBoss = null; this.aiBoss = null; + this.liveDataBoss = null; } public AppdefBoss getAppdefBoss() @@ -217,4 +221,21 @@ return this.aiBoss; } + public LiveDataBoss getLiveDataBoss() + throws NamingException, ClientShellAuthenticationException + { + if (this.liveDataBoss == null) { + try { + Hashtable env = this.auth.getNamingEnv(); + + this.liveDataBoss = LiveDataBossUtil.getHome(env).create(); + } catch (ClientShellAuthenticationException e) { + throw e; + } catch (Exception e) { + throw new NamingException("Could not get LiveDataBoss: " + e); + } + } + + return this.liveDataBoss; + } } Modified: trunk/src/org/hyperic/hq/bizapp/client/shell/ClientShellEntityFetcher.java =================================================================== --- trunk/src/org/hyperic/hq/bizapp/client/shell/ClientShellEntityFetcher.java 2007-03-22 02:11:21 UTC (rev 3809) +++ trunk/src/org/hyperic/hq/bizapp/client/shell/ClientShellEntityFetcher.java 2007-03-22 04:17:56 UTC (rev 3810) @@ -39,6 +39,7 @@ import javax.naming.NamingException; import org.hyperic.hq.agent.AgentConnectionException; +import org.hyperic.hq.agent.AgentRemoteException; import org.hyperic.hq.appdef.shared.AIIpValue; import org.hyperic.hq.appdef.shared.AIPlatformValue; import org.hyperic.hq.appdef.shared.AIServerValue; @@ -91,6 +92,7 @@ import org.hyperic.hq.bizapp.shared.EventsBoss; import org.hyperic.hq.bizapp.shared.MeasurementBoss; import org.hyperic.hq.bizapp.shared.ProductBoss; +import org.hyperic.hq.bizapp.shared.LiveDataBoss; import org.hyperic.hq.bizapp.shared.action.EmailActionConfig; import org.hyperic.hq.bizapp.shared.resourceImport.BatchImportData; import org.hyperic.hq.bizapp.shared.resourceImport.BatchImportException; @@ -115,6 +117,7 @@ import org.hyperic.hq.product.PluginException; import org.hyperic.hq.product.PluginNotFoundException; import org.hyperic.hq.scheduler.ScheduleValue; +import org.hyperic.hq.livedata.shared.LiveDataException; import org.hyperic.util.ConfigPropertyException; import org.hyperic.util.StringUtil; import org.hyperic.util.config.ConfigResponse; @@ -1099,7 +1102,7 @@ boss = this.bossManager.getMeasurementBoss(); boss.invokeDataCompact(auth.getAuthToken()); } - + public boolean ensureNamesAreIds(ConfigResponse response) throws SessionNotFoundException, SessionTimeoutException, ClientShellAuthenticationException, RemoteException, @@ -1155,6 +1158,29 @@ return (0 == numInvalid); } - + + public String getLiveData(AppdefEntityID id, String command) + throws NamingException, ClientShellAuthenticationException, + PermissionException, AgentConnectionException, RemoteException, + AgentRemoteException, AgentNotFoundException, LiveDataException, + AppdefEntityNotFoundException + { + LiveDataBoss boss; + + boss = this.bossManager.getLiveDataBoss(); + + return boss.getLiveData(auth.getAuthToken(), id, command); + } + + public String[] getLiveDataCommands(AppdefEntityID id) + throws RemoteException, NamingException, + ClientShellAuthenticationException, PluginNotFoundException + { + LiveDataBoss boss; + + boss = this.bossManager.getLiveDataBoss(); + + return boss.getLiveDataCommands(auth.getAuthToken(), id); + } } Added: trunk/src/org/hyperic/hq/bizapp/client/shell/ClientShell_livedata.java =================================================================== --- trunk/src/org/hyperic/hq/bizapp/client/shell/ClientShell_livedata.java (rev 0) +++ trunk/src/org/hyperic/hq/bizapp/client/shell/ClientShell_livedata.java 2007-03-22 04:17:56 UTC (rev 3810) @@ -0,0 +1,57 @@ +/* + * NOTE: This copyright does *not* cover user programs that use HQ + * program services by normal system calls through the application + * program interfaces provided as part of the Hyperic Plug-in Development + * Kit or the Hyperic Client Development Kit - this is merely considered + * normal use of the program, and does *not* fall under the heading of + * "derived work". + * + * Copyright (C) [2004, 2005, 2006], Hyperic, Inc. + * This file is part of HQ. + * + * HQ is free software; you can redistribute it and/or modify + * it under the terms version 2 of the GNU General Public License as + * published by the Free Software Foundation. This program is distributed + * in the hope that it will be useful, but WITHOUT ANY WARRANTY; without + * even the implied warranty of MERCHANTABILITY or FITNESS FOR A + * PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA. + */ + +package org.hyperic.hq.bizapp.client.shell; + +import org.hyperic.util.shell.MultiwordShellCommand; +import org.hyperic.util.shell.ShellBase; +import org.hyperic.util.shell.ShellCommandInitException; +import org.hyperic.util.shell.ShellCommandHandler; + +public class ClientShell_livedata extends MultiwordShellCommand { + + private ClientShell shell; + + public ClientShell_livedata(ClientShell shell){ + this.shell = shell; + } + + public void init(String commandName, ShellBase shell) + throws ShellCommandInitException { + ShellCommandHandler handler; + + super.init(commandName, shell); + + handler = new ClientShell_livedata_get(this.shell); + registerSubHandler("get", handler); + + handler = new ClientShell_livedata_list(this.shell); + registerSubHandler("list", handler); + } + + public String getUsageShort(){ + return "Control resources in HQ"; + } +} Added: trunk/src/org/hyperic/hq/bizapp/client/shell/ClientShell_livedata_get.java =================================================================== --- trunk/src/org/hyperic/hq/bizapp/client/shell/ClientShell_livedata_get.java (rev 0) +++ trunk/src/org/hyperic/hq/bizapp/client/shell/ClientShell_livedata_get.java 2007-03-22 04:17:56 UTC (rev 3810) @@ -0,0 +1,83 @@ +/* + * NOTE: This copyright does *not* cover user programs that use HQ + * program services by normal system calls through the application + * program interfaces provided as part of the Hyperic Plug-in Development + * Kit or the Hyperic Client Development Kit - this is merely considered + * normal use of the program, and does *not* fall under the heading of + * "derived work". + * + * Copyright (C) [2004, 2005, 2006], Hyperic, Inc. + * This file is part of HQ. + * + * HQ is free software; you can redistribute it and/or modify + * it under the terms version 2 of the GNU General Public License as + * published by the Free Software Foundation. This program is distributed + * in the hope that it will be useful, but WITHOUT ANY WARRANTY; without + * even the implied warranty of MERCHANTABILITY or FITNESS FOR A + * PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA. + */ + +package org.hyperic.hq.bizapp.client.shell; + +import org.hyperic.util.shell.ShellCommandUsageException; +import org.hyperic.util.shell.ShellCommandExecException; +import org.hyperic.util.shell.ShellCommandBase; +import org.hyperic.hq.appdef.shared.AppdefEntityID; +import org.json.JSONArray; + +public class ClientShell_livedata_get extends ShellCommandBase { + + private static final int[] PARAM_VALID_RESOURCE = { + ClientShell_resource.PARAM_PLATFORM, + ClientShell_resource.PARAM_SERVER, + ClientShell_resource.PARAM_SERVICE, + }; + + private ClientShellEntityFetcher _entityFetcher; + + public ClientShell_livedata_get(ClientShell shell) { + _entityFetcher = new ClientShellEntityFetcher(shell.getBossManager(), + shell.getAuthenticator()); + } + + public void processCommand(String [] args) + throws ShellCommandUsageException, ShellCommandExecException { + + if (args.length != 3) { + throw new ShellCommandUsageException(getSyntaxEx()); + } + + try { + int type = ClientShell_resource.paramToEntityType(args[0]); + AppdefEntityID id = _entityFetcher.getID(type, args[1]); + + String s = _entityFetcher.getLiveData(id, args[2]); + JSONArray json = new JSONArray(s); + this.getShell().getOutStream().println("Printing output from " + + args[2] + " command:"); + this.getShell().getOutStream().println(json.toString(2)); + + } catch (Exception e) { + throw new ShellCommandExecException(e); + } + } + + public String getSyntaxEx(){ + return "Use 'help " + this.getCommandName() + "' for details"; + } + + public String getUsageShort(){ + return "Get live data from a resource"; + } + + public String getUsageHelp (String[] args) { + return "<" + ClientShell_resource.generateArgList(PARAM_VALID_RESOURCE) + + "> < name | id > <command>"; + } +} Added: trunk/src/org/hyperic/hq/bizapp/client/shell/ClientShell_livedata_list.java =================================================================== --- trunk/src/org/hyperic/hq/bizapp/client/shell/ClientShell_livedata_list.java (rev 0) +++ trunk/src/org/hyperic/hq/bizapp/client/shell/ClientShell_livedata_list.java 2007-03-22 04:17:56 UTC (rev 3810) @@ -0,0 +1,85 @@ +/* + * NOTE: This copyright does *not* cover user programs that use HQ + * program services by normal system calls through the application + * program interfaces provided as part of the Hyperic Plug-in Development + * Kit or the Hyperic Client Development Kit - this is merely considered + * normal use of the program, and does *not* fall under the heading of + * "derived work". + * + * Copyright (C) [2004, 2005, 2006], Hyperic, Inc. + * This file is part of HQ. + * + * HQ is free software; you can redistribute it and/or modify + * it under the terms version 2 of the GNU General Public License as + * published by the Free Software Foundation. This program is distributed + * in the hope that it will be useful, but WITHOUT ANY WARRANTY; without + * even the implied warranty of MERCHANTABILITY or FITNESS FOR A + * PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA. + */ + +package org.hyperic.hq.bizapp.client.shell; + +import org.hyperic.util.shell.ShellCommandBase; +import org.hyperic.util.shell.ShellCommandUsageException; +import org.hyperic.util.shell.ShellCommandExecException; +import org.hyperic.hq.appdef.shared.AppdefEntityID; + +import java.io.PrintStream; + +public class ClientShell_livedata_list extends ShellCommandBase { + private static final int[] PARAM_VALID_RESOURCE = { + ClientShell_resource.PARAM_PLATFORM, + ClientShell_resource.PARAM_SERVER, + ClientShell_resource.PARAM_SERVICE, + }; + + private ClientShellEntityFetcher _entityFetcher; + + public ClientShell_livedata_list(ClientShell shell) { + _entityFetcher = new ClientShellEntityFetcher(shell.getBossManager(), + shell.getAuthenticator()); + } + + public void processCommand(String [] args) + throws ShellCommandUsageException, ShellCommandExecException { + + if (args.length != 2) { + throw new ShellCommandUsageException(getSyntaxEx()); + } + + try { + int type = ClientShell_resource.paramToEntityType(args[0]); + AppdefEntityID id = _entityFetcher.getID(type, args[1]); + + String[] cmds = _entityFetcher.getLiveDataCommands(id); + + PrintStream ps = this.getShell().getOutStream(); + ps.println("Commands for " + id + ":"); + for (int i = 0; i < cmds.length; i++) { + ps.println(" " + cmds[i]); + } + + } catch (Exception e) { + throw new ShellCommandExecException(e); + } + } + + public String getSyntaxEx(){ + return "Use 'help " + this.getCommandName() + "' for details"; + } + + public String getUsageShort(){ + return "Get the live data commands for a resource"; + } + + public String getUsageHelp (String[] args) { + return "<" + ClientShell_resource.generateArgList(PARAM_VALID_RESOURCE) + + "> < name | id >"; + } +} Added: trunk/src/org/hyperic/hq/bizapp/server/session/LiveDataBossEJBImpl.java =================================================================== --- trunk/src/org/hyperic/hq/bizapp/server/session/LiveDataBossEJBImpl.java (rev 0) +++ trunk/src/org/hyperic/hq/bizapp/server/session/LiveDataBossEJBImpl.java 2007-03-22 04:17:56 UTC (rev 3810) @@ -0,0 +1,98 @@ +/* + * NOTE: This copyright does *not* cover user programs that use HQ + * program services by normal system calls through the application + * program interfaces provided as part of the Hyperic Plug-in Development + * Kit or the Hyperic Client Development Kit - this is merely considered + * normal use of the program, and does *not* fall under the heading of + * "derived work". + * + * Copyright (C) [2004, 2005, 2006], Hyperic, Inc. + * This file is part of HQ. + * + * HQ is free software; you can redistribute it and/or modify + * it under the terms version 2 of the GNU General Public License as + * published by the Free Software Foundation. This program is distributed + * in the hope that it will be useful, but WITHOUT ANY WARRANTY; without + * even the implied warranty of MERCHANTABILITY or FITNESS FOR A + * PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA. + */ + +package org.hyperic.hq.bizapp.server.session; + +import org.hyperic.hq.appdef.shared.AppdefEntityID; +import org.hyperic.hq.appdef.shared.AgentNotFoundException; +import org.hyperic.hq.appdef.shared.AppdefEntityNotFoundException; +import org.hyperic.hq.authz.shared.PermissionException; +import org.hyperic.hq.agent.AgentConnectionException; +import org.hyperic.hq.agent.AgentRemoteException; +import org.hyperic.hq.livedata.shared.LiveDataException; +import org.hyperic.hq.livedata.shared.LiveDataManagerLocal; +import org.hyperic.hq.livedata.server.session.LiveDataManagerEJBImpl; +import org.hyperic.hq.product.PluginNotFoundException; + +import javax.ejb.SessionBean; +import javax.ejb.CreateException; +import javax.ejb.EJBException; +import javax.ejb.SessionContext; +import java.rmi.RemoteException; + +/** + * External API into the live data system. + * + * @ejb:bean name="LiveDataBoss" + * jndi-name="ejb/bizapp/LiveDataBoss" + * local-jndi-name="LocalLiveDataBoss" + * view-type="both" + * type="Stateless" + * @ejb:transaction type="Required" + */ + +public class LiveDataBossEJBImpl implements SessionBean { + + /** @ejb:create-method */ + public void ejbCreate() throws CreateException {} + public void ejbActivate() throws EJBException, RemoteException {} + public void ejbPassivate() throws EJBException, RemoteException {} + public void ejbRemove() throws EJBException, RemoteException {} + public void setSessionContext(SessionContext ctx) {} + + /** + * Get live data for a given resource + * + * The data returned is the string representation of a JSONArray. This + * is mainly because JSONArray is not Serializable. To reconstruct the + * JSONArray object use: + * + * new JSONArray(string); + * + * @ejb:interface-method + */ + public String getLiveData(int sessionId, AppdefEntityID id, + String command) + throws PermissionException, AgentConnectionException, + AgentRemoteException, AgentNotFoundException, + AppdefEntityNotFoundException, LiveDataException + { + LiveDataManagerLocal manager = LiveDataManagerEJBImpl.getOne(); + return manager.getData(id, command); + } + + /** + * Get the commands for a given resource. + * + * @ejb:interface-method + */ + public String[] getLiveDataCommands(int sessionId, AppdefEntityID id) + throws PluginNotFoundException + { + LiveDataManagerLocal manager = LiveDataManagerEJBImpl.getOne(); + + return manager.getCommands(id); + } +} Added: trunk/src/org/hyperic/hq/livedata/agent/LiveDataCommandsAPI.java =================================================================== --- trunk/src/org/hyperic/hq/livedata/agent/LiveDataCommandsAPI.java (rev 0) +++ trunk/src/org/hyperic/hq/livedata/agent/LiveDataCommandsAPI.java 2007-03-22 04:17:56 UTC (rev 3810) @@ -0,0 +1,45 @@ +/* + * NOTE: This copyright does *not* cover user programs that use HQ + * program services by normal system calls through the application + * program interfaces provided as part of the Hyperic Plug-in Development + * Kit or the Hyperic Client Development Kit - this is merely considered + * normal use of the program, and does *not* fall under the heading of + * "derived work". + * + * Copyright (C) [2004, 2005, 2006], Hyperic, Inc. + * This file is part of HQ. + * + * HQ is free software; you can redistribute it and/or modify + * it under the terms version 2 of the GNU General Public License as + * published by the Free Software Foundation. This program is distributed + * in the hope that it will be useful, but WITHOUT ANY WARRANTY; without + * even the implied warranty of MERCHANTABILITY or FITNESS FOR A + * PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA. + */ + +package org.hyperic.hq.livedata.agent; + +import org.hyperic.hq.agent.AgentAPIInfo; + +public class LiveDataCommandsAPI extends AgentAPIInfo { + private static final byte MAJOR_VER = 0x00; + private static final byte MINOR_VER = 0x00; + private static final byte BUGFIX_VER = 0x01; + + public static final String command_getData = + "hyperic.livedata.getData"; + + public static final String[] commandSet = { + command_getData + }; + + public LiveDataCommandsAPI() { + super(MAJOR_VER, MINOR_VER, BUGFIX_VER); + } +} Added: trunk/src/org/hyperic/hq/livedata/agent/client/LiveDataClient.java =================================================================== --- trunk/src/org/hyperic/hq/livedata/agent/client/LiveDataClient.java (rev 0) +++ trunk/src/org/hyperic/hq/livedata/agent/client/LiveDataClient.java 2007-03-22 04:17:56 UTC (rev 3810) @@ -0,0 +1,64 @@ +/* + * NOTE: This copyright does *not* cover user programs that use HQ + * program services by normal system calls through the application + * program interfaces provided as part of the Hyperic Plug-in Development + * Kit or the Hyperic Client Development Kit - this is merely considered + * normal use of the program, and does *not* fall under the heading of + * "derived work". + * + * Copyright (C) [2004, 2005, 2006], Hyperic, Inc. + * This file is part of HQ. + * + * HQ is free software; you can redistribute it and/or modify + * it under the terms version 2 of the GNU General Public License as + * published by the Free Software Foundation. This program is distributed + * in the hope that it will be useful, but WITHOUT ANY WARRANTY; without + * even the implied warranty of MERCHANTABILITY or FITNESS FOR A + * PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA. + */ + +package org.hyperic.hq.livedata.agent.client; + +import org.hyperic.hq.livedata.agent.LiveDataCommandsAPI; +import org.hyperic.hq.livedata.agent.commands.LiveData_args; +import org.hyperic.hq.livedata.agent.commands.LiveData_result; +import org.hyperic.hq.livedata.shared.LiveDataException; +import org.hyperic.hq.agent.client.AgentConnection; +import org.hyperic.hq.agent.AgentConnectionException; +import org.hyperic.hq.agent.AgentRemoteException; +import org.hyperic.hq.agent.AgentRemoteValue; + +import java.util.Properties; + +public class LiveDataClient { + + private LiveDataCommandsAPI _api; + private AgentConnection _agentConnection; + + public LiveDataClient(AgentConnection agentConnection) { + _agentConnection = agentConnection; + _api = new LiveDataCommandsAPI(); + } + + public String getData(String type, String command, Properties props) + throws AgentConnectionException, AgentRemoteException, + LiveDataException + { + LiveData_args args = new LiveData_args(); + + args.setConfig(type, command); + + AgentRemoteValue res = + _agentConnection.sendCommand(LiveDataCommandsAPI.command_getData, + _api.getVersion(), args); + LiveData_result val = new LiveData_result(res); + + return val.getResult(); + } +} Added: trunk/src/org/hyperic/hq/livedata/agent/commands/LiveData_args.java =================================================================== --- trunk/src/org/hyperic/hq/livedata/agent/commands/LiveData_args.java (rev 0) +++ trunk/src/org/hyperic/hq/livedata/agent/commands/LiveData_args.java 2007-03-22 04:17:56 UTC (rev 3810) @@ -0,0 +1,58 @@ +/* + * NOTE: This copyright does *not* cover user programs that use HQ + * program services by normal system calls through the application + * program interfaces provided as part of the Hyperic Plug-in Development + * Kit or the Hyperic Client Development Kit - this is merely considered + * normal use of the program, and does *not* fall under the heading of + * "derived work". + * + * Copyright (C) [2004, 2005, 2006], Hyperic, Inc. + * This file is part of HQ. + * + * HQ is free software; you can redistribute it and/or modify + * it under the terms version 2 of the GNU General Public License as + * published by the Free Software Foundation. This program is distributed + * in the hope that it will be useful, but WITHOUT ANY WARRANTY; without + * even the implied warranty of MERCHANTABILITY or FITNESS FOR A + * PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA. + */ + +package org.hyperic.hq.livedata.agent.commands; + +import org.hyperic.hq.agent.AgentRemoteValue; + +public class LiveData_args extends AgentRemoteValue { + + private static final String PARAM_PLUGIN = "plugin"; + private static final String PARAM_COMMAND = "command"; + + public LiveData_args() { + super(); + } + + public LiveData_args(AgentRemoteValue val) { + String type = val.getValue(PARAM_PLUGIN); + String command = val.getValue(PARAM_COMMAND); + + setConfig(type, command); + } + + public void setConfig(String type, String command) { + super.setValue(PARAM_PLUGIN, type); + super.setValue(PARAM_COMMAND, command); + } + + public String getPlugin() { + return getValue(PARAM_PLUGIN); + } + + public String getCommand() { + return getValue(PARAM_COMMAND); + } +} Added: trunk/src/org/hyperic/hq/livedata/agent/commands/LiveData_result.java =================================================================== --- trunk/src/org/hyperic/hq/livedata/agent/commands/LiveData_result.java (rev 0) +++ trunk/src/org/hyperic/hq/livedata/agent/commands/LiveData_result.java 2007-03-22 04:17:56 UTC (rev 3810) @@ -0,0 +1,59 @@ +/* + * NOTE: This copyright does *not* cover user programs that use HQ + * program services by normal system calls through the application + * program interfaces provided as part of the Hyperic Plug-in Development + * Kit or the Hyperic Client Development Kit - this is merely considered + * normal use of the program, and does *not* fall under the heading of + * "derived work". + * + * Copyright (C) [2004, 2005, 2006], Hyperic, Inc. + * This file is part of HQ. + * + * HQ is free software; you can redistribute it and/or modify + * it under the terms version 2 of the GNU General Public License as + * published by the Free Software Foundation. This program is distributed + * in the hope that it will be useful, but WITHOUT ANY WARRANTY; without + * even the implied warranty of MERCHANTABILITY or FITNESS FOR A + * PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA. + */ + +package org.hyperic.hq.livedata.agent.commands; + +import org.hyperic.hq.agent.AgentRemoteValue; +import org.hyperic.hq.agent.AgentAssertionException; +import org.hyperic.hq.agent.AgentRemoteException; + +public class LiveData_result extends AgentRemoteValue { + + private static final String PARAM_RESULT = "result"; + + public void setValue(String key, String val) { + throw new AgentAssertionException("This should never be called"); + } + + public LiveData_result() { + super(); + } + + public LiveData_result(AgentRemoteValue val) + throws AgentRemoteException { + + String result = val.getValue(PARAM_RESULT); + + setResult(result); + } + + public void setResult(String result) { + super.setValue(PARAM_RESULT, result); + } + + public String getResult() { + return super.getValue(PARAM_RESULT); + } +} Added: trunk/src/org/hyperic/hq/livedata/agent/server/LiveDataCommandsServer.java =================================================================== --- trunk/src/org/hyperic/hq/livedata/agent/server/LiveDataCommandsServer.java (rev 0) +++ trunk/src/org/hyperic/hq/livedata/agent/server/LiveDataCommandsServer.java 2007-03-22 04:17:56 UTC (rev 3810) @@ -0,0 +1,102 @@ +/* + * NOTE: This copyright does *not* cover user programs that use HQ + * program services by normal system calls through the application + * program interfaces provided as part of the Hyperic Plug-in Development + * Kit or the Hyperic Client Development Kit - this is merely considered + * normal use of the program, and does *not* fall under the heading of + * "derived work". + * + * Copyright (C) [2004, 2005, 2006], Hyperic, Inc. + * This file is part of HQ. + * + * HQ is free software; you can redistribute it and/or modify + * it under the terms version 2 of the GNU General Public License as + * published by the Free Software Foundation. This program is distributed + * in the hope that it will be useful, but WITHOUT ANY WARRANTY; without + * even the implied warranty of MERCHANTABILITY or FITNESS FOR A + * PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA. + */ + +package org.hyperic.hq.livedata.agent.server; + +import org.hyperic.hq.agent.server.AgentServerHandler; +import org.hyperic.hq.agent.server.AgentDaemon; +import org.hyperic.hq.agent.server.AgentStartException; +import org.hyperic.hq.agent.AgentAPIInfo; +import org.hyperic.hq.agent.AgentRemoteValue; +import org.hyperic.hq.agent.AgentRemoteException; +import org.hyperic.hq.livedata.agent.LiveDataCommandsAPI; +import org.hyperic.hq.livedata.agent.commands.LiveData_args; +import org.hyperic.hq.livedata.agent.commands.LiveData_result; +import org.hyperic.hq.product.LiveDataPluginManager; +import org.hyperic.hq.product.ProductPlugin; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.json.JSONArray; + +import java.io.InputStream; +import java.io.OutputStream; + +public class LiveDataCommandsServer implements AgentServerHandler { + + private Log _log = LogFactory.getLog(LiveDataCommandsServer.class); + private LiveDataPluginManager _manager; + + private LiveDataCommandsAPI _commands = new LiveDataCommandsAPI(); + + public String[] getCommandSet() { + return LiveDataCommandsAPI.commandSet; + } + + public AgentAPIInfo getAPIInfo() { + return _commands; + } + + public AgentRemoteValue dispatchCommand(String cmd, AgentRemoteValue args, + InputStream inStream, + OutputStream outStream) + throws AgentRemoteException + { + if (cmd.equals(LiveDataCommandsAPI.command_getData)) { + LiveData_args res = new LiveData_args(args); + return cmdGetData(res); + } else { + throw new AgentRemoteException("Unexpected command: " + cmd); + } + } + + public void startup(AgentDaemon agent) throws AgentStartException { + + try { + _manager = (LiveDataPluginManager)agent. + getPluginManager(ProductPlugin.TYPE_LIVE_DATA); + } catch (Exception e) { + throw new AgentStartException("Unable to load live data manager", + e); + } + } + + public void shutdown() { + } + + public LiveData_result cmdGetData(LiveData_args args) + throws AgentRemoteException + { + _log.info("Asked to invoke cmdGetData for " + args.getPlugin()); + + try { + JSONArray o = _manager.getData(args.getPlugin(), args.getCommand()); + LiveData_result res = new LiveData_result(); + res.setResult(o.toString()); + return res; + } catch (Exception e) { + throw new AgentRemoteException("Unable to invoke command", e); + } + } +} Added: trunk/src/org/hyperic/hq/livedata/server/session/LiveDataManagerEJBImpl.java =================================================================== --- trunk/src/org/hyperic/hq/livedata/server/session/LiveDataManagerEJBImpl.java (rev 0) +++ trunk/src/org/hyperic/hq/livedata/server/session/LiveDataManagerEJBImpl.java 2007-03-22 04:17:56 UTC (rev 3810) @@ -0,0 +1,133 @@ +/* + * NOTE: This copyright does *not* cover user programs that use HQ + * program services by normal system calls through the application + * program interfaces provided as part of the Hyperic Plug-in Development + * Kit or the Hyperic Client Development Kit - this is merely considered + * normal use of the program, and does *not* fall under the heading of + * "derived work". + * + * Copyright (C) [2004, 2005, 2006], Hyperic, Inc. + * This file is part of HQ. + * + * HQ is free software; you can redistribute it and/or modify + * it under the terms version 2 of the GNU General Public License as + * published by the Free Software Foundation. This program is distributed + * in the hope that it will be useful, but WITHOUT ANY WARRANTY; without + * even the implied warranty of MERCHANTABILITY or FITNESS FOR A + * PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA. + */ + +package org.hyperic.hq.livedata.server.session; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.hyperic.hq.product.LiveDataPluginManager; +import org.hyperic.hq.product.ProductPlugin; +import org.hyperic.hq.product.PluginNotFoundException; +import org.hyperic.hq.product.server.session.ProductManagerEJBImpl; +import org.hyperic.hq.livedata.agent.client.LiveDataClient; +import org.hyperic.hq.appdef.shared.AgentConnectionUtil; +import org.hyperic.hq.appdef.shared.AppdefEntityID; +import org.hyperic.hq.appdef.shared.AgentNotFoundException; +import org.hyperic.hq.appdef.shared.AppdefEntityNotFoundException; +import org.hyperic.hq.appdef.shared.ConfigManagerLocal; +import org.hyperic.hq.appdef.server.session.ConfigManagerEJBImpl; +import org.hyperic.hq.authz.shared.PermissionException; +import org.hyperic.hq.agent.AgentConnectionException; +import org.hyperic.hq.agent.AgentRemoteException; +import org.hyperic.hq.common.SystemException; +import org.hyperic.hq.livedata.shared.LiveDataManagerLocal; +import org.hyperic.hq.livedata.shared.LiveDataManagerUtil; +import org.hyperic.hq.livedata.shared.LiveDataException; + +import javax.ejb.SessionContext; +import javax.ejb.SessionBean; +import java.util.Properties; + +/** + * @ejb:bean name="LiveDataManager" + * jndi-name="ejb/livedata/LiveDataManager" + * local-jndi-name="LocalLiveDataManager" + * view-type="local" + * type="Stateless" + */ +public class LiveDataManagerEJBImpl implements SessionBean { + + private static Log _log = LogFactory.getLog(LiveDataManagerEJBImpl.class); + + private LiveDataPluginManager _manager; + + /** @ejb:create-method */ + public void ejbCreate() { + + // Get reference to the plugin manager + try { + _manager = (LiveDataPluginManager) ProductManagerEJBImpl. + getOne().getPluginManager(ProductPlugin.TYPE_LIVE_DATA); + } catch (Exception e) { + _log.error("Unable to get plugin manager", e); + } + } + + public static LiveDataManagerLocal getOne() { + try { + return LiveDataManagerUtil.getLocalHome().create(); + } catch (Exception e) { + throw new SystemException(e); + } + } + + public void ejbPostCreate() {} + public void ejbActivate() {} + public void ejbPassivate() {} + public void ejbRemove() {} + public void setSessionContext(SessionContext ctx) {} + + private String getPlugin(AppdefEntityID id) + throws AppdefEntityNotFoundException + { + ConfigManagerLocal cManager = ConfigManagerEJBImpl.getOne(); + // XXX: Seems this method should not be in the config manager. + return cManager.getPluginName(id); + } + + /** + * Get live data for a given resource. + * + * @ejb:interface-method + */ + public String getData(AppdefEntityID id, String command) + throws PermissionException, AgentNotFoundException, + AgentConnectionException, AgentRemoteException, + AppdefEntityNotFoundException, LiveDataException + { + LiveDataClient client = + new LiveDataClient(AgentConnectionUtil.getClient(id)); + Properties props = new Properties(); + + String plugin = getPlugin(id); + return client.getData(plugin, command, props); + } + + /** + * Get the available commands for a given resources. + * + * @ejb:interface-method + */ + public String[] getCommands(AppdefEntityID id) + throws PluginNotFoundException + { + try { + String plugin = getPlugin(id); + return _manager.getCommands(plugin); + } catch (AppdefEntityNotFoundException e) { + throw new PluginNotFoundException("No plugin found for " + id, e); + } + } +} Added: trunk/src/org/hyperic/hq/livedata/shared/LiveDataException.java =================================================================== --- trunk/src/org/hyperic/hq/livedata/shared/LiveDataException.java (rev 0) +++ trunk/src/org/hyperic/hq/livedata/shared/LiveDataException.java 2007-03-22 04:17:56 UTC (rev 3810) @@ -0,0 +1,22 @@ +package org.hyperic.hq.livedata.shared; + +import org.hyperic.util.NestedException; + +public class LiveDataException extends NestedException { + + public LiveDataException() { + super(); + } + + public LiveDataException(String s) { + super(s); + } + + public LiveDataException(Throwable t) { + super(t); + } + + public LiveDataException(String s, Throwable t) { + super(s, t); + } +} Added: trunk/src/org/hyperic/hq/livedata/shared/LiveDataTranslator.java =================================================================== --- trunk/src/org/hyperic/hq/livedata/shared/LiveDataTranslator.java (rev 0) +++ trunk/src/org/hyperic/hq/livedata/shared/LiveDataTranslator.java 2007-03-22 04:17:56 UTC (rev 3810) @@ -0,0 +1,72 @@ +/* + * NOTE: This copyright does *not* cover user programs that use HQ + * program services by normal system calls through the application + * program interfaces provided as part of the Hyperic Plug-in Development + * Kit or the Hyperic Client Development Kit - this is merely considered + * normal use of the program, and does *not* fall under the heading of + * "derived work". + * + * Copyright (C) [2004, 2005, 2006], Hyperic, Inc. + * This file is part of HQ. + * + * HQ is free software; you can redistribute it and/or modify + * it under the terms version 2 of the GNU General Public License as + * published by the Free Software Foundation. This program is distributed + * in the hope that it will be useful, but WITHOUT ANY WARRANTY; without + * even the implied warranty of MERCHANTABILITY or FITNESS FOR A + * PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA. + */ + +package org.hyperic.hq.livedata.shared; + +import org.json.JSONObject; +import org.json.JSONArray; +import org.apache.commons.beanutils.PropertyUtils; + +import java.lang.reflect.Array; +import java.util.Map; +import java.util.Iterator; + +public class LiveDataTranslator { + + public static JSONArray encode(Object o) throws Exception { + + JSONArray jarr = new JSONArray(); + + if (o.getClass().isArray()) { + int len = Array.getLength(o); + for (int i = 0; i < len; i++) { + Object element = Array.get(o, i); + JSONObject jobj = translate(element); + jarr.put(jobj); + } + } else { + JSONObject jobj = translate(o); + jarr.put(jobj); + } + + return jarr; + } + + // XXX: handle embedded arrays + private static JSONObject translate(Object o) + throws Exception + { + JSONObject json = new JSONObject(); + + Map props = PropertyUtils.describe(o); + for (Iterator i = props.keySet().iterator(); i.hasNext(); ) { + String method = (String)i.next(); + Object val = PropertyUtils.getProperty(o, method); + json.put(method, val); + } + + return json; + } +} Added: trunk/src/org/hyperic/hq/product/LiveDataPlugin.java =================================================================== --- trunk/src/org/hyperic/hq/product/LiveDataPlugin.java (rev 0) +++ trunk/src/org/hyperic/hq/product/LiveDataPlugin.java 2007-03-22 04:17:56 UTC (rev 3810) @@ -0,0 +1,33 @@ +/* + * NOTE: This copyright does *not* cover user programs that use HQ + * program services by normal system calls through the application + * program interfaces provided as part of the Hyperic Plug-in Development + * Kit or the Hyperic Client Development Kit - this is merely considered + * normal use of the program, and does *not* fall under the heading of + * "derived work". + * + * Copyright (C) [2004, 2005, 2006], Hyperic, Inc. + * This file is part of HQ. + * + * HQ is free software; you can redistribute it and/or modify + * it under the terms version 2 of the GNU General Public License as + * published by the Free Software Foundation. This program is distributed + * in the hope that it will be useful, but WITHOUT ANY WARRANTY; without + * even the implied warranty of MERCHANTABILITY or FITNESS FOR A + * PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA. + */ + +package org.hyperic.hq.product; + +public abstract class LiveDataPlugin extends GenericPlugin { + + public abstract Object getData(String command) throws PluginException; + + public abstract String[] getCommands(); +} Added: trunk/src/org/hyperic/hq/product/LiveDataPluginManager.java =================================================================== --- trunk/src/org/hyperic/hq/product/LiveDataPluginManager.java (rev 0) +++ trunk/src/org/hyperic/hq/product/LiveDataPluginManager.java 2007-03-22 04:17:56 UTC (rev 3810) @@ -0,0 +1,79 @@ +/* + * NOTE: This copyright does *not* cover user programs that use HQ + * program services by normal system calls through the application + * program interfaces provided as part of the Hyperic Plug-in Development + * Kit or the Hyperic Client Development Kit - this is merely considered + * normal use of the program, and does *not* fall under the heading of + * "derived work". + * + * Copyright (C) [2004, 2005, 2006], Hyperic, Inc. + * This file is part of HQ. + * + * HQ is free software; you can redistribute it and/or modify + * it under the terms version 2 of the GNU General Public License as + * published by the Free Software Foundation. This program is distributed + * in the hope that it will be useful, but WITHOUT ANY WARRANTY; without + * even the implied warranty of MERCHANTABILITY or FITNESS FOR A + * PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA. + */ + +package org.hyperic.hq.product; + +import org.hyperic.hq.livedata.shared.LiveDataTranslator; +import org.json.JSONArray; + +import java.util.Properties; + +public class LiveDataPluginManager extends PluginManager { + + public LiveDataPluginManager(Properties props) { + super(props); + } + + public String getName() { + return ProductPlugin.TYPE_LIVE_DATA; + } + + private LiveDataPlugin getLiveDataPlugin(String plugin) + throws PluginException + { + ProductPluginManager mgr = (ProductPluginManager)getParent(); + ProductPlugin pp = mgr.getProductPlugin(plugin); + + //XXX: fix me, this only works for platforms. + LiveDataPlugin p = + (LiveDataPlugin)pp.getPlugin(ProductPlugin.TYPE_LIVE_DATA, + pp.getTypeInfo()); + if (p == null) { + throw new PluginException("Live data plugin for " + + pp.getTypeInfo() + " not found."); + } + return p; + } + + public JSONArray getData(String plugin, String command) + throws PluginException + { + LiveDataPlugin p = getLiveDataPlugin(plugin); + Object o = p.getData(command); + + try { + return LiveDataTranslator.encode(o); + } catch (Exception e) { + throw new PluginException(e); + } + } + + public String[] getCommands(String plugin) + throws PluginException + { + LiveDataPlugin p = getLiveDataPlugin(plugin); + return p.getCommands(); + } +} Modified: trunk/src/org/hyperic/hq/product/ProductPlugin.java =================================================================== --- trunk/src/org/hyperic/hq/product/ProductPlugin.java 2007-03-22 02:11:21 UTC (rev 3809) +++ trunk/src/org/hyperic/hq/product/ProductPlugin.java 2007-03-22 04:17:56 UTC (rev 3810) @@ -41,6 +41,7 @@ public static final String TYPE_RESPONSE_TIME = "responsetime"; public static final String TYPE_LOG_TRACK = "log_track"; public static final String TYPE_CONFIG_TRACK = "config_track"; + public static final String TYPE_LIVE_DATA = "livedata"; //server import attribute propagated by ConfigManager public static final String PROP_INSTALLPATH = "installpath"; Modified: trunk/src/org/hyperic/hq/product/ProductPluginManager.java =================================================================== --- trunk/src/org/hyperic/hq/product/ProductPluginManager.java 2007-03-22 02:11:21 UTC (rev 3809) +++ trunk/src/org/hyperic/hq/product/ProductPluginManager.java 2007-03-22 04:17:56 UTC (rev 3810) @@ -102,6 +102,7 @@ private RtPluginManager rpm; private LogTrackPluginManager ltpm; private ConfigTrackPluginManager ctpm; + private LiveDataPluginManager ldpm; public ProductPluginManager() { this(System.getProperties()); @@ -348,7 +349,8 @@ this.rpm = new RtPluginManager(props); this.ltpm = new LogTrackPluginManager(props); this.ctpm = new ConfigTrackPluginManager(props); - + this.ldpm = new LiveDataPluginManager(props); + PluginManager[] mgrs = { this.mpm, this.cpm, @@ -356,6 +358,7 @@ this.rpm, this.ltpm, this.ctpm, + this.ldpm, this //note to self }; @@ -418,6 +421,10 @@ return this.ctpm; } + public LiveDataPluginManager getLiveDataPluginManager() { + return this.ldpm; + } + public MeasurementPlugin getMeasurementPlugin(String name) { try { return (MeasurementPlugin)this.mpm.getPlugin(name); Added: trunk/src/org/hyperic/hq/product/jmx/MxLiveDataPlugin.java =================================================================== --- trunk/src/org/hyperic/hq/product/jmx/MxLiveDataPlugin.java (rev 0) +++ trunk/src/org/hyperic/hq/product/jmx/MxLiveDataPlugin.java 2007-03-22 04:17:56 UTC (rev 3810) @@ -0,0 +1,45 @@ +/* + * NOTE: This copyright does *not* cover user programs that use HQ + * program services by normal system calls through the application + * program interfaces provided as part of the Hyperic Plug-in Development + * Kit or the Hyperic Client Development Kit - this is merely considered + * normal use of the program, and does *not* fall under the heading of + * "derived work". + * + * Copyright (C) [2004, 2005, 2006], Hyperic, Inc. + * This file is part of HQ. + * + * HQ is free software; you can redistribute it and/or modify + * it under the terms version 2 of the GNU General Public License as + * published by the Free Software Foundation. This program is distributed + * in the hope that it will be useful, but WITHOUT ANY WARRANTY; without + * even the implied warranty of MERCHANTABILITY or FITNESS FOR A + * PARTICULAR PURPOSE. See the GNU General Public License for more + * details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA. + */ + +package org.hyperic.hq.product.jmx; + +import org.hyperic.hq.product.LiveDataPlugin; +import org.hyperic.hq.product.PluginException; + +public class MxLiveDataPlugin extends LiveDataPlugin { + + public Object getData(String command) + throws PluginException + { + return new Object(); + } + + public String[] getCommands() { + return new String[0]; + } + + public static void main(String[] args) throws Exception { + } +} |