I’m learning to use the Glassfish 3 REST interface directly, since the admin web GUI is so damn slow that it’s barely usable. So, for example, I do this:
curl -s http://localhost:4848/monitoring/domain/server/transaction-service
This works fine on my personal instance of Glassfish, which has a blank password for the admin user. On the production instance, it complains about “Invalid user name or password.” So how do I pass the user name and password to this command?
Bonus question: I already know how to specify the credentials to asadmin – how do I perform the above operation with asadmin?
The GlassFish REST Interface supports basic authentication.
You would use the ‘–user’ option for curl to authenticate your requests.
The command would look like this
If you are the admin user for your production server, you should secure the GlassFish REST Interface to protect the authentication data from sniffing, if it has not been configured already.
The command would look like this, after securing the interface.
You can use asadmin get and asadmin list to view monitoring data, too.
Try
To get the value of statistics associated with the transaction service. Remember to set the monitoring level to HI first.