Child pages
  • Wonder JavaMonitor and wotaskd

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Info

If JavaMonitor is configured with a password, and I hope you do, pass pw=monitorpassword as a argument to the query :

Code Block
http://monitorhost:port/cgi-bin/WebObjects/JavaMonitor.woa/wa/statistics?pw=monitorpassword

wget http://monitorhost:56789/cgi-bin/WebObjects/JavaMonitor.woa/admin/stop?type=app&name=InstanceName&pw=yourPassword

Direct Actions in JavaMonitor for Management Tasks

You can do most of the standard management tasks you'd normally do in JavaMonitor's web UI by calling standard WebObjects Direct Actions. Instead of using the /wa/ request handler though, these management tasks use a new /admin/ request handler. These Direct Actions can be very useful, especially if you need to restart instances or other do tasks from the command line, from within Ant or other build or deployment systems.

...

To get details about instance 1 of the AjaxExample application:
http://monitorhost:port/cgi-bin/WebObjects/JavaMonitor.woa/admin/info?type=ins&name=AjaxExample-1

Remote Control via REST Routes (for JavaMonitor)

If the control offered by the Direct Actions isn't enough, JavaMonitor allows additional control via REST calls. Between the two methods (Direct Actions, REST) you have almost full remote-control of JavaMonitor. Just make sure that your JavaMonitor installation is secure! Just like with Direct Actions, you need to append ?pw=XXXX to the URLs if your JavaMonitor is password protected.

...

Note that before configuring the site you must first add a host. If you attempt to configure the site prior to adding a host you will get an InvalidStateException.

...

Remote Control via REST Routes (for wotaskd)

Starting on August

...

10th 2012, wotaskd also have REST routes. By using them, you can do most of the tasks using REST and you might not even need JavaMonitor. Just like the JavaMonitor REST and Direct Actions, you need to append ?pw=XXXX to the URLs if wotaskd is password protected.

Code Block
none
none
titleFetching Details for All Applications

curl -X GET http://wotaskdhost:port/cgi-bin/WebObjects/JavaMonitor.woa/ra/mApplications.json
Code Block
none
none
titleAdding a New Application

curl -X POST -d "{id: 'AjaxExample',type: 'MApplication', name: 'AjaxExample',unixOutputPath: '/opt/Local/Library/WebObjects/Logs', unixPath: '/opt/Local/Library/WebObjects/Applications/AjaxExample.woa/AjaxExample'}" http://wotaskdhost:port/cgi-bin/WebObjects/JavaMonitor.woa/ra/mApplications.json
Code Block
none
none
titleDelete an Application

curl -X DELETE http://wotaskdhost:port/cgi-bin/WebObjects/JavaMonitor.woa/ra/mApplications/AjaxExample.json
Code Block
none
none
titleAdding a New Instance

curl -X GET http://wotaskdhost:port/cgi-bin/WebObjects/JavaMonitor.woa/ra/mApplications/AjaxExample/addInstance&host=localhost
Code Block
none
none
titleDelete an Instance

curl -X GET http://wotaskdhost:port/cgi-bin/WebObjects/JavaMonitor.woa/ra/mApplications/AjaxExample/deleteInstance?id=1
Code Block
none
none
titleConfiguring the Site

curl -X PUT -d "{woAdaptor:'www.mydomain.com'}" http://wotaskdhost:port/cgi-bin/WebObjects/JavaMonitor.woa/ra/mSiteConfig.json
Code Block
none
none
titleStarting all applications

curl -X GET http://wotaskdhost:port/cgi-bin/WebObjects/JavaMonitor.woa/ra/mApplications/start
Code Block
none
none
titleStarting a specific application (AjaxExample in this example)

curl -X GET http://wotaskdhost:port/cgi-bin/WebObjects/JavaMonitor.woa/ra/mApplications/AjaxExample/start
Code Block
none
none
titleStarting a specific instance of an application (instance 1 of AjaxExample in this example)

curl -X GET http://wotaskdhost:port/cgi-bin/WebObjects/JavaMonitor.woa/ra/mApplications/AjaxExample/start?id=1
Code Block
none
none
titleStopping all applications

curl -X GET http://wotaskdhost:port/cgi-bin/WebObjects/JavaMonitor.woa/ra/mApplications/stop
Code Block
none
none
titleStopping a specific application (AjaxExample in this example)

curl -X GET http://wotaskdhost:port/cgi-bin/WebObjects/JavaMonitor.woa/ra/mApplications/AjaxExample/stop
Code Block
none
none
titleStopping a specific instance of an application (instance 1 of AjaxExample in this example)

curl -X GET http://wotaskdhost:port/cgi-bin/WebObjects/JavaMonitor.woa/ra/mApplications/AjaxExample/stop?id=1
Code Block
none
none
titleForce quit all applications

curl -X GET http://wotaskdhost:port/cgi-bin/WebObjects/JavaMonitor.woa/ra/mApplications/forceQuit
Code Block
none
none
titleForce quit a specific application (AjaxExample in this example)

curl -X GET http://wotaskdhost:port/cgi-bin/WebObjects/JavaMonitor.woa/ra/mApplications/AjaxExample/forceQuit
Code Block
none
none
titleForce quit a specific instance of an application (instance 1 of AjaxExample in this example)

curl -X GET http://wotaskdhost:port/cgi-bin/WebObjects/JavaMonitor.woa/ra/mApplications/AjaxExample/forceQuit?id=1
Code Block
none
none
titleInformation about all applications

curl -X GET http://wotaskdhost:port/cgi-bin/WebObjects/JavaMonitor.woa/ra/mApplications/info
Code Block
none
none
titleInformation about a specific application (AjaxExample in this example)

curl -X GET http://wotaskdhost:port/cgi-bin/WebObjects/JavaMonitor.woa/ra/mApplications/AjaxExample/info
Code Block
none
none
titleInformation about a specific instance of an application (instance 1 of AjaxExample in this example)

curl -X GET http://wotaskdhost:port/cgi-bin/WebObjects/JavaMonitor.woa/ra/mApplications/AjaxExample/info?id=1
Code Block
none
none
titleCheck if all applications are running

curl -X GET http://wotaskdhost:port/cgi-bin/WebObjects/JavaMonitor.woa/ra/mApplications/isRunning
Code Block
none
none
titleCheck if a specific application is running (AjaxExample in this example)

curl -X GET http://wotaskdhost:port/cgi-bin/WebObjects/JavaMonitor.woa/ra/mApplications/AjaxExample/isRunning
Code Block
none
none
titleCheck if a specific instance of an application is running (instance 1 of AjaxExample in this example)

curl -X GET http://wotaskdhost:port/cgi-bin/WebObjects/JavaMonitor.woa/ra/mApplications/AjaxExample/isRunning?id=1
Code Block
none
none
titleCheck if all applications are stopped

curl -X GET http://wotaskdhost:port/cgi-bin/WebObjects/JavaMonitor.woa/ra/mApplications/isStopped
Code Block
none
none
titleCheck if a specific application is stopped (AjaxExample in this example)

curl -X GET http://wotaskdhost:port/cgi-bin/WebObjects/JavaMonitor.woa/ra/mApplications/AjaxExample/isStopped
Code Block
none
none
titleCheck if a specific instance of an application is stopped (instance 1 of AjaxExample in this example)

curl -X GET http://wotaskdhost:port/cgi-bin/WebObjects/JavaMonitor.woa/ra/mApplications/AjaxExample/isStopped?id=1

Troubleshooting

If JavaMonitor won't start up check the troubleshooting deployment section. In particular pay attention to the WOTaskd Didn't Start Q&A.