|
Monitoring of JVM parameters such as Memory Usage and Thread count is an important process using which the VM performance can be improved and problems such as VM crash could be prevented. In earlier JDK releases, these parameters could be monitored only using profiling tools or some scripting languages which were turning out to be extra overheads to the application. JDK 1.5 provides features to monitor and manage the JVM. Web NMS uses the SNMP mode to store historic information about the Web NMS JVM parameters so that administrators can monitor the condition of the Web NMS VM memory usage at any point of time. JMX MBeans is not supported currently.
System Properties for JVM Monitoring
J2SE 1.5 provides system properties to enable VM monitoring of Java applications. The following table lists down the properties and their default values in the various Web NMS startup scripts.
|
System Property |
Default Values |
||
|
startnms.bat/sh |
startnmsFE.bat/sh |
startApplicationClient.bat/sh | |
|
com.sun.management.jmxremote.port |
16000 |
15000 |
14000 |
|
com.sun.management.jmxremote.authenticate |
false |
false |
false |
|
com.sun.management.jmxremote.ssl |
false |
false |
false |
|
com.sun.management.snmp.interface |
%COMPUTERNAME% (Windows) `hostname` (Linux/Solaris) |
%COMPUTERNAME% (Windows) `hostname` |
%COMPUTERNAME% (Windows) `hostname` |
|
com.sun.management.snmp.acl |
false |
false |
false |
|
com.sun.management.snmp.port |
16500 |
15500 |
14500 |
Visit the following links for information on the purpose of these properties :
http://java.sun.com/j2se/1.5.0/docs/guide/management/agent.html#properties
http://java.sun.com/j2se/1.5.0/docs/guide/management/SNMP.html#snmp_properties
Web NMS JVM Monitoring collects, stores, and display the following System and Server parameters as graphs by default:
For JVMs BE server, FE server(s) and Client(s)
CPU Utilization
Memory Usage
Number of threads spawned
For BE server alone
Status Polling Rate
Trap Processing Rate
Event Processing Rate
Alert Processing Rate
Data Collection Rate
The polled data of each resource will be added for performance monitoring and the Performance module handles the data collection and storage. For each type of JVM i.e., BE, FE, and Client, there is a class to add the polled data namely, WebNMSBEResourceMonitoring, WebNMSFEResourceMonitoring, and WebNMSClientResourceMonitoring.
The WebNMSJVMMonitoring.xml file is a configuration file for Web NMS JVM Monitoring. The ResourceMonitoringFilter is an event filter, which filters out events related to JVM monitoring. For the resource of the filtered event, the filter will parse the WebNMSJVMMonitoring.xml file and invoke action specified for the resource.
To monitor CPU Utilization, SNMP agent should be running in the machine, in which the JVM is started.
Viewing JVM Monitoring Details
The collected information about the Web NMS JVM can be viewed in the following graph/table formats:
Line Chart
Bar Chart
Area Chart
Scatter Chart
XY Step Chart
Table
Web Client
The collected data will be displayed as graphs, in the Web Client. The graphs display is invoked using the procedure given below:
Connect the server with Web Client.
Click the Admin > Complete View > Monitor/Management > JVM Management node on the left-side tree of the client screen.
Alternatively, click JVM Management link in the Monitor/Management section on the right-side of the client screen.
Java Client
The collected data will be displayed as graphs in Java Application/Applet/Web Start Client. The graphs display is invoked using the procedure given below:
Connect the server with Java Client.
Click Tools > JVM Monitoring Details menu item to bring up the JVM Monitoring Details screen.
Web NMS JVM Monitoring
You can configure the parameters to be monitored as per your requirement, in the WebNMSJVMMonitoring.xml file available in the <Web NMS Home>/conf directory.
The file consists of the following:
Mail Notification - Action parameters
Three resource monitoring parameters for BE, FE, and Client
CPU Usage
Memory Usage
Thread Count
Other Web NMS server performance monitoring parameters for BE alone
Status Polling Rate
Trap Processing Rate
Event Processing Rate
Alert Processing Rate
Data Collection Rate
You can also configure the threshold name and action to be taken, if the threshold is crossed, for each polled data.
The WebNMSMgmtBEProcess process defined in NmsProcessesBE.conf file takes care of the following functions:
Monitors memory usage of the BE Server
Monitors JVM resource usage of the BE Server periodically
Monitors JVM resource usage of the FE Server JVM periodically. The BE Server starts monitoring the FE server JVM as and when a FE gets connected to the BE. This function will be disabled if the MONITOR_FE_JVM argument of the process WebNMSMgmtBEProcess is set to false in the NmsProcessesBE.conf file of the BE server
PROCESS
com.adventnet.nms.management.WebNMSMgmtBEProcess
ARGUMENTS
|
Argument |
Purpose |
Possible Values |
Default Value |
|
MEMORY_USAGE_THRESHOLD |
Indicates the threshold value of memory usage of BE Server. When the memory usage exceeds this value, actions such as email notification, thread dump generation and garbage collection are triggered |
Within the Range 0.1 and 1.0 |
0.7 |
|
MONITOR_BE_MEMORY_USAGE |
Determines whether the memory usage of the BE server is to be monitored or not |
true or false |
true |
|
MONITOR_FE_JVM |
Determines whether the FE server JVM is to monitored or not. If this is set to true, the BE Server starts gathering the JVM details of FE server whenever the BE is notified of a new FE connected to it |
true or false |
true |
|
Determines whether Java GC is to be run or not. If this argument is set to true, Java GC is automatically run when the BE JVM exceeds the configured threshold |
true or false |
false |
When the memory usage of the BE Server exceeds 0.7, an email notification is sent according to the configurations made in the Action Name="MailNotification" parameter of WebNMSJVMMonitoring.xml file. Also, if RUN_GARBAGE_COLLECTOR is set to true, Web NMS runs the garbage collector to free up the unused objects.
Further, thread dumps are generated when initiated from the Web Client and stored in the JVMThreadDump.txt file.
The WebNMSMgmtFEProcess process defined in NmsProcessesFE.conf file takes care of the following functions:
Monitors memory usage of the FE Server
Monitors JVM resource usage of the Clients periodically. The FE Server starts monitoring the Client JVM as and when a client gets connected to the FE. This function will be disabled if the MONITOR_CLIENT_JVM argument of the process WebNMSMgmtFEProcess is set to false in the NmsProcessesFE.conf file
PROCESS
com.adventnet.nms.management.WebNMSMgmtFEProcess
ARGUMENTS
|
Argument |
Purpose |
Possible Values |
Default Value |
|
MEMORY_USAGE_THRESHOLD |
Indicates the threshold value of memory usage of FE Server. When the memory usage exceeds this value, actions such as email notification, thread dump generation and garbage collection are triggered |
Within the Range 0.1 and 1.0 |
0.7 |
|
MONITOR_FE_MEMORY_USAGE |
Determines whether the memory usage of the FE server is to be monitored or not |
true or false |
true |
|
MONITOR_CLIENT_JVM |
Determines whether the clients connected to this FE server should be monitored or not. If this is set to true, the FE Server will start gathering JVM information of all clients that are connected to it. |
true or false |
true |
|
RUN_GARBAGE_COLLECTOR |
Determines whether Java GC is to be run or not. If this argument is set to true, Java GC is automatically run when the FE memory usage exceeds the configured threshold |
true or false |
false |
If the memory usage of the FE JVM exceeds 0.7, an email notification is sent according to the configuration made in the Action Name="MailNotification" parameter of WebNMSJVMMonitoring.xml file. Also, if RUN_GARBAGE_COLLECTOR is set to true, Web NMS runs the garbage collector to free up the unreferenced objects.
Further, thread dumps are generated when initiated from the Web Client and stored in the JVMThreadDump.txt file.
The Client monitors its own memory usage. If the memory usage exceeds the configured threshold limit, runs the garbage collector (if configured). Parameters for Client monitoring are available in the clientparameters.conf file and can be configured according to the requirement.
Thread dumps are generated when initiated from the Web Client and stored in the JVMThreadDump.txt file
The following table lists down the parameters and their usage:
|
Argument |
Purpose |
Possible Values |
Default Value |
|
Indicates the threshold limit for the memory usage of Client. When the memory usage exceeds this value, actions such as email notification, thread dump generation and garbage collection are triggered |
Within the Range 0.1 and 1.0 |
0.7 | |
|
MONITOR_CLIENT_MEMORY_USAGE |
Determines whether the memory usage of the Client server is to be monitored or not |
true or false |
true |
|
Determines whether Java GC is to be run or not. If this argument is set to true, Java GC is automatically run when the Client memory usage exceeds the configured threshold limit |
true or false |
false |
When the memory usage of the client exceeds the configured limit, an email notification is triggered by the BE Server according to the configuration made in the Action Name="MailNotification" parameter of WebNMSJVMMonitoring.xml file.
|
|
Note: The Client JVM Monitoring is not supported in Java Web Start, Applet, and Web clients. |
Server Configuration
When the server is started using script, configure JVM Monitoring using the properties highlighted in the following entry in the startnms.bat/startnms.sh file present under <Web NMS Home>/bin:
startnms.bat file
|
:start1 %JAVA_HOME%\bin\java -cp %CLASS_PATH% -Dcatalina.home=%TOMCAT_HOME% -Dcatalina.base=%TOMCAT_HOME% -Dpgsql.home=%PGSQL_HOME% -Xmx100m -XX:+HeapDumpOnOutOfMemoryError -XX:+UseConcMarkSweepGC -Dssl.port=%SSL_PORT% -Dwebserver.port=%WEBSERVER_PORT% -Dresource_check="%WEBSERVER_PORT%,%WEBCONTAINER_PORT%,%TOMCAT_SHUTDOWNPORT%" -Djava.rmi.server.codebase=%CODEBASE_LIST% set serverexit=%errorlevel%
Note: %COMPUTERNAME% should be replaced with the name of the machine where the Web NMS server is installed. |
startnms.sh file
|
$JAVA_HOME/bin/java -cp $CLASS_PATH -Dcatalina.home=$TOMCAT_HOME
Note: `hostname` should be replaced with the name of the machine where the Web NMS server is installed. |
Application Client Configuration
When the Application Client is started using script, configure Client JVM Monitoring using the properties highlighted in the following entry in the startApplicationClient.bat/startApplicationClient.sh file present under <Web NMS Home>/bin:
startApplicationClient.bat file
|
:start %JAVA_HOME%\bin\java -Dcom.sun.management.jmxremote.port=14000
Note: %COMPUTERNAME% should be replaced with the name of application client machine. |
startApplicationClient.sh file
|
$JAVA_HOME/bin/java -Xmx200m -Dcom.sun.management.jmxremote.port=14000
Note: %COMPUTERNAME% should be replaced with the name of application client machine. |
Server Configuration
When the server is started from the Web NMS Launcher, configure JVM Monitoring using the properties highlighted in the following entry in the Start Web NMS Server application of the launcher_conf.txt file present under <Web NMS Home>/conf:
|
<property name="AppJavaOption" value="-Dcom.sun.management.jmxremote.port=16000 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.snmp.interface=hostname -Dcom.sun.management.snmp.acl=false -Dcom.sun.management.snmp.port=16500 -Dpgsql.home=./pgsql -Dwebserver.port=9090 -mx100m -Dresource_check=9090,8009 ......
Note: hostname should be replaced with the name of the machine where the Web NMS server is installed. |
Application Client Configuration
When the Application Client is started from the Web NMS Launcher, configure Client JVM Monitoring using the properties highlighted in the following entry in the Application Client application of the launcher_conf.txt file present under <Web NMS Home>/conf:
|
<property name="AppJavaOption" value="-Dcom.sun.management.jmxremote.port=14000 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.snmp.interface=hostname -Dcom.sun.management.snmp.acl=false -Dcom.sun.management.snmp.port=14500"/>
Note: hostname should be replaced with the name of application client machine. |
When the server is installed as a Windows Service, configure JVM Monitoring using the following system properties in the Java Additional Parameters of the wrapper.conf file:
|
wrapper.java.additional.7=-Dcom.sun.management.jmxremote.port=16000 wrapper.java.additional.8=-Dcom.sun.management.snmp.port=16500 wrapper.java.additional.9=-Dcom.sun.management.jmxremote.authenticate=false wrapper.java.additional.10=-Dcom.sun.management.jmxremote.ssl=false wrapper.java.additional.11=-Dcom.sun.management.snmp.interface=localhost wrapper.java.additional.12=-Dcom.sun.management.snmp.acl=false |
|
|
Note: You will not be able to start more than one application client/BE JVM/FE JVM with the JVM Monitoring process enabled. To overcome this problem, you need to configure the value of com.sun.management.jmxremote.port and com.sun.management.snmp.port arguments to some other free ports in the respective startup script/configuration file. |
If you face server startup problems due to long class path in Windows, refer to the Input Line Too Long topic for a solution.
|