Is there a way to get an element in a DMS system based on the IP?
Something like GetElementByName but ByIp.
There is a way to get elements with the DMSClass call and check for the IP address in the element objects.
But the DMSClass is now obsolete so I’m searching for another way to do this.
Robbie Demaegdt [SLC] [DevOps Advocate] Selected answer as best 11th March 2024
Hi Robbie, the DMS library unfortunately doesn’t expose the polling IP in an easy way. The connections first need to be downcasted to the correct type before the IP address can be accessed:
var elementsHttp = dms.GetElements().Where(x => x.Connections.OfType<IHttpConnection>().Any(y => y.TcpConfiguration.RemoteHost == “x”));
There is also the ‘GetElementByIpMessage’ SLNet message that can probably be used for what you want to do.
Robbie Demaegdt [SLC] [DevOps Advocate] Selected answer as best 11th March 2024
The GetElementByIpMessage isn’t working neither on the SLNetClientTestTool.
I was able to find elements with the IHTTPConnection, ISnmpConnection.
Finding elements with serial based (TCP/IP, UDP/IP and Serial) aren’t supported yet from time of writing this (latest release version 1.0.1.5 and 1.1.1.5 or the Skyline.DataMiner.Core.DataMinerSystem.Common package)