SNMP Monitoring for Java VM
SNMP is not really simple, but quite a useful protocol, if you want to run standard monitoring tools like Nagios, Zero RRD or Cacti.
Even though Java offers JMX for runtime information like thread and memory consumption, you can also use SNMP to read at least a subset.
In my opinion usage of a standard monitoring tool has several advantages over JMX-based visualization in jconsole or Lambda Probe:
- Statistics fit into centralized reporting, e.g. for SLAs.
- The tools are independent of the Java VM. If the VM freezes, the history is still available
First you need to enable the SNMP Agent in your Java VM. Please find the details here. This is only an outline:
- Prepare an ACL configuration at $JAVA_HOME/lib/management/snmp.acl. On Sun's Java 6 for Ubuntu 10.04 64 Bit you will find these files in the package ia32-sun-java6-bin.
- Use the following options on the command line to enable SNMP:
-Dcom.sun.management.snmp.port=7667 -Dcom.sun.management.snmp.acl.file=$JAVA_HOME/lib/management/snmp.acl
If you really put the snmp.acl at $JAVA_HOME/lib/management, it's very likely, you will not need to specify the com.sun.management.snmp.acl.file option.
Now you are ready to read the internal state by using SNMP:
- Zero Agent's module for Java SNMP just needs the port specified in conf/enabled/JavaSNMP.conf.
- Please find some available OIDs in the source code of JavaSNMP.pm
- The full list of available values is included in the following MIB.
Zero 2009/02 Release
We updated the Zero packages on SourceForge.net yesterday.
Even though it contains only minor changes and bugfixes, you may find the new parser and calendar gadget in the graph view useful.
The VMWare and VirtualBox appliances for the Zero Service are also up-to-date.
Zero RRD Framework: Major Release
It's done, yesterday we published a major update of the Zero RRD Framework at SourceForge. You will find the latest code in the SubVersion Repository, but also a snapshot in the Download Section.
You can just download and extract the tar.gz archives for zerod and zero-agent in your /opt folder and follow the manual in the doc folder.
Any feedback and help is appreciated.
This framework is used at a big site with thousands of agents reporting to the server, showing a very nice performance and easy installation/deployment (using cfengine).
Even though the installation may be of "alpha" quality, it's ready for production.
I personally tested the agent on Debian, Ubuntu and CentOS, the zerod service on Debian and Ubuntu and I currently prepare a VirtualBox appliance providing a ready-to-use zerod.
zerod/zero-agent
Hopefully soon SourceForge.net will show a new release of the Zero RRD Framework, that provides a simple but powerful service for real time graphs.
If you know the syntax of RRDTool you are already an export in configuring Zero. Uploading data is a simple HTTP request, but you can also use the Perl-based agent.