Open steven-douilliet opened 2 weeks ago
Hello! One of your MIBs has a bug. Specifically, your error log shows that TIMETRA-FILTER-MIB has an object type TIPFilterParamsFwdSdpBind which has a DEFVAL value whose size is not allowed by the SYNTAX for that object type. Right now, pysmi is not able to detect that problem while compiling the MIB. As a result, pysnmp trips over the problem when loading the compiled version.
I hope to adapt pysmi to discard such invalid DEFVAL values (as it already does for some cases), so that you can still compile and load MIBs that have such bugs. I have already made some progress on that front, but it will take a while longer.
For now, your best option is to edit your copy of TIMETRA-FILTER-MIB and comment out the DEFVAL line for TIPFilterParamsFwdSdpBind (and perhaps for other object types that have the same problem).
Ah sorry, I was not clear enough. Your attachment is the Python code for that MIB, as generated by pysmi. That file has been generated from the original ASN.1 input MIB, which is also called TIMETRA-FILTER-MIB. That file basically looks like this, although note that your copy might be slightly different, depending on where you got it from.
If you never downloaded that TIMETRA-FILTER-MIB file yourself, and instead let pysmi "borrow" the MIB, then you would have to download a copy first, so that you can edit it. In that case you have to make sure that pysmi uses your local copy.
Either way, it is that original ASN.1 file that you would have to edit, by searching for TIPFilterParamsFwdSdpBind and adding two dashes ("--") in front of the DEFVAL line below it. For example, in this case, you'd have to change line 1198 to -- DEFVAL { '0'H }
.
As last resort, you can also edit the generated Python code that you attached. Then you would have to remove line 1605, which reads defaultHexValue = "0"
. That is generally not a great idea though: that Python file might be overwritten if the MIB is recompiled for some reason later.
This workaround works. Thanks !
Expected behavior
I want to load des MIBs when my SNMP server starts
Actual behavior
Loading modules fails.
Detailed steps
But loading modules fails.
Python package information
Operating system information
Linux
Python information
3.12
(Optional) Contents of your test script
Relevant log output