GlassFish Server 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.
Remote subcommands require running servers.
If monitoring for GlassFish Server is disabled, running the run-script subcommand automatically enables it.
Example 9-1 Running a Script for Monitoring GlassFish Server
This example runs the script /tools/mon/modulestarted.js on all server instances in the cluster named cluster1.
asadmin> run-script --target cluster1 /tools/mon/modulestarted.js
You can view the full syntax and options of the subcommand by typing asadmin help run-script at the command line.