1

I have a GlassFish v3 app server running on 64-bit Debian Lenny. Everything is running fine, except I would like to monitor GF's JVM instance with SNMP. However, every time I try to enable it by adding the following <jvm-options> in domain.xml:

-Dcom.sun.management.snmp.port=10161
-Dcom.sun.management.snmp.acl.file=/path/to/snmp.acl
-Dcom.sun.management.snmp.interface=127.0.0.1

GlassFish refuses to start:

$ asadmin start-domain
Waiting for DAS to start .Error starting domain: default.
The server exited prematurely with exit code 1.
Command start-domain failed.
$

There is also nothing illuminating (well, really nothing at all) in jvm.log or server.log. The snmp.acl file contains:

acl = {
  {
    communities = public
    access = read-only
    managers = localhost
  }
}

and is chmod 600 (I know this is not the problem because it will actually fail with an error about the permissions if it is set to anything other than 600)

$ java -version
java version "1.6.0_0"
OpenJDK  Runtime Environment (build 1.6.0_0-b11)
OpenJDK 64-Bit Server VM (build 1.6.0_0-b11, mixed mode)

3 Answers 3

2

-Dcom.sun.management options are Sun extension to JVM. It is not a part of the JVM spec, and therefore they are not available in OpenJDK !

Anyway, even using a Sun JVM, i got fatal error when deploying applications on my running cluster. Maybe it is intentional by Sun because they sold a extension for SNMP monitoring.

2
  • I am not sure this is the case. JMX works fine and it is in that namespace. Also, as I mentioned, if I deliberately screw up the SNMP ACL file, it crashes with an error about the ACL. If SNMP wasn't in OpenJDK I would not expect it to even attempt to read the ACL, and just ignore the com.sun.management.snmp properties. Anyway I thought OpenJDK (more or less) is the Sun JDK?
    – edarc
    Feb 26, 2010 at 14:01
  • I tried to use SNMP in glassfish with OpenJDK, and it doesn't worked. Keeping the same configuration and switching to Sun Java worked fine. But you probably right concerning the support of SNMP in OpenJDK. However I know some functionality are missing in OpenJDK 6 compare to Sun Java.
    – Bouil
    Feb 27, 2010 at 19:49
1

I had the same problem. After enabling SNMP the Glassfish don't start anymore. The solution is simple and described here: http://www.randombugs.com/java/glassfish/snmp-support-glassfish-211-cluster-support.html

Just put the correct permissions on your acl file.

[randombugs@jack]# chown <application user> /etc/java-6-sun/management/snmp.acl
[randombugs@jack]# chmod o-r /etc/java-6-sun/management/snmp.acl
[randombugs@jack]# chmod g-r /etc/java-6-sun/management/snmp.acl
0

You probably checked already, but is there anything listening on that port already?

netstat -an | grep LISTEN will show that.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .