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

SNMP GET request doesn`t work #4

Open
urtow opened this issue Aug 17, 2016 · 2 comments
Open

SNMP GET request doesn`t work #4

urtow opened this issue Aug 17, 2016 · 2 comments

Comments

@urtow
Copy link
Contributor

urtow commented Aug 17, 2016

Hello,

Sorry for my rude language :)

Here test:

*** Settings ***
Library     SnmpLibrary

*** Test Cases ***
SNMP GET
    ${connect status} =  Open Snmp V2c Connection   127.0.0.1    public
    ${value}=   Get     SNMPv2-MIB::sysDescr    0

This test fails with following error:
ValueError: need more than 1 value to unpack

I use pdb and see, what test fail here:
sym, suffixes = sym.split('.', 1)
https://github.com/kontron/robotframework-snmplibrary/blob/master/src/SnmpLibrary/utils.py#L41

Because sym is - sysDescr and have no dots.

Okaaay, i change test to this:

*** Settings ***
Library     SnmpLibrary

*** Test Cases ***
SNMP GET
    ${connect status} =  Open Snmp V2c Connection   127.0.0.1    public
    ${value}=   Get     SNMPv2-MIB::sysDescr.0

And here error:
Object with OID .1.3.6.1.2.1.1.1.0.0 not found

Because idx alredy in SNMPv2-MIB::sysDescr.0, but here: https://github.com/kontron/robotframework-snmplibrary/blob/master/src/SnmpLibrary/library.py#L243

idx added again.

WAT? о_О

@mwalle
Copy link
Contributor

mwalle commented Aug 17, 2016

Am 2016-08-17 15:11, schrieb urtow:

Hello,

Sorry for my rude language :)

no problem :b

we changed the interface lately so it accepts an index which defaults to
(0,). And I guess this isnt working with OID names. FYI we are just
using numerical OIDs here. doh!

Try the following as a possible workaround until the bug is fixed:

${value}= Get SNMPv2-MIB::sysDescr.

Note the trailing dot.

@urtow
Copy link
Contributor Author

urtow commented Aug 17, 2016

${value}= Get SNMPv2-MIB::sysDescr.

Works!

Thank you.

If you also fix installation issue - it will be great! :)

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

2 participants