inspectIT - Check Communication between Agent and CMR
Setup inspectIT in order to diagnose problems within systems is usually quite easy. However, the Devil is in the detail. One of the pitfalls might be the communication between the agent and the CMR (Central Measurement Repository) due to closed ports. From our own experience, this is annoying because you need an additional restart of your application after you have opened the ports. The restart might hinder colleagues or in the worst case even your customers.
Fortunately, there is a simple way to verify the communication between agent and CMR without using the system to be diagnosed. The only thing you need is Java’s command -version. Simply run it with the JVM parameters which are needed to start an application with inspectIT:
java -javaagent:[PATH-TO-INSPECTIT-AGENT]/inspectit-agent.jar -Dinspectit.repository=[HOST]:[PORT] -Dinspectit.agent.name=[AgentName] -version
If the check was successful, you should see outputs like
Terminal (execution of -version command)
2017-06-23 18:10:03,209: [inspectIT] 1367 [ main] INFO nection.impl.KryoNetConnection - KryoNet: Connecting to localhost:9070
2017-06-23 18:10:03,330: [inspectIT] 1488 [ main] INFO nection.impl.KryoNetConnection - KryoNet: Connection established!
2017-06-23 18:10:03,908: [inspectIT] 2066 [ main] INFO spectit.agent.java.SpringAgent - Using agent version 184.108.40.206.
CMR Log File (stdout.log)
017-06-23 18:10:03,340: 247966 [ervice-thread-0] INFO er.service.RegistrationService - Trying to register Agent 'CommunicationCheck'
2017-06-23 18:10:03,347: 247973 [ervice-thread-0] INFO er.service.RegistrationService - Successfully registered the Agent 'CommunicationCheck' with id 3152, version 220.127.116.11 and following net
You should see the agent in either the Repository Manager or the Data Explorer.
This little trick can be used to check if the communication between agent and CMR is possible without losing too much time.
Hopefully it keeps you and your customers in good mood 😉