12.3 Invoking Scripts through the Experience Manager-Monitor Web Server (WebOps)

The Experience Manager-Monitor scripting layer allows certain scripted functions to be invoked through the monitor’s Web server through a feature called Web-Invocable Scripted Operations (WebOps). This feature allows custom functionality to be accessed by remote systems or custom Web pages hosted on the monitor’s Web server. In the default configuration, only diagnostic WebOps are enabled:

These and other sample WebOps are included in the WebOps.js file in the Monitor’s “scripts” directory. WebOps can be invoked by pointing a browser to /Plugins/invoke.pl?op=WebOps_name on the monitor’s Web server. For example, to assuming a monitor with the default configuration is running on the local system and the Web server is listening on port 8080, pointing a browser to http://localhost:8080/Plugins/invoke.pl?op=threadDump returns a thread dump for the running monitor.

Custom WebOps might be coded to perform virtually any action available to the monitor scripting layer. Web server requests to /Plugins/invoke.pl are routed to the WebOps framework. Upon receiving a request, the framework searches for a valid WebOps specified by the op parameter. If found, all of the parameters in the request are bound into a java.util.Map object and passed as an argument to the operation. Anything returned by the operation is automatically returned to the caller as an HTML string. Refer to the included WebOps.js file for examples.

Two settings in monitor.properties are used to manage WebOps functionality: