public static void SetInt(string ip, string community, string oid, int valor, int timeout, Int32 port = 161, VersionCode snmpVersion = VersionCode.V1, Boolean tryGetInt = true) { try { SetOne(ip, community, oid, timeout, port, snmpVersion, SnmpType.Integer32, valor); } catch (SnmpException ex) { if (tryGetInt) { int _val = SnmpClient.GetInt(ip, community, oid, timeout); if (_val == valor) { return; } } throw ex; } }
public static void SendTrap(string ipTo, string idIncidencia, string value) { string newOid = SnmpAgent.OID_TRAP_GENERA_INCIDENCIA + idIncidencia; SnmpClient.TrapTo(ipTo, "public", newOid, value); }