Friday, July 26, 2013

How to set up the WebLogic monitor

Installation Overview:

LoadRunner provides two different ways to monitor a WebLogic server depending upon the WebLogic version, i.e. SNMP-based monitor, or JMX monitor.
WebLogic Monitor (SNMP-based monitor)

WebLogic monitor (SNMP- based) gathers measurement based on information returned by the WebLogic SNMP agent.
Availability: LoadRunner 6.0
Supported Server Version: WebLogic 5.x
Supported Server Platform: Windows NT, Windows 2000

WebLogic Monitor (JMX monitor)

WebLogic monitor (JMX) gathers measurement based on Java API. It uses the JMX interface, (which is a Sun extension to Java.
Availability: LoadRunner7.02 or above
Supported Server Version: WebLogic 6.x –7.x. For WebLogic8.x,
Supported Server Platform: Windows NT, Windows 2000, Solaris 2.6, AIX 5.1, HP-UX 11
WebLogic Monitor (SNMP-based monitor)
Installation guide

The WebLogic (SNMP) monitor uses SNMP to retrieve server statistics. To use this monitor, you must make sure that a version prior to WebLogic 6.0 is installed on your server, and that the SNMP agent is installed and activated on the server.


How to start the Bea Web Server

1. Go to the WebLogic directory.

2. Save the startWebLogic.cmd file as startWebLogic.bat.

3. Open startWebLogic.bat and set the JDK_HOME parameter to .

4. Run startWebLogic.bat from the Command Prompt and wait a couple of minutes – if it starts OK, you will receive a “WebLogic started” notification.


How to start the SNMP agent on the server

1. Make sure that the standard SNMP agent is not running – to verify this, go to Control Panel ® Services and check the status of SNMP and SNMP Trap or consult the UNIX admin for the SNMP daemon on the Unix machine.

2. For the Windows platform, Open startSnmpAgent.cmd or startSnmpAgent.bat and set the JDK_HOME parameter to .

For the UNIX platform, the batch file is startSnmpAgent.sh.

3. In the same file (startSnmpAgent.bat or startSnmpAgent.sh), search for the following line (usually the last line in file):

“%JDK_HOME%\bin\java -classpath %JAVACLASSPATH% weblogic.SNMPAgent -password ServerSystemPassword -serverURLs t3://localhost:7001 -trapDestinations localhost:162”
This is the command use to startup the WebLogic SNMP agent.
It requires a Java Virtual Machine for execution.
The classpath must contain weblogicaaux.jar and \weblogic\classes. For Weblogic 5.1 with SP, you would need to add the sp jar file (usually named weblogic510spxxx.jar)to the CLASSPATH of the agent startup script.

4. Replace ServerSystemPassword with the password defined during server installation.

5. If you do not know your password, it is in the “weblogic.properties” file under the property “weblogic.password.system=???.”

6. You will probably need to change “localhost” to the name of your machine.

7. Run startSnmpAgent.bat from the Command Prompt. If it starts OK, you will receive a “Agent Initialization Complete” message.

NOTE:

1. For detailed instructions on installing the WebLogic SNMP agent and the utilities to test the agent, see http://www.weblogic.com/docs51/admindocs/snmpagent.html.

2. If you intend to run the WebLogic Server SNMP agent as the only agent on the system, you may not be able to start it if any other agent is already running and is bound to the SNMP port (161).
How to configure the SNMP-based monitor in LoadRunner

1. Click the WebLogic (SNMP) graph in the graph tree, and drag it into the right pane of the Run view.

2. Right-click the graph and choose Add Measurement(s), or choose Monitors à Add Online Measurement.

3. In the Monitored Server Machines section of the WebLogic (SNMP) ( or WebLogic) dialog box, click Add to enter the server name or IP address of the machine you want to monitor. Select the platform on which the machine runs, and click OK.

4. In the Resource Measurements section of the WebLogic (SNMP) dialog box, click Add to select the measurements that you want to monitor. The WebLogic SNMP Resources dialog box displays the available measurements.

5. Browse the WebLogic SNMP Objects tree.

6. To measure an object, select it, and click Add. The following tables describe the measurements and server properties that can be monitored
Known Issues and limitations

1. The SNMP-based monitor can only monitor up to 25 measurements.

2. Some network devices between the LoadRunner Controller machine and the SNMP agent machine might be configured to block or reroute the SNMP traffic.

Points to focus:


Q. LoadRunner 6.51 Controller crashes if the SNMP agent is unavailable


R. This is a known issue in LoadRunner 65 SP1. To resolve the issue, please download and apply Patch LR651P34 from Support’s Download à Patches à LoadRunner à 6.5 SP1 à LR651P34 – LoadRunner 6.51 Fixed Controller crashes caused by unavailability of the SNMP or WebLogic server
Q. How to monitor a non- Community String

R. To do so, please modify the snmp.cfg located in \dat\monitors:

1. Look for the appropriate monitor.

2. Uncomment the “SNMP_community_name=” line by removing the semi-colon (“;”).

3. Add the community string setup by the SNMP agent, to the end of “SNMP_community_name=;”. Please note that this is case-sensitive.

4. Save the snmp.cfg file and restart the LoadRunner Controller.


Q. How to change the port number

R. To do so, you need to modify the snmp.cfg file in \dat\monitors.

1. Look for the appropriate monitor.

2. Uncomment the “port=” line by removing the semi-colon (“;”).

3. Add the port number to the end of “port=”. For example, port=1234
Q. Error: “Not a scalar MIB object”

R. You receive this error because you are trying to access a private/ proprietary MIB file. LoadRunner does not recognize this file, as it is not in LoadRunner’s MIB definition file.
WebLogic Monitor (JMX monitor)
Installation Requirement

1. WebLogic 6.0 or above on the server

2. JDK 1.3.x or above installed on the Controller machine. For WebLogic8.x, you need JDK1.4.

3. Copy WebLogic.jar from \lib folder to \classes

4. LoadRunner 7.02 or above:

a. No patches is required for LoadRunner 7.5 or above

b. For LoadRunner 7.02:
Contact Mercury Customer Support for patch LR702P34 – LoadRunner 7.02 WebLogic JMX monitor for versions 6.0 & 6.1
To install:

i. Exit LoadRunner Controller.

ii. Unzip weblogic60_702.zip in the LoadRunner installation directory.

iii. Terminate the Java Web server by entering the URL

http://localhost:1112/?id=exit&type=0 in a browser.

iv. Run patch_monitors_v702.bat in \bin

v. Install Java Runtime by executing j2re-1_3_1-win.exe.
How to configure the WebLogic (JMX) Monitor in LoadRunner

1. Click the WebLogic (JMX) graph in the graph tree, and drag it into the right pane of the Run view.

2. Right-click the graph and choose Add Measurement(s), or choose Monitors à Add Online Measurement.

3. In the Monitored Server Machines section of the WebLogic (JMX) dialog box, click Add to enter the server name or IP address of the machine you want to monitor. Enter the server name or IP address according to the following format:

:

For example: mercury:8111. Select the platform on which the machine runs, and click OK.

4. Click Add in the Resource Measurements section of the WebLogic (JMX) dialog box. In the Enter Login Information dialog box, enter the username and password of a user with administrative privileges to the WebLogic server. The BEA WebLogic Monitor Configurationdialog box opens. For details on creating user permissions, see

5. Browse the Measured Components tree.

6. Check the required performance counters in the BEA WebLogic Monitor Configuration window’s right pane.

7. Click OK in the BEA WebLogic Monitor Configuration dialog box, and in the WebLogic (JMX) dialog box, to activate the WebLogic (JMX) monitor.
How to Monitor WebLogic8.x

LoadRunner 7.x and 8.x does not support monitoring against WebLogic8.x out of the box. In order to Monitor WebLogic8.x:

1. Go to \classes and rename the file jmxri.jar to something else.

2. Go to \dat\monitors and edit the weblogicmon.ini:

a. Set the JVM to point to JDK1.4

b. Comment out the JavaVersion entry if there is a complain about JDK versions

c. DO NOT comment out the reference to jmxri.jar in this file It must remain as shown below:

JVM_CLASSES1=jmxri.jar

3. Copy the weblogic.jar from the server to the \classes directory.

4. In WebLogic 8.x server console, do not setup administration port on SSL.

Known Issues and limitations

1. If the network connection between the monitored host (WebLogic server) and the LoadRunner Controller is slow, the monitor will not work. This is caused by a severe performance hit caused by using the JMX interface (which is a Sun extension to Java).

2. Some objects may not be present in the server after a restart. If you are monitoring objects like this, you must ensure they are created before restarting the monitoring program. Usually, activating some part of the Web application’s functionality creates these objects.

3. WebLogic contains a large number of counters. In the simple Pet Store Demo alone, there are over 1400 of them. If you add all the counters, it will cause the LoadRunner to freeze for a very long time (10-30 minutes) while it adds the information to the GUI.

4. NOTE: When troubleshooting JMX issues, make sure that you shut down the LoadRunner side Web server (killing the javaw.exe in the process list) after any changes you make. Else, the changes won’t take effect.

Tips and tricks:

Q. What is the limit on the number of metrics that can be monitored


R. There is no limit on the number of metrics for JMX monitor. However, if you add a large number of counters, it will cause LoadRunner to freeze for a long time while it adds the information to the GUI.


Q. Application (Controller or MonintorClient) disappears when user select “Add Measurement” for JMX monitor in LoadRunner7.5.

R. This is a known issue in LR 7.5 only. Please contact Mercury Customer Support for LR75P1 – LoadRunner 7.5 Fix WebLogic JMX monitor dialog crash. This issue was addressed after LR 7.51


Q. Java Virtual Machine Version mismatch: Required version 1.3

R. If you do not have JVM installed, or have multiple versions of JVM installed, you will get this error. Please double check the installation. If you have multiple JVM,

1. Bring up \dat\monitors\WebLogicMon.ini

2. On the entry for JVM, set the full path to the correct java.exe. For example:

JVM=c:\jdk1.3\bin\java.exe

3. Make sure that the ‘JavaVersion=’ entry mention the correct JVM version.

Q. Parsing error. Details: host , port , line: . Reason: An Invalid character was found in text content.”

R. This is a known issue with platforms when there are European special characters returned from the server. Please contact Mercury Customer Support for the patch LR75P32 – LoadRunner 7.5 WebSphere, WebLogic JMX, EJB monitors don’t work with European special characters


Q. java.lang.ExceptionInInitializerError
R. You can get this error if JMX monitor does not have access to the ‘weblogic.jar’ file. To resolve the issue:

1. Copy the ‘weblogic.jar’ file from the server to the LoadRunner\classes folder on the controller machine.

2. Update the ‘CLASSPATH’ environment variable on the controller machine to include absolute path to LoadRunner\classes folder.

3. Go to Task Manager -> Processes tab and ensure that there is no ‘javaw.exe’ process running.

4. Launch the controller and try using the Weblogic JMX Monitor again.


Q. java.lang.exception: Failed to add host of type WebLogic. Reason: javax.naming.AuthenticationException (Root Exception is java.lang.SecurityException: User: Administrator, failed to be authenticated.
R. You get this error when the authentication information (username/password) provided for connecting to the WebLogic server is incorrect. Verify username/password and re-enter them with correct case.


Q. java.lang.Exception: Failed to add host of type WebLogic. Reason: java.lang.Exception: Unable to load WebLogic classes. CLASSPATH Servlet may not be running. Copy file weblogic.jar to \classes folder.

R. You can get this error if JMX monitor could not find WebLogic classes. To resolve the issue:
Go to Task Manager à Processes tab and ensure that there is no ‘javaw.exe’ process running.
Copy the ‘weblogic.jar’ file from the server to the < LoadRunner>\classes folder on the Controller machine.
Update the ‘CLASSPATH’ environment variable on the controller machine to include absolute path to < LoadRunner>\classes folder.
Launch the Controller and try using the WebLogic JMX Monitor again.


Q. java.lang.Exception: Failed to add host of type WebLogic. Reason: javax.naming.CommunicationException [Root exception is java.net.ConnectException: t3://machine_name: 7001: Destination unreachable; nested exception is: java.net.Connect Exception: Connection refused: connect; No available router to destination]
R. You can get this error if WebLogic is not running. Please make sure that you have started the WebLogic server
Q. Error: “javax.naming.ServiceUnavailableException [Root exception is java.net.UnknownHost Exception: XXXXXX]”
R. Make sure that host name entered for monitored server machines is correct. Try to ping and verify if the machine is available.


Q. Error: “java.lang.NoClassDefFoundError: javax/security/auth/callback/CallbackHandler.” Monitoring WebLogic 8.x with JDK 1.3

R. You need to use JDK 1.4 with Weblogic8.x. Refer to the next error if you have problem using JDK1.4.
Q. Error: “Java Virtual Machine Version Mismatch: Required version: 1.4.2; Sun Microsystems Inc”

R. If you are using JDK1.4.2, please comment out JavaVersion=1.3 from dat\monitors\WeblogicMon.ini by adding a semi-colon in front of the line.

EXAMPLE:

;JavaVersion=1.3


Q. Error: “org.xml.saxParseException: The root element is required in a well-formed document”

R. Set JVM entry to java.exe instead of javaw.exe

1. Go to \dat\monitors directory

2. Modify the JVM entry in weblogicmon.ini file to point to java.exe instead of javaw.exe.

Example:

[WebLogicMon]

JVM=C:\JDK1.3\bin\java.exe

Note: The java console will come up after changing javaw.exe to java.exe


Q.Error: “java.lang.OutOfMemory”

R. Increase the size of the JVM by editing the weblogicmon.ini file in \dat\monitors folder as shown below:

[WebLogicMon]

JVM=javaw.exe -Xms64M -Xmx256M

Or

[WebLogicMon]

JVM=java.exe -Xms64M -Xmx256M

This will set 64 MegaBytes as the memory allocated for the heap when the JVM starts.

And 256 MegaBytes as the maximum heap size the Java interpreter will use for dynamically allocated objects and arrays

No comments: