Jvm snmp monitoring configuration

Source: Internet
Author: User
Tags snmp snmp port

I recently looked at the JVM support for monitoring. Apart from the common JMX, there are also SNMP, which is a bit interesting. There are a lot of Network Management Protocol adaptation places, so let's test it first.

First, find a Java applet that can run continuously in the background, such as the bio socket server at hand.

 

Configuration of SNMP on JVM

Starting SNMP requires two changes, (http://docs.oracle.com/javase/7/docs/technotes/guides/management/snmp.html)

  • Add

Com. Sun. Management. SNMP. Port = port_number. port_number indicates the SNMP port monitored by the JVM. The standard value is 161.

  • You also need to copy the ACL template file fromJre_home/lib/management/snmp. ACL. TemplateToJre_home/lib/management/snmp. ACL.

Modify the original template file, comment out some comments, and change it to the following format:

 acl = {  {    communities = public, private    access = read-only    managers = localhost  } } trap = {   {     trap-community = public     hosts = localhost    } }

Then the operating system to change, so that the ACL file has only one owner, is to start the Java User Name, how to change the reference this article http://docs.oracle.com/javase/6/docs/technotes/guides/management/security-windows.html

If this step is not performed, an error will be reported during startup.

Error: Password File Read access must be restricted: C: \ Program Files \ Java \ jre7 \
Lib \ management \ SNMP. ACL

I am too troublesome. Set the startup parameter to not check (COM. Sun. Management. SNMP. ACL = false), so that this check can be skipped.

java -Dcom.sun.management.snmp.port=161 -Dcom.sun.management.snmp.acl=false com.tool.server.MyBIOServer

The configuration on the JVM side is OK.

 

SNMP Management Terminal Configuration

First to this address of the jvm snmp mib file: http://java.sun.com/j2se/1.5.0/docs/guide/management/JVM-MANAGEMENT-MIB.mib

Find an SNMP client. I use ireasoning MIB browser and load the MIB file.

Enter localhost in the address, and use the 161 port we set earlier to directly walk all exposed properties of the JVM on the Management end.

We can see that all kinds of JVM internal information are available, such as jvmclassessloadedcount. It also supports trap and low memory warning, which is good.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.