Previous 14.1 Specifics of measurement server types Next

14.1.14 JMX measurement servers

The JMX measurement server is an active and discoverable PVSR module. The measurement server takes into account the timeout value specified for the equipment, which is used to establish the SSH connection. Beside the basic attributes, the equipment has the following additional parameters (the code of the parameter is given in parenthesis; see Subsection 7.5.6 on Parameters of non-SNMP data collectors).

 

PVSR can monitor the JMX server using a remote PVSR JMX agent or using a local PVSR JMX agent. If PVSR uses the local agent then the “IP address”, “User” and “Password” must refer to the local PVSR server and the “JMX host” parameter must be set to the address of the JMX server. However if PVSR uses a remote agent installed on the same server as the monitored JMX server then “IP address”, “User” and “Password” must refer to the remote server and the “JMX host” parameter must be set to “localhost”. In same cases (for example Alfresco Java server) the JMX server doesn’t use a standard JMX URL, in these cases the “JMX port” and “JMX host” parameters still must have a value, but the user must fill in a correct JMX URL as well, in which case PVSR will ignore the settings at the “JMX port” and “JMX host” parameters.

 

  • IP address (JMX EQ 1 IP): Single line text field, which can be seen by non-administrators as well. The field contains the IP address of the server on which the PVSR JMX is running, it is a mandatory parameter
  • User (JMX EQ 2 USERNAME): Single line text field, which cannot be seen by non-administrators. The field contains the user name to be used for the JMX agent connection, it is a mandatory parameter
  • Password (JMX EQ 3 PASSWORD): Single line text field, which cannot be seen by non-administrators. The field contains the password used to establish the JMX agent connection. If it is not specified then key based authentication is used to login to the remote machine
  • JMX port (JMX EQ 4 PORT): Integer field, which cannot be seen by non-administrators. The field contains the TCP port of the JMX. It is a mandatory parameter and its default value is 1099.
  • JMX agent path (JMX EQ 5 AGENT PATH): Single line text field, which cannot be seen by non-administrators. The field contains the path of the JMX agent to execute. It is a mandatory parameter and its default value is „/apps/jmx-agent/jmx-agent.sh”.
  • Java path (JMX EQ 6 JAVA PATH): Single line text field, which cannot be seen by non-administrators. The field contains the path of the Java VM executable. It is a mandatory parameter and its default value is „java”.
  • Java classpath (JMX EQ 7 CLASS PATH): Single line text field, which cannot be seen by non-administrators. The field contains the classpath of the Java VM. It is an mandatory parameter and its default value is “.:lib:config”. It must contain these directories. If the equipment is a JBOSS then it must contain exact path to the JBOSS_HOME/lib and the JBOSS_HOME/server/default/lib directories as well.
  • JMX server type (JMX EQ 8 SERVER TYPE): Drop-down list field, which cannot be seen by non-administrators. The field contains the type of the JMX server
  • JMX host (JMX EQ 9 HOST): Text field, which cannot be seen by non-administrators. It is mandatory and contains the host to which PVSR connects after it logged in to the server identified by the “IP address” field. Its default value is localhost
  • JMX User (JMX EQ 11 JMXUSERNAME): optional user name for the JMX server authentication
  • JMX Password (JMX EQ 12 JMXPASSWORD): optional user password for the JMX server authentication
  • JMX URL (JMX EQ 10 JMXURL): In same cases (for example Alfresco Java server) the JMX server doesn’t use a standard JMX URL, in these cases the “JMX port” and “JMX host” parameters still must have a value, but the user must fill in a correct JMX URL as well, in which case PVSR will ignore the settings at the “JMX port” and “JMX host” parameters
  • Trusted Store file (JMX EQ 9 TRUSTED STORE FILE): optional file location where the JMX agent is. If specified then PVSR will use its content for the SSL protocol
  • Trusted Store password (JMX EQ 9 TRUSTED STORE PASSWORD): if the Trusted Store file is specified then PVSR uses this password for the trusted store file

 

The agent has to be installed in the server prior to configuring the measurements in PVSR. In order to install it, the jmx-agent-app.zip file has to be uploaded on the monitored server (preferably in the /apps directory) and then the following command has to be ran:

unzip jmx-agent-app.zip

 

The measurement server does not provide any UPTIME data.

 

14.1.14.1 JMX server types

There are two available server types: JBOSS 4 and Java 1.5. You should know the following before choosing the appropriate one.

JBOSS 4

JBoss 4 application server is shipped with its own JMX server implementation, since at that time the Sun JVM did not have an integrated JMX server. The JBoss 4 JMX server does not collect Java process level information.

Java 1.5

