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

Connection refused #100

Closed
rjrobinson opened this issue Apr 19, 2017 · 4 comments
Closed

Connection refused #100

rjrobinson opened this issue Apr 19, 2017 · 4 comments

Comments

@rjrobinson
Copy link

Error reading from UDP: read udp 10.0.1.4:49582->24.34.214.79:161: i/o timeout

Seems that I can only get this error, but when using the command line, or the ruby snmp gem, it works fine.

Any thoughts?

@hh-h
Copy link

hh-h commented Apr 25, 2017

I have the save issue with a few switches:
console snmpbulkwalk ok, 0.2s
console snmpwalk ok, 0.8s
python netsnmp ok, 0.2s
gosnmp timeout

GoSNMP config

Version:   gosnmp.Version2c,
Timeout:   time.Duration(6) * time.Second,
Retries:   3,

I'll investigate on weekend my issue

@hh-h
Copy link

hh-h commented Apr 26, 2017

Okay, seems like I've figured out the problem. When I started to diff two packets from python library and go library I've noticed that max-repetitions is different.
So when I changed MaxRepetitions to lower value (16) problem disappeared.

$ snmpbulkwalk -v2c -Cr50 -c public 10.128.4.34 .1.3.6.1.2.1.2.2.1.3
Timeout: No Response from 10.128.4.34
$ snmpbulkwalk -v2c -Cr16 -c public 10.128.4.34 .1.3.6.1.2.1.2.2.1.3
iso.3.6.1.2.1.2.2.1.3.1 = INTEGER: 24
... skipped ...

Try to set MaxRepetitions to lower value, I'd recommend 10, because it's snmpbulkwalk default, but net-snmp's python bindings using 16 and I don't have problems with it.

ex

    s := &gosnmp.GoSNMP{
        Target:    ip,
        Port:      uint16(161),
        Community: "public",
        Version:   gosnmp.Version2c,
        Timeout:   time.Duration(6) * time.Second,
        Retries:   2,
        MaxRepetitions: 16,
    }
    err = s.Connect()

Cheers

@soniah
Copy link
Collaborator

soniah commented Sep 15, 2017

Thanks @hh-h @rjrobinson I've updated the comments around MaxRepetitions to reference this issue.

@soniah soniah closed this as completed Sep 15, 2017
@marcotollini
Copy link

Thanks a lot!
With this message I hope to help the next person that is doing Walk with goSNMP on Huawei VRP (NE40E): set MaxRepetition at 20, or you will get a Timeout error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants