Monitoring Scripting Client provides an asadmin subcommand to run scripts for monitoring GlassFish Server. To ensure that scripts can receive and process events correctly, you must use the subcommand that is provided to run these scripts.
Ensure that the server is running.
Remote subcommands require a running server.
Ensure that monitoring is enabled for GlassFish Server.
If monitoring for GlassFish Server is disabled, no events that your script is listening for are sent.
For information about how to enable monitoring for GlassFish Server, see To Enable Monitoring in Oracle GlassFish Server 3.0.1 Administration Guide.
Run the run-script subcommand.
This example runs the script /tools/mon/modulestarted.js.
asadmin> run-script /tools/mon/modulestarted.js
You can also view the full syntax and options of the subcommand by typing asadmin help run-script at the command line.