#SNMP - GetBulk V2 请求限制为 100 个结果?
#SNMP - GetBulk V2 request is limited to 100 results?
我正在尝试执行以下请求,结果应该是大约 900 个变量,而不是 100 个。
无论我发送 1 个或 10 个 oid 有多少,我总是得到不超过 100 个变量。
我做错了什么?
var readCommunity = new OctetString("XXXXX");
var oidsList = new List<string>
{
"1.3.6.1.2.1.2.2.1.3",
"1.3.6.1.2.1.2.2.1.5",
"1.3.6.1.2.1.2.2.1.6",
"1.3.6.1.2.1.2.2.1.7",
"1.3.6.1.2.1.2.2.1.8",
"1.3.6.1.2.1.2.2.1.2",
"1.3.6.1.2.1.2.2.1.10",
"1.3.6.1.2.1.2.2.1.16",
"1.3.6.1.2.1.2.2.1.14",
"1.3.6.1.2.1.31.1.1.1.6"
};
var oids = oidsList.Select(oid => new Variable(new ObjectIdentifier(oid))).ToArray();
ISnmpMessage request= new GetBulkRequestMessage(
0,
VersionCode.V2,
readCommunity,
0,
1000,
oids);
var response = request.GetResponse(60000, new IPEndPoint(IPAddress.Parse("1.1.1.1"), 161));
您可以发送请求,要求购买任意数量的商品,但要 return 给您多少是由代理决定的。标准就是这样定义的,
The receiving SNMP entity produces a Response-PDU with up to the
total number of requested variable bindings communicated by the
request.
While the maximum number of variable bindings in the Response-PDU is
bounded by N + (M * R), the response may be generated with a lesser
number of variable bindings (possibly zero) for either of three
reasons.
我正在尝试执行以下请求,结果应该是大约 900 个变量,而不是 100 个。 无论我发送 1 个或 10 个 oid 有多少,我总是得到不超过 100 个变量。 我做错了什么?
var readCommunity = new OctetString("XXXXX");
var oidsList = new List<string>
{
"1.3.6.1.2.1.2.2.1.3",
"1.3.6.1.2.1.2.2.1.5",
"1.3.6.1.2.1.2.2.1.6",
"1.3.6.1.2.1.2.2.1.7",
"1.3.6.1.2.1.2.2.1.8",
"1.3.6.1.2.1.2.2.1.2",
"1.3.6.1.2.1.2.2.1.10",
"1.3.6.1.2.1.2.2.1.16",
"1.3.6.1.2.1.2.2.1.14",
"1.3.6.1.2.1.31.1.1.1.6"
};
var oids = oidsList.Select(oid => new Variable(new ObjectIdentifier(oid))).ToArray();
ISnmpMessage request= new GetBulkRequestMessage(
0,
VersionCode.V2,
readCommunity,
0,
1000,
oids);
var response = request.GetResponse(60000, new IPEndPoint(IPAddress.Parse("1.1.1.1"), 161));
您可以发送请求,要求购买任意数量的商品,但要 return 给您多少是由代理决定的。标准就是这样定义的,
The receiving SNMP entity produces a Response-PDU with up to the total number of requested variable bindings communicated by the
request.
While the maximum number of variable bindings in the Response-PDU is
bounded by N + (M * R), the response may be generated with a lesser
number of variable bindings (possibly zero) for either of three
reasons.