AnsweredAssumed Answered

Custom Probes: Unit For String Data?

Question asked by alexander.li on Dec 10, 2015
Latest reply on Dec 14, 2015 by dakoServFFR

!I am currently developed a custom probe to read an xml, and the xml data will be "connected" or "disconnected".

I already can get the data and show it to probe log, but the problem I can't pass the data to the QoS.

When I used in QoS Datasource in dashboard, the data always return null.

I think I select the wrong metric type or unit for string data.

Help me to fix it. Thank you in advance

 

Here is my log:

Dec 10 11:07:55:339 [Data Collector - 3, xml_probe] ==== Begin getUpdatedInventory: Pass-1   XML_Probe

Dec 10 11:07:55:339 [Data Collector - 3, xml_probe] Resoruce Config XMLPath : C:\Users\Administrator\Desktop\book.xml

Dec 10 11:07:55:340 [Data Collector - 3, xml_probe] Connected

Dec 10 11:07:55:340 [Data Collector - 3, xml_probe] XML Data: Connected

Dec 10 11:07:55:341 [Data Collector - 3, xml_probe] Adding robot CS below probe for local probe

Dec 10 11:07:55:345 [Data Collector - 3, xml_probe] PERF: DONE:  xml_probe inventory update for XML_Probe   {Seconds=0.006}

Dec 10 11:07:55:346 [Data Collector - 3, xml_probe] PERF: START: Finding Device Deltas

Dec 10 11:07:55:347 [Data Collector - 3, xml_probe] PERF: DONE:  Finding Device Deltas   {Seconds=0.001}   Finished finding Device Deltas.

Dec 10 11:07:55:347 [Data Collector - 3, xml_probe] Total inventory monitored: 2 nodes.

Inventory count by type: {NetworkXML=>1, RESOURCE=>1}

Dec 10 11:07:55:348 [Data Collector - 3, xml_probe] PERF: Memory Status: Max=455   CurrentAllocated=32   Free=19   Used=13 MB  NoGC

Dec 10 11:07:55:348 [Data Collector - 3, xml_probe] PERF: START: Sending qos for monitors

Dec 10 11:07:55:350 [Data Collector - 3, xml_probe] NimQosValue data not of valid type: com.nimsoft.vm.meas.DataPoint is not valid for Value objects

Dec 10 11:07:55:350 [Data Collector - 3, xml_probe] PERF: DONE:  Sending qos for monitors   {Seconds=0.002}

Here is my probe_schema.xml :

<element-type name="NetworkXML">    <qos-metric-types>    <qos-metric-type name="NetworkState">    <description>Getting info about Connection status via XML File</description>    <label>Connection Status</label>    <metric-type>1:5</metric-type>    <qos-name>QOS_SYSTEM_CONNECTION_STATUS_XML</qos-name>    <unit>none</unit>    </qos-metric-type>    </qos-metric-types>     </element-type>

I also attached RegisteredMetricType.xlsx for the list of metrics

 

Here is my Java:

public InventoryDataset addXMLStateToInventory(ResourceConfig resourceConfig) throws NimException, InterruptedException{      InventoryDataset inventoryDataset = new InventoryDataset(resourceConfig);    NetworkXML networkXML = NetworkXML.addInstance(inventoryDataset, new EntityId(resourceConfig, "NetworkState"), "NetworkState", resourceConfig);    Log.info("Resoruce Config XMLPath : " + resourceConfig.getResourceProperty("XMLPath"));    String xml_data = getFirstData( resourceConfig.getResourceProperty("XMLPath"));    Log.info("XML Data: " + xml_data);    networkXML.setMetric(networkXML.NetworkState, xml_data);    return inventoryDataset; 

Outcomes