Esempio n. 1
0
 public SnmpHelper(string host, string community, SnmpSharpNet.SnmpVersion ver = SnmpSharpNet.SnmpVersion.Ver2, int port = 161)
     :base(host, port, community, SNMP_TIMEOUT, SNMP_RETRY){
     this._ver = ver;
     this._suppressExceptions = false;
     System.Net.IPAddress ip = null;
     if (!System.Net.IPAddress.TryParse(host, out ip))
         ip = System.Net.Dns.GetHostAddresses(host).FirstOrDefault();
 }
Esempio n. 2
0
 public string OidToIp(SnmpSharpNet.Oid oid) {
     var match = Regex.Match(oid.ToString(), @"((\.[0-9]+){4})$");
     if (!match.Success)
         return "";
     return match.Groups[1].Value.Trim('.');
 }