Browsing the Glassfish SNMP J2EE-MIB

Presentation


There are many different MIB browser that you can use to browse a MIB.

The one I am using are:

  •    snmpwalk

snmpwalk 

snmpwalk, snmpget, snmpgetnext snmp utilities are bundled with any Solaris distribution (after Solaris 10). (The same also for linux as well).  It is possible to browse very easily a MIB using those commands.

snmp utilities commands are described in UNIX man pages

  • man snmpwalk
  • man snmpget


snmpalk allows to browse very easily the J2EE-MIB


Example:


  •    retrieving the snmp J2eesrvTable from the J2EE-MIB

snmpwalk -c public -v 1 <hostname>:10161 1.3.6.1.4.1.42.2.9999.1.1.1.1.1.2

iso.3.6.1.4.1.42.2.9999.1.1.1.1.1.2.1.2.1.1 = STRING: "name=server"
iso.3.6.1.4.1.42.2.9999.1.1.1.1.1.2.1.3.1.1 = OID: iso.3.6.1.4.1.42
iso.3.6.1.4.1.42.2.9999.1.1.1.1.1.2.1.5.1.1 = STRING: "Sun Microsystems, Inc."
iso.3.6.1.4.1.42.2.9999.1.1.1.1.1.2.1.6.1.1 = STRING: "Sun Java System Application Server 9.1.1"
iso.3.6.1.4.1.42.2.9999.1.1.1.1.1.2.1.7.1.1 = INTEGER: 1
iso.3.6.1.4.1.42.2.9999.1.1.1.1.1.2.1.8.1.1 = INTEGER: 1
iso.3.6.1.4.1.42.2.9999.1.1.1.1.1.2.1.9.1.1 = INTEGER: 2
iso.3.6.1.4.1.42.2.9999.1.1.1.1.1.2.1.10.1.1 = INTEGER: 4
iso.3.6.1.4.1.42.2.9999.1.1.1.1.1.2.1.11.1.1 = STRING: "Fri Oct 31 15:47:37 MET 2008"


By providing as parameter the J2EE-MIB definition on the command line (using the -m option), the user is getting a more readable output

snmpwalk -c public -v 1 <hostname>:10161 -m J2EE-MIB J2EE-MIB::j2eeMoGroup | more
J2EE-MIB::j2eeDomMoName.1 = STRING: "domain1"
J2EE-MIB::j2eeDomEnterprise.1 = OID: J2EE-MIB::sun
J2EE-MIB::j2eeDomMoStateManaged.1 = INTEGER: false(2)
J2EE-MIB::j2eeDomMoStatProv.1 = INTEGER: false(2)
J2EE-MIB::j2eeDomMoEventProv.1 = INTEGER: false(2)
J2EE-MIB::j2eeDomSMState.1 = INTEGER: other(1)
J2EE-MIB::j2eeDomSMStartTime.1 = STRING: "NOT_APPLICABLE"
J2EE-MIB::j2eeSrvMoName.1.1 = STRING: "cluster=cl1,name=cl1_ins1"
J2EE-MIB::j2eeSrvMoName.1.2 = STRING: "name=server"
J2EE-MIB::j2eeSrvMoName.1.3 = STRING: "name=sa_ins3"
J2EE-MIB::j2eeSrvMoName.1.4 = STRING: "cluster=cl1,name=cl1_ins2"
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 Communications Server 1.5
J2EE-MIB::j2eeSrvVersion.1.2 = STRING: Sun GlassFish Communications Server 1.5
J2EE-MIB::j2eeSrvVersion.1.3 = STRING: Sun GlassFish Communications Server 1.5
J2EE-MIB::j2eeSrvVersion.1.4 = STRING: Sun GlassFish Communications Server 1.5
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: stopped(3)
J2EE-MIB::j2eeSrvSMState.1.2 = INTEGER: running(4)
J2EE-MIB::j2eeSrvSMState.1.3 = INTEGER: stopped(3)
J2EE-MIB::j2eeSrvSMState.1.4 = INTEGER: stopped(3)
J2EE-MIB::j2eeSrvSMStartTime.1.1 = STRING: "NOT_APPLICABLE"
J2EE-MIB::j2eeSrvSMStartTime.1.2 = STRING: "Thu Feb 05 16:06:55 MET 2009"
J2EE-MIB::j2eeSrvSMStartTime.1.3 = STRING: "NOT_APPLICABLE"
J2EE-MIB::j2eeSrvSMStartTime.1.4 = STRING: "NOT_APPLICABLE"
J2EE-MIB::j2eeJVMVersion.2.1 = STRING: 1.5.0_12
J2EE-MIB::j2eeJVMVendor.2.1 = STRING: Sun Microsystems Inc.
J2EE-MIB::j2eeJVMEnterprise.2.1 = OID: J2EE-MIB::sun
....
...

