Advertisement
Guest User

Untitled

a guest
Sep 29th, 2014
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.55 KB | None | 0 0
  1. START OF TRACEBACK
  2. ------------------------------------------------------------------------
  3. File: /opt/noc/sa/script/snmp.py (Line: 293)
  4. Function: on_read
  5. 286 rsp_msg, data = decoder.decode(data, asn1Spec=p_mod.Message())
  6. 287 rsp_pdu = p_mod.apiMessage.getPDU(rsp_msg)
  7. 288 # Match response to request
  8. 289 if self.api_pdu.getRequestID(self.req_PDU) == p_mod.apiPDU.getRequestID(rsp_pdu):
  9. 290 # Check for SNMP errors reported
  10. 291 errorStatus = self.api_pdu.getErrorStatus(rsp_pdu)
  11. 292 if errorStatus and errorStatus != 2:
  12. 293 ==> raise errorStatus
  13. 294 # Format var-binds table
  14. 295 var_bind_table = self.api_pdu.getVarBindTable(self.req_PDU, rsp_pdu)
  15. 296 # Report SNMP table
  16. 297 for table_row in var_bind_table:
  17. 298 for name, val in table_row:
  18. 299 if val is None:
  19. Variables:
  20. rsp_pdu =
  21. ResponsePDU().setComponentByPosition(0, Integer32(8252302)).setComponentByPosition(1, Integer('authorizationError')).setComponentByPosition(2, Integer(0)).setComponentByPosition(3, VarBindList())
  22. self = <SNMPGetNextSocket(0x37a6310, )>
  23. p_mod =
  24. <module 'pysnmp.proto.api.v2c' from '/opt/noc/lib/python2.7/site-packages/pysnmp/proto/api/v2c.pyc'>
  25. errorStatus = Integer('authorizationError')
  26. rsp_msg =
  27. 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())))
  28. address = '172.16.111.5'
  29. data = ''
  30. port = 161
  31. ------------------------------------------------------------------------
  32. File: /opt/noc/lib/nbsocket/udpsocket.py (Line: 50)
  33. Function: handle_read
  34. 43 msg, transport_address = self.socket.recvfrom(self.READ_CHUNK)
  35. 44 except socket.error, why:
  36. 45 if why[0] in (EINTR, EAGAIN):
  37. 46 return
  38. 47 raise socket.error, why
  39. 48 if not msg:
  40. 49 return
  41. 50 ==> self.on_read(msg, transport_address[0], transport_address[1])
  42. 51
  43. 52 def on_read(self, data, address, port):
  44. 53 pass
  45. 54
  46. 55 def sendto(self, msg, addr):
  47. 56 self.out_buffer += [(msg, addr)]
  48. Variables:
  49. msg =
  50. '0\x1a\x02\x01\x01\x04\x06public\xa2\r\x02\x03}\xeb\x8e\x02\x01\x10\x02\x01\x000\x00'
  51. self = <SNMPGetNextSocket(0x37a6310, )>
  52. transport_address = ('172.16.111.5', 161)
  53. ------------------------------------------------------------------------
  54. File: /opt/noc/lib/nbsocket/socketfactory.py (Line: 93)
  55. Function: guarded_socket_call
  56. 86 Wrapper for safe call of socket method. Handles and reports
  57. 87 socket errors.
  58. 88
  59. 89 :return: Call status
  60. 90 :rtype: Bool
  61. 91 """
  62. 92 try:
  63. 93 ==> method()
  64. 94 except Exception:
  65. 95 exc = get_socket_error()
  66. 96 try:
  67. 97 if exc:
  68. 98 socket.on_error(exc)
  69. 99 else:
  70. Variables:
  71. self = <noc.lib.nbsocket.socketfactory.SocketFactory object at 0x2f15750>
  72. method =
  73. <bound method SNMPGetNextSocket.handle_read of <SNMPGetNextSocket(0x37a6310, )>>
  74. socket = <SNMPGetNextSocket(0x37a6310, )>
  75. ------------------------------------------------------------------------
  76. File: /opt/noc/lib/nbsocket/socketfactory.py (Line: 216)
  77. Function: loop
  78. 209 self.cnt_polls += 1
  79. 210 # Process write events before read
  80. 211 # to catch refused connections
  81. 212 for s in w:
  82. 213 self.guarded_socket_call(s, s.handle_write)
  83. 214 # Process read events
  84. 215 for s in r:
  85. 216 ==> self.guarded_socket_call(s, s.handle_read)
  86. 217 else:
  87. 218 # No socket initialized. Sleep to prevent CPU hogging
  88. 219 time.sleep(timeout)
  89. 220
  90. 221 def run(self, run_forever=False):
  91. 222 """
  92. Variables:
  93. s = <SNMPGetNextSocket(0x37a6310, )>
  94. r = [<SNMPGetNextSocket(0x37a6310, )>]
  95. timeout = 1
  96. w = []
  97. self = <noc.lib.nbsocket.socketfactory.SocketFactory object at 0x2f15750>
  98. ------------------------------------------------------------------------
  99. File: /opt/noc/lib/nbsocket/socketfactory.py (Line: 242)
  100. Function: run
  101. 235 else:
  102. 236 cond = lambda: len(self.sockets) > 1
  103. 237 # Wait for any socket
  104. 238 while not cond():
  105. 239 time.sleep(1)
  106. 240 last_tick = last_stale = time.time()
  107. 241 while cond() and not self.to_shutdown:
  108. 242 ==> self.loop(1)
  109. 243 t = time.time()
  110. 244 if self.tick_callback and t - last_tick >= 1:
  111. 245 try:
  112. 246 self.tick_callback()
  113. 247 except Exception:
  114. 248 error_report()
  115. Variables:
  116. self = <noc.lib.nbsocket.socketfactory.SocketFactory object at 0x2f15750>
  117. cond = <function <lambda> at 0x370fc80>
  118. t = 1411986422.799181
  119. last_stale = 1411986422.597425
  120. run_forever = True
  121. last_tick = 1411986422.597425
  122. ------------------------------------------------------------------------
  123. File: /opt/noc/sa/activator/activator.py (Line: 436)
  124. Function: run
  125. 429 """
  126. 430 return self.object_mappings.get(source)
  127. 431
  128. 432 def run(self):
  129. 433 """
  130. 434 Main event loop
  131. 435 """
  132. 436 ==> self.factory.run(run_forever=True)
  133. 437
  134. 438 def tick(self):
  135. 439 """
  136. 440 Called every second
  137. 441 """
  138. 442 t = time.time()
  139. Variables:
  140. self = <noc.sa.activator.activator.Activator object at 0x3187310>
  141. ------------------------------------------------------------------------
  142. File: /opt/noc/lib/daemon.py (Line: 371)
  143. Function: guarded_run
  144. 364
  145. 365 def guarded_run(self):
  146. 366 """
  147. 367 Run daemon and catch common exceptions
  148. 368 :return:
  149. 369 """
  150. 370 try:
  151. 371 ==> self.run()
  152. 372 except KeyboardInterrupt:
  153. 373 pass
  154. 374 except MemoryError:
  155. 375 logging.error("Out of memory. Exiting.")
  156. 376 except SystemExit:
  157. 377 logging.info("Exiting")
  158. Variables:
  159. self = <noc.sa.activator.activator.Activator object at 0x3187310>
  160. ------------------------------------------------------------------------
  161. END OF TRACEBACK
  162. 2014-09-29 13:27:02,887 Removing pidfile: /srv/noc/run/noc-activator.0.pid
  163. 2014-09-29 13:27:02,887 STOP
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement