Monitoring with JBOSS 7.1 JMX in ZABBIX agent windows - windows

I have a problem when i try connect my zabbix server with JBoss 7.1, the error is:
Failed to retrieve RMIServer stub: javax.naming.ServiceUnavailableException [Root exception is java.rmi.
I think the fault is in the client configuration, the agent run in windows, some know what command I need to use for change the port in run.conf.
thanks for your time.

The first thing to do is to note that in order to monitor JBoss through JMX you do not need to have Zabbix agent running. Instead, you should run Zabbix Java gateway (see also section on JMX monitoring).
However, as of Zabbix 2.2.5, the gateway only supports JMX service URLs of the following type:
service:jmx:rmi:///jndi/rmi://{CONN}:{PORT}/jmxrmi
whereas JBoss seems to be monitored using URLs of type
service:jmx:remoting-jmx://{CONN}:{PORT}
Consequently, JBoss monitoring with Zabbix is currently not possible out of the box, but you can use patches and ideas described in ZBXNEXT-1274.

Related

Spring boot microservices doesn't work with Intelij IDEA

I am creating a spring boot microservice project with intelij IDEA.
Currently I have developed three seperate spring boot rest services as customer service, vehicle service and spring cloud config server. Spring cloud config server is pointing to a github repository.
The issue is sometimes above projects take more than 10 minutes to run and sometimes does't run and give an error message as "failed to check application readystate intellij attached provider for the vm is not found". I have no idea why this happens ?
There are two possible causes:
1. IntelliJ IDEA and the Spring application are running in different JVMs.
There is a bug for IntelliJ IDEA regarding that:
https://youtrack.jetbrains.com/issue/IDEA-210665
Here is short summary:
IntelliJ IDEA uses local JMX connector for retrieving Spring Boot actuator endpoint's data by default. However, it could be impossible to get local JMX connector address via attach api if Spring Boot application and IntelliJ IDEA are run by different JVMs. In this case, add the following lines to VM options of your Spring Boot run configuration:
-Dcom.sun.management.jmxremote.port={some_port}
-Dcom.sun.management.jmxremote.authenticate=false
-Dcom.sun.management.jmxremote.ssl=false
As mentioned in the official Oracle documentation, this configuration is insecure. Any remote user who knows (or guesses) your port number and host name will be able to monitor and control your Java applications and platform.
2. Prolonged time to retrieve local hostname
You can check that time using inetTester. Normally it should take only several milliseconds to complete. If it takes a long time then you can add the hostname returned by inetTester to /etc/hosts file like this:
127.0.0.1 localhost winsky
::1 localhost winsky

Java Apm agent with multiple tomcats

How to configure multiple tomcats running on same machine to Apm server ? With single tomcat I m able to start APMUI.
Just to be sure we are on the same page here:
You have multiple instances of Tomcat running on the same machine.
You have configured APM through CATALINA_OPTS as defined in the Elastic APM docs.
I guess the simplest setup would be to have a wrapper script to start each Tomcat instance that exports the right CATALINA_OPTS. You could share global settings like the APM server address, but could customize the app name, namespaces,...

How to make an application like JConsole?

I want to make an application like JConsole. Is it possible? If yes, what are the changes need to done at JVM level? I am planning to use Spring-Boot. As per my knowledge, JMX is enabled by default. Do I need to configure anything extra in my Spring-Boot app in order to access the JMXBeans which are exposed by default?
Here I'm not trying to expose any MBean instead I'm trying to access those beans which are already exposed by JVM. How to achieve it?
JConsole is a JMX compliant monitoring and management application. The architecture is quite simple. It's a client-server architecture. Where the client is the Remote application (Example JConsole or the one that you want to build) and the server is the JMX Agent. In your case, you want to build your own client which is possible.
I want to make an application like JConsole. Is it possible?
Yes, it is possible.
If yes, what are the changes need to done at JVM level?
What do you mean by changes at JVM level? You are simply creating a client application that connects to the server (JMX Agent) using a certain protocol. Remote Method Invocation (RMI) is the protocol used by JConsole for the connection to the JMX Agent. If you want to use RMI for communication, you don't have to do anything on the server side. But if you want to use some other protocol for communication, you can define your own Protocol adapter.
As per my knowledge, JMX is enabled by default.
As of Java SE 6 it is. But you can only monitor it locally. For connection from a remote machine, you need to define an RMI port to start listening for incoming connections.
Here I'm not trying to expose any MBean instead I'm trying to access those beans which are already exposed by JVM. How to achieve it?
Please check out the example from this link - Mimicking Out-of-the-Box Management Using the JMX Remote API. It shows you how to create a simple client application that connects to a remote JMX agent and access the MBeans. This should guide you in the right direction.

Spring Boot with Elasticsearch embedded conflicting on port 54022

I'm trying to start two spring-boot (1.3.2.RELEASE) app instances on my dev machine. The app uses elasticsearch embedded (1.5.2) through spring data elasticsearch (1.3.2.RELEASE).
I configured instances to use different ports (-Dserver.port=8081), and this works well for my other app without elasticsearch.
So, my first instance starts normally, with second instance start I'm getting
Error: Exception thrown by the agent : java.rmi.server.ExportException: Port already in use: 54022; nested exception is:
java.net.BindException: Address already in use
I've tried to get more info from the logs, but it didn't help.
logging.level.org.elasticsearch=TRACE
I even tried
logging.level.root=TRACE
No mention about the port 54022. Google doesn't help much either.
Update: I start my instances in STS. When shutting down the instance (red square button in the console view) I see that STS connects to 54022 port. Maybe it's some kind of shutdown port?
andrey:~$ lsof -i tcp:54022
STS 447 andrey 36u IPv6 0xf4ba94cfea1e25e5 0t0 TCP localhost:49424->localhost:54022 (CLOSE_WAIT)
This problem is specific to STS IDE (Spring Tool Suite). This is not reproducible if you run the app from console.
54022 is JMX Port by STS.
To solve the issue go to Run > Run Configurations... > Spring Boot App > <your_run_config> > Spring Boot (Tab).
Toggle Enable Live Bean support or change the JMX Port.

Spring integration monitor multiple jvm using same connection

I can monitor individual SPRING INTEGRATION applications via visualvm changing the command line parameters when starting the JVM (-Dcom.sun.....)
My application has components in multiple jvm's, each of which i can name.
I would like my operational console to connect per server to one JMX service via one port. Then as I add JVM's(services) they are discoverable by the operational console(lets assume its visualvm) by name.
Any help is greatly appreciated
Take a look at Jolokia I believe a single client can connect to multiple agents (you install a jolokia agent on each JVM).

Resources