Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: When request snmpgetbulk if set max_repetitions more 10, result only first 10 response #17

Open
aversant opened this issue Oct 18, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@aversant
Copy link

Describe the issue:

When use getbulk with max_repetitions more 10, it return only 10 response value. But if set max_repetitions to 10 and less - return all.

Reproduce the code example:

from gufo.snmp.sync_client import SnmpSession, SnmpVersion
from gufo.snmp.user import User, Aes128Key, DesKey, Md5Key, Sha1Key, KeyType

u = User(name="Network",  auth_key=Sha1Key("XXXX".encode(), key_type=KeyType.Password), priv_key=Aes128Key("YYYY".encode(),  key_type=KeyType.Password))

s = SnmpSession(user=u, addr="172.21.21.21", timeout=3, version=SnmpVersion.v3)
s.refresh()
s.get("1.3.6.1.2.1.2.1.0")
57

In [12]: list(s.getbulk("1.3.6.1.2.1.2.2.1.1", max_repetitions=20))
Out[12]:
[('1.3.6.1.2.1.2.2.1.1.1', 1),
 ('1.3.6.1.2.1.2.2.1.1.2', 2),
 ('1.3.6.1.2.1.2.2.1.1.3', 3),
 ('1.3.6.1.2.1.2.2.1.1.4', 4),
 ('1.3.6.1.2.1.2.2.1.1.5', 5),
 ('1.3.6.1.2.1.2.2.1.1.6', 6),
 ('1.3.6.1.2.1.2.2.1.1.7', 7),
 ('1.3.6.1.2.1.2.2.1.1.8', 8),
 ('1.3.6.1.2.1.2.2.1.1.9', 9),
 ('1.3.6.1.2.1.2.2.1.1.10', 10)]

In [13]: list(s.getbulk("1.3.6.1.2.1.2.2.1.1", max_repetitions=10))
Out[13]:
[('1.3.6.1.2.1.2.2.1.1.1', 1),
 ('1.3.6.1.2.1.2.2.1.1.2', 2),
 ('1.3.6.1.2.1.2.2.1.1.3', 3),
 ('1.3.6.1.2.1.2.2.1.1.4', 4),
 ('1.3.6.1.2.1.2.2.1.1.5', 5),
 ('1.3.6.1.2.1.2.2.1.1.6', 6),
 ('1.3.6.1.2.1.2.2.1.1.7', 7),
 ('1.3.6.1.2.1.2.2.1.1.8', 8),
 ('1.3.6.1.2.1.2.2.1.1.9', 9),
 ('1.3.6.1.2.1.2.2.1.1.10', 10),
 ('1.3.6.1.2.1.2.2.1.1.11', 11),
 ('1.3.6.1.2.1.2.2.1.1.12', 12),
 ('1.3.6.1.2.1.2.2.1.1.13', 13),
 ('1.3.6.1.2.1.2.2.1.1.14', 14),
 ('1.3.6.1.2.1.2.2.1.1.15', 15),
.....
 ('1.3.6.1.2.1.2.2.1.1.51', 51),
 ('1.3.6.1.2.1.2.2.1.1.52', 52),
 ('1.3.6.1.2.1.2.2.1.1.769', 769),
 ('1.3.6.1.2.1.2.2.1.1.770', 770),
 ('1.3.6.1.2.1.2.2.1.1.16777217', 16777217),
 ('1.3.6.1.2.1.2.2.1.1.16779225', 16779225),
 ('1.3.6.1.2.1.2.2.1.1.16779293', 16779293)]

Error message:

No response

Python version information

3.11.6 (main, Jan 6 2024, 05:32:16) [GCC 10.2.1 20210110]

Gufo SNMP version information

0.5.2

Operation system version

cat /etc/debian_version
11.8

@aversant aversant added the bug Something isn't working label Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant