Hi Dojo
Since the Interop.SLDms namespace is deprecated, I would like to replace the following code with methods from the DataMinerSystem (class) library.
DMSClass dms = new DMSClass();
object x = new object();
dms.GetInfo(8/*DMS_GET_INFO*/, 0, ref x);
object[] retrievedElements = (object[])x;
foreach (object element in retrievedElements)
{
object[] singleElementInfo = (object[])element;
string[] genericElementInfo = (string[])singleElementInfo[0];
if (genericElementInfo[14].Equals("Skyline SLA Definition Basic"))
{
string sDmaEid = genericElementInfo[0] + "/" + genericElementInfo[1];
string sSLAName = genericElementInfo[3];
string[] saDMAEidService = genericElementInfo[24].Split('/');
}
}
where
genericElementInfo[0] = 772
genericElementInfo[1] = 111
genericElementInfo[3] = "My SLA"
genericElementInfo[14] = "Skyline SLA Definition Basic"
genericElementInfo[24] = "772/110"
Using the DataMinerSystem (class) library code below, I can retrieve a collection of IDmsElement objects representing the SLA (Service Level Agreement) elements available in the DMS.
IDms dms = protocol.GetDms();
IDmsElement[] retrievedElements = dms.GetElements().Where(element => element.Protocol.Name.Equals("Skyline SLA Definition Basic") && element.Protocol.Version.Equals("Production")).ToArray();
foreach (IDmsElement element in retrievedElements)
{
string sDmaEid = element.AgentId + "/" + element.Id;
string sSLAName = element.Name;
string[] saDMAEidService = ... .Split('/');
}
where
element.AgentId = 772
element.Id = 111
element.Name = "My SLA"
element.Protocol.Name = "Skyline SLA Definition Basic"
element. ... = "772/110"
The genericElementInfo[24] field contains the DataMiner element ID of the Service monitored by the SLA. I'm having trouble finding this DataMiner element ID in the IDmsElement objects retrieved through the DataMinerSystem (class) library.
The following code appears to explain the contents of the genericElementInfo array. However, I'm not sure whether this information is entirely correct, as I found it in an outdated document.
string[] genericElementInfo = (string[])singleElementInfo[0];
DMAElementConnection connection = new DMAElementConnection();
connection.parity = genericElementInfo[20];
connection.databits = genericElementInfo[21];
connection.stopbits = genericElementInfo[22];
connection.flowctrl = genericElementInfo[23];
connection.busaddress = genericElementInfo[24];
connection.retries = genericElementInfo[25];
connection.slowpoll = genericElementInfo[26];
connection.slowpollbase = genericElementInfo[27];
connection.timeouttime = genericElementInfo[28];
connection.pollingip = genericElementInfo[29];
connection.pollingport = genericElementInfo[30];
This would suggest that the DataMiner element ID of the service monitored by the SLA is stored in the SLA element's bus address field. If this is indeed the case, how can I retrieve this ID through the DataMinerSystem (class) library?
Serializing the element.Connections property of an SLA element returns {
"Id": 0,
"Timeout": "00:00:00",
"Retries": 0,
"ElementTimeout": null
}
For comparison, serializing the element.Connections property of a regular serial element returns {
"Connection": {
"RemoteHost": "127.0.0.2",
"NetworkInterfaceCard": 0,
"LocalPort": 0,
"RemotePort": 12312,
"IsSslTlsEnabled": false,
"IsDedicated": false
},
"BusAddress": "",
"Timeout": "00:25:00",
"Retries": 3,
"ElementTimeout": "08:20:00",
"Id": 0
}
Thank you in advance!
Kind regards
Hi Michiel,
The DataMinerSystem library currently only provides support for obtaining information about the following connection types: virtual, snmp (v1.v2c,v3), HTTP and serial. This is why the serialization of the connection of an SLA element does not return much info.
We are currently busy adding support for additional connection types (including SLA) to the DataMinerSystem library, so I expect in one of the upcoming versions this information will be available.
For now, if you want to avoid using the deprecated Interop.SLDms, you could execute a raw SLNet call. E.g., execute a GetElementByIdMessage. The resulting ElementInfoEventMessage will then provide the ID of the monitored service element under the MainPort/BusAddress property.