From: <gla...@hy...> - 2010-04-16 19:19:45
|
Author: glaullon Date: 2010-04-16 12:19:35 -0700 (Fri, 16 Apr 2010) New Revision: 14513 URL: http://svn.hyperic.org/?view=rev&root=Hyperic+HQ&revision=14513 Modified: trunk/plugins/websphere/etc/hq-plugin.xml trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/ApplicationCollector.java trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/ConnectionPoolCollector.java trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/EJBCollector.java trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/ThreadPoolCollector.java trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebappCollector.java trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebsphereAdminDetector.java trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebsphereCollector.java trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebsphereControlPlugin.java trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebsphereDetector.java trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebsphereMeasurementPlugin.java trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebsphereProductPlugin.java trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebsphereServerCollector.java trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebsphereUtil.java trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/jmx/AppServerQuery.java trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/jmx/WebsphereRuntimeDiscoverer.java Log: [HHQ-3864] WebSphere 7.0 Server not found on Windows [HHQ-3836] WebSphere Control Program path for Windows incorrectly defaults to startServer.sh [HHQ-3903] NPE: Unexpected error running autodiscoverer for plugin: WebSphere Admin 6.1: null Modified: trunk/plugins/websphere/etc/hq-plugin.xml =================================================================== --- trunk/plugins/websphere/etc/hq-plugin.xml 2010-04-16 18:40:59 UTC (rev 14512) +++ trunk/plugins/websphere/etc/hq-plugin.xml 2010-04-16 19:19:35 UTC (rev 14513) @@ -414,6 +414,20 @@ type="secret"/> </config> + <config name="control"> + <option name="program.start" + optional="true" + description="Start Script" + default="bin/startServer.sh"/> + + <option name="program.stop" + optional="true" + description="Stop Script" + default="bin/stopServer.sh"/> + </config> + + + <property name="websphere.regkey" value="SOFTWARE\IBM\WebSphere Application Server"/> @@ -446,6 +460,7 @@ </scan> <config include="connector"/> + <config include="control" type="control"/> </server> @@ -473,6 +488,7 @@ <config include="connector"/> + <config include="control" type="control"/> <properties> <property name="javaVendor" Modified: trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/ApplicationCollector.java =================================================================== --- trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/ApplicationCollector.java 2010-04-16 18:40:59 UTC (rev 14512) +++ trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/ApplicationCollector.java 2010-04-16 19:19:35 UTC (rev 14513) @@ -61,16 +61,19 @@ setAvailability(true); return; } - Object state = - getAttribute(getMBeanServer(), this.name, "state"); + try{ + Object state = + getAttribute(getMBeanServer(), this.name, "state"); - log.debug("[collect] name='"+name.getKeyProperty("name")+"' state='"+state+"("+state.getClass()+")'"); - - if ((state == null) || (!(state instanceof Integer))) { + if ((state == null) || (!(state instanceof Integer))) { + setAvailability(false); + } + else { + setAvailability(((Integer)state).intValue()==1); + } + }catch(PluginException e){ setAvailability(false); + setMessage(e.getMessage()); } - else { - setAvailability(((Integer)state).intValue()==1); - } } } Modified: trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/ConnectionPoolCollector.java =================================================================== --- trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/ConnectionPoolCollector.java 2010-04-16 18:40:59 UTC (rev 14512) +++ trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/ConnectionPoolCollector.java 2010-04-16 19:19:35 UTC (rev 14513) @@ -108,14 +108,19 @@ if (mServer == null) { return; } - JDBCStats stats = (JDBCStats)getStats(mServer, this.name); - if (stats == null) { - return; + try { + JDBCStats stats = (JDBCStats)getStats(mServer, this.name); + if (stats == null) { + return; + } + setAvailability(true); + Stats[] pools = stats.getConnectionPools(); + for (int i=0; i<pools.length; i++) { + collectStatCount(pools[i], ATTRS); + } + } catch (PluginException e) { + setAvailability(false); + setMessage(e.getMessage()); } - setAvailability(true); - Stats[] pools = stats.getConnectionPools(); - for (int i=0; i<pools.length; i++) { - collectStatCount(pools[i], ATTRS); - } } } Modified: trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/EJBCollector.java =================================================================== --- trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/EJBCollector.java 2010-04-16 18:40:59 UTC (rev 14512) +++ trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/EJBCollector.java 2010-04-16 19:19:35 UTC (rev 14513) @@ -52,14 +52,19 @@ } public void collect() { - Object ejbs = - getAttribute(getMBeanServer(), this.name, "ejbs"); + try { + Object ejbs = + getAttribute(getMBeanServer(), this.name, "ejbs"); - if (ejbs == null) { + if (ejbs == null) { + setAvailability(false); + } + else { + setAvailability(true); + } + } catch (PluginException e) { setAvailability(false); + setMessage(e.getMessage()); } - else { - setAvailability(true); - } } } Modified: trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/ThreadPoolCollector.java =================================================================== --- trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/ThreadPoolCollector.java 2010-04-16 18:40:59 UTC (rev 14512) +++ trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/ThreadPoolCollector.java 2010-04-16 19:19:35 UTC (rev 14513) @@ -56,17 +56,22 @@ if (mServer == null) { return; } - Stats stats = getStats(mServer, this.name); - if (stats == null) { - //XXX certain threadpools have no stats, why? - Object o = getAttribute(mServer, this.name, "name"); - if (o != null) { + try { + Stats stats = getStats(mServer, this.name); + if (stats == null) { + //XXX certain threadpools have no stats, why? + Object o = getAttribute(mServer, this.name, "name"); + if (o != null) { + setAvailability(true); + } + } + else { setAvailability(true); + collectStatCount(stats, ATTRS); } + } catch (PluginException e) { + setAvailability(false); + setMessage(e.getMessage()); } - else { - setAvailability(true); - collectStatCount(stats, ATTRS); - } } } Modified: trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebappCollector.java =================================================================== --- trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebappCollector.java 2010-04-16 18:40:59 UTC (rev 14512) +++ trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebappCollector.java 2010-04-16 19:19:35 UTC (rev 14513) @@ -52,14 +52,19 @@ } public void collect() { - Object servlets = - getAttribute(getMBeanServer(), this.name, "servlets"); + try{ + Object servlets = + getAttribute(getMBeanServer(), this.name, "servlets"); - if (servlets == null) { + if (servlets == null) { + setAvailability(false); + } + else { + setAvailability(true); + } + } catch (PluginException e) { setAvailability(false); + setMessage(e.getMessage()); } - else { - setAvailability(true); - } } } Modified: trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebsphereAdminDetector.java =================================================================== --- trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebsphereAdminDetector.java 2010-04-16 18:40:59 UTC (rev 14512) +++ trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebsphereAdminDetector.java 2010-04-16 19:19:35 UTC (rev 14513) @@ -40,6 +40,10 @@ protected List discoverServers(ConfigResponse config) throws PluginException { + if (!WebsphereProductPlugin.VALID_JVM) { + return new ArrayList(); + } + if (this.discoverer == null) { String version = getTypeInfo().getVersion(); this.discoverer = new WebsphereRuntimeDiscoverer(version, this); @@ -65,18 +69,6 @@ return this.discoverer.discoverServers(config); } - protected static String getStartupScript() { - if (isWin32()) { - return "bin\\startNode.bat"; - } else { - return "bin/startNode.sh"; - } - } - - /*public String getIdentifier(WebSphereProcess proc) { - return proc.getServerRoot(); - }*/ - public List getServerResources(ConfigResponse platformConfig) throws PluginException { List servers = new ArrayList(); List processes = getServerProcessList(getProcessQuery()); Modified: trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebsphereCollector.java =================================================================== --- trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebsphereCollector.java 2010-04-16 18:40:59 UTC (rev 14512) +++ trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebsphereCollector.java 2010-04-16 19:19:35 UTC (rev 14513) @@ -83,6 +83,10 @@ } protected void init() throws PluginException { + if(log.isDebugEnabled()){ + log.debug("[init] ("+getClass().getName()+") props="+getProperties()); + } + AdminClient mServer = getMBeanServer(); if(mServer==null) return; @@ -142,7 +146,8 @@ protected Object getAttribute(AdminClient mServer, ObjectName name, - String attr) { + String attr) + throws PluginException{ try { WebsphereStopWatch timer = new WebsphereStopWatch(); @@ -163,11 +168,11 @@ log.debug("getAttribute(" + name + ", " + attr + "): " + e.getMessage(), e); } - return null; + throw new PluginException(e.getMessage()); } } - protected Stats getStats(AdminClient mServer, ObjectName name) { + protected Stats getStats(AdminClient mServer, ObjectName name) throws PluginException { return (Stats)getAttribute(mServer, name, "stats"); } @@ -222,7 +227,7 @@ return super.getValue(metric, result); } - protected boolean collectStats(ObjectName name) { + protected boolean collectStats(ObjectName name) throws PluginException { AdminClient mServer = getMBeanServer(); if (mServer == null) { return false; @@ -230,7 +235,7 @@ return collectStats(mServer, name); } - protected boolean collectStats(AdminClient mServer, ObjectName oname) { + protected boolean collectStats(AdminClient mServer, ObjectName oname) throws PluginException { Stats stats = getStats(mServer, oname); if (stats == null) { setAvailability(false); Modified: trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebsphereControlPlugin.java =================================================================== --- trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebsphereControlPlugin.java 2010-04-16 18:40:59 UTC (rev 14512) +++ trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebsphereControlPlugin.java 2010-04-16 19:19:35 UTC (rev 14513) @@ -45,23 +45,8 @@ private static final List commands = Arrays.asList(actions); private InetPortPinger portPinger; - private String binDir = null; private String[] ctlArgs = new String[0]; - protected String getDefaultScript() { - return - "bin/startServer" + - getScriptExtension(getTypeInfo()); - } - - public void init(PluginManager manager) - throws PluginException { - - super.init(manager); - setTimeout(DEFAULT_TIMEOUT * 10); - setControlProgram(getDefaultScript()); - } - protected String getAdminHost() { return getConfig().getValue(WebsphereProductPlugin.PROP_ADMIN_HOST); } @@ -100,12 +85,6 @@ { super.configure(config); - validateControlProgram(WebsphereProductPlugin.SERVER_NAME); - - this.binDir = getControlProgramDir(); - - //5.0 startup script takes server.name as an arg - //and stop takes user/pass w/ global security enabled String username = getUsername(); String password = getPassword(); @@ -186,7 +165,8 @@ } protected int doCommand(String action, String[] args) { - String script = this.binDir + File.separator + action + "Server.sh"; + String script=getConfig().getValue(PROP_PROGRAM+"."+action); + setControlProgram(script); getLog().debug("command script=" + script); Modified: trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebsphereDetector.java =================================================================== --- trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebsphereDetector.java 2010-04-16 18:40:59 UTC (rev 14512) +++ trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebsphereDetector.java 2010-04-16 19:19:35 UTC (rev 14513) @@ -80,6 +80,8 @@ private String node = null; protected List discoverServices(ConfigResponse config) throws PluginException { + if(!WebsphereProductPlugin.VALID_JVM) return new ArrayList(); + if (this.discoverer == null) { String version = getTypeInfo().getVersion(); this.discoverer = new WebsphereRuntimeDiscoverer(version, this); @@ -144,15 +146,24 @@ return this.node; } - protected static String getStartupScript() { - if (isWin32()) { - return "bin\\startServer.bat"; - } - else { - return "bin/startServer.sh"; - } + public final String getControlScript(String script) { + return "bin"+File.separatorChar+script+getScriptExtension(); } + public final ConfigResponse getControlConfig(WebSphereProcess proc) { + String type = proc.getServer().equals("nodeagent") ? "Node" : "Server"; + File cs1 = new File(proc.getServerRoot(), getControlScript("start" + type)); + File cs2 = new File(proc.getServerRoot(), getControlScript("stop" + type)); + assert cs1.exists() : cs1.getAbsolutePath(); + assert cs2.exists() : cs2.getAbsolutePath(); + ConfigResponse cc = new ConfigResponse(); + cc.setValue(ServerControlPlugin.PROP_PROGRAM + ".start", cs1.getAbsolutePath()); + cc.setValue(ServerControlPlugin.PROP_PROGRAM + ".stop", cs2.getAbsolutePath()); + log.debug("[getControlConfig] server=" + proc.getServer()); + log.debug("[getControlConfig] cc=" + cc); + return cc; + } + protected void initDetector(File root) { //sadly, the setupCmdLine script is the //best way to determine the node name @@ -401,17 +412,6 @@ server.setIdentifier(proc.getIdentifier()); server.setName(getPlatformName() + " " + type + " " + proc.getServerName()); - ConfigResponse controlConfig = null; - - if (!isServiceControl()) { - File controlScript = new File( proc.getServerRoot(), getStartupScript()); - Properties controlProps = new Properties(); - controlProps.setProperty(ServerControlPlugin.PROP_PROGRAM, - controlScript.getAbsolutePath()); - controlConfig = - new ConfigResponse(controlProps); - } - ConfigResponse productConfig = new ConfigResponse(getProductConfig(proc)); @@ -428,16 +428,13 @@ //this will make sure only 1 gets auto-enabled for metrics/ai server.setConnectProperties(METRIC_CONNECT_PROPS); - server.setProductConfig(productConfig); + setProductConfig(server, productConfig); server.setMeasurementConfig(); - if (controlConfig != null) { - server.setControlConfig(controlConfig); - } + setControlConfig(server, getControlConfig(proc)); servers.add(server); - this.log.debug("Detected " + server.getName() + - " in " + serverDir); + log.debug("Detected " + server.getName() + " in " + serverDir); return servers; } Modified: trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebsphereMeasurementPlugin.java =================================================================== --- trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebsphereMeasurementPlugin.java 2010-04-16 18:40:59 UTC (rev 14512) +++ trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebsphereMeasurementPlugin.java 2010-04-16 19:19:35 UTC (rev 14513) @@ -47,6 +47,10 @@ MetricUnreachableException, MetricNotFoundException { + if(!WebsphereProductPlugin.VALID_JVM) + throw new MetricUnreachableException("The WebSphere plugin needs a IBM JVM !!! " + + "(agent jvm=" + System.getProperty("java.vm.vendor") + ")"); + if (useJMX()) { return super.getValue(metric); //collector } Modified: trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebsphereProductPlugin.java =================================================================== --- trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebsphereProductPlugin.java 2010-04-16 18:40:59 UTC (rev 14512) +++ trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebsphereProductPlugin.java 2010-04-16 19:19:35 UTC (rev 14513) @@ -33,6 +33,7 @@ import java.net.URL; import java.net.URLClassLoader; import java.util.ArrayList; +import java.util.Arrays; import java.util.Enumeration; import java.util.HashMap; import java.util.Iterator; @@ -46,10 +47,12 @@ import org.apache.commons.logging.LogFactory; import org.hyperic.hq.product.ProductPlugin; import org.hyperic.hq.product.ProductPluginManager; +import org.hyperic.sigar.OperatingSystem; import org.hyperic.sigar.win32.RegistryKey; import org.hyperic.sigar.win32.Win32Exception; public class WebsphereProductPlugin extends ProductPlugin { + public static boolean VALID_JVM=true; public static final String NAME = "websphere"; @@ -119,26 +122,19 @@ //if we are running with the ibm jdk we can configure //websphere.installpath ourselves. private static String getInstallPathFromJDK() { - String vendor = System.getProperty("java.vendor"); - - if (!vendor.startsWith("IBM")) { - return null; + String res = null; + if (VALID_JVM) { + String javaHome = System.getProperty("java.home"); + File dir = new File(javaHome); + do { + if (!new File(dir, "profiles").exists()) { + dir = dir.getParentFile(); + } else { + res = dir.getAbsolutePath(); + } + } while ((res == null) && (dir.getParentFile() != null)); } - - String javaHome = System.getProperty("java.home"); - - File dir = new File(javaHome); - - //exists in both 4.0 and 5.0 - final String jar = "lib" + File.separator + "websphere-validation.jar"; - - while ((dir = dir.getParentFile()) != null) { - if (new File(dir, jar).exists()) { - return dir.getAbsolutePath(); - } - } - - return null; + return res; } /** @@ -215,6 +211,9 @@ dir = root + "/IBM/WebSphere/AppServer"; if (!new File(dir).isDirectory()) { dir = root + "/WebSphere/AppServer"; + if (!new File(dir).isDirectory()) { + dir=null; + } } where = "default location"; } @@ -225,7 +224,7 @@ return null; } else { - log.debug(PROP_INSTALLPATH + " configured using " + where); + log.debug(PROP_INSTALLPATH + " configured using " + where+" ("+dir+")"); return dir; } } @@ -438,6 +437,18 @@ } public String[] getClassPath(ProductPluginManager manager) { + OperatingSystem os = OperatingSystem.getInstance(); + boolean testIBMJDK = (os.getName().equals(OperatingSystem.NAME_LINUX) + || os.getName().equals(OperatingSystem.NAME_WIN32)); + assert testIBMJDK : os.getName(); + if (testIBMJDK) { + VALID_JVM = System.getProperty("java.vm.vendor").toUpperCase().indexOf("IBM") != -1; + if (!VALID_JVM) { + log.error("The WebSphere plugin needs a IBM JVM !!! " + + "(agent jvm=" + System.getProperty("java.vm.vendor") + ")"); + } + } + if (isWin32()) { String prop = "websphere.regkey"; REG_KEY = getProperties().getProperty(prop); @@ -450,7 +461,7 @@ Properties managerProps = manager.getProperties(); autoRT = "true".equals(managerProps.getProperty("websphere.autort")); - + useJMX = !"false".equals(managerProps.getProperty("websphere.usejmx")); final String propKey = "websphere.useext"; Modified: trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebsphereServerCollector.java =================================================================== --- trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebsphereServerCollector.java 2010-04-16 18:40:59 UTC (rev 14512) +++ trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebsphereServerCollector.java 2010-04-16 19:19:35 UTC (rev 14513) @@ -87,6 +87,10 @@ this.name = null; } } + + // check server properties. + Stats stats =(Stats) getStats(mServer, this.name); + } public void collect() { @@ -101,23 +105,28 @@ setAvailability(true); - if (this.name != null) { - Stats stats =(Stats) getStats(mServer, this.name); + try { + if (this.name != null) { + Stats stats =(Stats) getStats(mServer, this.name); - if (stats != null) { - if (isJVM) { - double total = getStatCount(stats, "HeapSize"); - double used = getStatCount(stats, "UsedMemory"); - setValue("totalMemory", total); - setValue("usedMemory", used); - setValue("freeMemory", total-used); + if (stats != null) { + if (isJVM) { + double total = getStatCount(stats, "HeapSize"); + double used = getStatCount(stats, "UsedMemory"); + setValue("totalMemory", total); + setValue("usedMemory", used); + setValue("freeMemory", total-used); + } + else { + collectStatCount(stats, this.attrs); + } + }else{ + log.debug("no Stats"); } - else { - collectStatCount(stats, this.attrs); - } - }else{ - log.debug("no Stats"); } + } catch (PluginException e) { + setAvailability(false); + setMessage(e.getMessage()); } } } Modified: trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebsphereUtil.java =================================================================== --- trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebsphereUtil.java 2010-04-16 18:40:59 UTC (rev 14512) +++ trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/WebsphereUtil.java 2010-04-16 19:19:35 UTC (rev 14513) @@ -126,10 +126,21 @@ AdminClient mServer; WebsphereStopWatch timer = new WebsphereStopWatch(); + // http://blogs.sun.com/sunabl/entry/websphere_application_server_and_jvm ???? + // XXX test it with solaris version. try { mServer = AdminClientFactory.createAdminClient(props); - } catch (ConnectorException e) { + } catch (LinkageError e) { + log.error("!!! Incorrect JVM !!!", e); throw new MetricUnreachableException(e.getMessage(), e); + } catch (ConnectorException ex) { + Throwable e = ex; + while ((e = (Throwable) e.getCause()) != null) { + if (e instanceof LinkageError) { + throw new MetricUnreachableException("!!! Incorrect JVM !!!", e); + } + } + throw new MetricUnreachableException(ex.getMessage(), ex); } if (log.isDebugEnabled() && timer.isTooLong()) { Modified: trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/jmx/AppServerQuery.java =================================================================== --- trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/jmx/AppServerQuery.java 2010-04-16 18:40:59 UTC (rev 14512) +++ trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/jmx/AppServerQuery.java 2010-04-16 19:19:35 UTC (rev 14513) @@ -81,25 +81,7 @@ return WebsphereProductPlugin.PROP_SERVER_NAME; } - public Properties getProperties() { - Properties props = getParent().getProperties(); - configure(props); - - String controlScript = - this.installpath + - File.separator + "bin" + - File.separator + "startServer" + - GenericPlugin.getScriptExtension(); - - props.setProperty(WebsphereControlPlugin.PROP_PROGRAM, - controlScript); - - return props; - } - public Properties getMetricProperties() { - //cant fucking believe this is not available via jmx - //parse app server port out of server.xml final String addr = "<address xmi:id=\"EndPoint_1\""; String name = getName(); String node = getParent().getName(); Modified: trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/jmx/WebsphereRuntimeDiscoverer.java =================================================================== --- trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/jmx/WebsphereRuntimeDiscoverer.java 2010-04-16 18:40:59 UTC (rev 14512) +++ trunk/plugins/websphere/src/org/hyperic/hq/plugin/websphere/jmx/WebsphereRuntimeDiscoverer.java 2010-04-16 19:19:35 UTC (rev 14513) @@ -46,8 +46,10 @@ import com.ibm.websphere.management.AdminClient; import com.ibm.websphere.management.exception.ConnectorException; +import java.io.File; import org.hyperic.hq.plugin.websphere.WebSphereProcess; import org.hyperic.hq.plugin.websphere.WebsphereDetector; +import org.hyperic.hq.product.ServerControlPlugin; import org.hyperic.hq.product.ServerResource; /** @@ -154,7 +156,8 @@ } catch (MetricUnreachableException e) { throw new PluginException(e.getMessage(), e); } catch (ConnectorException e) { - throw new PluginException(e.getMessage(), e); + if(log.isDebugEnabled()) + log.error(e.getMessage(),e); } return res; @@ -326,10 +329,9 @@ this.log.debug("discovered server: " + server.getName()); - server.setProductConfig(productConfig); server.setMeasurementConfig(new ConfigResponse(serverQuery.getMetricProperties())); - server.setControlConfig(new ConfigResponse()); + server.setControlConfig(serverDetector.getControlConfig(proc)); server.setCustomProperties(new ConfigResponse(serverQuery.getCustomProperties())); ArrayList services = new ArrayList(); |