<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: WebSphere 8.5.5 JVM Instrumentation App - Has anyone got it working? in All Apps and Add-ons</title>
    <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/WebSphere-8-5-5-JVM-Instrumentation-App-Has-anyone-got-it/m-p/363259#M43846</link>
    <description>&lt;P&gt;I did resolve the above issue, by replacing this subsection of the code:&lt;BR /&gt;
            agent = new SplunkJavaAgent();&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;        new java.util.Timer().schedule( 
                new java.util.TimerTask() {
                    @Override
                    public void run() {
                        agent.startAgent(agentArgument, instrumentation);
                    }
                }, 
                60000 
        );          
    } catch (Throwable t) {
        System.err.println(getDateInfo() + "Error starting Splunk Java Agent : " + t.getMessage());
    }
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Where the startAgent function contains the various methods that actually run the agent.&lt;BR /&gt;
The next issue was that the parent thread would exit so various other bits of the code doing parent.isAlive() exited, I removed the isAlive() check and that allowed the JMX to run as expected.&lt;/P&gt;

&lt;P&gt;&lt;EM&gt;However&lt;/EM&gt; for an unknown reason the MBeans are super-limited when used via this method, I eventually managed to obtain about 6 MBeans, I even tried with properties/domain set to *, and this still results in minimal data.&lt;/P&gt;

&lt;P&gt;I'm unsure why, when connecting remotely via JMX I can see approx 50 MBeans, I can only see a small number internally when I use this method so something is wrong but I'm unsure how to diagnose this further.&lt;/P&gt;

&lt;P&gt;This sleeping for 60 seconds trick also resolved my java 2 security issues so that seems to work, I still don't see the logging working as expected but there is no issue reading the properties file anymore...&lt;/P&gt;</description>
    <pubDate>Tue, 09 Jan 2018 05:19:39 GMT</pubDate>
    <dc:creator>gjanders</dc:creator>
    <dc:date>2018-01-09T05:19:39Z</dc:date>
    <item>
      <title>WebSphere 8.5.5 JVM Instrumentation App - Has anyone got it working?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/WebSphere-8-5-5-JVM-Instrumentation-App-Has-anyone-got-it/m-p/363256#M43843</link>
      <description>&lt;P&gt;So I'm testing monitoring IBM WebSphere 8.5.5 with Splunk, and preferably without a 3rd party java agent such as New Relic or CA APM or similar.&lt;/P&gt;

&lt;P&gt;However it is proving very difficult, I've tested the JVM instrumentation agent with WebSphere 8.5.5 and I initially hit a class issue as per the answer &lt;A href="https://answers.splunk.com/answers/478870/websphere-859-jvm-fails-to-start-with-jvm-instrume-1.html"&gt;WebSphere 8.5.9 JVM fails to start with JVM Instrumentation Agent. How can I get an IBM Java 1.6 compatible version?&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;TL;DR version is has anyone got the JVM instrumentation app working in WAS 8.5.5 ?&lt;/P&gt;

&lt;P&gt;For those interested in the details feel free to read on, my initial attempt was to remove org\apache\commons\logging\ and I also tried a few variations of this (for example removing only the clashing Log4JLogger.class file).&lt;BR /&gt;
This allows the JVM to startup as expected but I do not seem to get any logging from the agent.&lt;/P&gt;

&lt;P&gt;In the JVM level I'm using:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;-javaagent:/tmp/splunkagent.jar=/tmp/splunkagent.properties
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I also tried re-compiling the code that Damien Dallimore has provided on &lt;A href="https://github.com/damiendallimore/SplunkJavaAgent"&gt;github&lt;/A&gt; by switching out the log4j references with:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;import org.apache.commons.logging.Log; 
import org.apache.commons.logging.LogFactory; 

    private static Log logger = LogFactory.getLog(SplunkJavaAgent.class);
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I also changed splunkagent.properties to:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;#ERROR/INFO
agent.loggingLevel=INFO
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I also tried setting this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;-javaagent:/home/was/splunkagent.jar=/tmp/splunkagent.properties
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That results in:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[1/5/18 18:51:34:935 AEDT] 0000000f SplunkJavaAge E com.splunk.javaagent.SplunkJavaAgent run Error running properties file checker thread :Access denied ("java.io.FilePermission" "/tmp/splunkagent.properties" "read")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So it does log when something is wrong, but I cannot get it to log the rest of the time...&lt;/P&gt;

