目前的情况是,一方面,我有一个系统,在这个系统中,我们有摄像头适配器(我们开发的),可以帮助我们将摄像头集成到系统中。在另一边,我们有一个摄像头模拟器。
在我的相机适配器中,为了获得相机的当前UpTime,我发送了一个带有system UpTime的正确Oid的SNMP Get命令。
在我的适配器中,我正在使用SnmpSharpNet library。
public static void GetSystemUptime(string host, out TimeSpan? uptime)
{
SimpleSnmp snmp = new SimpleSnmp();
snmp.PeerIP = IPAddress.Parse(host);
Oid oid = new Oid(SnmpOid.SYS_UPTIME);
Dictionary<Oid, AsnType> dict = snmp.Get(SnmpVersion.Ver1, new[] { oid.ToString()});
AsnType asnType;
if (dict == null || dict.TryGetValue(oid, out asnType) == false || asnType == null || asnType.GetType() != typeof(TimeTicks))
{
uptime = null;
return;
}
uptime = (TimeSpan)(asnType as TimeTicks);
}但现在,我正在开发摄像机模拟器,它实际上是模拟摄像机的。所以我现在需要制作SNMP Agent。我似乎找不到关于如何在SNMP Agent中处理Get命令的信息,所以我可以在后面回复正确的信息。
任何人都可以将我链接到相关信息或指导我完成整个过程。
坦克,
拍拍
发布于 2012-07-25 19:48:21
http://www.lextm.com/2012/07/sharpsnmp-vs-snmpsharpnet/
你所问的可能是每个SNMP#NET用户都想知道的。
SNMP#NET不能很好地支持代理开发。您需要切换到另一个库,无论是商业库还是开源库。
https://stackoverflow.com/questions/11636915
复制相似问题