Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- START OF TRACEBACK
- ------------------------------------------------------------------------
- File: /opt/noc/sa/script/snmp.py (Line: 293)
- Function: on_read
- 286 rsp_msg, data = decoder.decode(data, asn1Spec=p_mod.Message())
- 287 rsp_pdu = p_mod.apiMessage.getPDU(rsp_msg)
- 288 # Match response to request
- 289 if self.api_pdu.getRequestID(self.req_PDU) == p_mod.apiPDU.getRequestID(rsp_pdu):
- 290 # Check for SNMP errors reported
- 291 errorStatus = self.api_pdu.getErrorStatus(rsp_pdu)
- 292 if errorStatus and errorStatus != 2:
- 293 ==> raise errorStatus
- 294 # Format var-binds table
- 295 var_bind_table = self.api_pdu.getVarBindTable(self.req_PDU, rsp_pdu)
- 296 # Report SNMP table
- 297 for table_row in var_bind_table:
- 298 for name, val in table_row:
- 299 if val is None:
- Variables:
- rsp_pdu =
- ResponsePDU().setComponentByPosition(0, Integer32(8252302)).setComponentByPosition(1, Integer('authorizationError')).setComponentByPosition(2, Integer(0)).setComponentByPosition(3, VarBindList())
- self = <SNMPGetNextSocket(0x37a6310, )>
- p_mod =
- <module 'pysnmp.proto.api.v2c' from '/opt/noc/lib/python2.7/site-packages/pysnmp/proto/api/v2c.pyc'>
- errorStatus = Integer('authorizationError')
- rsp_msg =
- Message().setComponentByPosition(0, Integer('version-2')).setComponentByPosition(1, OctetString('public')).setComponentByPosition(2, PDUs().setComponentByPosition(3, ResponsePDU().setComponentByPosition(0, Integer32(8252302)).setComponentByPosition(1, Integer('authorizationError')).setComponentByPosition(2, Integer(0)).setComponentByPosition(3, VarBindList())))
- address = '172.16.111.5'
- data = ''
- port = 161
- ------------------------------------------------------------------------
- File: /opt/noc/lib/nbsocket/udpsocket.py (Line: 50)
- Function: handle_read
- 43 msg, transport_address = self.socket.recvfrom(self.READ_CHUNK)
- 44 except socket.error, why:
- 45 if why[0] in (EINTR, EAGAIN):
- 46 return
- 47 raise socket.error, why
- 48 if not msg:
- 49 return
- 50 ==> self.on_read(msg, transport_address[0], transport_address[1])
- 51
- 52 def on_read(self, data, address, port):
- 53 pass
- 54
- 55 def sendto(self, msg, addr):
- 56 self.out_buffer += [(msg, addr)]
- Variables:
- msg =
- '0\x1a\x02\x01\x01\x04\x06public\xa2\r\x02\x03}\xeb\x8e\x02\x01\x10\x02\x01\x000\x00'
- self = <SNMPGetNextSocket(0x37a6310, )>
- transport_address = ('172.16.111.5', 161)
- ------------------------------------------------------------------------
- File: /opt/noc/lib/nbsocket/socketfactory.py (Line: 93)
- Function: guarded_socket_call
- 86 Wrapper for safe call of socket method. Handles and reports
- 87 socket errors.
- 88
- 89 :return: Call status
- 90 :rtype: Bool
- 91 """
- 92 try:
- 93 ==> method()
- 94 except Exception:
- 95 exc = get_socket_error()
- 96 try:
- 97 if exc:
- 98 socket.on_error(exc)
- 99 else:
- Variables:
- self = <noc.lib.nbsocket.socketfactory.SocketFactory object at 0x2f15750>
- method =
- <bound method SNMPGetNextSocket.handle_read of <SNMPGetNextSocket(0x37a6310, )>>
- socket = <SNMPGetNextSocket(0x37a6310, )>
- ------------------------------------------------------------------------
- File: /opt/noc/lib/nbsocket/socketfactory.py (Line: 216)
- Function: loop
- 209 self.cnt_polls += 1
- 210 # Process write events before read
- 211 # to catch refused connections
- 212 for s in w:
- 213 self.guarded_socket_call(s, s.handle_write)
- 214 # Process read events
- 215 for s in r:
- 216 ==> self.guarded_socket_call(s, s.handle_read)
- 217 else:
- 218 # No socket initialized. Sleep to prevent CPU hogging
- 219 time.sleep(timeout)
- 220
- 221 def run(self, run_forever=False):
- 222 """
- Variables:
- s = <SNMPGetNextSocket(0x37a6310, )>
- r = [<SNMPGetNextSocket(0x37a6310, )>]
- timeout = 1
- w = []
- self = <noc.lib.nbsocket.socketfactory.SocketFactory object at 0x2f15750>
- ------------------------------------------------------------------------
- File: /opt/noc/lib/nbsocket/socketfactory.py (Line: 242)
- Function: run
- 235 else:
- 236 cond = lambda: len(self.sockets) > 1
- 237 # Wait for any socket
- 238 while not cond():
- 239 time.sleep(1)
- 240 last_tick = last_stale = time.time()
- 241 while cond() and not self.to_shutdown:
- 242 ==> self.loop(1)
- 243 t = time.time()
- 244 if self.tick_callback and t - last_tick >= 1:
- 245 try:
- 246 self.tick_callback()
- 247 except Exception:
- 248 error_report()
- Variables:
- self = <noc.lib.nbsocket.socketfactory.SocketFactory object at 0x2f15750>
- cond = <function <lambda> at 0x370fc80>
- t = 1411986422.799181
- last_stale = 1411986422.597425
- run_forever = True
- last_tick = 1411986422.597425
- ------------------------------------------------------------------------
- File: /opt/noc/sa/activator/activator.py (Line: 436)
- Function: run
- 429 """
- 430 return self.object_mappings.get(source)
- 431
- 432 def run(self):
- 433 """
- 434 Main event loop
- 435 """
- 436 ==> self.factory.run(run_forever=True)
- 437
- 438 def tick(self):
- 439 """
- 440 Called every second
- 441 """
- 442 t = time.time()
- Variables:
- self = <noc.sa.activator.activator.Activator object at 0x3187310>
- ------------------------------------------------------------------------
- File: /opt/noc/lib/daemon.py (Line: 371)
- Function: guarded_run
- 364
- 365 def guarded_run(self):
- 366 """
- 367 Run daemon and catch common exceptions
- 368 :return:
- 369 """
- 370 try:
- 371 ==> self.run()
- 372 except KeyboardInterrupt:
- 373 pass
- 374 except MemoryError:
- 375 logging.error("Out of memory. Exiting.")
- 376 except SystemExit:
- 377 logging.info("Exiting")
- Variables:
- self = <noc.sa.activator.activator.Activator object at 0x3187310>
- ------------------------------------------------------------------------
- END OF TRACEBACK
- 2014-09-29 13:27:02,887 Removing pidfile: /srv/noc/run/noc-activator.0.pid
- 2014-09-29 13:27:02,887 STOP
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement