public Node DiscoveryByNode(Node node) { SnmpExpect expect = new SnmpExpect(); List<OidKey> list = BuildOidList(node); foreach (var oid in list) { Detail detail = new Detail { OidKey = oid, Node = node, Properties = expect.SnmpGet(node.RoCommunity, node.Address, oid.Key) }; node.AddDetail(detail); } return node; }
private List<OidKey> BuildOidList(Node node) { List<OidKey> list=new List<OidKey>(); foreach (var template in node.Templates) { foreach (var key in template.Keys) { if (list.Any(k => k.Key == key.Key)) { //------------------------ } else { list.Add(key); } } } }