This API call provides an indication of the status of ExtraView.
http://www.myserver.com/evj/ExtraView/ev_api.action?
user_id=username
&password=password
&statevar=get_heartbeat
The return from the server is XML, similar to the following:
<?xml version="1.0" encoding="UTF-8" ?>
<EV_HEARTBEAT> <EV_STATUS>EXTRAVIEW ALIVE</EV_STATUS> <DB_STATUS>DB CONNECTION CONFIRMED</DB_STATUS> <DB_DATETIME>2003/09/11 11:33:22</DB_DATETIME> <FREE_MEMORY>197</FREE_MEMORY> <TOTAL_MEMORY>250</TOTAL_MEMORY> <HEARTBEAT_EXEC_TIME>330</HEARTBEAT_EXEC_TIME> <TASK_INFO TASK=task name> <NODE_ID>node name<NODE_ID> <START_OPTION>start option</START_OPTION> <TASK_STATE>task state</TASK_STATE> <POLL_INTERVAL>poll interval seconds</POLL_INTERVAL> - [<THREAD_INFO> <THREAD_STATE>thread state</THREAD_STATE> <SECS_SINCE_EXECUTION>seconds since last execution [<PRIORITY>thread priority</PRIORITY> ] </THREAD_INFO>] </TASK_INFO> </EV_HEARTBEAT> |
In the above, the section on task information is repeated for each configured task on the application server. The returned information includes:
task name | name of the background task, e.g., SESSION_MONITOR, TASK_CONTROL_TASK, BATCHMAIL, etc. |
node name | name of the node hosting the evapi service |
start option | START_NOW, STOP_NOW, START_ON_BOOT, or none |
task state | STARTED, STOPPED, or ERROR |
poll interval seconds | the (minimum) number of seconds between polled executions |
thread state | running or stopped |
seconds since last execution | number of seconds since the task was most recently scheduled to run |
thread priority | the priority of the thread ( using Java thread priority values) -- may not appear in output |
The return indicates not only that ExtraView is alive, but also it confirms that a database connection could be made, that the ExtraView servlet is running on the application server, and that the web server is running.
Note that the tag named DB_DATETIME and its value provide the current timestamp of the database server. This can be useful to provide local client applications with the server time of the host ExtraView application.
The amount of free memory, the total memory and the amount of time the command took to execute are also returned.
This command can be placed in a script that is run at routine intervals to provide an indication of the health of the system. Not only can confirmation be made that the system is alive, but the time to execute the command is available