GithubHelp home page GithubHelp logo

jmxsh's People

Watchers

 avatar

jmxsh's Issues

Path always defaults to jmxrmi

The -T/--url_path option used to specify the path portion of the jmx service 
url is ineffective, default value of jmxrmi cannot be overridden.

This issue is due to a mismatch between the key name used for this option at 
definition time (using "url_path") and at retrieval time (using "path"). 

Patch attached.

Original issue reported on code.google.com by [email protected] on 9 Feb 2010 at 3:44

Attachments:

Unable to pass negative number into parameter expecting an integer

What steps will reproduce the problem?
1. expose a command who takes an integer paramete [ ie: foo(int arg0) ]
2. call [jmx_invoke -m foo.bar:name=Bam foo -1]

What is the expected output? What do you see instead?
expected: successful update of the mbean
actual: Error: Could not find operation -1

What version of the product are you using? On what operating system?
jmxsh-R5, osx 10.7.5

Please provide any additional information below.
passing in 0 or positive values works as expected. the jmx command is an 
operation, not an attribute.

Original issue reported on code.google.com by [email protected] on 11 Jul 2013 at 11:11

User guide - documentation

Hi,
can we get some documentation for this project?
I'm interested in finding out how to run this as a scriptable executable.
Thanks.

Original issue reported on code.google.com by [email protected] on 15 Aug 2008 at 7:40

getOperationsInfo returns only the first method name found

What steps will reproduce the problem?
1. jmx_invoke -m ContentApplicationEngine:type=Cache evict


What is the expected output? What do you see instead?
There are two methods with name evict:
1)void evict(String p0)
2) void evict()

Only the first method is recognized.


What version of the product are you using? On what operating system?

Java version "1.6.0_30"
Java(TM) SE Runtime Environment (build 1.6.0_30-b12)
Java HotSpot(TM) Server VM (build 20.5-b03, mixed mode)

Linux 3.2.0-24-generic-pae #39-Ubuntu SMP Mon May 21 18:54:21 UTC 2012 i686 
i686 i386 GNU/Linux


Please provide any additional information below.

In method MBeanOperationInfo getOperationInfo(String server, String mbean, 
String opname) only the first occurrence is found.

Original issue reported on code.google.com by [email protected] on 20 Jun 2012 at 11:10

Unable to list mbean attributes

I'm able to list mbeans in various domains and I'm able to get values of 
specific mbean attributes, but I'm unable to list all attributes of a given 
mbean.  Is this not supported or is there hidden syntax to do it?

Original issue reported on code.google.com by [email protected] on 18 Oct 2012 at 7:49

patch to read from standard input without interactive mode

I'm writing a Ganglia gmond python module that uses jmxsh. It was not efficient 
to constantly be writing out to a script file in order to execute commands. 
This will enable reading from standard input and returning the results of the 
commands only.

http://code.google.com/p/gmond-python-modules

Here is the module that uses jmxsh:
http://code.google.com/p/gmond-python-modules/source/browse/trunk/jmxsh.py

Index: src/jmxsh/JInterp.java
===================================================================
--- src/jmxsh/JInterp.java      (revision 25)
+++ src/jmxsh/JInterp.java      (working copy)
@@ -24,6 +24,8 @@

 import org.apache.log4j.*;
 import tcl.lang.*;
+import java.io.InputStreamReader;
+import java.io.BufferedReader;

 class JInterp extends Interp {

@@ -111,6 +113,21 @@
        }
     }

+    static void evaluateStdin() {
+       try {
+               BufferedReader br = new BufferedReader(new 
InputStreamReader(System.in));
+               String strLine;
+               while ((strLine = br.readLine()) != null) {
+                       //System.out.println(strLine);
+                       instance.eval(strLine);
+               }
+       }
+       catch (Exception e) {
+           logger.error("Tcl error while evaluating stdin.", e);
+           throw new IllegalArgumentException("Error processing stdin" + 
instance.getResult().toString());
+       }
+    }
+
     static void processTclEvents() {
        try {
            Notifier.processTclEvents(instance.getNotifier());
Index: src/jmxsh/Main.java
===================================================================
--- src/jmxsh/Main.java (revision 25)
+++ src/jmxsh/Main.java (working copy)
@@ -153,6 +153,13 @@
                 .hasArg(false)
                 .create("I")
         );
+
+        opts.addOption(
+            OptionBuilder.withLongOpt("quiet")
+                .withDescription("Quiet mode. Do not go into interactive 
mode.")
+                .hasArg(false)
+                .create("q")
+        );

         opts.addOption(
             OptionBuilder.withLongOpt("browse")
@@ -343,10 +350,24 @@
                 }
             }

-            // 5b. Otherwise, start interactive session.

-            interactive = true;
-            historyEnabled = true;
+            // Run stdinput commands
+            if (commandLine.hasOption("quiet")) {
+
+                JInterp.setGlobal("argv", scriptArgs, 1);
+                JInterp.setGlobal("argc", scriptArgs.length-1);
+
+                JInterp.evaluateStdin();
+
+               System.exit(0);
+            } else {
+
+            // 5b. Otherwise, start interactive session
+
+               interactive = true;
+               historyEnabled = true;
+                       }
+
             if (commandLine.hasOption("nohistory")) {
                 historyEnabled = false;
             }
@@ -438,7 +459,7 @@
                 System.err.println("Exception caught: " + e.getMessage());
             }
         }
-    }
+    }

 }

Original issue reported on code.google.com by [email protected] on 30 Jul 2010 at 8:25

getting Bad version number in .class file exception while running with java 1.5.0_24

What steps will reproduce the problem?
1. download the jar and jmxsh script 
2. setup java home
3. run ./jmxsh

What is the expected output? What do you see instead?
I expected to run the jar file..But i got below exception
Exception in thread "main" java.lang.UnsupportedClassVersionError: Bad version 
number in .class file
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
        at com.simontuffs.onejar.JarClassLoader.defineClass(JarClassLoader.java:693)
        at com.simontuffs.onejar.JarClassLoader.findClass(JarClassLoader.java:599)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
        at com.simontuffs.onejar.Boot.run(Boot.java:300)
        at com.simontuffs.onejar.Boot.main(Boot.java:159)


What version of the product are you using? On what operating system?
 Latest version specified here


Please provide any additional information below.
Running on java version "1.5.0_24"

Original issue reported on code.google.com by [email protected] on 31 Jan 2012 at 12:03

Shell Mode: error using mbean names containing quotes (e.g. Tomcat 7 ThreadPools)

What steps will reproduce the problem?
1. connect to a Tomcat 7 instance:
% jmx_connect -h localhost -p 1234

2. query a mbean ending with a quote:  
% jmx_get -m Catalina:type=ThreadPool,name="ajp-bio-8009" currentThreadsBusy
Error: Cannot convert result to a string.
Cannot convert result to a string.

Debug output is:
105151 [ConsoleThread] DEBUG jmxsh.ShellMode  - jmx_get -m 
Catalina:type=ThreadPool,name="ajp-bio-8009" currentThreadsBusy
105165 [main] DEBUG jmxsh.Jmx  - Getting attribute for server - 
service:jmx:rmi:///jndi/rmi://localhost:1234/jmxrmi, mbean - Catal
ina:type=ThreadPool,name="ajp-bio-8009, attribute - currentThreadsBusy
105167 [main] ERROR jmxsh.Jmx  - Error while getting attribute.
java.lang.IllegalArgumentException: Invalid object name 
'Catalina:type=ThreadPool,name="ajp-bio-8009' - Unterminated quoted value
        at jmxsh.Jmx.getObjectName(Jmx.java:198)
        at jmxsh.Jmx.getAttribute(Jmx.java:265)
        at jmxsh.GetCmd.cmdProc(GetCmd.java:164)
        at tcl.lang.Parser.evalObjv(Parser.java:826)
        at tcl.lang.Parser.eval2(Parser.java:1228)
        at tcl.lang.Interp.eval(Interp.java:2679)
        at tcl.lang.Interp.eval(Interp.java:2747)
        at tcl.lang.Interp.recordAndEval(Interp.java:2900)
        at jmxsh.ShellMode$1.processEvent(ShellMode.java:79)
        at tcl.lang.Notifier.serviceEvent(Notifier.java:457)
        at tcl.lang.Notifier.doOneEvent(Notifier.java:610)
        at tcl.lang.Notifier.processTclEvents(Notifier.java:786)
        at jmxsh.JInterp.processTclEvents(JInterp.java:116)
        at jmxsh.Main.run(Main.java:358)
        at jmxsh.Main.main(Main.java:262)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at com.simontuffs.onejar.Boot.run(Boot.java:306)
        at com.simontuffs.onejar.Boot.main(Boot.java:159)


What version of the product are you using? On what operating system?
jmxsh-R5.jar
SPARC Solaris 10
java version "1.6.0_27"
Java(TM) SE Runtime Environment (build 1.6.0_27-b07)
Java HotSpot(TM) Server VM (build 20.2-b06, mixed mode)


This will work around the problem (two terminating quotes):
% jmx_get -m Catalina:type=ThreadPool,name="ajp-bio-8009"" currentThreadsBusy
4

...or this (change the order of the key/value pairs):
% jmx_get -m Catalina:name="ajp-bio-8009",type=ThreadPool currentThreadsBusy
4

Browse Mode works just fine for these mbeans.

Original issue reported on code.google.com by [email protected] on 14 Sep 2011 at 2:24

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.