Within a protocol I want to detect when an SNMP table result is an empty array.
When this condition is discovered I will use QAction to update a standalone parameter to alert of the null data response from the array.
When the parameter is receiving data, I'll update the other parameter again
What's the best way to detect a returned empty snmp arrays in a protocol?
Hi,
By executing a count on the number of rows in the table it is possible to know if a table is empty or not.
int rowCount = protocol.RowCount(tablePid);
if rowCount == 0 then the response is empty, else it will have data.
Do note that this will only work if the device is responding. If there is a timeout then the previous polled rows will remain in the table.
Regards,
I have tried with an snmp simulation to poll a table with rows and then poll it again without the rows and in my case the rows are no longer present in the table on the element.
-Which DataMiner version is being used?
-Is it polling SNMPv1,v2, or v3?
-How does the table definition look like in the protocol.xml: is the table containing all columns of type “snmp” or does it also contain other column types like “retrieved” or “state”?
-How does the SNMP/OID tag look like for the table parameter? Is it having the options=”instance;multipleGetNext” or is it using a different method?
Thanks for the reply.
Unfortunately a snmp table response of zero does not mean the table will be empty so this example doesn’t work.
See example https://samstump.com/dma/snmptableresponse.png
You are correct the table rows stay in the table when a timeout occurs – which is fine – but when the timeout is resolved if the snmp table response is empty then the previous rows are still in the table and counting the number of rows does not work to highlight the empty snmp table response.