I currently query a list of devices using the following API call:

/api/table.xml?username=myuser&passhash=????&content=devices&output=xml&columns=device,status,downsens&count=40

The XML file I receive contains multiple devices that have interfaces down with what it looks like conflicting information: For the same device I have: <status>Up </status> <downsens> <a title="App-Server-1: 117x Down" class="sensorlinkred" href="sensors.htm?id=2408&filter_status=5"> <div class="sensr">117</div></a> </downsens> <downsens_raw>0000000117</downsens_raw> How can the same device have the status=Up and the downsens value contains Down and a non-zero time value(i.e. 117)? Could you please offer some clarification?

Thanks in advance, Dan.


Article Comments

Is it possible that the ping sensor is up but the rest is down? It's not a time value, but the amount of actually down sensors on the device; or did I get you wrong there?


Feb, 2016 - Permalink

I don't have a ping sensor in this particular device. I have an 'SNMP Traffic 64' sensor and several other custom SNMP sensors.

Maybe I didn't explain myself too well in the original question.

When I query the same devices and I specify the content to be sensors as shown in the API call below: /api/table.xml?username=????&passhash=????&content=sensors&output=xml&columns=device,type,sensor,status,message,lastvalue&count=40

The result of the 'status' column(same as <status> xml tag) is Down for every sensor that is down as it should be.

But then If I query the exact same sensors using the following API call: /api/table.xml?username=????&passhash=????&content=devices&output=xml&columns=device,status,downsens&count=40 The result of the 'status' column is now Up for the exact same device that is reported as down in the sensor query.

Additionally, the 'downsens' column contains the string Down and provides a number specifying how long the sensor has been down for.

In my opinion, there are two possible outcomes. Either the query I am using is wrong or the 'status' column is not properly being updated for API calls containing content=devices .

I am inclined to believe it is me who may be making a mistake, but need to make sure.

Note: The behavior explained above applies to sensors/devices in a 'Down' status only. Sensors/Devices in a 'Paused' status do properly show when queried in the two ways described above content=devices and content=sensors

I hope this clarifies the original question.

Thanks.


Feb, 2016 - Permalink

Ah - well, the devices only have two states - active (up) and paused. There's no down state for them. Just these two states. You'll have to rely on the content=sensors query. Within that, the status property reflects the current sensor state.


Feb, 2016 - Permalink

Thank you! That was the information I was looking for.


Feb, 2016 - Permalink