Console-based JVM monitoring tool

Overview

Tests Homebrew Release

jvm-mon

Console based JVM monitoring - when you just want to SSH into a server and see what's going on.

jvm-top lets you monitor your JVM server applications from the terminal.

Screenshot

New Version

Release: 1.0-ea1

  • Rewritten in Go
  • Single executable file
  • Can monitor applications on Java 8 and above
  • Does not require an existing JDK

How it works:

  • jvm-mon executable comes bundled with a Java agent jar
  • On startup it extracts the agent to a temp directory
  • It attaches to the JVM you want to monitor
  • Loads agent into running JVM to collect metrics
  • Agent and app establish a socket connection to send metrics

Install

Requirement: a JDK8 on the server and JAVA_HOME environment variable pointing to it. It won't work with just a JRE.

MacOS

brew install jvm-mon

Linux/MacOS

  1. Download the release and extract
  2. Set JAVA_HOME environment variable: export JAVA_HOME=/path/to/your/jdk8
  3. Execute ./bin/jvm-mon from extracted directory

Usage

  • Select a JVM process and press Enter to monitor it
  • Press q or Ctrl+C to exit
  • Press Del or Backspace to kill a process

What is available

Currently it shows:

  • List of running JVM processes
  • Cpu and GC load
  • Heap size and usage
  • Top threads with cpu usage

Building from source

To build locally run ./gradlew installDist. Then go to ./build/install/jvm-mon/ and run ./bin/jvm-mon.

To develop you will need npm on your machine and then run ./gradlew npmDeps once to get dependencies.

How does it work?

jvm-mon is a Kotlin application based on these awesome libraries:

  • blessed-contrib terminal dashboard library in JavaScript
  • J2V8 Java Bindings for V8 JavaScript engine and Node.js
  • jvmtop Java monitoring for the command-line

The way it works is:

  1. The Kotlin app starts a Node.js engine in-process
  2. Node.js loads a script with all the widgets
  3. The script calls back into Kotlin to get metrics
Issues
  • UnsatisfiedLinkError: Could not load J2V8 library. Reasons: no j2v8_linux_x86_64 in java.library.path

    UnsatisfiedLinkError: Could not load J2V8 library. Reasons: no j2v8_linux_x86_64 in java.library.path

    Executing from a VM, unzipped package, CentOS 6

    Java HotSpot(TM) 64-Bit Server VM warning: You have loaded library /home/rss/libj2v8_linux_x86_64.so which might have disabled stack guard. The VM will try to fix the stack guard now.
    It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
    Exception in thread "main" java.lang.ExceptionInInitializerError
    Caused by: java.lang.IllegalStateException: J2V8 native library not loaded
    	at com.eclipsesource.v8.V8.checkNativeLibraryLoaded(V8.java:195)
    	at com.eclipsesource.v8.V8.createV8Runtime(V8.java:149)
    	at com.eclipsesource.v8.V8.createV8Runtime(V8.java:125)
    	at com.eclipsesource.v8.NodeJS.createNodeJS(NodeJS.java:58)
    	at com.eclipsesource.v8.NodeJS.createNodeJS(NodeJS.java:45)
    	at JvmMon.<clinit>(JvmMon.java:12)
    Caused by: java.lang.UnsatisfiedLinkError: Could not load J2V8 library. Reasons:
    	no j2v8_linux_x86_64 in java.library.path
    	/home/rss/libj2v8_linux_x86_64.so: /usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.15' not found (required by /home/rss/libj2v8_linux_x86_64.so)
    
    	at com.eclipsesource.v8.LibraryLoader.loadLibrary(LibraryLoader.java:75)
    	at com.eclipsesource.v8.V8.load(V8.java:71)
    	at com.eclipsesource.v8.V8.createV8Runtime(V8.java:145)
    	... 4 more
    
    opened by trumpetx 10
  • Make available through homebrew

    Make available through homebrew

    Would be great if it would be possible to distribute it using homebrew

    opened by johanhaleby 9
  • Package using capsule

    Package using capsule

    To produce a single executable jar http://www.capsule.io

    or maybe Packr https://github.com/libgdx/packr

    opened by ajermakovics 6
  • ClassNotFoundException on MacOS/Java 8

    ClassNotFoundException on MacOS/Java 8

    When I try to run a build of HEAD, I get the following:

    $ bin/jvm-mon
    Exception in thread "main" java.lang.NoClassDefFoundError: sun/jvmstat/monitor/MonitorException
    	at com.jvmtop.view.VMOverviewView.scanForNewVMs(VMOverviewView.java:157)
    	at JvmMon.update(JvmMon.java:38)
    	at JvmMon.main(JvmMon.java:22)
    Caused by: java.lang.ClassNotFoundException: sun.jvmstat.monitor.MonitorException
    	at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
    	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    	... 3 more
    
    $ java -version
    java version "1.8.0_91"
    Java(TM) SE Runtime Environment (build 1.8.0_91-b14)
    Java HotSpot(TM) 64-Bit Server VM (build 25.91-b14, mixed mode)
    
    $ uname -a
    Darwin somehost.local 15.6.0 Darwin Kernel Version 15.6.0: Mon Jan  9 23:07:29 PST 2017; root:xnu-3248.60.11.2.1~1/RELEASE_X86_64 x86_64
    
    opened by fs111 6
  • Display Java processes being run by other users on a box

    Display Java processes being run by other users on a box

    I like the idea of jvm-mon, but it would be really useful if it displayed/monitored all the java processes running on a box (irrespective of user). If I run jvm-mon as root on my machine (Fedora 23) I would expect to be able to see all java processes running (they are available via jps), but this isn't the case.

    opened by tom-smalls 5
  • Doesn't work when not run from within the exploded zip/tar

    Doesn't work when not run from within the exploded zip/tar

    $ opt/jvm-mon-0.1/bin/jvm-mon
    objc[39393]: Class JavaLaunchHelper is implemented in both /Users/dnw/.jenv/versions/1.8/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.
    
    node.js:376
            callback();
            ^
    module.js:341: Error: Cannot find module '/Users/dnw/opt/jvm-mon-0.1/bin/src/dist/jvm-mon.js'
    
    $ cd opt/jvm-mon-0.1
    $ bin/jvm-mon
    objc[39418]: Class JavaLaunchHelper is implemented in both /Users/dnw/.jenv/versions/1.8/bin/java and /Library/Java/JavaVirtualMachines/jdk1.8.0_112.jdk/Contents/Home/jre/lib/libinstrument.dylib. One of the two will be used. Which one is undefined.~
    $ # that worked
    
    opened by dwijnand 4
  • Windows build

    Windows build

    Should be a matter of adding the right J2V8 dependency

    opened by ajermakovics 3
  • Find and load tools.jar from java code

    Find and load tools.jar from java code

    To avoid setting JAVA_HOME env var before launching

    Perhaps using javax.tools.ToolProvider.getSystemToolClassLoader() http://docs.oracle.com/javase/7/docs/api/javax/tools/ToolProvider.html#getSystemToolClassLoader()

    opened by ajermakovics 3
  • Would like to be able to kill java process

    Would like to be able to kill java process

    I would like to be able to kill a java process from the monitor.

    opened by ctwise 2
  • Cannot find module jvm-mon.js on Ubuntu 16.04

    Cannot find module jvm-mon.js on Ubuntu 16.04

    Hey,

    I downloaded your tar, extracted it, did the configuration for Java, and when I executed jvm-mon, here is the error I got :

    OpenJDK 64-Bit Server VM warning: You have loaded library /home/tristan/libj2v8_linux_x86_64.so which might have disabled stack guard. The VM will try to fix the stack guard now.
    It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
    
    node.js:376
            callback();
            ^
    module.js:341: Error: Cannot find module '/home/tristan/Téléchargements/jvm-mon-0.1/bin/src/dist/jvm-mon.js'
    
    opened by Kaijiro 2
  • Chart stops updating after running for a long time

    Chart stops updating after running for a long time

    Once memory and cpu chart reaches end it stops updating.

    Workaround: switch to another process and back

    bug 
    opened by ajermakovics 0
  • Refresh list of JVMs

    Refresh list of JVMs

    So that newly started processes also appear in the list and exited processes disappear. Atm it only shows processes that were already running.

    opened by ajermakovics 0
  • Calculating values for heap usage for plotting the graph

    Calculating values for heap usage for plotting the graph

    How can I get plotted values of heap usage graph in text file ( possibly comma separated ) ? Also, I couldn't understand how exactly are you getting/calculating those values for plotting ? Can you please tell this approach, that would be more beneficial for me. Thanks in advance, means a lot.

    opened by AshwatKumar 3
  • Calculate GC usage

    Calculate GC usage

    In the new Go version

    opened by ajermakovics 0
  • Try with Termdash

    Try with Termdash

    https://github.com/mum4k/termdash

    It has some nice features like zooming into a chart.

    opened by ajermakovics 0
  • support jdk 11

    support jdk 11

    It's a cool tool, any shedule to support jdk 11?

    jvm-mon-js 
    opened by changuoqiang 2
  • ConnectIOException at startup

    ConnectIOException at startup

    This maybe a little weird but it's really happening and I don't realize why.

    Just launching bin/jvm-mon with:

    • jvm-mon version 0.3
    • java version "1.8.0_171" Java(TM) SE Runtime Environment (build 1.8.0_171-b11) Java HotSpot(TM) 64-Bit Server VM (build 25.171-b11, mixed mode)
    • Linux localhost 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
    • Ubuntu 14.04 LTS
    java.rmi.ConnectIOException: Exception creating connection to: 192.168.0.150; nested exception is:
    	java.net.NoRouteToHostException: No route to host (Host unreachable)
    	at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:631)
    	at sun.rmi.transport.tcp.TCPChannel.createConnection(TCPChannel.java:216)
    	at sun.rmi.transport.tcp.TCPChannel.newConnection(TCPChannel.java:202)
    	at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:129)
    	at java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(RemoteObjectInvocationHandler.java:227)
    	at java.rmi.server.RemoteObjectInvocationHandler.invoke(RemoteObjectInvocationHandler.java:179)
    	at com.sun.proxy.$Proxy0.newClient(Unknown Source)
    	at javax.management.remote.rmi.RMIConnector.getConnection(RMIConnector.java:2430)
    	at javax.management.remote.rmi.RMIConnector.connect(RMIConnector.java:308)
    	at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:270)
    	at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:229)
    	at com.jvmtop.openjdk.tools.ProxyClient.tryConnect(ProxyClient.java:392)
    	at com.jvmtop.openjdk.tools.ProxyClient.connect(ProxyClient.java:354)
    	at com.jvmtop.monitor.VMInfo.attachToVM(VMInfo.java:219)
    	at com.jvmtop.monitor.VMInfo.processNewVM(VMInfo.java:186)
    	at com.jvmtop.view.VMOverviewView.scanForNewVMs(VMOverviewView.java:176)
    	at JvmMon.update(JvmMon.java:50)
    	at JvmMon.<init>(JvmMon.java:45)
    	at JvmMon.main(JvmMon.java:27)
    Caused by: java.net.NoRouteToHostException: No route to host (Host unreachable)
    	at java.net.PlainSocketImpl.socketConnect(Native Method)
    	at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
    	at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
    	at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
    	at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
    	at java.net.Socket.connect(Socket.java:589)
    	at java.net.Socket.connect(Socket.java:538)
    	at java.net.Socket.<init>(Socket.java:434)
    	at java.net.Socket.<init>(Socket.java:211)
    	at sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(RMIDirectSocketFactory.java:40)
    	at sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(RMIMasterSocketFactory.java:148)
    	at sun.rmi.transport.tcp.TCPEndpoint.newSocket(TCPEndpoint.java:613)
    	... 18 more
    

    Interfaces Ip addr:

    ip a
    1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default
        link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
        inet 127.0.0.1/8 scope host lo
           valid_lft forever preferred_lft forever
        inet6 ::1/128 scope host
           valid_lft forever preferred_lft forever
    2: em1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
        link/ether f4:03:43:57:41:6c brd ff:ff:ff:ff:ff:ff
        inet 192.168.0.200/24 brd 192.168.0.255 scope global em1
           valid_lft forever preferred_lft forever
        inet6 fe80::f603:43ff:fe57:416c/64 scope link
           valid_lft forever preferred_lft forever
    3: em2: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
        link/ether f4:03:43:57:41:6d brd ff:ff:ff:ff:ff:ff
    4: em3: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
        link/ether f4:03:43:57:41:6e brd ff:ff:ff:ff:ff:ff
    5: em4: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
        link/ether f4:03:43:57:41:6f brd ff:ff:ff:ff:ff:ff
    

    Kernel IP routing table

    Kernel IP routing table
    Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
    0.0.0.0         192.168.0.1     0.0.0.0         UG        0 0          0 em1
    192.168.0.0     0.0.0.0         255.255.255.0   U         0 0          0 em1
    
    opened by perrefe 1
  • stack guard warning and IOException when starting

    stack guard warning and IOException when starting

    I'm unable to start the application due to some IOException. There's also warnings related to stack guard:

    bin/jvm-mon
    OpenJDK 64-Bit Server VM warning: You have loaded library /home/minecraft/jvm-mon-0.3/libj2v8_linux_x86_64.so which might have disabled stack guard. The VM will try to fix the stack guard now.
    It's highly recommended that you fix the library with 'execstack -c <libfile>', or link it with '-z noexecstack'.
    java.io.IOException: well-known file is not secure
            at sun.tools.attach.LinuxVirtualMachine.checkPermissions(Native Method)
            at sun.tools.attach.LinuxVirtualMachine.<init>(LinuxVirtualMachine.java:117)
            at sun.tools.attach.LinuxAttachProvider.attachVirtualMachine(LinuxAttachProvider.java:63)
            at com.sun.tools.attach.VirtualMachine.attach(VirtualMachine.java:208)
            at com.jvmtop.openjdk.tools.LocalVirtualMachine.loadManagementAgent(LocalVirtualMachine.java:341)
            at com.jvmtop.openjdk.tools.LocalVirtualMachine.startManagementAgent(LocalVirtualMachine.java:141)
            at com.jvmtop.openjdk.tools.ProxyClient.tryConnect(ProxyClient.java:372)
            at com.jvmtop.openjdk.tools.ProxyClient.connect(ProxyClient.java:354)
            at com.jvmtop.monitor.VMInfo.attachToVM(VMInfo.java:219)
            at com.jvmtop.monitor.VMInfo.processNewVM(VMInfo.java:186)
            at com.jvmtop.view.VMOverviewView.scanForNewVMs(VMOverviewView.java:176)
            at JvmMon.update(JvmMon.java:50)
            at JvmMon.<init>(JvmMon.java:45)
            at JvmMon.main(JvmMon.java:27)
    

    This is on CentOS Linux release 7.4.1708 (Core) with openjdk version "1.8.0_161" OpenJDK Runtime Environment (build 1.8.0_161-b14) OpenJDK 64-Bit Server VM (build 25.161-b14, mixed mode)

    jvm-mon-js 
    opened by LemADEC 3
  • Support remote host JVM monitoring

    Support remote host JVM monitoring

    Hello, very nice console app! Is there a way to monitor remote JVM, i.e over JMX? I have jvm apps on remote but with JRE only and cant install JDK there

    opened by CorrectHorseBatteryStapple 1
  • IOException

    IOException

    Hi, i have IOException when profiling my app. Look at screen. https://ibb.co/hgMx4x

    opened by AlexPitigin 2
Releases(1.0-ea1)
Integrated console application library, using Go structs as commands, with menus, completions, hints, history, Vim mode, $EDITOR usage, and more ...

Gonsole - Integrated Console Application library This package rests on a readline console library, (giving advanced completion, hint, input and histor

null 12 Jun 28, 2021
pgCenter is a command-line admin tool for observing and troubleshooting Postgres.

Command-line admin tool for observing and troubleshooting Postgres.

Lesovsky Alexey 1.3k Jul 22, 2021
Tool for shell commands execution, visualization and alerting. Configured with a simple YAML file.

Sampler. Visualization for any shell command. Sampler is a tool for shell commands execution, visualization and alerting. Configured with a simple YAM

Alexander Lukyanchikov 9k Jul 26, 2021
🎨 Terminal color rendering library, support 8/16 colors, 256 colors, RGB color rendering output, support Print/Sprintf methods, compatible with Windows.

?? Terminal color rendering library, support 8/16 colors, 256 colors, RGB color rendering output, support Print/Sprintf methods, compatible with Windows. GO CLI 控制台颜色渲染工具库,支持16色,256色,RGB色彩渲染输出,使用类似于 Print/Sprintf,兼容并支持 Windows 环境的色彩渲染

Gookit 876 Jul 23, 2021
Make Highly Customized Boxes for your CLI

Box CLI Maker ?? Box CLI Maker is a Highly Customized Terminal Box Creator. Features Make Terminal Box in 8️⃣ inbuilt different styles 16 Inbuilt Colo

Swastik Baranwal 138 Jul 18, 2021
oc CLI plugin to interact with Helm features provided by the OpenShift Console

OpenShift provides support for managing the lifecycle of Helm charts. This capability is limited primarily to the Web Console. This plugin enables the management of Helm charts similar to using the standalone Helm CLI while offloading much of the work to OpenShift.

Andrew Block 16 Jun 14, 2021
A command-line tool and library for generating regular expressions from user-provided test cases

Table of Contents What does this tool do? Do I still need to learn to write regexes then? Current features How to install? 4.1 The command-line tool 4

Peter M. Stahl 4.2k Jul 23, 2021
Simplistic interactive filtering tool

peco Simplistic interactive filtering tool NOTE: If you are viewing this on GitHub, this document refers to the state of peco in whatever current bran

null 6.5k Jul 16, 2021
a TUI for signal messenger, written in Go

siggo A terminal ui for signal-cli, written in Go. Features vim-style ux useful for quick messages or use $EDITOR to compose fancy ones emoji support,

Derric Williams 252 Jul 8, 2021
git-xargs is a command-line tool (CLI) for making updates across multiple Github repositories with a single command.

Table of contents Introduction Reference Contributing Introduction Overview git-xargs is a command-line tool (CLI) for making updates across multiple

Gruntwork 447 Jul 16, 2021
Source code editor in pure Go.

Editor Source code editor in pure Go. About This is a simple but advanced source code editor As the editor is being developed, the rules of how the UI

Jorge Miguel Pinto 226 Jun 29, 2021
A goroutine monitor to keep track of active routines from within your favorite shell.

roumon A goroutine monitor to keep track of active routines from within your favorite shell. Features Track live state of all active goroutines Termin

Armin Becher 59 Jul 19, 2021
Lux is a command-line interface for controlling and monitoring Govee lighting strips built in Go.

What is Lux? Lux is a command-line interface for controlling and monitoring Govee lighting strips built in Go. Lux provides it's users with the abilit

BanDev 28 Jun 24, 2021
Golang library with POSIX-compliant command-line UI (CLI) and Hierarchical-configuration. Better substitute for stdlib flag.

cmdr cmdr is a POSIX-compliant, command-line UI (CLI) library in Golang. It is a getopt-like parser of command-line options, be compatible with the ge

hz 78 Jul 14, 2021