1.5 version of Sun JVM was the first to have an integrated JMX server which provide Java process level (garbage collection related) information besides what the application server provided. In order to be able to connect Sun JVM’s JMX server, we should set the following startup parameters of the Java process running the application server. The actual setting differs for each application server. The value of the jmxremote.port parameter in the following examples should be same as the value of PVSR JMX port setting.

14.1.14.1.1 JBOSS 4

You should append the following lines to the $JBOSS_HOME/bin/run.conf file:

         ...

         JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.port=12345"

         JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.authenticate=false"

         JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.ssl=false"

         JAVA_OPTS="$JAVA_OPTS -Djboss.platform.mbeanserver"

         JAVA_OPTS=
"$JAVA_OPTS -Djavax.management.builder.initial=org.jboss.system.server.jmx.MBeanServerBuilderImpl"

14.1.14.1.2 JBOSS 5

You should append the following lines to the $JBOSS_HOME/bin/run.conf file:

         ...

         JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.port=12346"

         JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.authenticate=false"

         JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.ssl=false"

 

         JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote"

         JAVA_OPTS="$JAVA_OPTS -Djboss.platform.mbeanserver=true"

         JAVA_OPTS="$JAVA_OPTS -Djavax.management.builder.initial=org.jboss.system.server.jmx.MBeanServerBuilderImpl"

 

Due to a JBoss 5 implementation error you should add some class files to one of the JAR files first:

         cd $JBOSS_HOME/bin/

         cp run.jar run.jar.safe

         mkdir run-jar

         cd run-jar/

         jar xf ../../lib/jboss-system-jmx.jar

         jar uvf ../run.jar  org/jboss/system/server/jmx/


 

LazyMBeanServer.class org/jboss/system/server/jmx/MBeanServerBuilderImpl.class

         cd ..

         rm -r run-jar

         ./run.sh 

14.1.14.1.3 JBOSS 6

You should append the following lines to the $JBOSS_HOME/bin/run.conf file:

         ...

         JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.authenticate=false"

         JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.ssl=false"

         JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.port=12347"

 

         # Use the JBoss MBeanServerBuilder

         JAVA_OPTS="$JAVA_OPTS -Djboss.platform.mbeanserver"

         JAVA_OPTS="$JAVA_OPTS -Djavax.management.builder.initial=org.jboss.system.server.jmx.MBeanServerBuilderImpl"

 

         #Use the jboss logmanager

         JAVA_OPTS="$JAVA_OPTS -Djava.util.logging.manager=org.jboss.logmanager.LogManager"

         JAVA_OPTS="$JAVA_OPTS -Dorg.jboss.logging.Logger.pluginClass=org.jboss.logging.logmanager.LoggerPluginImpl"

 

         export JBOSS_CLASSPATH="../lib/jboss-logmanager.jar"

14.1.14.1.4 Tomcat versions 5, 6 and 7

You should insert the following lines to $CATALINA_HOME/bin/catalina.sh before the line containing "Execute The Requested Command":

         ...

         JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.port=12345"

         JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.authenticate=false"

         JAVA_OPTS="$JAVA_OPTS -Dcom.sun.management.jmxremote.ssl=false"

 

         # ----- Execute The Requested Command -----------------------------------------

 

 

14.1.14.2 Available JMX measurements

The users can query the available measurement variables for a JMX equipment. To do this, the JMX equipment needs to be opened from the Settings -> Site and equipment configuration menu and then the Available JMX measurements item has to be selected from the menu above.

 

PVSR discovers the equipment and lists some of its data in three columns: class name, variable and details. The first column contains the measurement’s class name. The second contains the class’s variables. And the third column contains an edit link to the corresponding measurement definition and the measurement definition’s description. The edit link points to the edit page of the measurement definition which contains the class name and variable in its first or second metric expression. If the third column contains no data, it means that the class with that particular variable isn’t used in any measurement definition. If it contains multiple rows, it means that the class and variable is used in more than one metric expression.

 

It is easy to create a new PVSR measurement type using these informations. If the class of a variable is XXX and the name of the variable is YYY then the variable can be used in a PVSR measurement definition with the name XXX@YYY.PORT and the description OID has to be set to XXX@Index. For example: in the case of the JBOSS ActiveThreadCount measurement variable the name of the class is org.jboss.system.server.ServerInfo, so in the measurement expression one must use

#org.jboss.system.server.ServerInfo@TotalMemory.PORT#

, while in the description OID

org.jboss.system.server.ServerInfo@Index

14.1.14.3 Core data page

There’s a “Core data” page summarizing information when measuring Tomcat or JBoss application servers. These pieces of information are basic data about the host and the application server, for example:

·       Host OS, version

·       number of processors

·       location (directory) of application server

·       http servers’ port and IP address

·       session data of applications running on the server