...
If you call http://monitorhost:port/cgi-bin/WebObjects/JavaMonitor.woa/wa/statistics
, JavaMonitor will send you back statistics, in serialized Property List format, about instances, per application.
Code Block |
---|
| none |
---|
| none |
---|
title | Statistics Example Resultsnone |
---|
|
(
{
"configuredInstances" = "2";
"maxSessions" = "0";
"maxAvgIdleTime" = "2.078";
"avgTransactions" = "44.0000";
"sumSessions" = "0";
"avgAvgTransactionTime" = "0.0985000";
"refusingInstances" = "0";
"avgSessions" = "0.0000";
"maxTransactions" = "88";
"applicationName" = "AjaxExample";
"avgAvgIdleTime" = "1.0390000";
"maxAvgTransactionTime" = "0.197";
"runningInstances" = "2";
"sumTransactions" = "88";
},
{
"configuredInstances" = "2";
"maxSessions" = "0";
"maxAvgIdleTime" = "325.443";
"avgTransactions" = "0.5000";
"sumSessions" = "0";
"avgAvgTransactionTime" = "0.00000";
"refusingInstances" = "0";
"avgSessions" = "0.0000";
"maxTransactions" = "1";
"applicationName" = "AjaxExample2";
"avgAvgIdleTime" = "162.7215000";
"maxAvgTransactionTime" = "0.0";
"runningInstances" = "2";
"sumTransactions" = "1";
}
)
|
...
Examples of REST calls :
Code Block |
---|
| none |
---|
| none |
---|
title | Adding a New Hostnone |
---|
|
curl -X POST -d "{id: 'otherserver.com',type: 'MHost', osType: 'MACOSX',address: '192.168.20.5', name: 'otherserver.com'}" http://monitorhost:port/apps/WebObjects/JavaMonitor.woa/ra/mHosts.json
|
Code Block |
---|
| none |
---|
| none |
---|
title | Fetching Details for All Applicationsnone |
---|
|
curl -X GET http://monitorhost:port/cgi-bin/WebObjects/JavaMonitor.woa/ra/mApplications.json
|
Code Block |
---|
| none |
---|
| none |
---|
title | Adding a New Applicationnone |
---|
|
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://monitorhost:port/cgi-bin/WebObjects/JavaMonitor.woa/ra/mApplications.json
|
Code Block |
---|
| none |
---|
| none |
---|
title | Delete an Applicationnone |
---|
|
curl -X DELETE http://monitorhost:port/cgi-bin/WebObjects/JavaMonitor.woa/ra/mApplications/AjaxExample.json
|
Code Block |
---|
| none |
---|
| none |
---|
title | Adding a New Instancenone |
---|
|
curl -X GET http://monitorhost:port/cgi-bin/WebObjects/JavaMonitor.woa/ra/mApplications/AjaxExample/addInstance&host=localhost
|
Code Block |
---|
| none |
---|
| none |
---|
title | Delete an Instancenone |
---|
|
curl -X GET http://monitorhost:port/cgi-bin/WebObjects/JavaMonitor.woa/ra/mApplications/AjaxExample/deleteInstance?id=1
|
Code Block |
---|
| none |
---|
| none |
---|
title | Configuring the Sitenone |
---|
|
curl -X PUT -d "{woAdaptor:'www.mydomain.com'}" http://monitorhost:port/cgi-bin/WebObjects/JavaMonitor.woa/ra/mSiteConfig.json
|
...
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 |
---|
title | Fetching Details for All Applicationsnone |
---|
|
curl -X GET http://wotaskdhost:port/cgi-bin/WebObjects/JavaMonitor.woa/ra/mApplications.json
|
Code Block |
---|
| none |
---|
| none |
---|
title | Adding a New Applicationnone |
---|
|
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 |
---|
title | Delete an Applicationnone |
---|
|
curl -X DELETE http://wotaskdhost:port/cgi-bin/WebObjects/JavaMonitor.woa/ra/mApplications/AjaxExample.json
|
Code Block |
---|
| none |
---|
| none |
---|
title | Adding a New Instancenone |
---|
|
curl -X GET http://wotaskdhost:port/cgi-bin/WebObjects/JavaMonitor.woa/ra/mApplications/AjaxExample/addInstance&host=localhost
|
Code Block |
---|
| none |
---|
| none |
---|
title | Delete an Instancenone |
---|
|
curl -X GET http://wotaskdhost:port/cgi-bin/WebObjects/JavaMonitor.woa/ra/mApplications/AjaxExample/deleteInstance?id=1
|
Code Block |
---|
| none |
---|
| none |
---|
title | Configuring the Sitenone |
---|
|
curl -X PUT -d "{woAdaptor:'www.mydomain.com'}" http://wotaskdhost:port/cgi-bin/WebObjects/JavaMonitor.woa/ra/mSiteConfig.json
|
Code Block |
---|
| none |
---|
| none |
---|
title | Starting all applicationsnone |
---|
|
curl -X GET http://wotaskdhost:port/cgi-bin/WebObjects/JavaMonitor.woa/ra/mApplications/start
|
Code Block |
---|
| none |
---|
| none |
---|
title | Starting a specific application (AjaxExample in this example)none |
---|
|
curl -X GET http://wotaskdhost:port/cgi-bin/WebObjects/JavaMonitor.woa/ra/mApplications/AjaxExample/start
|
Code Block |
---|
| none |
---|
| none |
---|
title | Starting a specific instance of an application (instance 1 of AjaxExample in this example)none |
---|
|
curl -X GET http://wotaskdhost:port/cgi-bin/WebObjects/JavaMonitor.woa/ra/mApplications/AjaxExample/start?id=1
|
Code Block |
---|
| none |
---|
| none |
---|
title | Stopping all applicationsnone |
---|
|
curl -X GET http://wotaskdhost:port/cgi-bin/WebObjects/JavaMonitor.woa/ra/mApplications/stop
|
Code Block |
---|
| none |
---|
| none |
---|
title | Stopping a specific application (AjaxExample in this example)none |
---|
|
curl -X GET http://wotaskdhost:port/cgi-bin/WebObjects/JavaMonitor.woa/ra/mApplications/AjaxExample/stop
|
Code Block |
---|
| none |
---|
| none |
---|
title | Stopping a specific instance of an application (instance 1 of AjaxExample in this example)none |
---|
|
curl -X GET http://wotaskdhost:port/cgi-bin/WebObjects/JavaMonitor.woa/ra/mApplications/AjaxExample/stop?id=1
|
Code Block |
---|
| none |
---|
| none |
---|
title | Force quit all applicationsnone |
---|
|
curl -X GET http://wotaskdhost:port/cgi-bin/WebObjects/JavaMonitor.woa/ra/mApplications/forceQuit
|
Code Block |
---|
| none |
---|
| none |
---|
title | Force quit a specific application (AjaxExample in this example)none |
---|
|
curl -X GET http://wotaskdhost:port/cgi-bin/WebObjects/JavaMonitor.woa/ra/mApplications/AjaxExample/forceQuit
|
Code Block |
---|
| none |
---|
| none |
---|
title | Force quit a specific instance of an application (instance 1 of AjaxExample in this example)none |
---|
|
curl -X GET http://wotaskdhost:port/cgi-bin/WebObjects/JavaMonitor.woa/ra/mApplications/AjaxExample/forceQuit?id=1
|
Code Block |
---|
| none |
---|
| none |
---|
title | Information about all applicationsnone |
---|
|
curl -X GET http://wotaskdhost:port/cgi-bin/WebObjects/JavaMonitor.woa/ra/mApplications/info
|
Code Block |
---|
| none |
---|
| none |
---|
title | Information about a specific application (AjaxExample in this example)none |
---|
|
curl -X GET http://wotaskdhost:port/cgi-bin/WebObjects/JavaMonitor.woa/ra/mApplications/AjaxExample/info
|
Code Block |
---|
| none |
---|
| none |
---|
title | Information about a specific instance of an application (instance 1 of AjaxExample in this example)none |
---|
|
curl -X GET http://wotaskdhost:port/cgi-bin/WebObjects/JavaMonitor.woa/ra/mApplications/AjaxExample/info?id=1
|
Code Block |
---|
| none |
---|
| none |
---|
title | Check if all applications are runningnone |
---|
|
curl -X GET http://wotaskdhost:port/cgi-bin/WebObjects/JavaMonitor.woa/ra/mApplications/isRunning
|
Code Block |
---|
| none |
---|
| none |
---|
title | Check if a specific application is running (AjaxExample in this example)none |
---|
|
curl -X GET http://wotaskdhost:port/cgi-bin/WebObjects/JavaMonitor.woa/ra/mApplications/AjaxExample/isRunning
|
Code Block |
---|
| none |
---|
| none |
---|
title | Check if a specific instance of an application is running (instance 1 of AjaxExample in this example)none |
---|
|
curl -X GET http://wotaskdhost:port/cgi-bin/WebObjects/JavaMonitor.woa/ra/mApplications/AjaxExample/isRunning?id=1
|
Code Block |
---|
| none |
---|
| none |
---|
title | Check if all applications are stoppednone |
---|
|
curl -X GET http://wotaskdhost:port/cgi-bin/WebObjects/JavaMonitor.woa/ra/mApplications/isStopped
|
Code Block |
---|
| none |
---|
| none |
---|
title | Check if a specific application is stopped (AjaxExample in this example)none |
---|
|
curl -X GET http://wotaskdhost:port/cgi-bin/WebObjects/JavaMonitor.woa/ra/mApplications/AjaxExample/isStopped
|
Code Block |
---|
| none |
---|
| none |
---|
title | Check if a specific instance of an application is stopped (instance 1 of AjaxExample in this example)none |
---|
|
curl -X GET http://wotaskdhost:port/cgi-bin/WebObjects/JavaMonitor.woa/ra/mApplications/AjaxExample/isStopped?id=1
|
...