Was trying to use snmptrapd for the first time in years. Incoming traps generates this error:
2024-10-30 11:00:25,287 [ERROR] [zen.pynetsnmp.callback] Exception in _callback invalid input syntax for type inet: "None" LINE 1: ... LEFT JOIN gwportprefix USING (interfaceid) WHERE 'None' IN ... ^ Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/pynetsnmp/netsnmp.py", line 464, in _callback sess.callback(pdu.contents) File "/usr/local/lib/python3.9/site-packages/nav/snmptrapd/agent_pynetsnmp.py ", line 221, in callback self._callback(addr, pdu) File "/usr/local/lib/python3.9/site-packages/nav/snmptrapd/agent_pynetsnmp.py ", line 130, in callback self._client_callback(trap) File "/usr/local/lib/python3.9/site-packages/nav/bin/snmptrapd.py", line 234, in trap_handler _log_trap_handle_result(handled_by, trap) File "/usr/local/lib/python3.9/site-packages/nav/bin/snmptrapd.py", line 239, in _log_trap_handle_result trap.netbox.sysname + ' ({})'.format(trap.agent) if trap.netbox else trap.agent File "/usr/local/lib/python3.9/site-packages/nav/snmptrapd/trap.py", line 87, in netbox setattr(self, '_netbox', self._lookup_agent()) File "/usr/local/lib/python3.9/site-packages/nav/snmptrapd/trap.py", line 67, in _lookup_agent cur.execute( psycopg2.errors.InvalidTextRepresentation: invalid input syntax for type inet: "None" LINE 1: ... LEFT JOIN gwportprefix USING (interfaceid) WHERE 'None' IN ... ^
2024-10-30 11:02:07,171 [ERROR] [zen.pynetsnmp.callback] Exception in _callback current transaction is aborted, commands ignored until end of transaction block Traceback (most recent call last): File "/usr/local/lib/python3.9/site-packages/pynetsnmp/netsnmp.py", line 464, in _callback sess.callback(pdu.contents) File "/usr/local/lib/python3.9/site-packages/nav/snmptrapd/agent_pynetsnmp.py ", line 221, in callback self._callback(addr, pdu) File "/usr/local/lib/python3.9/site-packages/nav/snmptrapd/agent_pynetsnmp.py ", line 130, in callback self._client_callback(trap) File "/usr/local/lib/python3.9/site-packages/nav/bin/snmptrapd.py", line 207, in trap_handler connection = getConnection('default') File "/usr/local/lib/python3.9/site-packages/nav/db/__init__.py", line 170, in getConnection _connection_cache.invalidate() File "/usr/local/lib/python3.9/site-packages/nav/__init__.py", line 55, in invalidate if self[key].is_invalid(): File "/usr/local/lib/python3.9/site-packages/nav/db/__init__.py", line 57, in is_invalid if self.ping(): File "/usr/local/lib/python3.9/site-packages/nav/db/__init__.py", line 77, in ping cursor.execute('SELECT 1') psycopg2.errors.InFailedSqlTransaction: current transaction is aborted, commands ignored until end of transaction block
The incoming traps does not have any corresponding handler (yet), but I was expecting the code to handle unknown traps without barfing.
--Ingeborg