oodt-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mattm...@apache.org
Subject svn commit: r1492529 - in /oodt/trunk: ./ resource/src/main/java/org/apache/oodt/cas/resource/monitor/exceptions/ resource/src/main/java/org/apache/oodt/cas/resource/monitor/ganglia/ resource/src/main/java/org/apache/oodt/cas/resource/monitor/ganglia/c...
Date Thu, 13 Jun 2013 05:42:14 GMT
Author: mattmann
Date: Thu Jun 13 05:42:13 2013
New Revision: 1492529

URL: http://svn.apache.org/r1492529
Log:
- patch contributed for OODT-618 Implement ganglia XML parser by Rajith Siriwardana

Added:
    oodt/trunk/resource/src/main/java/org/apache/oodt/cas/resource/monitor/exceptions/
    oodt/trunk/resource/src/main/java/org/apache/oodt/cas/resource/monitor/exceptions/MonitoringException.java
    oodt/trunk/resource/src/main/java/org/apache/oodt/cas/resource/monitor/ganglia/
    oodt/trunk/resource/src/main/java/org/apache/oodt/cas/resource/monitor/ganglia/GangliaMetKeys.java
    oodt/trunk/resource/src/main/java/org/apache/oodt/cas/resource/monitor/ganglia/GangliaXMLParser.java
    oodt/trunk/resource/src/main/java/org/apache/oodt/cas/resource/monitor/ganglia/configuration/
    oodt/trunk/resource/src/main/java/org/apache/oodt/cas/resource/monitor/ganglia/configuration/Cluster.java
    oodt/trunk/resource/src/main/java/org/apache/oodt/cas/resource/monitor/ganglia/configuration/Host.java
    oodt/trunk/resource/src/main/java/org/apache/oodt/cas/resource/monitor/ganglia/configuration/Metric.java
    oodt/trunk/resource/src/test/org/apache/oodt/cas/resource/monitor/TestGangliaXMLParser.java
    oodt/trunk/resource/src/testdata/gangliaXMLdump.xml
Modified:
    oodt/trunk/CHANGES.txt

Modified: oodt/trunk/CHANGES.txt
URL: http://svn.apache.org/viewvc/oodt/trunk/CHANGES.txt?rev=1492529&r1=1492528&r2=1492529&view=diff
==============================================================================
--- oodt/trunk/CHANGES.txt (original)
+++ oodt/trunk/CHANGES.txt Thu Jun 13 05:42:13 2013
@@ -4,6 +4,8 @@ Apache OODT Change Log
 Release 0.6 - Current Development
 --------------------------------------------
 
+* OODT-618 Implement ganglia XML parser (Rajith Siriwardana via mattmann)
+
 * OODT-625 Bake TraceableFile product policy into FM (mattmann)
 
 * OODT-622 Updated svn:ignore properties for several modules to add Eclipse

Added: oodt/trunk/resource/src/main/java/org/apache/oodt/cas/resource/monitor/exceptions/MonitoringException.java
URL: http://svn.apache.org/viewvc/oodt/trunk/resource/src/main/java/org/apache/oodt/cas/resource/monitor/exceptions/MonitoringException.java?rev=1492529&view=auto
==============================================================================
--- oodt/trunk/resource/src/main/java/org/apache/oodt/cas/resource/monitor/exceptions/MonitoringException.java (added)
+++ oodt/trunk/resource/src/main/java/org/apache/oodt/cas/resource/monitor/exceptions/MonitoringException.java Thu Jun 13 05:42:13 2013
@@ -0,0 +1,34 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.oodt.cas.resource.monitor.exceptions;
+
+/**
+ * @author rajith
+ * @version $Revision$
+ */
+public class MonitoringException extends Exception {
+
+    /**
+     * Make a new exception.
+     *
+     * @param message the error message
+     */
+    public MonitoringException(String message) {
+        super(message);
+    }
+}

Added: oodt/trunk/resource/src/main/java/org/apache/oodt/cas/resource/monitor/ganglia/GangliaMetKeys.java
URL: http://svn.apache.org/viewvc/oodt/trunk/resource/src/main/java/org/apache/oodt/cas/resource/monitor/ganglia/GangliaMetKeys.java?rev=1492529&view=auto
==============================================================================
--- oodt/trunk/resource/src/main/java/org/apache/oodt/cas/resource/monitor/ganglia/GangliaMetKeys.java (added)
+++ oodt/trunk/resource/src/main/java/org/apache/oodt/cas/resource/monitor/ganglia/GangliaMetKeys.java Thu Jun 13 05:42:13 2013
@@ -0,0 +1,59 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.oodt.cas.resource.monitor.ganglia;
+
+/**
+ * @author rajith
+ * @version $Revision$
+ */
+public interface GangliaMetKeys {
+
+    public static final String CLUSTER = "CLUSTER";
+    public static final String HOST = "HOST";
+    public static final String METRIC = "METRIC";
+
+    public static final String NAME = "NAME";
+    public static final String VAL = "VAL";
+    public static final String TN = "TN";
+    public static final String TMAX = "TMAX";
+    public static final String DMAX = "DMAX";
+
+    /*Metric specific keys*/
+    public static final String TYPE = "TYPE";
+    public static final String UNITS = "UNITS";
+    public static final String SLOPE = "SLOPE";
+    public static final String SOURCE = "SOURCE";
+    public static final String EXTRA_ELEMENT = "EXTRA_ELEMENT";
+    public static final String GROUP = "GROUP";
+    public static final String DESC = "DESC";
+    public static final String TITLE = "TITLE";
+
+    /*Host specific keys*/
+    public static final String IP = "IP";
+    public static final String REPORTED = "REPORTED";
+    public static final String LOCATION = "LOCATION";
+    public static final String GMOND_STARTED = "GMOND_STARTED";
+
+    /*Cluster specific keys*/
+    public static final String LOCALTIME = "LOCALTIME";
+    public static final String OWNER = "OWNER";
+    public static final String LATLONG = "LATLONG";
+    public static final String URL = "URL";
+
+
+}

