jmx

List all the user in weblogic by java

≡放荡痞女 提交于 2019-12-06 10:37:38
问题 Does anyone know how to list all the weblogic users in java? For instance, there is 5 users in security realm, and I want to get all of them. How do I do? 回答1: It's pretty easy. For future reference, if you want to look up something like "how do I do X with weblogic and Java..." use JMX in your google search. Here is an example from weblogic wonders. Note you will need to change your URL and user/password in the code: import javax.naming.*; import javax.management.MBeanInfo; import weblogic

Questions on JMX Example

删除回忆录丶 提交于 2019-12-06 09:32:26
I have written sample JMX MBean "PoolMBean" based on my uderstanding of MBeans. I have written this to manage and monitor the connection pool. My question here is, is this the way Mbeans are written? Are there any issues in this Mbean code not related to connection pool? 1) What kind of objects can an Mbean method return? package pool; import java.util.Date; public class Connection { public Date createdAt; protected int usedCount; protected boolean isAvailable = true; public Connection newConnection(){ Connection con= null; /** * Code for creating Connection */ return con; } public void

Kafka consumer lag through JMX

安稳与你 提交于 2019-12-06 09:22:38
I'm trying to monitor the lag of a consumer group in Kafka 0.10. Our consumers are keeping track of their offsets in Kafka rather than ZooKeper. This means I can get the figures using the following: bin/kafka-consumer-groups.sh --bootstrap-server <broker> --describe --group <group-name> This works fine. However, my broker already makes use of the Prometheus JMX exporter for collecting a number of stats. I've connected JConsole to the brokers but can't see the same data being reported in JMX as reported by kafka-consumer-groups.sh . Is there anyway to get this information from Kafka with JMX

how to modify ThreadPoolTaskExecutor at runtime through jmx

风格不统一 提交于 2019-12-06 09:19:19
问题 I'm having trouble modifying my MBean properties through JConsole. I have a Threading bean which invoked with: public static void main(String[] args) throws Exception { // JMX new SimpleJmxAgent(); // spring executor context ApplicationContext ctx = new FileSystemXmlApplicationContext( "src/resources/ThreadContent.xml"); startThreads(ctx); } private static void startThreads(ApplicationContext ctx) { TaskExecutor tE = (TaskExecutor) ctx.getBean("TaskExecutor"); System.out.println("Starting

How to get the name of JMX Jmeter filename in a variable

戏子无情 提交于 2019-12-06 07:01:47
I want to use the name of the jmeter test script (.jmx) in a listener so as to generate the result file in a dynamic way. Can you please tell me what is the Jmeter variable for that purpose? Used ${fileName} which didn't work The variable that holds the test plan name is ${__TestPlanName} Ref: http://jmeter.apache.org/usermanual/functions.html#__TestPlanName You can do it via Beanshell scripting like: GUI mode import org.apache.jmeter.gui.GuiPackage; String scriptName = GuiPackage.getInstance().getTestPlanFile(); vars.put("scriptName", scriptName); non-GUI mode import org.apache.jmeter

How do I monitor Tomcat6 with JVisualvm in Ubuntu Linux?

倾然丶 夕夏残阳落幕 提交于 2019-12-06 06:03:28
问题 I'm trying to set up JVisualVm to monitor a Tomcat 6 instance (running on Ubuntu Server 10.04 LTS). I've seen other questions, but none of them directly answer my problem. I try to connect to Tomcat with JVisualvm and it comes back with a "Cannot connect" error - but there are TCP connections being made to the server; the server drops the connection after a short burst of traffic. I have already added this to /etc/default/tomcat6 and restarted tomcat6 # This enables JMX in order to permit

Which API does Java's jps tool use internally?

本小妞迷上赌 提交于 2019-12-06 04:48:43
问题 I need to recreate the functionalities of the jps tool programmatically. I need to find out all Java running processes along with their id so I can attach to that process (similar to what JConsole does). I thought the VirtualMachine API would help, but did not get expected result when I run the following public class ProcessList { public static void main(String[] args){ List<VirtualMachineDescriptor> vms = VirtualMachine.list(); for(VirtualMachineDescriptor vm : vms){ System.out.println (vm

Access tomcat running in docker container by JMX

孤街浪徒 提交于 2019-12-06 04:02:56
问题 I want to get tomcat's performance by JMX. Tomcat version is 7 and Java version is 1.7.0_79. Tomcat runs on the docker's container. The port mapping has set up by the following. docker run -itd -p 18080:8080 -p 19998:19998 -p 62911:62911 sad_jang2 bash In the tomcat container, setevn.sh was created in the path, /tomcat_home/bin/ with the following content. export JAVA_OPTS=" -Xdebug -Xrunjdwp:transport=dt_socket,address=62911,server=y,suspend=n -Dcom.sun.management.jmxremote -Dcom.sun

How to add description for MBean method to see it in jmx-console of JBOSS

你离开我真会死。 提交于 2019-12-06 03:59:34
问题 I'm using JBoss 4.3.2.GA I've added method to my MBean service. Method has several arguments in signature. It works fine but I want more. Problem: when I see method signature in jmx-console, I don't know what every of this input fields means, because jmx-console doesn't show arguments names, only input fields for values. Is there ability add description of every argument (in Java code, not xml) allowing to show this description in jmx-console of JBOSS? I've tried to use Spring annotation:

running Hibernate 4.3 with JMX (without spring)

徘徊边缘 提交于 2019-12-06 03:53:53
问题 I'm running a java webapp (wicket 6.13) using Hibernate 4.3 and Guice 1.0 I'm trying to configure Hibernate so that I can access runtime information via the JMX framework. I'm not using spring, can anyone indicate how I enable the JMX on hibernate 4.3 manually. I've poked around the JmxService, JmxServiceInitiator, JmxServiceImpl, StandardServiceRegistryImpl I've also found the following settings in AvailableSettings: "hibernate.jmx.enabled"; "hibernate.jmx.usePlatformServer"; "hibernate.jmx