snmpget: Retrieving a specfic OID


Whereas snmpwalk is browsing the entire MIB, it is possible to retrieve a specific OID value using snmpget

Example:



snmpget -c public -v 1 jesma115:10161 J2EE-MIB::j2eeSrvVersion.1.1
  --->  J2EE-MIB::j2eeSrvVersion.1.1 = STRING: Sun Java System Application Server 9.1.1




Useful Tips


snmpwalk is very powerful, and allows to browse  very easily specific needs.
Example: Getting Server information

browsing the server list of the domain:

  •    Getting the server list: 

snmpwalk -c public -v 1 <hostname>:10161 J2EE-MIB::j2eeSrvMoName
J2EE-MIB::j2eeSrvMoName.1.1 = STRING: "cluster=cl1,name=cl1_ins1"
J2EE-MIB::j2eeSrvMoName.1.2 = STRING: "name=server"
J2EE-MIB::j2eeSrvMoName.1.3 = STRING: "name=sa_ins3"
J2EE-MIB::j2eeSrvMoName.1.4 = STRING: "cluster=cl1,name=cl1_ins2"

  •    Getting the Servers State


snmpwalk -c public -v 1 <hostname>:10161 J2EE-MIB::j2eeSrvSMState
J2EE-MIB::j2eeSrvSMState.1.1 = INTEGER: stopped(3)
J2EE-MIB::j2eeSrvSMState.1.2 = INTEGER: running(4)
J2EE-MIB::j2eeSrvSMState.1.3 = INTEGER: stopped(3)
J2EE-MIB::j2eeSrvSMState.1.4 = INTEGER: stopped(3)

  •    Getting the Server Start Time


snmpwalk -c public -v 1 <hostname>:10161 J2EE-MIB::j2eeSrvSMStartTime
J2EE-MIB::j2eeSrvSMStartTime.1.1 = STRING: "NOT_APPLICABLE"
J2EE-MIB::j2eeSrvSMStartTime.1.2 = STRING: "Thu Feb 05 16:06:55 MET 2009"
J2EE-MIB::j2eeSrvSMStartTime.1.3 = STRING: "NOT_APPLICABLE"
J2EE-MIB::j2eeSrvSMStartTime.1.4 = STRING: "NOT_APPLICABLE"

In this deployment, the domain is made up of 4 different glassfish server instance:

  •    one for the DAS (server)
  • instance in cluster cl1 (cl1_ins1, cl1_ins2) 
  • one standalone instance  (sa_ins3)


Only the DAS server is running and the other  server instances are stopped.

Example: getting information about a deployed webapplication

The following example is showing a deployed webapplication webapp1 , which contains modules and servlets

snmpwalk -c public -v 1 <hostname>:10161 J2EE-MIB::j2eeMoGroup | grep webapp1
J2EE-MIB::j2eeAppMoName.2.11 = STRING: "name=webapp1,server=server"
J2EE-MIB::j2eeModMoName.2.11.14 = STRING: "application=webapp1,name=//server/webapp1webmod2,server=server"
J2EE-MIB::j2eeModMoName.2.11.15 = STRING: "application=webapp1,name=//server/webapp1webmod1,server=server"
J2EE-MIB::j2eeSletMoName.2.11.14.36 = STRING: "application=webapp1,name=webapp1webmod2_Servlet2,webmodule=//server/webapp1webmod2,server=server"
J2EE-MIB::j2eeSletMoName.2.11.14.37 = STRING: "application=webapp1,name=jsp,webmodule=//server/webapp1webmod2,server=server"
J2EE-MIB::j2eeSletMoName.2.11.14.38 = STRING: "application=webapp1,name=default,webmodule=//server/webapp1webmod2,server=server"
J2EE-MIB::j2eeSletMoName.2.11.14.39 = STRING: "application=webapp1,name=webapp1webmod2_Servlet1,webmodule=//server/webapp1webmod2,server=server"
J2EE-MIB::j2eeSletMoName.2.11.15.40 = STRING: "application=webapp1,name=webapp1webmod1_Servlet1,webmodule=//server/webapp1webmod1,server=server"
J2EE-MIB::j2eeSletMoName.2.11.15.41 = STRING: "application=webapp1,name=jsp,webmodule=//server/webapp1webmod1,server=server"
J2EE-MIB::j2eeSletMoName.2.11.15.42 = STRING: "application=webapp1,name=default,webmodule=//server/webapp1webmod1,server=server"
J2EE-MIB::j2eeSletMoName.2.11.15.43 = STRING: "application=webapp1,name=webapp1webmod1_Servlet2,webmodule=//server/webapp1webmod1,server=server"
Comments:

Post a Comment:
  • HTML Syntax: NOT allowed
About

Olivier Rivat

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today