mk23 / snmpy

Extensible net-snmp agentx system.
MIT License
9 stars 7 forks source link

agentx not trimming long strings #102

Open mk23 opened 6 years ago

mk23 commented 6 years ago

Long strings ( > MAX_STR_LEN ) cause a ValueError.

ERROR: string too long
DEBUG:   Traceback (most recent call last):
DEBUG:     File "/home/max/Work/test_snmpy/snmpy/snmpy/server.py", line 51, in start_fetch
DEBUG:       self.commit_data(mod)
DEBUG:     File "/home/max/Work/test_snmpy/snmpy/snmpy/server.py", line 69, in commit_data
DEBUG:       self.snmp.replace_value(mod[item].oidstr, mod[item].value)
DEBUG:     File "/home/max/Work/test_snmpy/snmpy/snmpy/agentx.py", line 532, in replace_value
DEBUG:       self.data[oid].set_value(val)
DEBUG:     File "/home/max/Work/test_snmpy/snmpy/snmpy/agentx.py", line 402, in set_value
DEBUG:       ASNType.set_value(self, data)
DEBUG:     File "/home/max/Work/test_snmpy/snmpy/snmpy/agentx.py", line 370, in set_value
DEBUG:       self._data.value = data
DEBUG:   ValueError: string too long