Example3
Attemptto get a specic attribute from a subsystem:
asadmin> get --user admin-user --monitor server.jvm.uptime-lastsampletime
Returns:
server.jvm.uptime-lastsampletime = 1093215374813
Example4
Attemptto get an unknown attribute from within a subsystem attribute:
asadmin> get --user admin-user --monitor server.jvm.badname
Returns:
No such attribute found from reflecting the corresponding Stats
interface: [badname]
CLI137 Command get failed.

ToUse the PetStoreExample

Thefollowing example illustrates how the asadmin tool might be used for monitoring purposes.
Auser wants to inspect the number of calls made to a method in the sample PetStore
applicationafter it has been deployed onto the Enterprise Server. The instance onto which it has
beendeployed is named server. A combination of the list and get commands are used to
accessdesired statistics on a method.
Startthe Enterprise Server and the asadmin tool.
Setsome useful environment variables to avoid entering them forevery command:
asadmin> export AS_ADMIN_USER=admin AS_ADMIN_PASSWORD=admin123
asadmin>export AS_ADMIN_HOST=localhost AS_ADMIN_PORT=4848
Listmonitorable components for instance server:
asadmin> list --user adminuser --monitor server*
Returns(output will be similar to):
server
server.applications
server.applications.CometEJB
server.applications.ConverterApp
server.applications.petstore
1
2
3
ViewingMonitoringData
Chapter18 • Monitoring Components and Ser vices 199