&lt;P&gt;Later in the day I tried replacing all mentions of logger. with System.out.println and System.err.println and this data finally appeared in the native_stdout/stderr log files. I'm further along now but I will need to do more troubleshooting to get this working.&lt;/P&gt;

&lt;P&gt;Has anyone got this working in WebSphere?&lt;/P&gt;

&lt;P&gt;Also FYI, I tested the JMX/WebSphere add on, beyond the lack of Splunk 7 support the JMX add on &lt;EM&gt;did not&lt;/EM&gt; work with the WebSphere SSL :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;java.io.IOException: Failed to retrieve RMIServer stub: javax.naming.NamingException: Error during resolve [Root exception is org.omg.CORBA.TRANSIENT: initial and forwarded IOR inaccessible  vmcid: IBM  minor code: E07  completed: No]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Making the "CSIv2 inbound communications"  Transport SSL-supported instead of SSL-required fixes that issue, I then hit the issue that the JMX agent &lt;EM&gt;does not&lt;/EM&gt; work with username/password, or at least not in an WebSphere server as even with valid credentials is advised that an "unauthenticated" user was attempting to retrieving MBean information.&lt;/P&gt;</description>
      <pubDate>Fri, 05 Jan 2018 08:31:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/WebSphere-8-5-5-JVM-Instrumentation-App-Has-anyone-got-it/m-p/363256#M43843</guid>
      <dc:creator>gjanders</dc:creator>
      <dc:date>2018-01-05T08:31:01Z</dc:date>
    </item>
    <item>
      <title>Re: WebSphere 8.5.5 JVM Instrumentation App - Has anyone got it working?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/WebSphere-8-5-5-JVM-Instrumentation-App-Has-anyone-got-it/m-p/363257#M43844</link>
      <description>&lt;P&gt;I should add that I did disable java 2 security and I also disabled application security (just in case).&lt;BR /&gt;
At this stage I suspect that something is preventing the JVM agent from reading the properties file but I will do some more testing...&lt;/P&gt;</description>
      <pubDate>Sat, 06 Jan 2018 07:13:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/WebSphere-8-5-5-JVM-Instrumentation-App-Has-anyone-got-it/m-p/363257#M43844</guid>
      <dc:creator>gjanders</dc:creator>
      <dc:date>2018-01-06T07:13:46Z</dc:date>
    </item>
    <item>
      <title>Re: WebSphere 8.5.5 JVM Instrumentation App - Has anyone got it working?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/WebSphere-8-5-5-JVM-Instrumentation-App-Has-anyone-got-it/m-p/363258#M43845</link>
      <description>&lt;P&gt;More work is required still, it would appear the java 2 security system starts when the JVM starts and is disabled later in the JVM startup (assuming you have java 2 security disabled).&lt;/P&gt;

&lt;P&gt;This explains why the JVM agent could not access the filesystem, I tried a few combinations of adding a file into the jar file (was.policy, app.policy) to disable the required security options but I couldn't seem to get it working.&lt;BR /&gt;
I did get:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;grant codeBase "file:/tmp/splunkagent.jar" {
  permission java.security.AllPermission;
};
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;In the server.policy (profiles/.../properties/server.policy), which gets me past the first issue.&lt;/P&gt;

&lt;P&gt;Furthermore, I did also confirm the messages such as:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2018/01/08 16:42:12Error running properties file checker thread :Access denied ("java.io.FilePermission" "/tmp/splunkagent.properties" "read")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Are mostly harmless, when java 2 security does get disabled, the JVM does allow the file to be read, and since the agent keeps trying to read it it eventually works.&lt;/P&gt;

&lt;P&gt;Furthermore since the SystemOut/SystemErr logs are starting &lt;EM&gt;after&lt;/EM&gt; the JVM agent starts (at least from my point of view, I initially tried a 60 second delay in the java agent and that just delays the app server from starting by 60 seconds).&lt;/P&gt;

&lt;P&gt;Furthermore, in the Splunk Agent if i do:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;trace.jmx.configfiles=/tmp/jmx
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It appears to be loading the file without an issue, but then I receive no data in Splunk, however if I let it use the jmx.xml inside the jar file (which is identical) it works fine.&lt;/P&gt;

&lt;P&gt;Finally, I also found the Splunk app for WAS does things like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;mbean domain="WebSphere" properties="*,type=ThreadPool" dumpAllAttributes="true" &amp;gt;&amp;lt;/mbean&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;However I cannot seem to do "dumpAllAttributes", I'll trim the extra spaces and see if that helps...&lt;/P&gt;

&lt;P&gt;EDIT: In addition to the above I had to add this argument to the JVM options: &lt;CODE&gt;-Djavax.management.builder.initial=&lt;/CODE&gt; without this argument it just did not work...&lt;/P&gt;

&lt;P&gt;And that stops:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2018/01/08 18:38:10Initialising transport : Failed to load MBeanServerBuilder class com.ibm.ws.management.PlatformMBeanServerBuilder: java.lang.ClassNotFoundException: com.ibm.ws.management.PlatformMBeanServerBuilder
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;However that seems to prevent MBeans from been available...(or at least it appears to be preventing access to some MBeans...)&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jan 2018 06:04:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/WebSphere-8-5-5-JVM-Instrumentation-App-Has-anyone-got-it/m-p/363258#M43845</guid>
      <dc:creator>gjanders</dc:creator>
      <dc:date>2018-01-08T06:04:42Z</dc:date>
    </item>
    <item>
      <title>Re: WebSphere 8.5.5 JVM Instrumentation App - Has anyone got it working?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/WebSphere-8-5-5-JVM-Instrumentation-App-Has-anyone-got-it/m-p/363259#M43846</link>
      <description>&lt;P&gt;I did resolve the above issue, by replacing this subsection of the code:&lt;BR /&gt;
            agent = new SplunkJavaAgent();&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;        new java.util.Timer().schedule( 
                new java.util.TimerTask() {
                    @Override
                    public void run() {
                        agent.startAgent(agentArgument, instrumentation);
                    }
                }, 
                60000 
        );          
    } catch (Throwable t) {
        System.err.println(getDateInfo() + "Error starting Splunk Java Agent : " + t.getMessage());
    }
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Where the startAgent function contains the various methods that actually run the agent.&lt;BR /&gt;
The next issue was that the parent thread would exit so various other bits of the code doing parent.isAlive() exited, I removed the isAlive() check and that allowed the JMX to run as expected.&lt;/P&gt;

&lt;P&gt;&lt;EM&gt;However&lt;/EM&gt; for an unknown reason the MBeans are super-limited when used via this method, I eventually managed to obtain about 6 MBeans, I even tried with properties/domain set to *, and this still results in minimal data.&lt;/P&gt;

&lt;P&gt;I'm unsure why, when connecting remotely via JMX I can see approx 50 MBeans, I can only see a small number internally when I use this method so something is wrong but I'm unsure how to diagnose this further.&lt;/P&gt;

&lt;P&gt;This sleeping for 60 seconds trick also resolved my java 2 security issues so that seems to work, I still don't see the logging working as expected but there is no issue reading the properties file anymore...&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jan 2018 05:19:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/WebSphere-8-5-5-JVM-Instrumentation-App-Has-anyone-got-it/m-p/363259#M43846</guid>
      <dc:creator>gjanders</dc:creator>
      <dc:date>2018-01-09T05:19:39Z</dc:date>
    </item>
    <item>
      <title>Re: WebSphere 8.5.5 JVM Instrumentation App - Has anyone got it working?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/WebSphere-8-5-5-JVM-Instrumentation-App-Has-anyone-got-it/m-p/504228#M62117</link>
      <description>&lt;P&gt;&lt;STRONG&gt;I then hit the issue that the JMX agent&amp;nbsp;&lt;EM&gt;does not&lt;/EM&gt;&amp;nbsp;work with username/password, or at least not in an WebSphere server as even with valid credentials is advised that an "unauthenticated" user was attempting to retrieving MBean information.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;What did you do to get around this?&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jun 2020 18:49:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/WebSphere-8-5-5-JVM-Instrumentation-App-Has-anyone-got-it/m-p/504228#M62117</guid>
      <dc:creator>DomenicTroilo1</dc:creator>
      <dc:date>2020-06-12T18:49:00Z</dc:date>
    </item>
    <item>
      <title>Re: WebSphere 8.5.5 JVM Instrumentation App - Has anyone got it working?</title>
      <link>https://community.splunk.com/t5/All-Apps-and-Add-ons/WebSphere-8-5-5-JVM-Instrumentation-App-Has-anyone-got-it/m-p/504262#M62119</link>
      <description>&lt;P&gt;I moved on from that company a long time ago and did not get this working&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 13 Jun 2020 09:15:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/All-Apps-and-Add-ons/WebSphere-8-5-5-JVM-Instrumentation-App-Has-anyone-got-it/m-p/504262#M62119</guid>
      <dc:creator>gjanders</dc:creator>
      <dc:date>2020-06-13T09:15:32Z</dc:date>
    </item>
  </channel>
</rss>

