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?
As this question has now been open for a long time and there has been no further reaction from you, I will now close it. If you still want more information about this, could you post a new question?
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,
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.
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?
Hi Sam,
I would use the following NT Notify Type NT_GET_TABLE_COLUMNS (321) | DataMiner Docs to get the table columns. You can retrieve the primary key column for table 6001 and if it's empty, continue with setting parameter 3005 as "NULL DATA".
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
After the element returns from a timeout the existing rows are retained till new data is retrieved through snmp poll – so even though the snmp table response is empty there are still primary keys returning on this one.
Hi Sam,
it is possible to use conditional triggers for QActions. Please take a look at this. I'm assuming in your case you will create a QAction that triggers on the table parameter only when tableparameterId == "", or something along those lines. Keep in mind that check for NULL will happen before the QAction is even executed, and not inside of it.
Let me know if this helps or you have any further questions.
Cheers
Hi Sam,
Have you been able to find a solution for this yet? If the answers below helped, could you select the most helpful answer, or if you found another solution altogether, could you let us know? If you still need help with this, could you answer the questions Laurens asks in the comment of January 19th?