m-erhardt / check-synology-plugins

Collection of Icinga / Nagios plugins to monitor Synology DSM NAS devices
GNU General Public License v3.0
7 stars 3 forks source link

TypeError: decodeMessageVersion.<locals>.<lambda>() takes 3 positional arguments but 4 were given #9

Open UrbanDavid opened 9 months ago

UrbanDavid commented 9 months ago

Hi, I moved icinga from centos to ubuntu and I have isssue with this plugin. Before migratuin plugin was working, but on ubuntu 22.04 not working. I tried updated new version of plugins but I have still same issue.

r/usr/lib/nagios/plugins/check_synology_disks.py --host xxxx --seclevel 'authPriv' --user monitoring --authkey 'xxx' --privkey 'xxx'

Traceback (most recent call last): File "/usr/local/lib/python3.10/dist-packages/pysnmp/carrier/asyncore/dispatch.py", line 45, in runDispatcher loop(timeout or self.getTimerResolution(), File "/usr/lib/python3.10/asyncore.py", line 214, in loop poll_fun(timeout, map) File "/usr/lib/python3.10/asyncore.py", line 195, in poll2 readwrite(obj, flags) File "/usr/lib/python3.10/asyncore.py", line 130, in readwrite obj.handle_error() File "/usr/lib/python3.10/asyncore.py", line 115, in readwrite obj.handle_read_event() File "/usr/lib/python3.10/asyncore.py", line 427, in handle_read_event self.handle_read() File "/usr/local/lib/python3.10/dist-packages/pysnmp/carrier/asyncore/dgram/base.py", line 170, in handle_read self._cbFun(self, transportAddress, incomingMessage) File "/usr/local/lib/python3.10/dist-packages/pysnmp/carrier/base.py", line 84, in _cbFun self.recvCallables[recvId]( File "/usr/local/lib/python3.10/dist-packages/pysnmp/entity/engine.py", line 151, in receiveMessageCbFun self.msgAndPduDsp.receiveMessage( File "/usr/local/lib/python3.10/dist-packages/pysnmp/proto/rfc3412.py", line 291, in receiveMessage msgVersion = verdec.decodeMessageVersion(wholeMsg) File "/usr/local/lib/python3.10/dist-packages/pysnmp/proto/api/verdec.py", line 15, in decodeMessageVersion seq, wholeMsg = decoder.decode( File "/usr/local/lib/python3.10/dist-packages/pyasn1/codec/ber/decoder.py", line 2003, in call for asn1Object in streamingDecoder: File "/usr/local/lib/python3.10/dist-packages/pyasn1/codec/ber/decoder.py", line 1918, in iter for asn1Object in self._singleItemDecoder( File "/usr/local/lib/python3.10/dist-packages/pyasn1/codec/ber/decoder.py", line 1778, in call for value in concreteDecoder.valueDecoder( File "/usr/local/lib/python3.10/dist-packages/pyasn1/codec/ber/decoder.py", line 654, in valueDecoder for chunk in substrateFun(asn1Object, substrate, length, options): TypeError: decodeMessageVersion..() takes 3 positional arguments but 4 were given

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/lib/nagios/plugins/check_synology_disks.py", line 227, in main() File "/usr/lib/nagios/plugins/check_synology_disks.py", line 176, in main disk_ids = get_snmp_table('1.3.6.1.4.1.6574.2.1.1.2', args) File "/usr/lib/nagios/plugins/check_synology_disks.py", line 137, in get_snmp_table for error_indication, error_status, error_index, var_binds in iterator: File "/usr/local/lib/python3.10/dist-packages/pysnmp/hlapi/asyncore/sync/cmdgen.py", line 567, in bulkCmd snmpEngine.transportDispatcher.runDispatcher() File "/usr/local/lib/python3.10/dist-packages/pysnmp/carrier/asyncore/dispatch.py", line 50, in runDispatcher raise PySnmpError('poll error: %s' % ';'.join(format_exception(*exc_info()))) pysnmp.error.PySnmpError: poll error: Traceback (most recent call last): ; File "/usr/local/lib/python3.10/dist-packages/pysnmp/carrier/asyncore/dispatch.py", line 45, in runDispatcher loop(timeout or self.getTimerResolution(), ; File "/usr/lib/python3.10/asyncore.py", line 214, in loop poll_fun(timeout, map) ; File "/usr/lib/python3.10/asyncore.py", line 195, in poll2 readwrite(obj, flags) ; File "/usr/lib/python3.10/asyncore.py", line 130, in readwrite obj.handle_error() ; File "/usr/lib/python3.10/asyncore.py", line 115, in readwrite obj.handle_read_event() ; File "/usr/lib/python3.10/asyncore.py", line 427, in handle_read_event self.handle_read() ; File "/usr/local/lib/python3.10/dist-packages/pysnmp/carrier/asyncore/dgram/base.py", line 170, in handle_read self._cbFun(self, transportAddress, incomingMessage) ; File "/usr/local/lib/python3.10/dist-packages/pysnmp/carrier/base.py", line 84, in _cbFun self.recvCallables[recvId]( ; File "/usr/local/lib/python3.10/dist-packages/pysnmp/entity/engine.py", line 151, in receiveMessageCbFun self.msgAndPduDsp.receiveMessage( ; File "/usr/local/lib/python3.10/dist-packages/pysnmp/proto/rfc3412.py", line 291, in receiveMessage msgVersion = verdec.decodeMessageVersion(wholeMsg) ; File "/usr/local/lib/python3.10/dist-packages/pysnmp/proto/api/verdec.py", line 15, in decodeMessageVersion seq, wholeMsg = decoder.decode( ; File "/usr/local/lib/python3.10/dist-packages/pyasn1/codec/ber/decoder.py", line 2003, in call for asn1Object in streamingDecoder: ; File "/usr/local/lib/python3.10/dist-packages/pyasn1/codec/ber/decoder.py", line 1918, in iter for asn1Object in self._singleItemDecoder( ; File "/usr/local/lib/python3.10/dist-packages/pyasn1/codec/ber/decoder.py", line 1778, in call for value in concreteDecoder.valueDecoder( ; File "/usr/local/lib/python3.10/dist-packages/pyasn1/codec/ber/decoder.py", line 654, in valueDecoder for chunk in substrateFun(asn1Object, substrate, length, options): ;TypeError: decodeMessageVersion..() takes 3 positional arguments but 4 were given caused by <class 'TypeError'>: decodeMessageVersion..() takes 3 positional arguments but 4 were given

m-erhardt commented 9 months ago

Hi,

this is caused by a breaking change within the pyasn1-library (https://github.com/etingof/pysnmp/issues/438).

As quick workaround you can downgrade pyasn1 to a 0.4.x release (pyasn1==0.4.8) or try to replace pysnmp with the fork pysnmp-lextudio==5.0.30

Unfortunately the original pysnmp module is currently not actively maintained but there is an effort to continue the project as a fork under its original namespace (https://github.com/etingof/pysnmp/issues/429 / https://github.com/pypi/support/issues/2420).

I'll see how that goes and change the requirements.txt accordingly...