Jagger
 All Classes Namespaces Files Functions Variables Enumerator Groups Pages
How to start monitoring agent

Section describes how to start monitoring agents to collect system and JVM metrics


Back to Collecting system and JVM metrics


Terms

Agent - stand alone client application, started on SUT site to collect monitoring metrics. Agent will connect to
Jagger server node (COORDINATION_SERVER), register there, post collected data and follow commands, received from server.

Jagger server setup

To make Jagger server ready for agent(s) connection set properties in corresponding environment.properties file

chassis.conditions.monitoring.enable=true
chassis.conditions.min.agents.count=2


There are some more properties for monitoring setup. You can find them here: Jagger configuration properties

Starting agent

After you test program compilation, you will get .zip file in target folder, containing compiled code to start agent.
Copy this file to SUT site and unzip it there.

Agent with system resources monitoring
Simpliest example how to start agent:
./start_agent.sh -Dchassis.coordination.http.url=http://192.168.56.1:8089 -Djmx.enabled=false -Dagent.name=someAgentOnSUT

chassis.coordination.http.url - URL of Jagger server node
jmx.enabled - flag to enable/disable JMX monitoring
agent.name - name of agent. Will be displayed in all reports
Agent with system resources and JVM monitoring
To monitor JVM of the SUT, it is necessary to open JMX connection. Such connection should be allowed by SUT.
To enable JMX connection to JVM - set following properties when starting SUT or application server JVM:
-Dcom.sun.management.jmxremote
-Dcom.sun.management.jmxremote.port=9870
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false
-Djava.rmi.server.hostname=192.168.1.1
last property - IP of SUT host

Example how to start agent with enable JMX monitoring:
./start_agent.sh -Dchassis.coordination.http.url=http://192.168.56.1:8089 -Djmx.enabled=true -Dagent.name=someAgentOnSUT -Djmx.services=localhost:9870,localhost:9875

jmx.enabled - flag to enable/disable JMX monitoring
jmx.services - host:port of JMX service(s)

Also you can define name for every JMX connection, like:
-Djmx.services=localhost:9870{tomcat},localhost:9875{jetty}

and delay how long (in ms) agent should wait for JMX connection to open:
-Djmx.connection.timeout=10000

There are some more properties for agent setup. You can find them here: Agent configuration

JMX monitoring configuration for JBoss 6 and later

Following section is important if you want to monitor application running with JBoss 6 server or later version.
Section is describing feature available starting from Jagger 1.2.4

Some day JBoss Application Server decided to introduce it's own JMX. Starting from that time it became tricky
to connect to JBoss JMX MBeanServer from normal JConsole. Jagger agents faced same problem.

Below is example how to monitor application running with JBoss EAP 6.0.0 by Jagger agent.

1.First your project will require new dependencies in pom.xml file. Dependencies below are for JBoss 6.0.
Other JBoss versions will require other versions of libraries. Smile

<dependency>
<groupId>org.jboss.remotingjmx</groupId>
<artifactId>remoting-jmx</artifactId>
<version>1.0.3.Final</version>
</dependency>
<dependency>
<groupId>org.jboss.remoting3</groupId>
<artifactId>jboss-remoting</artifactId>
<version>3.2.8.GA</version>
</dependency>


2.Second during agent start you will require to set new property to specify JBoss specific JMX service URL

./start_agent.sh -Dchassis.coordination.http.url=http://192.168.56.1:8089 -Djmx.enabled=true -Djmx.url.format=service:jmx:remoting-jmx://%s
-Djmx.services=localhost:9885 -Dagent.name=someAgentOnSUT

jmx.url.format - new property available since Jagger 1.2.4 - JMX service URL format for JBoss

More reading:
JBoss Using jconsole to connect to JMX on AS7
JBoss JMX subsystem configuration