Hello everyone.
I am trying to create a new element using the IDms and ElementConfiguration classes from an automation Script, although I have been able to set almost everything, I haven't figure out how can I set this values
So, is there a way to set this configuration using the mentioned classes?
This is the code that I am using, is basically the snippet to create an element.
// Create the element
IDms dms = engine.GetDms();
IDma agent = dms.GetAgent(DmaHostID);
IDmsProtocol protocol = dms.GetProtocol(ProtocolDropdown.Selected, sProductionVersion);
IUdp port = new Udp(IPAddress.Text, 161);
ISnmpV2Connection snmpv2 = new SnmpV2Connection
{
UdpConfiguration = port,
DeviceAddress = IPAddress.Text,
GetCommunityString = GetCommunityStringCCAP.Text,
SetCommunityString = SetCommunityStringCCAP.Text,
Timeout = new TimeSpan(0, 0, 0, 110),
Retries = iRetries,
ElementTimeout = new TimeSpan(0, 0, 0, 120),
};
ElementConfiguration configuration = new ElementConfiguration(dms, ElementName.Text, protocol, new List<IElementConnection> { snmpv2 });
configuration.Description = ElementName.Text;
configuration.Views.Add(dms.GetView(iViewID));
DmsElementId id = agent.CreateElement(configuration);
Thank you !!
Hello Martin,
Sorry for my late response.
This is how I implemented the Timeout, and at least for us is working fine
ISnmpV2Connection snmpv2 = new SnmpV2Connection
{
UdpConfiguration = port,
DeviceAddress = IPAddress.Text,
GetCommunityString = GetCommunityStringCCAP.Text,
SetCommunityString = SetCommunityStringCCAP.Text,
Timeout = new TimeSpan(0, 0, 0, 120),
Retries = iRetries,
ElementTimeout = new TimeSpan(0, 0, 0, 120),
};
Feel free to message me anytime and we can review this together.
Regards!
Hi Esteban,
Those settings are currently not supported in the class library, if you wan to contribute you can add them yourself.
See how to Class library development | DataMiner Docs
I too have noticed that this setting
ElementTimeout = new TimeSpan(0, 0, 0, 120),
in the ISnmpV2Connection is ignored and element is always created with default timeout of 30s. Or maybe I’m doing something wrong, I don’t know.
This is actually surprising, especially since the CreateElement Web API Method does support this.
If you find a way how to set element timeout in the automation engine, please let me know, thanks.