Added: oodt/trunk/resource/src/main/java/org/apache/oodt/cas/resource/monitor/ganglia/GangliaXMLParser.java
URL: http://svn.apache.org/viewvc/oodt/trunk/resource/src/main/java/org/apache/oodt/cas/resource/monitor/ganglia/GangliaXMLParser.java?rev=1492529&view=auto
==============================================================================
--- oodt/trunk/resource/src/main/java/org/apache/oodt/cas/resource/monitor/ganglia/GangliaXMLParser.java (added)
+++ oodt/trunk/resource/src/main/java/org/apache/oodt/cas/resource/monitor/ganglia/GangliaXMLParser.java Thu Jun 13 05:42:13 2013
@@ -0,0 +1,113 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.oodt.cas.resource.monitor.ganglia;
+
+import org.apache.oodt.cas.resource.monitor.ganglia.configuration.Cluster;
+import org.apache.oodt.cas.resource.monitor.ganglia.configuration.Host;
+import org.apache.oodt.cas.resource.monitor.ganglia.configuration.Metric;
+import org.xml.sax.Attributes;
+import org.xml.sax.SAXException;
+import org.xml.sax.helpers.DefaultHandler;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+/**
+ * @author rajith
+ * @version $Revision$
+ *
+ * SAX parser to create a grid configuration from a XML stream.
+ * XML schema corresponds to a GMetad XML output.
+ */
+public class GangliaXMLParser extends DefaultHandler implements GangliaMetKeys {
+
+    private List<Cluster> grid;
+    private Cluster currentCluster;
+    private List<Host> currentClusterHosts;
+    private Host currentHost;
+    private List<Metric> currentHostMetrics;
+    private Metric currentMetric;
+    private HashMap<String, String> extraData;
+
+    /**
+     * {@inheritDoc}
+     */
+    public void endDocument() throws SAXException {
+        this.grid.add(currentCluster);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void endElement(String uri, String localName, String name) throws SAXException {
+        if (name.equals(METRIC)) {
+            this.currentMetric.setExtraData(extraData);
+            this.currentHostMetrics.add(currentMetric);
+
+        } else if (name.equals(HOST)) {
+            this.currentHost.setMetrics(currentHostMetrics);
+            this.currentClusterHosts.add(currentHost);
+
+        } else if (name.equals(CLUSTER)) {
+            this.currentCluster.setHosts(currentClusterHosts);
+        }
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void startDocument() throws SAXException {
+        this.grid = new ArrayList<Cluster>();
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void startElement(String uri, String localName, String name, Attributes atts) throws SAXException {
+        if (name.equals(METRIC)) {
+            this.currentMetric = new Metric(atts.getValue(NAME), atts.getValue(VAL), atts.getValue(TYPE),
+                    atts.getValue(UNITS), atts.getValue(TN), atts.getValue(TMAX), atts.getValue(DMAX),
+                    atts.getValue(SLOPE), atts.getValue(SOURCE));
+            this.extraData = new HashMap<String, String>();
+
+        } else if (name.equals(EXTRA_ELEMENT)) {
+            this.extraData.put(atts.getValue(NAME), atts.getValue(VAL));
+
+        } else if (name.equals(HOST)) {
+            this.currentHost = new Host(atts.getValue(NAME), atts.getValue(IP), atts.getValue(REPORTED),
+                    atts.getValue(TN), atts.getValue(TMAX), atts.getValue(DMAX), atts.getValue(LOCATION),
+                    atts.getValue(GMOND_STARTED));
+            this.currentHostMetrics = new ArrayList<Metric>();
+
+        } else if (name.equals(CLUSTER)) {
+            this.currentCluster = new Cluster(atts.getValue(NAME), atts.getValue(LOCALTIME), atts.getValue(OWNER),
+                    atts.getValue(LATLONG), atts.getValue(URL));
+            this.currentClusterHosts = new ArrayList<Host>();
+        }
+    }
+
+    /**
+     * Get the configuration after parsing the XML Stream.
+     *
+     * @return a grid configuration
+     */
+    public List<Cluster> getGridConfiguration() {
+        return this.grid;
+    }
+}

Added: oodt/trunk/resource/src/main/java/org/apache/oodt/cas/resource/monitor/ganglia/configuration/Cluster.java
URL: http://svn.apache.org/viewvc/oodt/trunk/resource/src/main/java/org/apache/oodt/cas/resource/monitor/ganglia/configuration/Cluster.java?rev=1492529&view=auto
==============================================================================
--- oodt/trunk/resource/src/main/java/org/apache/oodt/cas/resource/monitor/ganglia/configuration/Cluster.java (added)
+++ oodt/trunk/resource/src/main/java/org/apache/oodt/cas/resource/monitor/ganglia/configuration/Cluster.java Thu Jun 13 05:42:13 2013
@@ -0,0 +1,79 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.oodt.cas.resource.monitor.ganglia.configuration;
+
+import java.util.List;
+
+/**
+ * @author rajith
+ * @version $Revision$
+ *
+ * Configuration element for the Ganglia cluster mapping. Contains hosts' status information
+ * of a particular cluster.
+ *
+ *  <CLUSTER NAME="" LOCALTIME="" OWNER="" LATLONG="" URL="">
+ *      <HOST NAME=....
+ *      ...
+ *      <HOST NAME=..
+ *  </CLUSTER>
+ */
+public class Cluster {
+
+    private String name;
+    private String localtime;
+    private String owner;
+    private String latLong;
+    private String url;
+    private List<Host> hosts;
+
+    public Cluster(String name, String localtime, String owner, String latLong, String url) {
+        this.name = name;
+        this.localtime = localtime;
+        this.owner = owner;
+        this.latLong = latLong;
+        this.url = url;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public String getOwner() {
+        return owner;
+    }
+
+    public String getLocaltime() {
+        return localtime;
+    }
+
+    public String getLatLong() {
+        return latLong;
+    }
+
+    public String getUrl() {
+        return url;
+    }
+
+    public List<Host> getHosts() {
+        return hosts;
+    }
+
+    public void setHosts(List<Host> hosts) {
+        this.hosts = hosts;
+    }
+}

Added: oodt/trunk/resource/src/main/java/org/apache/oodt/cas/resource/monitor/ganglia/configuration/Host.java
URL: http://svn.apache.org/viewvc/oodt/trunk/resource/src/main/java/org/apache/oodt/cas/resource/monitor/ganglia/configuration/Host.java?rev=1492529&view=auto
==============================================================================
--- oodt/trunk/resource/src/main/java/org/apache/oodt/cas/resource/monitor/ganglia/configuration/Host.java (added)
+++ oodt/trunk/resource/src/main/java/org/apache/oodt/cas/resource/monitor/ganglia/configuration/Host.java Thu Jun 13 05:42:13 2013
@@ -0,0 +1,98 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.oodt.cas.resource.monitor.ganglia.configuration;
+
+import java.util.List;
+
+/**
+ * @author rajith
+ * @version $Revision$
+ *
+ * Configuration element for the Ganglia host mapping. Consists with Metrics information
+ * of a particular host
+ *
+ *  <HOST NAME="" IP="" REPORTED="" TN="" TMAX="" DMAX="" LOCATION="" GMOND_STARTED="">
+ *      <METRIC NAME="" VAL="" TYPE="" UNITS="" TN="" TMAX="" DMAX="" SLOPE="" SOURCE="">
+ *      ............
+ *      <METRIC NAME=....
+ *  </HOST>
+ */
+public class Host {
+
+    private String name;
+    private String ip;
+    private String reported;
+    private String tn;
+    private String tmax;
+    private String dmax;
+    private String location;
+    private String gmondstarted;
+    private List<Metric> metrics;
+
+    public Host(String name, String ip, String reported, String tn, String tmax,
+                String dmax, String location, String gmondstarted) {
+        this.name = name;
+        this.ip = ip;
+        this.reported = reported;
+        this.tn = tn;
+        this.tmax = tmax;
+        this.dmax = dmax;
+        this.location = location;
+        this.gmondstarted = gmondstarted;
+    }
+
+    public String getName() {
+        return name;
+    }
+
+    public String getIp() {
+        return ip;
+    }
+
+    public String getReported() {
+        return reported;
+    }
+
+    public String getTn() {
+        return tn;
+    }
+
+    public String getTmax() {
+        return tmax;
+    }
+
+    public String getDmax() {
+        return dmax;
+    }
+
+    public String getLocation() {
+        return location;
+    }
+
+    public String getGmondstarted() {
+        return gmondstarted;
+    }
+
+    public List<Metric> getMetrics() {
+        return metrics;
+    }
+
+    public void setMetrics(List<Metric> metrics) {
+        this.metrics = metrics;
+    }
+}

Added: oodt/trunk/resource/src/main/java/org/apache/oodt/cas/resource/monitor/ganglia/configuration/Metric.java
URL: http://svn.apache.org/viewvc/oodt/trunk/resource/src/main/java/org/apache/oodt/cas/resource/monitor/ganglia/configuration/Metric.java?rev=1492529&view=auto
==============================================================================
--- oodt/trunk/resource/src/main/java/org/apache/oodt/cas/resource/monitor/ganglia/configuration/Metric.java (added)
+++ oodt/trunk/resource/src/main/java/org/apache/oodt/cas/resource/monitor/ganglia/configuration/Metric.java Thu Jun 13 05:42:13 2013
@@ -0,0 +1,106 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.oodt.cas.resource.monitor.ganglia.configuration;
+
+import java.util.HashMap;
+
+/**
+ * @author rajith
+ * @version $Revision$
+ *
+ * Configuration element for the Ganglia Metric mapping.
+ *
+ *  <METRIC NAME="" VAL="" TYPE="" UNITS="" TN="" TMAX="" DMAX="" SLOPE="" SOURCE="">
+ *      <EXTRA_DATA>
+ *          <EXTRA_ELEMENT NAME="" VAL=""/>
+ *          <EXTRA_ELEMENT NAME="" VAL=""/>
+ *          ........
+ *      </EXTRA_DATA>
+ *  </METRIC>
+ */
+public class Metric {
+
+    private String name;
+    private String value;
+    private String type;
+    private String units;
+    private String tn;
+    private String tmax;
+    private String dmax;
+    private String slope;
+    private String source;
+    private HashMap<String, String> extraData;
+
+    public Metric(String name, String value, String valueType, String units,
+                  String tn, String tmax, String dmax, String slope, String source) {
+        this.name = name;
+        this.value = value;
+        this.type = valueType;
+        this.units = units;
+        this.tn = tn;
+        this.tmax = tmax;
+        this.dmax = dmax;
+        this.slope = slope;
+        this.source = source;
+    }
+
+
+    public String getName() {
+        return name;
+    }
+
+    public String getValue() {
+        return value;
+    }
+
+    public String getType() {
+        return type;
+    }
+
+    public String getUnits() {
+        return units;
+    }
+
+    public String getTn() {
+        return tn;
+    }
+
+    public String getTmax() {
+        return tmax;
+    }
+
+    public String getDmax() {
+        return dmax;
+    }
+
+    public String getSlope() {
+        return slope;
+    }
+
+    public String getSource() {
+        return source;
+    }
+
+    public HashMap<String, String> getExtraData() {
+        return extraData;
+    }
+
+    public void setExtraData(HashMap<String, String> extraData) {
+        this.extraData = extraData;
+    }
+}

Added: oodt/trunk/resource/src/test/org/apache/oodt/cas/resource/monitor/TestGangliaXMLParser.java
URL: http://svn.apache.org/viewvc/oodt/trunk/resource/src/test/org/apache/oodt/cas/resource/monitor/TestGangliaXMLParser.java?rev=1492529&view=auto
==============================================================================
--- oodt/trunk/resource/src/test/org/apache/oodt/cas/resource/monitor/TestGangliaXMLParser.java (added)
+++ oodt/trunk/resource/src/test/org/apache/oodt/cas/resource/monitor/TestGangliaXMLParser.java Thu Jun 13 05:42:13 2013
@@ -0,0 +1,142 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.oodt.cas.resource.monitor;
+
+import junit.framework.TestCase;
+import org.apache.oodt.cas.resource.monitor.exceptions.MonitoringException;
+import org.apache.oodt.cas.resource.monitor.ganglia.GangliaMetKeys;
+import org.apache.oodt.cas.resource.monitor.ganglia.GangliaXMLParser;
+import org.apache.oodt.cas.resource.monitor.ganglia.configuration.Cluster;
+import org.apache.oodt.cas.resource.monitor.ganglia.configuration.Host;
+import org.apache.oodt.cas.resource.monitor.ganglia.configuration.Metric;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.parsers.SAXParserFactory;
+import java.io.*;
+import java.util.HashMap;
+import java.util.List;
+
+/**
+ * @author rajith
+ * @version $Revision$
+ *
+ * Test Suite for the {@link GangliaXMLParser}
+ */
+public class TestGangliaXMLParser extends TestCase {
+
+    private List<Cluster> gridConfiguration;
+
+    /**
+     * {@inheritDoc}
+     * Read gangliaXMLdump.xml and build the grid configuration
+     */
+    protected void setUp() throws MonitoringException {
+        StringBuilder stringBuffer = new StringBuilder();
+
+        try {
+            BufferedReader reader = new BufferedReader(new FileReader("." + File.separator +
+                    "src" + File.separator + "testdata" + File.separator + "gangliaXMLdump.xml"));
+            String line = reader.readLine();
+            while (line != null) {
+                stringBuffer.append(line);
+                line = reader.readLine();
+            }
+            reader.close();
+        } catch (IOException e) {
+            throw new MonitoringException("Unable to read the sample monitoring report from the file: "
+                    + e.getMessage());
+        }
+
+        String buffer = stringBuffer.toString().trim();
+        SAXParserFactory factory = SAXParserFactory.newInstance();
+        javax.xml.parsers.SAXParser parser;
+        GangliaXMLParser gangliaXMLParser;
+        try {
+            parser = factory.newSAXParser();
+            gangliaXMLParser = new GangliaXMLParser();
+            parser.parse(new InputSource(new StringReader(buffer)), gangliaXMLParser);
+            gridConfiguration = gangliaXMLParser.getGridConfiguration();
+        } catch (ParserConfigurationException e) {
+            throw new MonitoringException("Error while parsing: " + e.getMessage());
+        } catch (SAXException e) {
+            throw new MonitoringException("Error while parsing the XML: " + e.getMessage());
+        } catch (IOException e) {
+            throw new MonitoringException("I/O error: " + e.getMessage());
+        }
+    }
+
+    /**
+     * test the "<CLUSTER>" tag data
+     * <CLUSTER NAME="" LOCALTIME="" OWNER="" LATLONG="" URL="">
+     */
+    public void testClusterTag() {
+        Cluster cluster = gridConfiguration.get(0);
+        assertEquals("localcluster", cluster.getName());
+        assertEquals("1370187645", cluster.getLocaltime());
+        assertEquals("oodt", cluster.getOwner());
+        assertEquals("N32.87 W117.22", cluster.getLatLong());
+        assertEquals("http://www.mycluster.org/", cluster.getUrl());
+    }
+
+    /**
+     * test the "<HOST>" tag data
+     * <HOST NAME="" IP="" REPORTED="" TN="" TMAX="" DMAX="" LOCATION="" GMOND_STARTED="">
+     */
+    public void testHostTag() {
+        Host host = ((gridConfiguration.get(0)).getHosts()).get(0);
+        assertEquals("localhost", host.getName());
+        assertEquals("127.0.0.1", host.getIp());
+        assertEquals("1370187637", host.getReported());
+        assertEquals("10", host.getTn());
+        assertEquals("20", host.getTmax());
+        assertEquals("0", host.getDmax());
+        assertEquals("0,0,0", host.getLocation());
+        assertEquals("1370186237", host.getGmondstarted());
+    }
+
+    /**
+     * test the "<METRIC>" tag data
+     * <METRIC NAME="" VAL="" TYPE="" UNITS="" TN="" TMAX="" DMAX="" SLOPE="" SOURCE="">
+     * <EXTRA_DATA>
+     * <EXTRA_ELEMENT NAME="" VAL=""/>
+     * <EXTRA_ELEMENT NAME="" VAL=""/>
+     * ........
+     * </EXTRA_DATA>
+     * </METRIC>
+     */
+    public void testMetricTag() {
+        Metric metric = ((((gridConfiguration.get(0)).getHosts()).get(0)).getMetrics()).get(0);
+        assertEquals("disk_free", metric.getName());
+        assertEquals("307.790", metric.getValue());
+        assertEquals("double", metric.getType());
+        assertEquals("GB", metric.getUnits());
+        assertEquals("143", metric.getTn());
+        assertEquals("180", metric.getTmax());
+        assertEquals("0", metric.getDmax());
+        assertEquals("both", metric.getSlope());
+        assertEquals("gmond", metric.getSource());
+
+        //extra data of the metric
+        HashMap<String, String> extraData = metric.getExtraData();
+        assertEquals("disk", extraData.get(GangliaMetKeys.GROUP));
+        assertEquals("Total free disk space", extraData.get(GangliaMetKeys.DESC));
+        assertEquals("Disk Space Available", extraData.get(GangliaMetKeys.TITLE));
+    }
+}

Added: oodt/trunk/resource/src/testdata/gangliaXMLdump.xml
URL: http://svn.apache.org/viewvc/oodt/trunk/resource/src/testdata/gangliaXMLdump.xml?rev=1492529&view=auto
==============================================================================
--- oodt/trunk/resource/src/testdata/gangliaXMLdump.xml (added)
+++ oodt/trunk/resource/src/testdata/gangliaXMLdump.xml Thu Jun 13 05:42:13 2013
@@ -0,0 +1,586 @@
+<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
+<!DOCTYPE GANGLIA_XML [
+        <!ELEMENT GANGLIA_XML (GRID|CLUSTER|HOST)*>
+        <!ATTLIST GANGLIA_XML VERSION CDATA #REQUIRED>
+        <!ATTLIST GANGLIA_XML SOURCE CDATA #REQUIRED>
+        <!ELEMENT GRID (CLUSTER | GRID | HOSTS | METRICS)*>
+        <!ATTLIST GRID NAME CDATA #REQUIRED>
+        <!ATTLIST GRID AUTHORITY CDATA #REQUIRED>
+        <!ATTLIST GRID LOCALTIME CDATA #IMPLIED>
+        <!ELEMENT CLUSTER (HOST | HOSTS | METRICS)*>
+        <!ATTLIST CLUSTER NAME CDATA #REQUIRED>
+        <!ATTLIST CLUSTER OWNER CDATA #IMPLIED>
+        <!ATTLIST CLUSTER LATLONG CDATA #IMPLIED>
+        <!ATTLIST CLUSTER URL CDATA #IMPLIED>
+        <!ATTLIST CLUSTER LOCALTIME CDATA #REQUIRED>
+        <!ELEMENT HOST (METRIC)*>
+        <!ATTLIST HOST NAME CDATA #REQUIRED>
+        <!ATTLIST HOST IP CDATA #REQUIRED>
+        <!ATTLIST HOST LOCATION CDATA #IMPLIED>
+        <!ATTLIST HOST REPORTED CDATA #REQUIRED>
+        <!ATTLIST HOST TN CDATA #IMPLIED>
+        <!ATTLIST HOST TMAX CDATA #IMPLIED>
+        <!ATTLIST HOST DMAX CDATA #IMPLIED>
+        <!ATTLIST HOST GMOND_STARTED CDATA #IMPLIED>
+        <!ELEMENT METRIC (EXTRA_DATA*)>
+        <!ATTLIST METRIC NAME CDATA #REQUIRED>
+        <!ATTLIST METRIC VAL CDATA #REQUIRED>
+        <!ATTLIST METRIC TYPE (string | int8 | uint8 | int16 | uint16 | int32 | uint32 | float | double | timestamp) #REQUIRED>
+        <!ATTLIST METRIC UNITS CDATA #IMPLIED>
+        <!ATTLIST METRIC TN CDATA #IMPLIED>
+        <!ATTLIST METRIC TMAX CDATA #IMPLIED>
+        <!ATTLIST METRIC DMAX CDATA #IMPLIED>
+        <!ATTLIST METRIC SLOPE (zero | positive | negative | both | unspecified) #IMPLIED>
+        <!ATTLIST METRIC SOURCE (gmond) 'gmond'>
+        <!ELEMENT EXTRA_DATA (EXTRA_ELEMENT*)>
+        <!ELEMENT EXTRA_ELEMENT EMPTY>
+        <!ATTLIST EXTRA_ELEMENT NAME CDATA #REQUIRED>
+        <!ATTLIST EXTRA_ELEMENT VAL CDATA #REQUIRED>
+        <!ELEMENT HOSTS EMPTY>
+        <!ATTLIST HOSTS UP CDATA #REQUIRED>
+        <!ATTLIST HOSTS DOWN CDATA #REQUIRED>
+        <!ATTLIST HOSTS SOURCE (gmond | gmetad) #REQUIRED>
+        <!ELEMENT METRICS (EXTRA_DATA*)>
+        <!ATTLIST METRICS NAME CDATA #REQUIRED>
+        <!ATTLIST METRICS SUM CDATA #REQUIRED>
+        <!ATTLIST METRICS NUM CDATA #REQUIRED>
+        <!ATTLIST METRICS TYPE (string | int8 | uint8 | int16 | uint16 | int32 | uint32 | float | double | timestamp) #REQUIRED>
+        <!ATTLIST METRICS UNITS CDATA #IMPLIED>
+        <!ATTLIST METRICS SLOPE (zero | positive | negative | both | unspecified) #IMPLIED>
+        <!ATTLIST METRICS SOURCE (gmond) 'gmond'>
+        ]>
+<GANGLIA_XML VERSION="3.1.7" SOURCE="gmetad">
+    <GRID NAME="unspecified" AUTHORITY="http://ubuntu/ganglia/" LOCALTIME="1370187648">
+        <CLUSTER NAME="localcluster" LOCALTIME="1370187645" OWNER="oodt" LATLONG="N32.87 W117.22"
+                 URL="http://www.mycluster.org/">
+            <HOST NAME="localhost" IP="127.0.0.1" REPORTED="1370187637" TN="10" TMAX="20" DMAX="0" LOCATION="0,0,0"
+                  GMOND_STARTED="1370186237">
+                <METRIC NAME="disk_free" VAL="307.790" TYPE="double" UNITS="GB" TN="143" TMAX="180" DMAX="0"
+                        SLOPE="both" SOURCE="gmond">
+                    <EXTRA_DATA>
+                        <EXTRA_ELEMENT NAME="GROUP" VAL="disk"/>
+                        <EXTRA_ELEMENT NAME="DESC" VAL="Total free disk space"/>
+                        <EXTRA_ELEMENT NAME="TITLE" VAL="Disk Space Available"/>
+                    </EXTRA_DATA>
+                </METRIC>
+                <METRIC NAME="machine_type" VAL="x86_64" TYPE="string" UNITS="" TN="203" TMAX="1200" DMAX="0"
+                        SLOPE="zero" SOURCE="gmond">
+                    <EXTRA_DATA>
+                        <EXTRA_ELEMENT NAME="GROUP" VAL="system"/>
+                        <EXTRA_ELEMENT NAME="DESC" VAL="System architecture"/>
+                        <EXTRA_ELEMENT NAME="TITLE" VAL="Machine Type"/>
+                    </EXTRA_DATA>
+                </METRIC>
+                <METRIC NAME="bytes_out" VAL="1022.59" TYPE="float" UNITS="bytes/sec" TN="83" TMAX="300" DMAX="0"
+                        SLOPE="both" SOURCE="gmond">
+                    <EXTRA_DATA>
+                        <EXTRA_ELEMENT NAME="GROUP" VAL="network"/>
+                        <EXTRA_ELEMENT NAME="DESC" VAL="Number of bytes out per second"/>
+                        <EXTRA_ELEMENT NAME="TITLE" VAL="Bytes Sent"/>
+                    </EXTRA_DATA>
+                </METRIC>
+                <METRIC NAME="gexec" VAL="OFF" TYPE="string" UNITS="" TN="203" TMAX="300" DMAX="0" SLOPE="zero"
+                        SOURCE="gmond">
+                    <EXTRA_DATA>
+                        <EXTRA_ELEMENT NAME="GROUP" VAL="core"/>
+                        <EXTRA_ELEMENT NAME="DESC" VAL="gexec available"/>
+                        <EXTRA_ELEMENT NAME="TITLE" VAL="Gexec Status"/>
+                    </EXTRA_DATA>
+                </METRIC>
+                <METRIC NAME="proc_total" VAL="580" TYPE="uint32" UNITS=" " TN="43" TMAX="950" DMAX="0" SLOPE="both"
+                        SOURCE="gmond">
+                    <EXTRA_DATA>
+                        <EXTRA_ELEMENT NAME="GROUP" VAL="process"/>
+                        <EXTRA_ELEMENT NAME="DESC" VAL="Total number of processes"/>
+                        <EXTRA_ELEMENT NAME="TITLE" VAL="Total Processes"/>
+                    </EXTRA_DATA>
+                </METRIC>
+                <METRIC NAME="cpu_nice" VAL="0.0" TYPE="float" UNITS="%" TN="22" TMAX="90" DMAX="0" SLOPE="both"
+                        SOURCE="gmond">
+                    <EXTRA_DATA>
+                        <EXTRA_ELEMENT NAME="GROUP" VAL="cpu"/>
+                        <EXTRA_ELEMENT NAME="DESC"
+                                       VAL="Percentage of CPU utilization that occurred while executing at the user level with nice priority"/>
+                        <EXTRA_ELEMENT NAME="TITLE" VAL="CPU Nice"/>
+                    </EXTRA_DATA>
+                </METRIC>
+                <METRIC NAME="pkts_in" VAL="4.85" TYPE="float" UNITS="packets/sec" TN="83" TMAX="300" DMAX="0"
+                        SLOPE="both" SOURCE="gmond">
+                    <EXTRA_DATA>
+                        <EXTRA_ELEMENT NAME="GROUP" VAL="network"/>
+                        <EXTRA_ELEMENT NAME="DESC" VAL="Packets in per second"/>
+                        <EXTRA_ELEMENT NAME="TITLE" VAL="Packets Received"/>
+                    </EXTRA_DATA>
+                </METRIC>
+                <METRIC NAME="cpu_speed" VAL="2267" TYPE="uint32" UNITS="MHz" TN="203" TMAX="1200" DMAX="0" SLOPE="zero"
+                        SOURCE="gmond">
+                    <EXTRA_DATA>
+                        <EXTRA_ELEMENT NAME="GROUP" VAL="cpu"/>
+                        <EXTRA_ELEMENT NAME="DESC" VAL="CPU Speed in terms of MHz"/>
+                        <EXTRA_ELEMENT NAME="TITLE" VAL="CPU Speed"/>
+                    </EXTRA_DATA>
+                </METRIC>
+                <METRIC NAME="boottime" VAL="1370172364" TYPE="uint32" UNITS="s" TN="203" TMAX="1200" DMAX="0"
+                        SLOPE="zero" SOURCE="gmond">
+                    <EXTRA_DATA>
+                        <EXTRA_ELEMENT NAME="GROUP" VAL="system"/>
+                        <EXTRA_ELEMENT NAME="DESC" VAL="The last time that the system was started"/>
+                        <EXTRA_ELEMENT NAME="TITLE" VAL="Last Boot Time"/>
+                    </EXTRA_DATA>
+                </METRIC>
+                <METRIC NAME="cpu_wio" VAL="1.9" TYPE="float" UNITS="%" TN="22" TMAX="90" DMAX="0" SLOPE="both"
+                        SOURCE="gmond">
+                    <EXTRA_DATA>
+                        <EXTRA_ELEMENT NAME="GROUP" VAL="cpu"/>
+                        <EXTRA_ELEMENT NAME="DESC"
+                                       VAL="Percentage of time that the CPU or CPUs were idle during which the system had an outstanding disk I/O request"/>
+                        <EXTRA_ELEMENT NAME="TITLE" VAL="CPU wio"/>
+                    </EXTRA_DATA>
+                </METRIC>
+                <METRIC NAME="os_name" VAL="Linux" TYPE="string" UNITS="" TN="203" TMAX="1200" DMAX="0" SLOPE="zero"
+                        SOURCE="gmond">
+                    <EXTRA_DATA>
+                        <EXTRA_ELEMENT NAME="GROUP" VAL="system"/>
+                        <EXTRA_ELEMENT NAME="DESC" VAL="Operating system name"/>
+                        <EXTRA_ELEMENT NAME="TITLE" VAL="Operating System"/>
+                    </EXTRA_DATA>
+                </METRIC>
+                <METRIC NAME="load_one" VAL="1.06" TYPE="float" UNITS=" " TN="53" TMAX="70" DMAX="0" SLOPE="both"
+                        SOURCE="gmond">
+                    <EXTRA_DATA>
+                        <EXTRA_ELEMENT NAME="GROUP" VAL="load"/>
+                        <EXTRA_ELEMENT NAME="DESC" VAL="One minute load average"/>
+                        <EXTRA_ELEMENT NAME="TITLE" VAL="One Minute Load Average"/>
+                    </EXTRA_DATA>
+                </METRIC>
+                <METRIC NAME="os_release" VAL="3.2.0-45-generic" TYPE="string" UNITS="" TN="203" TMAX="1200" DMAX="0"
+                        SLOPE="zero" SOURCE="gmond">
+                    <EXTRA_DATA>
+                        <EXTRA_ELEMENT NAME="GROUP" VAL="system"/>
+                        <EXTRA_ELEMENT NAME="DESC" VAL="Operating system release date"/>
+                        <EXTRA_ELEMENT NAME="TITLE" VAL="Operating System Release"/>
+                    </EXTRA_DATA>
+                </METRIC>
+                <METRIC NAME="disk_total" VAL="1042.222" TYPE="double" UNITS="GB" TN="1403" TMAX="1200" DMAX="0"
+                        SLOPE="both" SOURCE="gmond">
+                    <EXTRA_DATA>
+                        <EXTRA_ELEMENT NAME="GROUP" VAL="disk"/>
+                        <EXTRA_ELEMENT NAME="DESC" VAL="Total available disk space"/>
+                        <EXTRA_ELEMENT NAME="TITLE" VAL="Total Disk Space"/>
+                    </EXTRA_DATA>
+                </METRIC>
+                <METRIC NAME="cpu_user" VAL="8.0" TYPE="float" UNITS="%" TN="22" TMAX="90" DMAX="0" SLOPE="both"
+                        SOURCE="gmond">
+                    <EXTRA_DATA>
+                        <EXTRA_ELEMENT NAME="GROUP" VAL="cpu"/>
+                        <EXTRA_ELEMENT NAME="DESC"
+                                       VAL="Percentage of CPU utilization that occurred while executing at the user level"/>
+                        <EXTRA_ELEMENT NAME="TITLE" VAL="CPU User"/>
+                    </EXTRA_DATA>
+                </METRIC>
+                <METRIC NAME="cpu_idle" VAL="88.7" TYPE="float" UNITS="%" TN="22" TMAX="90" DMAX="0" SLOPE="both"
+                        SOURCE="gmond">
+                    <EXTRA_DATA>
+                        <EXTRA_ELEMENT NAME="GROUP" VAL="cpu"/>
+                        <EXTRA_ELEMENT NAME="DESC"
+                                       VAL="Percentage of time that the CPU or CPUs were idle and the system did not have an outstanding disk I/O request"/>
+                        <EXTRA_ELEMENT NAME="TITLE" VAL="CPU Idle"/>
+                    </EXTRA_DATA>
+                </METRIC>
+                <METRIC NAME="swap_free" VAL="2097148" TYPE="float" UNITS="KB" TN="3" TMAX="180" DMAX="0" SLOPE="both"
+                        SOURCE="gmond">
+                    <EXTRA_DATA>
+                        <EXTRA_ELEMENT NAME="GROUP" VAL="memory"/>
+                        <EXTRA_ELEMENT NAME="DESC" VAL="Amount of available swap memory"/>
+                        <EXTRA_ELEMENT NAME="TITLE" VAL="Free Swap Space"/>
+                    </EXTRA_DATA>
+                </METRIC>
+                <METRIC NAME="mem_cached" VAL="3100100" TYPE="float" UNITS="KB" TN="3" TMAX="180" DMAX="0" SLOPE="both"
+                        SOURCE="gmond">
+                    <EXTRA_DATA>
+                        <EXTRA_ELEMENT NAME="GROUP" VAL="memory"/>
+                        <EXTRA_ELEMENT NAME="DESC" VAL="Amount of cached memory"/>
+                        <EXTRA_ELEMENT NAME="TITLE" VAL="Cached Memory"/>
+                    </EXTRA_DATA>
+                </METRIC>
+                <METRIC NAME="pkts_out" VAL="4.80" TYPE="float" UNITS="packets/sec" TN="83" TMAX="300" DMAX="0"
+                        SLOPE="both" SOURCE="gmond">
+                    <EXTRA_DATA>
+                        <EXTRA_ELEMENT NAME="GROUP" VAL="network"/>
+                        <EXTRA_ELEMENT NAME="DESC" VAL="Packets out per second"/>
+                        <EXTRA_ELEMENT NAME="TITLE" VAL="Packets Sent"/>
+                    </EXTRA_DATA>
+                </METRIC>
+                <METRIC NAME="load_five" VAL="0.82" TYPE="float" UNITS=" " TN="53" TMAX="325" DMAX="0" SLOPE="both"
+                        SOURCE="gmond">
+                    <EXTRA_DATA>
+                        <EXTRA_ELEMENT NAME="GROUP" VAL="load"/>
+                        <EXTRA_ELEMENT NAME="DESC" VAL="Five minute load average"/>
+                        <EXTRA_ELEMENT NAME="TITLE" VAL="Five Minute Load Average"/>
+                    </EXTRA_DATA>
+                </METRIC>
+                <METRIC NAME="cpu_num" VAL="4" TYPE="uint16" UNITS="CPUs" TN="203" TMAX="1200" DMAX="0" SLOPE="zero"
+                        SOURCE="gmond">
+                    <EXTRA_DATA>
+                        <EXTRA_ELEMENT NAME="GROUP" VAL="cpu"/>
+                        <EXTRA_ELEMENT NAME="DESC" VAL="Total number of CPUs"/>
+                        <EXTRA_ELEMENT NAME="TITLE" VAL="CPU Count"/>
+                    </EXTRA_DATA>
+                </METRIC>
+                <METRIC NAME="load_fifteen" VAL="0.68" TYPE="float" UNITS=" " TN="53" TMAX="950" DMAX="0" SLOPE="both"
+                        SOURCE="gmond">
+                    <EXTRA_DATA>
+                        <EXTRA_ELEMENT NAME="GROUP" VAL="load"/>
+                        <EXTRA_ELEMENT NAME="DESC" VAL="Fifteen minute load average"/>
+                        <EXTRA_ELEMENT NAME="TITLE" VAL="Fifteen Minute Load Average"/>
+                    </EXTRA_DATA>
+                </METRIC>
+                <METRIC NAME="mem_free" VAL="228108" TYPE="float" UNITS="KB" TN="3" TMAX="180" DMAX="0" SLOPE="both"
+                        SOURCE="gmond">
+                    <EXTRA_DATA>
+                        <EXTRA_ELEMENT NAME="GROUP" VAL="memory"/>
+                        <EXTRA_ELEMENT NAME="DESC" VAL="Amount of available memory"/>
+                        <EXTRA_ELEMENT NAME="TITLE" VAL="Free Memory"/>
+                    </EXTRA_DATA>
+                </METRIC>
+                <METRIC NAME="cpu_system" VAL="1.2" TYPE="float" UNITS="%" TN="22" TMAX="90" DMAX="0" SLOPE="both"
+                        SOURCE="gmond">
+                    <EXTRA_DATA>
+                        <EXTRA_ELEMENT NAME="GROUP" VAL="cpu"/>
+                        <EXTRA_ELEMENT NAME="DESC"
+                                       VAL="Percentage of CPU utilization that occurred while executing at the system level"/>
+                        <EXTRA_ELEMENT NAME="TITLE" VAL="CPU System"/>
+                    </EXTRA_DATA>
+                </METRIC>
+                <METRIC NAME="proc_run" VAL="1" TYPE="uint32" UNITS=" " TN="43" TMAX="950" DMAX="0" SLOPE="both"
+                        SOURCE="gmond">
+                    <EXTRA_DATA>
+                        <EXTRA_ELEMENT NAME="GROUP" VAL="process"/>
+                        <EXTRA_ELEMENT NAME="DESC" VAL="Total number of running processes"/>
+                        <EXTRA_ELEMENT NAME="TITLE" VAL="Total Running Processes"/>
+                    </EXTRA_DATA>
+                </METRIC>
+                <METRIC NAME="mem_total" VAL="8169032" TYPE="float" UNITS="KB" TN="203" TMAX="1200" DMAX="0"
+                        SLOPE="zero" SOURCE="gmond">
+                    <EXTRA_DATA>
+                        <EXTRA_ELEMENT NAME="GROUP" VAL="memory"/>
+                        <EXTRA_ELEMENT NAME="DESC" VAL="Total amount of memory displayed in KBs"/>
+                        <EXTRA_ELEMENT NAME="TITLE" VAL="Memory Total"/>
+                    </EXTRA_DATA>
+                </METRIC>
+                <METRIC NAME="cpu_aidle" VAL="87.1" TYPE="float" UNITS="%" TN="22" TMAX="3800" DMAX="0" SLOPE="both"
+                        SOURCE="gmond">
+                    <EXTRA_DATA>
+                        <EXTRA_ELEMENT NAME="GROUP" VAL="cpu"/>
+                        <EXTRA_ELEMENT NAME="DESC" VAL="Percent of time since boot idle CPU"/>
+                        <EXTRA_ELEMENT NAME="TITLE" VAL="CPU aidle"/>
+                    </EXTRA_DATA>
+                </METRIC>
+                <METRIC NAME="bytes_in" VAL="1417.43" TYPE="float" UNITS="bytes/sec" TN="83" TMAX="300" DMAX="0"
+                        SLOPE="both" SOURCE="gmond">
+                    <EXTRA_DATA>
+                        <EXTRA_ELEMENT NAME="GROUP" VAL="network"/>
+                        <EXTRA_ELEMENT NAME="DESC" VAL="Number of bytes in per second"/>
+                        <EXTRA_ELEMENT NAME="TITLE" VAL="Bytes Received"/>
+                    </EXTRA_DATA>
+                </METRIC>
+                <METRIC NAME="mem_buffers" VAL="2436620" TYPE="float" UNITS="KB" TN="3" TMAX="180" DMAX="0" SLOPE="both"
+                        SOURCE="gmond">
+                    <EXTRA_DATA>
+                        <EXTRA_ELEMENT NAME="GROUP" VAL="memory"/>
+                        <EXTRA_ELEMENT NAME="DESC" VAL="Amount of buffered memory"/>
+                        <EXTRA_ELEMENT NAME="TITLE" VAL="Memory Buffers"/>
+                    </EXTRA_DATA>
+                </METRIC>
+                <METRIC NAME="mem_shared" VAL="0" TYPE="float" UNITS="KB" TN="3" TMAX="180" DMAX="0" SLOPE="both"
+                        SOURCE="gmond">
+                    <EXTRA_DATA>
+                        <EXTRA_ELEMENT NAME="GROUP" VAL="memory"/>
+                        <EXTRA_ELEMENT NAME="DESC" VAL="Amount of shared memory"/>
+                        <EXTRA_ELEMENT NAME="TITLE" VAL="Shared Memory"/>
+                    </EXTRA_DATA>
+                </METRIC>
+                <METRIC NAME="swap_total" VAL="2097148" TYPE="float" UNITS="KB" TN="203" TMAX="1200" DMAX="0"
+                        SLOPE="zero" SOURCE="gmond">
+                    <EXTRA_DATA>
+                        <EXTRA_ELEMENT NAME="GROUP" VAL="memory"/>
+                        <EXTRA_ELEMENT NAME="DESC" VAL="Total amount of swap space displayed in KBs"/>
+                        <EXTRA_ELEMENT NAME="TITLE" VAL="Swap Space Total"/>
+                    </EXTRA_DATA>
+                </METRIC>
+                <METRIC NAME="part_max_used" VAL="77.7" TYPE="float" UNITS="%" TN="143" TMAX="180" DMAX="0" SLOPE="both"
+                        SOURCE="gmond">
+                    <EXTRA_DATA>
+                        <EXTRA_ELEMENT NAME="GROUP" VAL="disk"/>
+                        <EXTRA_ELEMENT NAME="DESC" VAL="Maximum percent used for all partitions"/>
+                        <EXTRA_ELEMENT NAME="TITLE" VAL="Maximum Disk Space Used"/>
+                    </EXTRA_DATA>
+                </METRIC>
+            </HOST>
+            <HOST NAME="localhost2" IP="127.0.0.1" REPORTED="1370187637" TN="10" TMAX="20" DMAX="0"
+                  LOCATION="unspecified" GMOND_STARTED="1370186237">
+                <METRIC NAME="disk_free" VAL="307.790" TYPE="double" UNITS="GB" TN="143" TMAX="180" DMAX="0"
+                        SLOPE="both" SOURCE="gmond">
+                    <EXTRA_DATA>
+                        <EXTRA_ELEMENT NAME="GROUP" VAL="disk"/>
+                        <EXTRA_ELEMENT NAME="DESC" VAL="Total free disk space"/>
+                        <EXTRA_ELEMENT NAME="TITLE" VAL="Disk Space Available"/>
+                    </EXTRA_DATA>
+                </METRIC>
+                <METRIC NAME="machine_type" VAL="x86_64" TYPE="string" UNITS="" TN="203" TMAX="1200" DMAX="0"
+                        SLOPE="zero" SOURCE="gmond">
+                    <EXTRA_DATA>
+                        <EXTRA_ELEMENT NAME="GROUP" VAL="system"/>
+                        <EXTRA_ELEMENT NAME="DESC" VAL="System architecture"/>
+                        <EXTRA_ELEMENT NAME="TITLE" VAL="Machine Type"/>
+                    </EXTRA_DATA>
+                </METRIC>
+                <METRIC NAME="bytes_out" VAL="1022.59" TYPE="float" UNITS="bytes/sec" TN="83" TMAX="300" DMAX="0"
+                        SLOPE="both" SOURCE="gmond">
+                    <EXTRA_DATA>
+                        <EXTRA_ELEMENT NAME="GROUP" VAL="network"/>
+                        <EXTRA_ELEMENT NAME="DESC" VAL="Number of bytes out per second"/>
+                        <EXTRA_ELEMENT NAME="TITLE" VAL="Bytes Sent"/>
+                    </EXTRA_DATA>
+                </METRIC>
+                <METRIC NAME="gexec" VAL="OFF" TYPE="string" UNITS="" TN="203" TMAX="300" DMAX="0" SLOPE="zero"
+                        SOURCE="gmond">
+                    <EXTRA_DATA>
+                        <EXTRA_ELEMENT NAME="GROUP" VAL="core"/>
+                        <EXTRA_ELEMENT NAME="DESC" VAL="gexec available"/>
+                        <EXTRA_ELEMENT NAME="TITLE" VAL="Gexec Status"/>
+                    </EXTRA_DATA>
+                </METRIC>
+                <METRIC NAME="proc_total" VAL="580" TYPE="uint32" UNITS=" " TN="43" TMAX="950" DMAX="0" SLOPE="both"
+                        SOURCE="gmond">
+                    <EXTRA_DATA>
+                        <EXTRA_ELEMENT NAME="GROUP" VAL="process"/>
+                        <EXTRA_ELEMENT NAME="DESC" VAL="Total number of processes"/>
+                        <EXTRA_ELEMENT NAME="TITLE" VAL="Total Processes"/>
+                    </EXTRA_DATA>
+                </METRIC>
+                <METRIC NAME="cpu_nice" VAL="0.0" TYPE="float" UNITS="%" TN="22" TMAX="90" DMAX="0" SLOPE="both"
+                        SOURCE="gmond">
+                    <EXTRA_DATA>
+                        <EXTRA_ELEMENT NAME="GROUP" VAL="cpu"/>
+                        <EXTRA_ELEMENT NAME="DESC"
+                                       VAL="Percentage of CPU utilization that occurred while executing at the user level with nice priority"/>
+                        <EXTRA_ELEMENT NAME="TITLE" VAL="CPU Nice"/>
+                    </EXTRA_DATA>
+                </METRIC>
+                <METRIC NAME="pkts_in" VAL="4.85" TYPE="float" UNITS="packets/sec" TN="83" TMAX="300" DMAX="0"
+                        SLOPE="both" SOURCE="gmond">
+                    <EXTRA_DATA>
+                        <EXTRA_ELEMENT NAME="GROUP" VAL="network"/>
+                        <EXTRA_ELEMENT NAME="DESC" VAL="Packets in per second"/>
+                        <EXTRA_ELEMENT NAME="TITLE" VAL="Packets Received"/>
+                    </EXTRA_DATA>
+                </METRIC>
+                <METRIC NAME="cpu_speed" VAL="2267" TYPE="uint32" UNITS="MHz" TN="203" TMAX="1200" DMAX="0" SLOPE="zero"
+                        SOURCE="gmond">
+                    <EXTRA_DATA>
+                        <EXTRA_ELEMENT NAME="GROUP" VAL="cpu"/>
+                        <EXTRA_ELEMENT NAME="DESC" VAL="CPU Speed in terms of MHz"/>
+                        <EXTRA_ELEMENT NAME="TITLE" VAL="CPU Speed"/>
+                    </EXTRA_DATA>
+                </METRIC>
+                <METRIC NAME="boottime" VAL="1370172364" TYPE="uint32" UNITS="s" TN="203" TMAX="1200" DMAX="0"
+                        SLOPE="zero" SOURCE="gmond">
+                    <EXTRA_DATA>
+                        <EXTRA_ELEMENT NAME="GROUP" VAL="system"/>
+                        <EXTRA_ELEMENT NAME="DESC" VAL="The last time that the system was started"/>
+                        <EXTRA_ELEMENT NAME="TITLE" VAL="Last Boot Time"/>
+                    </EXTRA_DATA>
+                </METRIC>
+                <METRIC NAME="cpu_wio" VAL="1.9" TYPE="float" UNITS="%" TN="22" TMAX="90" DMAX="0" SLOPE="both"
+                        SOURCE="gmond">
+                    <EXTRA_DATA>
+                        <EXTRA_ELEMENT NAME="GROUP" VAL="cpu"/>
+                        <EXTRA_ELEMENT NAME="DESC"
+                                       VAL="Percentage of time that the CPU or CPUs were idle during which the system had an outstanding disk I/O request"/>
+                        <EXTRA_ELEMENT NAME="TITLE" VAL="CPU wio"/>
+                    </EXTRA_DATA>
+                </METRIC>
+                <METRIC NAME="os_name" VAL="Linux" TYPE="string" UNITS="" TN="203" TMAX="1200" DMAX="0" SLOPE="zero"
+                        SOURCE="gmond">
+                    <EXTRA_DATA>
+                        <EXTRA_ELEMENT NAME="GROUP" VAL="system"/>
+                        <EXTRA_ELEMENT NAME="DESC" VAL="Operating system name"/>
+                        <EXTRA_ELEMENT NAME="TITLE" VAL="Operating System"/>
+                    </EXTRA_DATA>
+                </METRIC>
+                <METRIC NAME="load_one" VAL="1.06" TYPE="float" UNITS=" " TN="53" TMAX="70" DMAX="0" SLOPE="both"
+                        SOURCE="gmond">
+                    <EXTRA_DATA>
+                        <EXTRA_ELEMENT NAME="GROUP" VAL="load"/>
+                        <EXTRA_ELEMENT NAME="DESC" VAL="One minute load average"/>
+                        <EXTRA_ELEMENT NAME="TITLE" VAL="One Minute Load Average"/>
+                    </EXTRA_DATA>
+                </METRIC>
+                <METRIC NAME="os_release" VAL="3.2.0-45-generic" TYPE="string" UNITS="" TN="203" TMAX="1200" DMAX="0"
+                        SLOPE="zero" SOURCE="gmond">
+                    <EXTRA_DATA>
+                        <EXTRA_ELEMENT NAME="GROUP" VAL="system"/>
+                        <EXTRA_ELEMENT NAME="DESC" VAL="Operating system release date"/>
+                        <EXTRA_ELEMENT NAME="TITLE" VAL="Operating System Release"/>
+                    </EXTRA_DATA>
+                </METRIC>
+                <METRIC NAME="disk_total" VAL="1042.222" TYPE="double" UNITS="GB" TN="1403" TMAX="1200" DMAX="0"
+                        SLOPE="both" SOURCE="gmond">
+                    <EXTRA_DATA>
+                        <EXTRA_ELEMENT NAME="GROUP" VAL="disk"/>
+                        <EXTRA_ELEMENT NAME="DESC" VAL="Total available disk space"/>
+                        <EXTRA_ELEMENT NAME="TITLE" VAL="Total Disk Space"/>
+                    </EXTRA_DATA>
+                </METRIC>
+                <METRIC NAME="cpu_user" VAL="8.0" TYPE="float" UNITS="%" TN="22" TMAX="90" DMAX="0" SLOPE="both"
+                        SOURCE="gmond">
+                    <EXTRA_DATA>
+                        <EXTRA_ELEMENT NAME="GROUP" VAL="cpu"/>
+                        <EXTRA_ELEMENT NAME="DESC"
+                                       VAL="Percentage of CPU utilization that occurred while executing at the user level"/>
+                        <EXTRA_ELEMENT NAME="TITLE" VAL="CPU User"/>
+                    </EXTRA_DATA>
+                </METRIC>
+                <METRIC NAME="cpu_idle" VAL="88.7" TYPE="float" UNITS="%" TN="22" TMAX="90" DMAX="0" SLOPE="both"
+                        SOURCE="gmond">
+                    <EXTRA_DATA>
+                        <EXTRA_ELEMENT NAME="GROUP" VAL="cpu"/>
+                        <EXTRA_ELEMENT NAME="DESC"
+                                       VAL="Percentage of time that the CPU or CPUs were idle and the system did not have an outstanding disk I/O request"/>
+                        <EXTRA_ELEMENT NAME="TITLE" VAL="CPU Idle"/>
+                    </EXTRA_DATA>
+                </METRIC>
+                <METRIC NAME="swap_free" VAL="2097148" TYPE="float" UNITS="KB" TN="3" TMAX="180" DMAX="0" SLOPE="both"
+                        SOURCE="gmond">
+                    <EXTRA_DATA>
+                        <EXTRA_ELEMENT NAME="GROUP" VAL="memory"/>
+                        <EXTRA_ELEMENT NAME="DESC" VAL="Amount of available swap memory"/>
+                        <EXTRA_ELEMENT NAME="TITLE" VAL="Free Swap Space"/>
+                    </EXTRA_DATA>
+                </METRIC>
+                <METRIC NAME="mem_cached" VAL="3100100" TYPE="float" UNITS="KB" TN="3" TMAX="180" DMAX="0" SLOPE="both"
+                        SOURCE="gmond">
+                    <EXTRA_DATA>
+                        <EXTRA_ELEMENT NAME="GROUP" VAL="memory"/>
+                        <EXTRA_ELEMENT NAME="DESC" VAL="Amount of cached memory"/>
+                        <EXTRA_ELEMENT NAME="TITLE" VAL="Cached Memory"/>
+                    </EXTRA_DATA>
+                </METRIC>
+                <METRIC NAME="pkts_out" VAL="4.80" TYPE="float" UNITS="packets/sec" TN="83" TMAX="300" DMAX="0"
+                        SLOPE="both" SOURCE="gmond">
+                    <EXTRA_DATA>
+                        <EXTRA_ELEMENT NAME="GROUP" VAL="network"/>
+                        <EXTRA_ELEMENT NAME="DESC" VAL="Packets out per second"/>
+                        <EXTRA_ELEMENT NAME="TITLE" VAL="Packets Sent"/>
+                    </EXTRA_DATA>
+                </METRIC>
+                <METRIC NAME="load_five" VAL="0.82" TYPE="float" UNITS=" " TN="53" TMAX="325" DMAX="0" SLOPE="both"
+                        SOURCE="gmond">
+                    <EXTRA_DATA>
+                        <EXTRA_ELEMENT NAME="GROUP" VAL="load"/>
+                        <EXTRA_ELEMENT NAME="DESC" VAL="Five minute load average"/>
+                        <EXTRA_ELEMENT NAME="TITLE" VAL="Five Minute Load Average"/>
+                    </EXTRA_DATA>
+                </METRIC>
+                <METRIC NAME="cpu_num" VAL="4" TYPE="uint16" UNITS="CPUs" TN="203" TMAX="1200" DMAX="0" SLOPE="zero"
+                        SOURCE="gmond">
+                    <EXTRA_DATA>
+                        <EXTRA_ELEMENT NAME="GROUP" VAL="cpu"/>
+                        <EXTRA_ELEMENT NAME="DESC" VAL="Total number of CPUs"/>
+                        <EXTRA_ELEMENT NAME="TITLE" VAL="CPU Count"/>
+                    </EXTRA_DATA>
+                </METRIC>
+                <METRIC NAME="load_fifteen" VAL="0.68" TYPE="float" UNITS=" " TN="53" TMAX="950" DMAX="0" SLOPE="both"
+                        SOURCE="gmond">
+                    <EXTRA_DATA>
+                        <EXTRA_ELEMENT NAME="GROUP" VAL="load"/>
+                        <EXTRA_ELEMENT NAME="DESC" VAL="Fifteen minute load average"/>
+                        <EXTRA_ELEMENT NAME="TITLE" VAL="Fifteen Minute Load Average"/>
+                    </EXTRA_DATA>
+                </METRIC>
+                <METRIC NAME="mem_free" VAL="228108" TYPE="float" UNITS="KB" TN="3" TMAX="180" DMAX="0" SLOPE="both"
+                        SOURCE="gmond">
+                    <EXTRA_DATA>
+                        <EXTRA_ELEMENT NAME="GROUP" VAL="memory"/>
+                        <EXTRA_ELEMENT NAME="DESC" VAL="Amount of available memory"/>
+                        <EXTRA_ELEMENT NAME="TITLE" VAL="Free Memory"/>
+                    </EXTRA_DATA>
+                </METRIC>
+                <METRIC NAME="cpu_system" VAL="1.2" TYPE="float" UNITS="%" TN="22" TMAX="90" DMAX="0" SLOPE="both"
+                        SOURCE="gmond">
+                    <EXTRA_DATA>
+                        <EXTRA_ELEMENT NAME="GROUP" VAL="cpu"/>
+                        <EXTRA_ELEMENT NAME="DESC"
+                                       VAL="Percentage of CPU utilization that occurred while executing at the system level"/>
+                        <EXTRA_ELEMENT NAME="TITLE" VAL="CPU System"/>
+                    </EXTRA_DATA>
+                </METRIC>
+                <METRIC NAME="proc_run" VAL="1" TYPE="uint32" UNITS=" " TN="43" TMAX="950" DMAX="0" SLOPE="both"
+                        SOURCE="gmond">
+                    <EXTRA_DATA>
+                        <EXTRA_ELEMENT NAME="GROUP" VAL="process"/>
+                        <EXTRA_ELEMENT NAME="DESC" VAL="Total number of running processes"/>
+                        <EXTRA_ELEMENT NAME="TITLE" VAL="Total Running Processes"/>
+                    </EXTRA_DATA>
+                </METRIC>
+                <METRIC NAME="mem_total" VAL="8169032" TYPE="float" UNITS="KB" TN="203" TMAX="1200" DMAX="0"
+                        SLOPE="zero" SOURCE="gmond">
+                    <EXTRA_DATA>
+                        <EXTRA_ELEMENT NAME="GROUP" VAL="memory"/>
+                        <EXTRA_ELEMENT NAME="DESC" VAL="Total amount of memory displayed in KBs"/>
+                        <EXTRA_ELEMENT NAME="TITLE" VAL="Memory Total"/>
+                    </EXTRA_DATA>
+                </METRIC>
+                <METRIC NAME="cpu_aidle" VAL="87.1" TYPE="float" UNITS="%" TN="22" TMAX="3800" DMAX="0" SLOPE="both"
+                        SOURCE="gmond">
+                    <EXTRA_DATA>
+                        <EXTRA_ELEMENT NAME="GROUP" VAL="cpu"/>
+                        <EXTRA_ELEMENT NAME="DESC" VAL="Percent of time since boot idle CPU"/>
+                        <EXTRA_ELEMENT NAME="TITLE" VAL="CPU aidle"/>
+                    </EXTRA_DATA>
+                </METRIC>
+                <METRIC NAME="bytes_in" VAL="1417.43" TYPE="float" UNITS="bytes/sec" TN="83" TMAX="300" DMAX="0"
+                        SLOPE="both" SOURCE="gmond">
+                    <EXTRA_DATA>
+                        <EXTRA_ELEMENT NAME="GROUP" VAL="network"/>
+                        <EXTRA_ELEMENT NAME="DESC" VAL="Number of bytes in per second"/>
+                        <EXTRA_ELEMENT NAME="TITLE" VAL="Bytes Received"/>
+                    </EXTRA_DATA>
+                </METRIC>
+                <METRIC NAME="mem_buffers" VAL="2436620" TYPE="float" UNITS="KB" TN="3" TMAX="180" DMAX="0" SLOPE="both"
+                        SOURCE="gmond">
+                    <EXTRA_DATA>
+                        <EXTRA_ELEMENT NAME="GROUP" VAL="memory"/>
+                        <EXTRA_ELEMENT NAME="DESC" VAL="Amount of buffered memory"/>
+                        <EXTRA_ELEMENT NAME="TITLE" VAL="Memory Buffers"/>
+                    </EXTRA_DATA>
+                </METRIC>
+                <METRIC NAME="mem_shared" VAL="0" TYPE="float" UNITS="KB" TN="3" TMAX="180" DMAX="0" SLOPE="both"
+                        SOURCE="gmond">
+                    <EXTRA_DATA>
+                        <EXTRA_ELEMENT NAME="GROUP" VAL="memory"/>
+                        <EXTRA_ELEMENT NAME="DESC" VAL="Amount of shared memory"/>
+                        <EXTRA_ELEMENT NAME="TITLE" VAL="Shared Memory"/>
+                    </EXTRA_DATA>
+                </METRIC>
+                <METRIC NAME="swap_total" VAL="2097148" TYPE="float" UNITS="KB" TN="203" TMAX="1200" DMAX="0"
+                        SLOPE="zero" SOURCE="gmond">
+                    <EXTRA_DATA>
+                        <EXTRA_ELEMENT NAME="GROUP" VAL="memory"/>
+                        <EXTRA_ELEMENT NAME="DESC" VAL="Total amount of swap space displayed in KBs"/>
+                        <EXTRA_ELEMENT NAME="TITLE" VAL="Swap Space Total"/>
+                    </EXTRA_DATA>
+                </METRIC>
+                <METRIC NAME="part_max_used" VAL="77.7" TYPE="float" UNITS="%" TN="143" TMAX="180" DMAX="0" SLOPE="both"
+                        SOURCE="gmond">
+                    <EXTRA_DATA>
+                        <EXTRA_ELEMENT NAME="GROUP" VAL="disk"/>
+                        <EXTRA_ELEMENT NAME="DESC" VAL="Maximum percent used for all partitions"/>
+                        <EXTRA_ELEMENT NAME="TITLE" VAL="Maximum Disk Space Used"/>
+                    </EXTRA_DATA>
+                </METRIC>
+            </HOST>
+        </CLUSTER>
+    </GRID>
+</GANGLIA_XML>



Mime
View raw message