diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md new file mode 100644 index 0000000..cf0e2b9 --- /dev/null +++ b/RELEASE_NOTES.md @@ -0,0 +1,3 @@ +0.5 +--- +Initial beta release diff --git a/appIcon.png b/appIcon.png new file mode 100644 index 0000000..dec216d Binary files /dev/null and b/appIcon.png differ diff --git a/config/jmx.xml b/config/jmx.xml index dc8b8e3..cb08ebd 100644 --- a/config/jmx.xml +++ b/config/jmx.xml @@ -11,7 +11,7 @@ --> - + diff --git a/config/splunkagent.properties b/config/splunkagent.properties index 95b2d8d..4dcb2ab 100644 --- a/config/splunkagent.properties +++ b/config/splunkagent.properties @@ -4,9 +4,9 @@ # Common Agent options #--------------------- -agent.app.name=MyTestApp -agent.app.instance=MyJVM -agent.userEventTags=key1=value1,key2=value2 +agent.app.name=myapp +agent.app.instance=myjvm +#agent.userEventTags=key1=value1,key2=value2 #------------------------- # Splunk Transport options @@ -14,7 +14,7 @@ agent.userEventTags=key1=value1,key2=value2 #splunk.transport.internalQueueSize=10000 splunk.transport.impl=com.splunk.javaagent.transport.SplunkTCPTransport #splunk.transport.impl=com.splunk.javaagent.transport.SplunkStdOutTransport -splunk.transport.tcp.host=your-splunk-server +splunk.transport.tcp.host=splunkhost splunk.transport.tcp.port=5150 splunk.transport.tcp.maxQueueSize=5MB splunk.transport.tcp.dropEventsOnQueueFull=false @@ -22,13 +22,14 @@ splunk.transport.tcp.dropEventsOnQueueFull=false #----------------------------------- # Class/Method/Error Tracing options #----------------------------------- -#trace.whitelist=com/some/package/you/want/to/monitor +trace.whitelist=com/some/package/you/want/to/monitor trace.blacklist=com/sun,sun/,java/,javax/,com/splunk/javaagent/ trace.methodEntered=true trace.methodExited=true trace.classLoaded=true trace.errors=true + #------------------------------ # HPROF Dump Collection options #------------------------------ @@ -86,10 +87,10 @@ trace.hprof.frequency=600 #-------------------------------------------------------- #Embedded JMX polling , all other JMX config is in the JMX XML configuration file. -trace.jmx=false +trace.jmx=true #name of XML files(minus the ".xml" suffix) that should reside in the root of splunkagent.jar trace.jmx.configfiles=jmx #trace.jmx.configfiles=goo,foo #in seconds -trace.jmx.default.frequency=60 +trace.jmx.default.frequency=20 #trace.jmx.goo.frequency=30 \ No newline at end of file diff --git a/releases/splunkagent.tar.gz b/releases/splunkagent.tar.gz index 885568d..2f62072 100644 Binary files a/releases/splunkagent.tar.gz and b/releases/splunkagent.tar.gz differ diff --git a/src/com/splunk/javaagent/SplunkJavaAgent.java b/src/com/splunk/javaagent/SplunkJavaAgent.java index c8fec7a..f285005 100644 --- a/src/com/splunk/javaagent/SplunkJavaAgent.java +++ b/src/com/splunk/javaagent/SplunkJavaAgent.java @@ -536,15 +536,15 @@ public static void methodEntered(String className, String methodName, event.addPair("methodDesc", desc); event.addPair("threadID", Thread.currentThread().getId()); event.addPair("threadName", Thread.currentThread().getName()); - + try { StackTraceElement ste = Thread.currentThread().getStackTrace()[3]; - if(ste != null) - event.addPair("lineNumber", ste.getLineNumber()); - event.addPair("sourceFileName", ste.getFileName()); + if (ste != null) + event.addPair("lineNumber", ste.getLineNumber()); + event.addPair("sourceFileName", ste.getFileName()); } catch (Exception e1) { } - + addUserTags(event); try { agent.eventQueue.put(event); diff --git a/src/com/splunk/javaagent/jmx/ProcessServerThread.java b/src/com/splunk/javaagent/jmx/ProcessServerThread.java index e208ad1..be62ef7 100644 --- a/src/com/splunk/javaagent/jmx/ProcessServerThread.java +++ b/src/com/splunk/javaagent/jmx/ProcessServerThread.java @@ -11,9 +11,11 @@ import javax.management.NotificationFilter; import javax.management.ObjectInstance; import javax.management.ObjectName; -import javax.management.openmbean.CompositeDataSupport; +import javax.management.openmbean.CompositeData; + import javax.management.openmbean.CompositeType; -import javax.management.openmbean.TabularDataSupport; +import javax.management.openmbean.TabularData; + import com.splunk.javaagent.SplunkLogEvent; import com.splunk.javaagent.jmx.config.Attribute; @@ -136,9 +138,10 @@ public void run() { .getOutputname(); if (outputname != null && !outputname.isEmpty()) - mBeanAttributes.put( - operation.getOutputname(), - resolveObjectToString(result)); + //mBeanAttributes.put(operation + //.getOutputname(), + //resolveObjectToString(result)); + extractAttributeValue(result,mBeanAttributes,operation.getOutputname()); } catch (Exception e) { // logger.error("Error : " + @@ -178,7 +181,7 @@ else if (bean.getAttributes() != null) { // if the attribute pattern is multi level, loop // through the levels until the value is found for (String token : tokens) { - + // get root attribute object the first time if (attributeValue == null) { try { @@ -191,22 +194,25 @@ else if (bean.getAttributes() != null) { // logger.error("Error : " // + e.getMessage()); } - } else if (attributeValue instanceof CompositeDataSupport) { + } else if (attributeValue instanceof CompositeData) { try { - - attributeValue = ((CompositeDataSupport) attributeValue) + + attributeValue = ((CompositeData) attributeValue) .get(token); + + } catch (Exception e) { + e.printStackTrace(); // logger.error("Error : " // + e.getMessage()); } - } else if (attributeValue instanceof TabularDataSupport) { + } else if (attributeValue instanceof TabularData) { try { Object[] key = { token }; - attributeValue = ((TabularDataSupport) attributeValue) + attributeValue = ((TabularData) attributeValue) .get(key); } catch (Exception e) { @@ -214,11 +220,12 @@ else if (bean.getAttributes() != null) { // logger.error("Error : " // + e.getMessage()); } - } else { - + } + else { + } } - + mBeanAttributes.put(singular.getOutputname(), resolveObjectToString(attributeValue)); @@ -297,10 +304,10 @@ private void extractAttributeValue(Object attributeValue, // logger.error("Error : " + e.getMessage()); } - } else if (attributeValue instanceof CompositeDataSupport) { + } else if (attributeValue instanceof CompositeData) { try { - CompositeDataSupport cds = ((CompositeDataSupport) attributeValue); + CompositeData cds = ((CompositeData) attributeValue); CompositeType ct = cds.getCompositeType(); Set keys = ct.keySet(); @@ -314,10 +321,10 @@ private void extractAttributeValue(Object attributeValue, // logger.error("Error : " + e.getMessage()); } - } else if (attributeValue instanceof TabularDataSupport) { + } else if (attributeValue instanceof TabularData) { try { - TabularDataSupport tds = ((TabularDataSupport) attributeValue); - Set keys = tds.keySet(); + TabularData tds = ((TabularData) attributeValue); + Set keys = tds.keySet(); for (Object key : keys) { Object keyName = ((List) key).get(0);