Sun GlassFish Enterprise Manager SNMP Monitoring 1.0 Reference

Monitoring Clustered and Stand-Alone Server Instances

Using SNMP monitoring, GlassFish can be monitored in two ways:

The Sun GlassFish Enterprise Manager SNMP Monitoring 1.0 Installation and Quick Start Guide only gives examples of monitoring the DAS. This section gives examples of both ways of monitoring.

For additional information about setting up clusters, see the following documentation:

For simplicity, examples in this section show everything being created on the same machine using only asadmin commands. For more information about asadmin commands, see the Sun GlassFish Enterprise Server 2.1 Reference Manual. For information about using the Admin Console to create clusters and stand-alone instances, see the Admin Console online help.

Example snmpwalk commands in this section use the J2EE-MIB file. This file is available at http://java.sun.com/j2ee/tools/management/downloads/index.html.

Running the examples in this section involves the following tasks:

Creating the Topology

Examples in this section use the following topology:

The asadmin commands to create this topology are as follows:


asadmin start-domain
asadmin create-node-agent nodeagent1
asadmin create-instance --nodeagent nodeagent1 standalone-instance1
asadmin create-cluster cluster1
asadmin create-instance --nodeagent nodeagent1 --cluster cluster1 clustered-instance1
asadmin create-instance --nodeagent nodeagent1 --cluster cluster1 clustered-instance2

Note that all of the server instances use the same node agent. This is possible because all are on the same machine. This will come in handy in Starting the Server Instances.

Configuring the Ports

Since all the server instances to be monitored are on the same machine, you must change the default SNMP adapter ports for the server instances to avoid port conflicts. Use the following asadmin commands.


asadmin set standalone-instance1.property.snmp-adapter-port=10162
asadmin set clustered-instance1.property.snmp-adapter-port=10163
asadmin set clustered-instance2.property.snmp-adapter-port=10164

If the server instances are already running, you must restart them for these port changes to take effect. For more information about changing the SNMP adapter ports, see the Sun GlassFish Enterprise Manager SNMP Monitoring 1.0 Installation and Quick Start Guide.

Starting the Server Instances

Because all of the server instances were configured to use the same node agent in Creating the Topology, just one asadmin command starts all of them:


asadmin start-node-agent nodeagent1

Monitoring the Domain Administration Server

Before you can monitor the DAS (whose name is server), you must enable SNMP monitoring on the DAS by deploying the __assnmp.war module:


asadmin deploy ./__assnmp.war

To monitor the DAS, use the SNMP adapter port for the DAS, which is 10161 unless the default has been changed. When you monitor the DAS, you get the complete view of the domain, domain1. You get SNMP data for all the servers in the domain, including the DAS. For example, the following snmpwalk command retrieves data for all the servers in the domain.


snmpwalk -c public -v 1 -m ./J2EE-MIB localhost:10161 J2EE-MIB::j2eeSrvTable

The output looks like this:


J2EE-MIB::j2eeSrvMoName.1.1 = STRING: "name=server"
J2EE-MIB::j2eeSrvMoName.1.2 = STRING: "cluster=cluster1,name=clustered-instance2"
J2EE-MIB::j2eeSrvMoName.1.3 = STRING: "cluster=cluster1,name=clustered-instance1"
J2EE-MIB::j2eeSrvMoName.1.4 = STRING: "name=standalone-instance1"
J2EE-MIB::j2eeSrvEnterprise.1.1 = OID: J2EE-MIB::sun
J2EE-MIB::j2eeSrvEnterprise.1.2 = OID: J2EE-MIB::sun
J2EE-MIB::j2eeSrvEnterprise.1.3 = OID: J2EE-MIB::sun
J2EE-MIB::j2eeSrvEnterprise.1.4 = OID: J2EE-MIB::sun
J2EE-MIB::j2eeSrvVendor.1.1 = STRING: Sun Microsystems, Inc.
J2EE-MIB::j2eeSrvVendor.1.2 = STRING: Sun Microsystems, Inc.
J2EE-MIB::j2eeSrvVendor.1.3 = STRING: Sun Microsystems, Inc.
J2EE-MIB::j2eeSrvVendor.1.4 = STRING: Sun Microsystems, Inc.
J2EE-MIB::j2eeSrvVersion.1.1 = STRING: Sun GlassFish Enterprise Server v2.1
J2EE-MIB::j2eeSrvVersion.1.2 = STRING: Sun GlassFish Enterprise Server v2.1
J2EE-MIB::j2eeSrvVersion.1.3 = STRING: Sun GlassFish Enterprise Server v2.1
J2EE-MIB::j2eeSrvVersion.1.4 = STRING: Sun GlassFish Enterprise Server v2.1
J2EE-MIB::j2eeSrvMoStateManaged.1.1 = INTEGER: true(1)
J2EE-MIB::j2eeSrvMoStateManaged.1.2 = INTEGER: true(1)
J2EE-MIB::j2eeSrvMoStateManaged.1.3 = INTEGER: true(1)
J2EE-MIB::j2eeSrvMoStateManaged.1.4 = INTEGER: true(1)
J2EE-MIB::j2eeSrvMoStatProv.1.1 = INTEGER: false(2)
J2EE-MIB::j2eeSrvMoStatProv.1.2 = INTEGER: false(2)
J2EE-MIB::j2eeSrvMoStatProv.1.3 = INTEGER: false(2)
J2EE-MIB::j2eeSrvMoStatProv.1.4 = INTEGER: false(2)
J2EE-MIB::j2eeSrvMoEventProv.1.1 = INTEGER: false(2)
J2EE-MIB::j2eeSrvMoEventProv.1.2 = INTEGER: false(2)
J2EE-MIB::j2eeSrvMoEventProv.1.3 = INTEGER: false(2)
J2EE-MIB::j2eeSrvMoEventProv.1.4 = INTEGER: false(2)
J2EE-MIB::j2eeSrvSMState.1.1 = INTEGER: running(4)
J2EE-MIB::j2eeSrvSMState.1.2 = INTEGER: running(4)
J2EE-MIB::j2eeSrvSMState.1.3 = INTEGER: running(4)
J2EE-MIB::j2eeSrvSMState.1.4 = INTEGER: running(4)
J2EE-MIB::j2eeSrvSMStartTime.1.1 = STRING: "Tue Jan 27 08:52:43 PST 2009"
J2EE-MIB::j2eeSrvSMStartTime.1.2 = STRING: "Tue Jan 27 08:56:42 PST 2009"
J2EE-MIB::j2eeSrvSMStartTime.1.3 = STRING: "Tue Jan 27 08:56:43 PST 2009"
J2EE-MIB::j2eeSrvSMStartTime.1.4 = STRING: "Tue Jan 27 08:56:42 PST 2009"

