When there are multiple datapoints per single channel (such as bandwidth sensors, netflow sensors), the channel list shows as simply "Bytes Sent", but in the data, there are multiple entries bound to the same channel ID, making it impossible to choose the right one.

For example:

  1. 1, we query list of channels by sensor: Channel List:
 {
      "objid": 1,
      "objid_raw": 1,
      "channel": "",
      "channel_raw": "",
      "sensor": "",
      "sensor_raw": "",
      "name": "Bytes Sent"
    },

Data:

<value channel="Bytes Sent (volume)" channelid="1">3,691 KByte</value>
<value_raw channel="Bytes Sent (volume)" channelid="1">3779761.8783</value_raw>
<value channel="Bytes Sent (speed)" channelid="1">24 kbit/s</value>
<value_raw channel="Bytes Sent (speed)" channelid="1">2986.0656</value_raw>

Does not match.

If using numeric ID to match, it'll match on both, resulting in the last item being used.


Article Comments

Dear neuralfraud

The sensor measures the volumes and computes the volume difference over the time difference. The speed is the 'real' value for the channel. The reason is that the actual scanning of the sensor can slightly differ from the interval which is configured. The speed computation uses the actual time difference to the last scan and provides the real speed.


Dec, 2015 - Permalink

Is it not possible for the channel table to know that there are (volume), (speed), and other sub-channels?

Are there any other instance where there might be multiple sub-channels? Such as, detailed netflow?


Dec, 2015 - Permalink

Can you post the API calls you're using to get those results?


Dec, 2015 - Permalink

channel query:

http://neuralfraud-pc:3000/api/datasources/proxy/3/table.json?username=apiuser&password=********&content=channels&columns=objid,name&id=<sensor ID>

Historic data: http://neuralfraud-pc:3000/api/datasources/proxy/3/historicdata.xml?username=apiuser&password=********&id=<sensor ID>&sdate=2015-12-19-06-07-38&edate=2015-12-19-12-07-38&avg=0&pctshow=false&pctmode=false

(note, calls a proxied through a backend service)

I have to use XML for actual results because JSON output doesn't include channel names or ID.

For example: { "histdata": [ { "datetime": "12\/19\/2015 6:07:41 AM", "datetime_raw": 42357.463669016, "value": "2 msec", "value_raw": 2, "coverage": "100 %", "coverage_raw": 10000 } ] }

Same exact call, just JSON instead of XML. Anyhow, if subchannels are always going to be speed and volume, then it really doesn't matter. I'm more concerned if a sensor does something different. As long as that never happens, I can manage the results accurately.


Dec, 2015 - Permalink

Ah okay, now I get it. Since we'll be working on the API next year, this will be taken into consideration :) Thanks for your input!


Dec, 2015 - Permalink

You might want to try the parameter usecaption=true with the JSON query - it should be more verbose with the channel names.


Dec, 2015 - Permalink