With Params in a protocol you can use types like pollingip or elementname to have a parameter with this information populated in protocol parameters within the element.
https://docs.dataminer.services/develop/schemadoc/Protocol/Protocol.Params.Param.Type.html#pollingip
I would like to be able to have the set and get community strings as displayed parameters within the datadisplay of my protocol, but as they are not available like the elementname or pollingip is there any other way I can access them within my protocol to save in parameters within the element.
Hi Sam,
This is indeed not possible in the same way you can retrieve the polling ip or element name.
Instead, you'll have to use the class library in a QAction.
Through the class library you can retrieve the connections for a specific element.
As described in the link right before this, you can get all connections of a specific SNMP version using LINQ in the following way:
Where(x => x.Connections.OfType<ISnmpV1Connection>())
or
Where(x => x.Connections.OfType<ISnmpV2Connection>())
or
Where(x => x.Connections.OfType<ISnmpV3Connection>())
For each SNMPv1 or SNMPv2 connection you'll be able to access that data through the "GetCommunityString" and "SetCommunityString" properties. For SNMPv3 the equivalent data is stored in the "SecurityConfig" property.
Once retrieved in the QAction, you can put that data in whatever parameter you prefer.
The opposite should also be possible (trigger a QAction from a parameter change to set the set and get community strings).
I hope this helps.
Don't hesitate to reach out if anything would be unclear or if you are still having issues.
-That will indeed be possible like this on the condition that the credential library is not used to store the community strings.
-I did not test this, but changing the community strings for the same element might potentially end up in a deadlock (to be verified): a parameter set is executed which triggers a QAction that then wants to modify the element could result in the modify waiting for the for the QAction to finish and the QAction waiting for the modify to finish