Friday, March 6, 2009

Being a nice client of Inca service: monitoring Grid Resource

If you consider a monitoring mechanism for the TeraGrid resources, the Inca project from SDSC provides very useful information. ( With access to Inca service, you can easily utilize monitoring information with light-weight software component. Thank you for hosting the service and very helpful supports from the Inca team! It was very pleasant experience.

If you are using the TeraGrid resources, you might be interested in the Inca's real time monitoring testbed ( Inca server runs the testing described in above document. Those information is available through RESTful URLs for the clients. The information is encoded either XML or HTML.

However, to use access the result, you have to create a query. There are pre-created query available for the particular projects including the TeraGrid Resource Monitoring page in the TeraGrid user portal. This query includes result of monitoring status of remote login to the TeraGrid cluster, pre-ws gatekeeper, and ws gatekeeper server. If you want to see the most recent result of the testing encoded in XML:
Or, as a HTML page,

For more detail information,[clusterID]/prews-gram-batch
For example,
You will see the more detail information about the SDSC IA64 clusters such as testing intervals.

To create a query for your own purpose, you have to contact the administrator of the Inca service. Inca provides nice user interface for the administrator to create new query. After you create new query, you can access your result through:[XML|HTML]/kit-status-v1//

This output can be easily integrated to your software though light-weight way such as HTTP client. After downloding the information, we used conventional Java DOM implementation. With customized query, the response size seems to be reasonable to run with DOM implementation.

Please note that if you access Inca service hosted by SDSC, the testing interval is not changable.

Here is my test code:

import javax.xml.parsers.*;
import org.w3c.dom.*;

public class Test{
public static void main(String[] args){
try {
DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
DocumentBuilder db = dbf.newDocumentBuilder();
Document dom = db.parse("");
Element docEle = dom.getDocumentElement();
NodeList nl = docEle.getElementsByTagName("row");

System.out.println("There are "+ nl.getLength()+ " elements.");
if(nl != null && nl.getLength() > 0) {
for(int i = 0 ; i < nl.getLength();i++) {

//get the employee element
Element el = (Element)nl.item(i);
NodeList sub1 = el.getElementsByTagName("reportSummary");
NodeList sub2 = ((Element)sub1.item(0)).getElementsByTagName("hostname");
String hostname = ((Element)sub2.item(0)).getFirstChild().getNodeValue();
System.out.println("HostName "+i+":"+hostname);
} catch (Exception e) {

No comments: