Hi Dojo community,
I am developing an SNMP driver that requires certain commands to be executed after each set action. However, the SNMP set action is not always successful, and sometimes retries are needed.
Is there any way to determine when and if the set action was successful in the driver, similar to what can be seen in the stream viewer?
Hi,
When a set fails, the same number of retries are automatically done similar like a get.
I did not test it myself, but it should be possible to add a trigger <On id="pid">parameter</On><Time>timeout</Time> to trigger at each retry, or <Time>timeout after retries</Time> to only trigger once after all retries failed. With id="pid" the pid has to be replaced with the parameter id of the write parameter.
Regards,
Hi Laurens,
Thank you for your answer! I understand that the trigger will only activate if the set is unsuccessful. However, since the set can sometimes succeed, I need to execute an additional action only after a successful retry. If all retries fail, I don’t need to take any further action.
By default there is no trigger when the set succeeded. With a workaround it might be possible to still trigger on it and that is when the set happens through options=”snmpSet” on the write parameter and there is a corresponding read parameter (same parameter name with snmp enabled). When the set succeeds, the write value will be copied into the read parameter and when adding a trigger on the read parameter that one will go off when a new value enters. Note that a clear action on the read will have to added after the trigger went of if you want to trigger on every set that succeeded even if the value remained the same, else with the same value the trigger won’t go off anymore.
Unfortunately, we cannot trigger on the read parameter. The specific use case here is that the SNMP set action is used to update the value on the web UI of the device, while the SNMP get action retrieves values directly from the device itself. This is why we need to perform the SNMP set action first, send a command to save the data, and then follow it up with the SNMP get.
Could you please explain it more