@@ -6,6 +6,7 @@ has several methods to help control various aspects of the walk.
6
6
7
7
* [ Basic Use] ( #basic-use )
8
8
* [ API] ( #api )
9
+ * [ getOid] ( #getoid )
9
10
* [ next] ( #next )
10
11
* [ skipTo] ( #skipto )
11
12
* [ restart] ( #restart )
@@ -14,6 +15,9 @@ has several methods to help control various aspects of the walk.
14
15
* [ count] ( #count )
15
16
* [ isComplete] ( #iscomplete )
16
17
* [ hasOids] ( #hasoids )
18
+ * [ subtreeOnly] ( #subtreeonlybool-subtreeonly--true )
19
+ * [ maxRepetitions] ( #maxrepetitionsint-maxrepetitions )
20
+ * [ useGetBulk] ( #usegetbulkbool-usegetbulk )
17
21
18
22
## Basic Use
19
23
@@ -44,8 +48,19 @@ while($walk->hasOids()) {
44
48
echo sprintf("Walked a total of %s OIDs.", $walk->count()).PHP_EOL;
45
49
```
46
50
51
+ By default the client will send a getBulk request if you are using SNMP v2/v3, which improves performance.
52
+
47
53
## API
48
54
55
+ ### getOid
56
+
57
+ An alias of ` next() ` for getting the next OID in the walk.
58
+
59
+ ``` php
60
+ $oid = $walk->getOid();
61
+ echo sprintf("%s = %s", $oid->getOid(), $oid->getValue()).PHP_EOL;
62
+ ```
63
+
49
64
### next
50
65
51
66
Get the next OID in the walk.
@@ -152,3 +167,28 @@ Whether or not to walk only the subtree specified by the starting OID. The defau
152
167
# Walk past the subtree...
153
168
$walk->subtreeOnly(false);
154
169
```
170
+
171
+ ### maxRepetitions(int $maxRepetitions)
172
+
173
+ Specifies the maximum amount of OIDs to attempt to retrieve at a time during a getBulk request (SNMP v2/v3) during the
174
+ walk. This defaults to 100. You may have to modify this depending on device behavior. The larger this is set, the faster
175
+ the walk will likely complete.
176
+
177
+ ** Note** : Per SNMP RFCs, devices are only supposed to return the max amount of OIDs that can fit within a UDP packet,
178
+ regardless of how high this is set. However, not all devices seem to behave this way and may have specific maximums for
179
+ this value. If you notice issues, setting this lower may help.
180
+
181
+ ``` php
182
+ # Walk past the subtree...
183
+ $walk->maxRepetitions(10);
184
+ ```
185
+
186
+ ### useGetBulk(bool $useGetBulk)
187
+
188
+ Specifies whether a getBulk request should be sent for the walk. By default it will send using a getBulk request if you
189
+ are using SNMP v2/v3.
190
+
191
+ ``` php
192
+ # Explicitly disable getBulk requests if you want...
193
+ $walk->useGetBulk(false);
194
+ ```
0 commit comments