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

MIB file does not load properly #48

Open
j-gooding opened this issue May 26, 2019 · 8 comments
Open

MIB file does not load properly #48

j-gooding opened this issue May 26, 2019 · 8 comments

Comments

@j-gooding
Copy link

WIENER-CRATE-MIB.txt

This MIB seems to compile to pysnmp fine with mibdump.py, however when trying to execute mibBuilder.loadModules('WIENER-CRATE-MIB')

The following error is encountered:

Loading MIB modules... Traceback (most recent call last): File "/Users/name/.local/share/virtualenvs/MPOD-PfZE_iSv/lib/python3.7/site-packages/pysnmp/smi/builder.py", line 344, in loadModule exec(codeObj, g) File "/Users/name/.pysnmp/mibs/WIENER-CRATE-MIB.py", line 233, in <module> snmpCommunityTable = MibTableColumn((1, 3, 6, 1, 4, 1, 19947, 1, 5, 1, 1), ) TypeError: __init__() missing 1 required positional argument: 'syntax'

It looks like the compiler is listing some tables as MibTableColumns. I'm not sure how to fix this. Any help or ideas would be appreciated.

@etingof
Copy link
Owner

etingof commented May 27, 2019

I am not sure about this declaration:

Snmp ::= SEQUENCE {
    snmpAccessRight            INTEGER,
    snmpCommunityName          OCTET STRING,
    snmpCommunityTable         SnmpCommunityEntry,
    snmpPort                   INTEGER,
    ipDynamicAddress           IpAddress,
    --OCTET STRING,
    ipStaticAddress            IpAddress,
    --OCTET STRING,
    macAddress                 MacAddress
}

What's it purpose at all?

@j-gooding
Copy link
Author

This is what it looks like in a MIB browser (I'm using iReasoning here, though it shows the same in others). It is mainly used to set the IP address and ports for the device.

The MIB was supplied by the manufacturer, I didn't write it myself. I'm also new to the inner workings of SNMP, so I couldn't even tell you if its a valid MIB file or not, though it seems to pass a lint check.

Screen Shot 2019-05-27 at 5 43 33 PM

@ainiml
Copy link

ainiml commented Jul 29, 2020

It seems this library has issues parsing MIB files?

@j-gooding
Copy link
Author

It seems this library has issues parsing MIB files?

I think the issue is that there are certain things such as "FLOAT" and other data types that are not part of the RFC standard that are actually industry standard, and used almost universally. It's not helped by the fact that virtually all manufacturers use the same implementation code for their servers which is non-compliant with the standard. The author of this library has written it entirely according to specification. I'm not sure what his position is on adding things like FLOAT which are commonly used but not part of the standard.

@ainiml
Copy link

ainiml commented Jul 30, 2020

Yeah I've been looking for something to handle just mapping out all OID and Alias' to be used with a Prometheus exporter. And there's a ton of non-spec OIDs

@j-gooding
Copy link
Author

Yeah I've been looking for something to handle just mapping out all OID and Alias' to be used with a Prometheus exporter. And there's a ton of non-spec OIDs

To be honest my solution was to just use python to talk to net-snmp binaries using the shell. I haven't found anything that net-snmp couldn't handle and don't have the time to figure out how to add the requisite pure python functionality to pysnmp, plus I don't know if the author would accept changes or not either.

@ainiml
Copy link

ainiml commented Jul 30, 2020

Yeah I've been looking for something to handle just mapping out all OID and Alias' to be used with a Prometheus exporter. And there's a ton of non-spec OIDs

To be honest my solution was to just use python to talk to net-snmp binaries using the shell. I haven't found anything that net-snmp couldn't handle and don't have the time to figure out how to add the requisite pure python functionality to pysnmp, plus I don't know if the author would accept changes or not either.

I'm using smidump, but it segmentation faults when running in docker (runs fine outside of it). I think it's from preloading too many MIB files and hitting docker's default shm limit

@lextm
Copy link

lextm commented Sep 2, 2024

Should have been fixed in PySMI release 1.5.

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