Monitoring Individual Server Instances

To monitor stand-alone and clustered server instances directly, you need to enable SNMP monitoring on those servers by designating them as targets for deployment of the __assnmp.war web application. Create application references using the following asadmin commands:


asadmin create-application-ref --target standalone-instance1 __assnmp
asadmin create-application-ref --target cluster1 __assnmp

To monitor the stand-alone instance, standalone-instance1, use SNMP adapter port 10162. For example, here is an snmpwalk command and its output:


snmpwalk -c public -v 1 -m ./J2EE-MIB localhost:10162 J2EE-MIB::j2eeSrvTable

J2EE-MIB::j2eeSrvMoName.1.1 = STRING: "name=standalone-instance1"
J2EE-MIB::j2eeSrvEnterprise.1.1 = OID: J2EE-MIB::sun
J2EE-MIB::j2eeSrvVendor.1.1 = STRING: Sun Microsystems, Inc.
J2EE-MIB::j2eeSrvVersion.1.1 = STRING: Sun GlassFish Enterprise Server v2.1
J2EE-MIB::j2eeSrvMoStateManaged.1.1 = INTEGER: true(1)
J2EE-MIB::j2eeSrvMoStatProv.1.1 = INTEGER: false(2)
J2EE-MIB::j2eeSrvMoEventProv.1.1 = INTEGER: false(2)
J2EE-MIB::j2eeSrvSMState.1.1 = INTEGER: running(4)
J2EE-MIB::j2eeSrvSMStartTime.1.1 = STRING: "Tue Jan 27 08:56:17 PST 2009"

To monitor the clustered instances, clustered-instance1 and clustered-instance2, use SNMP adapter ports 10163 and 10164, respectively. For example, here are two snmpwalk commands and their output:


snmpwalk -c public -v 1 -m ./J2EE-MIB localhost:10163 J2EE-MIB::j2eeSrvTable

J2EE-MIB::j2eeSrvMoName.1.1 = STRING: "name=clustered-instance1"
J2EE-MIB::j2eeSrvEnterprise.1.1 = OID: J2EE-MIB::sun
J2EE-MIB::j2eeSrvVendor.1.1 = STRING: Sun Microsystems, Inc.
J2EE-MIB::j2eeSrvVersion.1.1 = STRING: Sun GlassFish Enterprise Server v2.1
J2EE-MIB::j2eeSrvMoStateManaged.1.1 = INTEGER: true(1)
J2EE-MIB::j2eeSrvMoStatProv.1.1 = INTEGER: false(2)
J2EE-MIB::j2eeSrvMoEventProv.1.1 = INTEGER: false(2)
J2EE-MIB::j2eeSrvSMState.1.1 = INTEGER: running(4)
J2EE-MIB::j2eeSrvSMStartTime.1.1 = STRING: "Tue Jan 27 08:56:22 PST 2009"

snmpwalk -c public -v 1 -m ./J2EE-MIB localhost:10164 J2EE-MIB::j2eeSrvTable

J2EE-MIB::j2eeSrvMoName.1.1 = STRING: "name=clustered-instance2"
J2EE-MIB::j2eeSrvEnterprise.1.1 = OID: J2EE-MIB::sun
J2EE-MIB::j2eeSrvVendor.1.1 = STRING: Sun Microsystems, Inc.
J2EE-MIB::j2eeSrvVersion.1.1 = STRING: Sun GlassFish Enterprise Server v2.1
J2EE-MIB::j2eeSrvMoStateManaged.1.1 = INTEGER: true(1)
J2EE-MIB::j2eeSrvMoStatProv.1.1 = INTEGER: false(2)
J2EE-MIB::j2eeSrvMoEventProv.1.1 = INTEGER: false(2)
J2EE-MIB::j2eeSrvSMState.1.1 = INTEGER: running(4)
J2EE-MIB::j2eeSrvSMStartTime.1.1 = STRING: "Tue Jan 27 08:56:24 PST 2009"