Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2014
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 63.67 KB | None | 0 0
  1. 2014-10-23 09:33:57,701 UNHANDLED EXCEPTION (2014-10-23 09:33:57.695856)
  2. Working directory: /opt/noc
  3. <type 'exceptions.IOError'>
  4. [Errno 2] No such file or directory: u'/var/log/noc/cli-sessions/RUMSKSOFES001-Generic.get_discovery_id-2014-10-23-09-33-57.log'
  5. START OF TRACEBACK
  6. ------------------------------------------------------------------------
  7. File: /opt/noc/sa/script/script.py (Line: 357)
  8. Function: cli_debug
  9. 350 if not self.log_cli_sessions_path:
  10. 351 return
  11. 352 m = datetime.datetime.now().strftime("[%Y-%m-%d %H:%M:%S] ")
  12. 353 if chars:
  13. 354 m += chars * 50
  14. 355 m += "\n"
  15. 356 m += str(msg) + "\n"
  16. 357 ==> with open(self.log_cli_sessions_path, "a") as f:
  17. 358 f.write(m)
  18. 359
  19. 360 def is_stale(self):
  20. 361 """Checks script is stale and must be terminated"""
  21. 362 return time.time() - self.start_time > self._timeout
  22. 363
  23. Variables:
  24. msg = u'IP: RUMSKSOFES001 SCRIPT: Generic.get_discovery_id'
  25. chars = '!'
  26. m =
  27. '[2014-10-23 09:33:57] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\nIP: RUMSKSOFES001 SCRIPT: Generic.get_discovery_id\n'
  28. self = <Script(Thread-29, initial)>
  29. ------------------------------------------------------------------------
  30. File: /opt/noc/sa/script/script.py (Line: 244)
  31. Function: __init__
  32. 237 and self.activator.log_cli_sessions_script_re.search(self.name):
  33. 238 self.log_cli_sessions_path = self.activator.log_cli_sessions_path
  34. 239 for k, v in [
  35. 240 ("ip", self.access_profile.address),
  36. 241 ("script", self.name),
  37. 242 ("ts", datetime.datetime.now().strftime("%Y-%m-%d-%H-%M-%S"))]:
  38. 243 self.log_cli_sessions_path = self.log_cli_sessions_path.replace("{{%s}}" % k, v)
  39. 244 ==> self.cli_debug("IP: %s SCRIPT: %s" % (self.access_profile.address, self.name), "!")
  40. 245 # Finally call setup_script() for additional script tuning
  41. 246 if profile.setup_script:
  42. 247 profile.setup_script(self)
  43. 248
  44. 249 @classmethod
  45. 250 def template_clean_result(cls, result):
  46. Variables:
  47. a = <noc.sa.protocols.sae_pb2.KWArg object at 0x277e4b0>
  48. profile = <noc.sa.profiles.Cisco.IOS.Profile object at 0x277cf50>
  49. access_profile = <noc.sa.protocols.sae_pb2.AccessProfile object at 0x277e210>
  50. parent = None
  51. k = 'ts'
  52. v = '2014-10-23-09-33-57'
  53. p = u'RUMSKSOFES001'
  54. object_name = u'RUMSKSOFES001'
  55. timeout = 1200
  56. kwargs = {}
  57. self = <Script(Thread-29, initial)>
  58. _activator = <noc.sa.activator.activator.Activator object at 0x1c6f190>
  59. ------------------------------------------------------------------------
  60. File: /opt/noc/sa/activator/activator.py (Line: 364)
  61. Function: run_script
  62. 357 Begin script execution
  63. 358 """
  64. 359 pv, pos, sn = script_name.split(".", 2)
  65. 360 profile = profile_registry["%s.%s" % (pv, pos)]()
  66. 361 script_class = script_registry[script_name]
  67. 362 if not timeout:
  68. 363 timeout = script_class.TIMEOUT
  69. 364 ==> script = script_class(profile, self, object_name, access_profile, timeout, **kwargs)
  70. 365 logging.info("Script %s(%s). Timeout set to %s" % (script_name,
  71. 366 access_profile.address, timeout))
  72. 367 with self.script_lock:
  73. 368 self.script_threads[script] = callback
  74. 369 logging.info("%d script threads (%d max)" % (
  75. 370 len(self.script_threads), self.max_script_threads))
  76. Variables:
  77. profile = <noc.sa.profiles.Cisco.IOS.Profile object at 0x277cf50>
  78. pv = u'Cisco'
  79. access_profile = <noc.sa.protocols.sae_pb2.AccessProfile object at 0x277e210>
  80. script_class = <class 'noc.sa.profiles.Generic.get_discovery_id.Script'>
  81. self = <noc.sa.activator.activator.Activator object at 0x1c6f190>
  82. pos = u'IOS'
  83. script_name = u'Cisco.IOS.get_discovery_id'
  84. callback = <function script_callback at 0x226f398>
  85. object_name = u'RUMSKSOFES001'
  86. sn = u'get_discovery_id'
  87. timeout = 1200
  88. kwargs = {}
  89. ------------------------------------------------------------------------
  90. File: /opt/noc/sa/activator/service.py (Line: 91)
  91. Function: script
  92. 84 return
  93. 85 # Deserialize additional arguments
  94. 86 kwargs = {}
  95. 87 for a in request.kwargs:
  96. 88 kwargs[str(a.key)] = cPickle.loads(str(a.value))
  97. 89 self.activator.run_script(request.object_name, request.script,
  98. 90 request.access_profile, script_callback, request.timeout,
  99. 91 ==> **kwargs)
  100. 92
  101. 93 def ping_check(self, controller, request, done):
  102. 94 """
  103. 95 Start ping check of addresses
  104. 96 """
  105. 97 def ping_check_callback(status):
  106. Variables:
  107. profile = <class 'noc.sa.profiles.Cisco.IOS.Profile'>
  108. script_class = <class 'noc.sa.profiles.Generic.get_discovery_id.Script'>
  109. script_callback = <function script_callback at 0x226f398>
  110. request = <noc.sa.protocols.sae_pb2.ScriptRequest object at 0x2281050>
  111. controller = <noc.sa.rpc.Controller object at 0x277c090>
  112. done =
  113. <bound method ActivatorSocket.send_response of <ActivatorSocket(0x2280190, 127.0.0.1:19701, connected)>>
  114. kwargs = {}
  115. self = <noc.sa.activator.service.Service object at 0x19f72d0>
  116. ------------------------------------------------------------------------
  117. File: /opt/noc/lib/python2.7/site-packages/google/protobuf/service_reflection.py (Line: 171)
  118. Function: _CallMethod
  119. 164 request: Request protocol message.
  120. 165 callback: A callback to invoke after the method has completed.
  121. 166 """
  122. 167 if method_descriptor.containing_service != self.descriptor:
  123. 168 raise RuntimeError(
  124. 169 'CallMethod() given method descriptor for wrong service type.')
  125. 170 method = getattr(srvc, method_descriptor.name)
  126. 171 ==> return method(rpc_controller, request, callback)
  127. 172
  128. 173 def _GetRequestClass(self, method_descriptor):
  129. 174 """Returns the class of the request protocol message.
  130. 175
  131. 176 Args:
  132. 177 method_descriptor: Descriptor of the method for which to return the
  133. Variables:
  134. srvc = <noc.sa.activator.service.Service object at 0x19f72d0>
  135. method_descriptor = <google.protobuf.descriptor.MethodDescriptor object at 0x1950f50>
  136. self = <google.protobuf.service_reflection._ServiceBuilder object at 0x1959190>
  137. request = <noc.sa.protocols.sae_pb2.ScriptRequest object at 0x2281050>
  138. rpc_controller = <noc.sa.rpc.Controller object at 0x277c090>
  139. callback =
  140. <bound method ActivatorSocket.send_response of <ActivatorSocket(0x2280190, 127.0.0.1:19701, connected)>>
  141. method =
  142. <bound method Service.script of <noc.sa.activator.service.Service object at 0x19f72d0>>
  143. ------------------------------------------------------------------------
  144. File: /opt/noc/lib/python2.7/site-packages/google/protobuf/service_reflection.py (Line: 146)
  145. Function: _WrapCallMethod
  146. 139
  147. 140 # CallMethod needs to operate with an instance of the Service class. This
  148. 141 # internal wrapper function exists only to be able to pass the service
  149. 142 # instance to the method that does the real CallMethod work.
  150. 143 def _WrapCallMethod(srvc, method_descriptor,
  151. 144 rpc_controller, request, callback):
  152. 145 return self._CallMethod(srvc, method_descriptor,
  153. 146 ==> rpc_controller, request, callback)
  154. 147 self.cls = cls
  155. 148 cls.CallMethod = _WrapCallMethod
  156. 149 cls.GetDescriptor = staticmethod(lambda: self.descriptor)
  157. 150 cls.GetDescriptor.__doc__ = "Returns the service descriptor."
  158. 151 cls.GetRequestClass = self._GetRequestClass
  159. 152 cls.GetResponseClass = self._GetResponseClass
  160. Variables:
  161. rpc_controller = <noc.sa.rpc.Controller object at 0x277c090>
  162. method_descriptor = <google.protobuf.descriptor.MethodDescriptor object at 0x1950f50>
  163. self = <google.protobuf.service_reflection._ServiceBuilder object at 0x1959190>
  164. request = <noc.sa.protocols.sae_pb2.ScriptRequest object at 0x2281050>
  165. srvc = <noc.sa.activator.service.Service object at 0x19f72d0>
  166. callback =
  167. <bound method ActivatorSocket.send_response of <ActivatorSocket(0x2280190, 127.0.0.1:19701, connected)>>
  168. ------------------------------------------------------------------------
  169. File: /opt/noc/sa/rpc.py (Line: 423)
  170. Function: rpc_handle_request
  171. 416 req.ParseFromString(request.serialized_request)
  172. 417 # logging.debug("Request accepted:\nid: %s\n%s" % (id, str(req)))
  173. 418 controller = Controller(self)
  174. 419 controller.transaction = self.transactions.begin(id=id,
  175. 420 method=request.method)
  176. 421 try:
  177. 422 self.service.CallMethod(method, controller,
  178. 423 ==> req, self.send_response)
  179. 424 except:
  180. 425 self.send_error(id, ERR_INTERNAL,
  181. 426 "RPC Call to %s failed" % request.method)
  182. 427 error_report()
  183. 428 else:
  184. 429 self.send_error(id, ERR_INVALID_METHOD,
  185. Variables:
  186. self = <ActivatorSocket(0x2280190, 127.0.0.1:19701, connected)>
  187. req = <noc.sa.protocols.sae_pb2.ScriptRequest object at 0x2281050>
  188. request = <noc.sa.protocols.sae_pb2.Request object at 0x21c8f30>
  189. id = 1380578324
  190. controller = <noc.sa.rpc.Controller object at 0x277c090>
  191. method = <google.protobuf.descriptor.MethodDescriptor object at 0x1950f50>
  192. ------------------------------------------------------------------------
  193. END OF TRACEBACK
  194. 2014-10-23 09:33:58,740 UNHANDLED EXCEPTION (2014-10-23 09:33:58.735057)
  195. Working directory: /opt/noc
  196. <type 'exceptions.IOError'>
  197. [Errno 2] No such file or directory: u'/var/log/noc/cli-sessions/RUMSKDUBES001-Cisco.IOS.get_version-2014-10-23-09-33-58.log'
  198. START OF TRACEBACK
  199. ------------------------------------------------------------------------
  200. File: /opt/noc/sa/script/script.py (Line: 357)
  201. Function: cli_debug
  202. 350 if not self.log_cli_sessions_path:
  203. 351 return
  204. 352 m = datetime.datetime.now().strftime("[%Y-%m-%d %H:%M:%S] ")
  205. 353 if chars:
  206. 354 m += chars * 50
  207. 355 m += "\n"
  208. 356 m += str(msg) + "\n"
  209. 357 ==> with open(self.log_cli_sessions_path, "a") as f:
  210. 358 f.write(m)
  211. 359
  212. 360 def is_stale(self):
  213. 361 """Checks script is stale and must be terminated"""
  214. 362 return time.time() - self.start_time > self._timeout
  215. 363
  216. Variables:
  217. msg = u'IP: RUMSKDUBES001 SCRIPT: Cisco.IOS.get_version'
  218. chars = '!'
  219. m =
  220. '[2014-10-23 09:33:58] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\nIP: RUMSKDUBES001 SCRIPT: Cisco.IOS.get_version\n'
  221. self = <Script(Thread-30, initial)>
  222. ------------------------------------------------------------------------
  223. File: /opt/noc/sa/script/script.py (Line: 244)
  224. Function: __init__
  225. 237 and self.activator.log_cli_sessions_script_re.search(self.name):
  226. 238 self.log_cli_sessions_path = self.activator.log_cli_sessions_path
  227. 239 for k, v in [
  228. 240 ("ip", self.access_profile.address),
  229. 241 ("script", self.name),
  230. 242 ("ts", datetime.datetime.now().strftime("%Y-%m-%d-%H-%M-%S"))]:
  231. 243 self.log_cli_sessions_path = self.log_cli_sessions_path.replace("{{%s}}" % k, v)
  232. 244 ==> self.cli_debug("IP: %s SCRIPT: %s" % (self.access_profile.address, self.name), "!")
  233. 245 # Finally call setup_script() for additional script tuning
  234. 246 if profile.setup_script:
  235. 247 profile.setup_script(self)
  236. 248
  237. 249 @classmethod
  238. 250 def template_clean_result(cls, result):
  239. Variables:
  240. a = <noc.sa.protocols.sae_pb2.KWArg object at 0x277e980>
  241. profile = <noc.sa.profiles.Cisco.IOS.Profile object at 0x277cd90>
  242. access_profile = <noc.sa.protocols.sae_pb2.AccessProfile object at 0x277e520>
  243. parent = None
  244. k = 'ts'
  245. v = '2014-10-23-09-33-58'
  246. p = u'RUMSKDUBES001'
  247. object_name = u'RUMSKDUBES001'
  248. timeout = 1200
  249. kwargs = {}
  250. self = <Script(Thread-30, initial)>
  251. _activator = <noc.sa.activator.activator.Activator object at 0x1c6f190>
  252. ------------------------------------------------------------------------
  253. File: /opt/noc/sa/activator/activator.py (Line: 364)
  254. Function: run_script
  255. 357 Begin script execution
  256. 358 """
  257. 359 pv, pos, sn = script_name.split(".", 2)
  258. 360 profile = profile_registry["%s.%s" % (pv, pos)]()
  259. 361 script_class = script_registry[script_name]
  260. 362 if not timeout:
  261. 363 timeout = script_class.TIMEOUT
  262. 364 ==> script = script_class(profile, self, object_name, access_profile, timeout, **kwargs)
  263. 365 logging.info("Script %s(%s). Timeout set to %s" % (script_name,
  264. 366 access_profile.address, timeout))
  265. 367 with self.script_lock:
  266. 368 self.script_threads[script] = callback
  267. 369 logging.info("%d script threads (%d max)" % (
  268. 370 len(self.script_threads), self.max_script_threads))
  269. Variables:
  270. profile = <noc.sa.profiles.Cisco.IOS.Profile object at 0x277cd90>
  271. pv = u'Cisco'
  272. access_profile = <noc.sa.protocols.sae_pb2.AccessProfile object at 0x277e520>
  273. script_class = <class 'noc.sa.profiles.Cisco.IOS.get_version.Script'>
  274. self = <noc.sa.activator.activator.Activator object at 0x1c6f190>
  275. pos = u'IOS'
  276. script_name = u'Cisco.IOS.get_version'
  277. callback = <function script_callback at 0x226f398>
  278. object_name = u'RUMSKDUBES001'
  279. sn = u'get_version'
  280. timeout = 1200
  281. kwargs = {}
  282. ------------------------------------------------------------------------
  283. File: /opt/noc/sa/activator/service.py (Line: 91)
  284. Function: script
  285. 84 return
  286. 85 # Deserialize additional arguments
  287. 86 kwargs = {}
  288. 87 for a in request.kwargs:
  289. 88 kwargs[str(a.key)] = cPickle.loads(str(a.value))
  290. 89 self.activator.run_script(request.object_name, request.script,
  291. 90 request.access_profile, script_callback, request.timeout,
  292. 91 ==> **kwargs)
  293. 92
  294. 93 def ping_check(self, controller, request, done):
  295. 94 """
  296. 95 Start ping check of addresses
  297. 96 """
  298. 97 def ping_check_callback(status):
  299. Variables:
  300. profile = <class 'noc.sa.profiles.Cisco.IOS.Profile'>
  301. script_class = <class 'noc.sa.profiles.Cisco.IOS.get_version.Script'>
  302. script_callback = <function script_callback at 0x226f398>
  303. request = <noc.sa.protocols.sae_pb2.ScriptRequest object at 0x2281050>
  304. controller = <noc.sa.rpc.Controller object at 0x277c790>
  305. done =
  306. <bound method ActivatorSocket.send_response of <ActivatorSocket(0x2280190, 127.0.0.1:19701, connected)>>
  307. kwargs = {}
  308. self = <noc.sa.activator.service.Service object at 0x19f72d0>
  309. ------------------------------------------------------------------------
  310. File: /opt/noc/lib/python2.7/site-packages/google/protobuf/service_reflection.py (Line: 171)
  311. Function: _CallMethod
  312. 164 request: Request protocol message.
  313. 165 callback: A callback to invoke after the method has completed.
  314. 166 """
  315. 167 if method_descriptor.containing_service != self.descriptor:
  316. 168 raise RuntimeError(
  317. 169 'CallMethod() given method descriptor for wrong service type.')
  318. 170 method = getattr(srvc, method_descriptor.name)
  319. 171 ==> return method(rpc_controller, request, callback)
  320. 172
  321. 173 def _GetRequestClass(self, method_descriptor):
  322. 174 """Returns the class of the request protocol message.
  323. 175
  324. 176 Args:
  325. 177 method_descriptor: Descriptor of the method for which to return the
  326. Variables:
  327. srvc = <noc.sa.activator.service.Service object at 0x19f72d0>
  328. method_descriptor = <google.protobuf.descriptor.MethodDescriptor object at 0x1950f50>
  329. self = <google.protobuf.service_reflection._ServiceBuilder object at 0x1959190>
  330. request = <noc.sa.protocols.sae_pb2.ScriptRequest object at 0x2281050>
  331. rpc_controller = <noc.sa.rpc.Controller object at 0x277c790>
  332. callback =
  333. <bound method ActivatorSocket.send_response of <ActivatorSocket(0x2280190, 127.0.0.1:19701, connected)>>
  334. method =
  335. <bound method Service.script of <noc.sa.activator.service.Service object at 0x19f72d0>>
  336. ------------------------------------------------------------------------
  337. File: /opt/noc/lib/python2.7/site-packages/google/protobuf/service_reflection.py (Line: 146)
  338. Function: _WrapCallMethod
  339. 139
  340. 140 # CallMethod needs to operate with an instance of the Service class. This
  341. 141 # internal wrapper function exists only to be able to pass the service
  342. 142 # instance to the method that does the real CallMethod work.
  343. 143 def _WrapCallMethod(srvc, method_descriptor,
  344. 144 rpc_controller, request, callback):
  345. 145 return self._CallMethod(srvc, method_descriptor,
  346. 146 ==> rpc_controller, request, callback)
  347. 147 self.cls = cls
  348. 148 cls.CallMethod = _WrapCallMethod
  349. 149 cls.GetDescriptor = staticmethod(lambda: self.descriptor)
  350. 150 cls.GetDescriptor.__doc__ = "Returns the service descriptor."
  351. 151 cls.GetRequestClass = self._GetRequestClass
  352. 152 cls.GetResponseClass = self._GetResponseClass
  353. Variables:
  354. rpc_controller = <noc.sa.rpc.Controller object at 0x277c790>
  355. method_descriptor = <google.protobuf.descriptor.MethodDescriptor object at 0x1950f50>
  356. self = <google.protobuf.service_reflection._ServiceBuilder object at 0x1959190>
  357. request = <noc.sa.protocols.sae_pb2.ScriptRequest object at 0x2281050>
  358. srvc = <noc.sa.activator.service.Service object at 0x19f72d0>
  359. callback =
  360. <bound method ActivatorSocket.send_response of <ActivatorSocket(0x2280190, 127.0.0.1:19701, connected)>>
  361. ------------------------------------------------------------------------
  362. File: /opt/noc/sa/rpc.py (Line: 423)
  363. Function: rpc_handle_request
  364. 416 req.ParseFromString(request.serialized_request)
  365. 417 # logging.debug("Request accepted:\nid: %s\n%s" % (id, str(req)))
  366. 418 controller = Controller(self)
  367. 419 controller.transaction = self.transactions.begin(id=id,
  368. 420 method=request.method)
  369. 421 try:
  370. 422 self.service.CallMethod(method, controller,
  371. 423 ==> req, self.send_response)
  372. 424 except:
  373. 425 self.send_error(id, ERR_INTERNAL,
  374. 426 "RPC Call to %s failed" % request.method)
  375. 427 error_report()
  376. 428 else:
  377. 429 self.send_error(id, ERR_INVALID_METHOD,
  378. Variables:
  379. self = <ActivatorSocket(0x2280190, 127.0.0.1:19701, connected)>
  380. req = <noc.sa.protocols.sae_pb2.ScriptRequest object at 0x2281050>
  381. request = <noc.sa.protocols.sae_pb2.Request object at 0x21c8ec0>
  382. id = 2116065186
  383. controller = <noc.sa.rpc.Controller object at 0x277c790>
  384. method = <google.protobuf.descriptor.MethodDescriptor object at 0x1950f50>
  385. ------------------------------------------------------------------------
  386. END OF TRACEBACK
  387. 2014-10-23 09:34:13,893 UNHANDLED EXCEPTION (2014-10-23 09:34:13.887870)
  388. Working directory: /opt/noc
  389. <type 'exceptions.IOError'>
  390. [Errno 2] No such file or directory: u'/var/log/noc/cli-sessions/RUMSKKALES001-Cisco.IOS.get_config-2014-10-23-09-34-13.log'
  391. START OF TRACEBACK
  392. ------------------------------------------------------------------------
  393. File: /opt/noc/sa/script/script.py (Line: 357)
  394. Function: cli_debug
  395. 350 if not self.log_cli_sessions_path:
  396. 351 return
  397. 352 m = datetime.datetime.now().strftime("[%Y-%m-%d %H:%M:%S] ")
  398. 353 if chars:
  399. 354 m += chars * 50
  400. 355 m += "\n"
  401. 356 m += str(msg) + "\n"
  402. 357 ==> with open(self.log_cli_sessions_path, "a") as f:
  403. 358 f.write(m)
  404. 359
  405. 360 def is_stale(self):
  406. 361 """Checks script is stale and must be terminated"""
  407. 362 return time.time() - self.start_time > self._timeout
  408. 363
  409. Variables:
  410. msg = u'IP: RUMSKKALES001 SCRIPT: Cisco.IOS.get_config'
  411. chars = '!'
  412. m =
  413. '[2014-10-23 09:34:13] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\nIP: RUMSKKALES001 SCRIPT: Cisco.IOS.get_config\n'
  414. self = <Script(Thread-31, initial)>
  415. ------------------------------------------------------------------------
  416. File: /opt/noc/sa/script/script.py (Line: 244)
  417. Function: __init__
  418. 237 and self.activator.log_cli_sessions_script_re.search(self.name):
  419. 238 self.log_cli_sessions_path = self.activator.log_cli_sessions_path
  420. 239 for k, v in [
  421. 240 ("ip", self.access_profile.address),
  422. 241 ("script", self.name),
  423. 242 ("ts", datetime.datetime.now().strftime("%Y-%m-%d-%H-%M-%S"))]:
  424. 243 self.log_cli_sessions_path = self.log_cli_sessions_path.replace("{{%s}}" % k, v)
  425. 244 ==> self.cli_debug("IP: %s SCRIPT: %s" % (self.access_profile.address, self.name), "!")
  426. 245 # Finally call setup_script() for additional script tuning
  427. 246 if profile.setup_script:
  428. 247 profile.setup_script(self)
  429. 248
  430. 249 @classmethod
  431. 250 def template_clean_result(cls, result):
  432. Variables:
  433. a = <noc.sa.protocols.sae_pb2.KWArg object at 0x28d90c0>
  434. profile = <noc.sa.profiles.Cisco.IOS.Profile object at 0x277ced0>
  435. access_profile = <noc.sa.protocols.sae_pb2.AccessProfile object at 0x277e750>
  436. parent = None
  437. k = 'ts'
  438. v = '2014-10-23-09-34-13'
  439. p = u'RUMSKKALES001'
  440. object_name = u'RUMSKKALES001'
  441. timeout = 1200
  442. kwargs = {}
  443. self = <Script(Thread-31, initial)>
  444. _activator = <noc.sa.activator.activator.Activator object at 0x1c6f190>
  445. ------------------------------------------------------------------------
  446. File: /opt/noc/sa/activator/activator.py (Line: 364)
  447. Function: run_script
  448. 357 Begin script execution
  449. 358 """
  450. 359 pv, pos, sn = script_name.split(".", 2)
  451. 360 profile = profile_registry["%s.%s" % (pv, pos)]()
  452. 361 script_class = script_registry[script_name]
  453. 362 if not timeout:
  454. 363 timeout = script_class.TIMEOUT
  455. 364 ==> script = script_class(profile, self, object_name, access_profile, timeout, **kwargs)
  456. 365 logging.info("Script %s(%s). Timeout set to %s" % (script_name,
  457. 366 access_profile.address, timeout))
  458. 367 with self.script_lock:
  459. 368 self.script_threads[script] = callback
  460. 369 logging.info("%d script threads (%d max)" % (
  461. 370 len(self.script_threads), self.max_script_threads))
  462. Variables:
  463. profile = <noc.sa.profiles.Cisco.IOS.Profile object at 0x277ced0>
  464. pv = u'Cisco'
  465. access_profile = <noc.sa.protocols.sae_pb2.AccessProfile object at 0x277e750>
  466. script_class = <class 'noc.sa.profiles.Cisco.IOS.get_config.Script'>
  467. self = <noc.sa.activator.activator.Activator object at 0x1c6f190>
  468. pos = u'IOS'
  469. script_name = u'Cisco.IOS.get_config'
  470. callback = <function script_callback at 0x226f398>
  471. object_name = u'RUMSKKALES001'
  472. sn = u'get_config'
  473. timeout = 1200
  474. kwargs = {}
  475. ------------------------------------------------------------------------
  476. File: /opt/noc/sa/activator/service.py (Line: 91)
  477. Function: script
  478. 84 return
  479. 85 # Deserialize additional arguments
  480. 86 kwargs = {}
  481. 87 for a in request.kwargs:
  482. 88 kwargs[str(a.key)] = cPickle.loads(str(a.value))
  483. 89 self.activator.run_script(request.object_name, request.script,
  484. 90 request.access_profile, script_callback, request.timeout,
  485. 91 ==> **kwargs)
  486. 92
  487. 93 def ping_check(self, controller, request, done):
  488. 94 """
  489. 95 Start ping check of addresses
  490. 96 """
  491. 97 def ping_check_callback(status):
  492. Variables:
  493. profile = <class 'noc.sa.profiles.Cisco.IOS.Profile'>
  494. script_class = <class 'noc.sa.profiles.Cisco.IOS.get_config.Script'>
  495. script_callback = <function script_callback at 0x226f398>
  496. request = <noc.sa.protocols.sae_pb2.ScriptRequest object at 0x2281050>
  497. controller = <noc.sa.rpc.Controller object at 0x277c4d0>
  498. done =
  499. <bound method ActivatorSocket.send_response of <ActivatorSocket(0x2280190, 127.0.0.1:19701, connected)>>
  500. kwargs = {}
  501. self = <noc.sa.activator.service.Service object at 0x19f72d0>
  502. ------------------------------------------------------------------------
  503. File: /opt/noc/lib/python2.7/site-packages/google/protobuf/service_reflection.py (Line: 171)
  504. Function: _CallMethod
  505. 164 request: Request protocol message.
  506. 165 callback: A callback to invoke after the method has completed.
  507. 166 """
  508. 167 if method_descriptor.containing_service != self.descriptor:
  509. 168 raise RuntimeError(
  510. 169 'CallMethod() given method descriptor for wrong service type.')
  511. 170 method = getattr(srvc, method_descriptor.name)
  512. 171 ==> return method(rpc_controller, request, callback)
  513. 172
  514. 173 def _GetRequestClass(self, method_descriptor):
  515. 174 """Returns the class of the request protocol message.
  516. 175
  517. 176 Args:
  518. 177 method_descriptor: Descriptor of the method for which to return the
  519. Variables:
  520. srvc = <noc.sa.activator.service.Service object at 0x19f72d0>
  521. method_descriptor = <google.protobuf.descriptor.MethodDescriptor object at 0x1950f50>
  522. self = <google.protobuf.service_reflection._ServiceBuilder object at 0x1959190>
  523. request = <noc.sa.protocols.sae_pb2.ScriptRequest object at 0x2281050>
  524. rpc_controller = <noc.sa.rpc.Controller object at 0x277c4d0>
  525. callback =
  526. <bound method ActivatorSocket.send_response of <ActivatorSocket(0x2280190, 127.0.0.1:19701, connected)>>
  527. method =
  528. <bound method Service.script of <noc.sa.activator.service.Service object at 0x19f72d0>>
  529. ------------------------------------------------------------------------
  530. File: /opt/noc/lib/python2.7/site-packages/google/protobuf/service_reflection.py (Line: 146)
  531. Function: _WrapCallMethod
  532. 139
  533. 140 # CallMethod needs to operate with an instance of the Service class. This
  534. 141 # internal wrapper function exists only to be able to pass the service
  535. 142 # instance to the method that does the real CallMethod work.
  536. 143 def _WrapCallMethod(srvc, method_descriptor,
  537. 144 rpc_controller, request, callback):
  538. 145 return self._CallMethod(srvc, method_descriptor,
  539. 146 ==> rpc_controller, request, callback)
  540. 147 self.cls = cls
  541. 148 cls.CallMethod = _WrapCallMethod
  542. 149 cls.GetDescriptor = staticmethod(lambda: self.descriptor)
  543. 150 cls.GetDescriptor.__doc__ = "Returns the service descriptor."
  544. 151 cls.GetRequestClass = self._GetRequestClass
  545. 152 cls.GetResponseClass = self._GetResponseClass
  546. Variables:
  547. rpc_controller = <noc.sa.rpc.Controller object at 0x277c4d0>
  548. method_descriptor = <google.protobuf.descriptor.MethodDescriptor object at 0x1950f50>
  549. self = <google.protobuf.service_reflection._ServiceBuilder object at 0x1959190>
  550. request = <noc.sa.protocols.sae_pb2.ScriptRequest object at 0x2281050>
  551. srvc = <noc.sa.activator.service.Service object at 0x19f72d0>
  552. callback =
  553. <bound method ActivatorSocket.send_response of <ActivatorSocket(0x2280190, 127.0.0.1:19701, connected)>>
  554. ------------------------------------------------------------------------
  555. File: /opt/noc/sa/rpc.py (Line: 423)
  556. Function: rpc_handle_request
  557. 416 req.ParseFromString(request.serialized_request)
  558. 417 # logging.debug("Request accepted:\nid: %s\n%s" % (id, str(req)))
  559. 418 controller = Controller(self)
  560. 419 controller.transaction = self.transactions.begin(id=id,
  561. 420 method=request.method)
  562. 421 try:
  563. 422 self.service.CallMethod(method, controller,
  564. 423 ==> req, self.send_response)
  565. 424 except:
  566. 425 self.send_error(id, ERR_INTERNAL,
  567. 426 "RPC Call to %s failed" % request.method)
  568. 427 error_report()
  569. 428 else:
  570. 429 self.send_error(id, ERR_INVALID_METHOD,
  571. Variables:
  572. self = <ActivatorSocket(0x2280190, 127.0.0.1:19701, connected)>
  573. req = <noc.sa.protocols.sae_pb2.ScriptRequest object at 0x2281050>
  574. request = <noc.sa.protocols.sae_pb2.Request object at 0x21c8ec0>
  575. id = 28982613
  576. controller = <noc.sa.rpc.Controller object at 0x277c4d0>
  577. method = <google.protobuf.descriptor.MethodDescriptor object at 0x1950f50>
  578. ------------------------------------------------------------------------
  579. END OF TRACEBACK
  580. 2014-10-23 09:34:20,994 UNHANDLED EXCEPTION (2014-10-23 09:34:20.988668)
  581. Working directory: /opt/noc
  582. <type 'exceptions.IOError'>
  583. [Errno 2] No such file or directory: u'/var/log/noc/cli-sessions/RUMSKNARES001-Cisco.IOS.get_interfaces-2014-10-23-09-34-20.log'
  584. START OF TRACEBACK
  585. ------------------------------------------------------------------------
  586. File: /opt/noc/sa/script/script.py (Line: 357)
  587. Function: cli_debug
  588. 350 if not self.log_cli_sessions_path:
  589. 351 return
  590. 352 m = datetime.datetime.now().strftime("[%Y-%m-%d %H:%M:%S] ")
  591. 353 if chars:
  592. 354 m += chars * 50
  593. 355 m += "\n"
  594. 356 m += str(msg) + "\n"
  595. 357 ==> with open(self.log_cli_sessions_path, "a") as f:
  596. 358 f.write(m)
  597. 359
  598. 360 def is_stale(self):
  599. 361 """Checks script is stale and must be terminated"""
  600. 362 return time.time() - self.start_time > self._timeout
  601. 363
  602. Variables:
  603. msg = u'IP: RUMSKNARES001 SCRIPT: Cisco.IOS.get_interfaces'
  604. chars = '!'
  605. m =
  606. '[2014-10-23 09:34:20] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\nIP: RUMSKNARES001 SCRIPT: Cisco.IOS.get_interfaces\n'
  607. self = <Script(Thread-32, initial)>
  608. ------------------------------------------------------------------------
  609. File: /opt/noc/sa/script/script.py (Line: 244)
  610. Function: __init__
  611. 237 and self.activator.log_cli_sessions_script_re.search(self.name):
  612. 238 self.log_cli_sessions_path = self.activator.log_cli_sessions_path
  613. 239 for k, v in [
  614. 240 ("ip", self.access_profile.address),
  615. 241 ("script", self.name),
  616. 242 ("ts", datetime.datetime.now().strftime("%Y-%m-%d-%H-%M-%S"))]:
  617. 243 self.log_cli_sessions_path = self.log_cli_sessions_path.replace("{{%s}}" % k, v)
  618. 244 ==> self.cli_debug("IP: %s SCRIPT: %s" % (self.access_profile.address, self.name), "!")
  619. 245 # Finally call setup_script() for additional script tuning
  620. 246 if profile.setup_script:
  621. 247 profile.setup_script(self)
  622. 248
  623. 249 @classmethod
  624. 250 def template_clean_result(cls, result):
  625. Variables:
  626. a = <noc.sa.protocols.sae_pb2.KWArg object at 0x28d91a0>
  627. profile = <noc.sa.profiles.Cisco.IOS.Profile object at 0x28e1cd0>
  628. access_profile = <noc.sa.protocols.sae_pb2.AccessProfile object at 0x28d9670>
  629. parent = None
  630. k = 'ts'
  631. v = '2014-10-23-09-34-20'
  632. p = u'RUMSKNARES001'
  633. object_name = u'RUMSKNARES001'
  634. timeout = 240
  635. kwargs = {}
  636. self = <Script(Thread-32, initial)>
  637. _activator = <noc.sa.activator.activator.Activator object at 0x1c6f190>
  638. ------------------------------------------------------------------------
  639. File: /opt/noc/sa/activator/activator.py (Line: 364)
  640. Function: run_script
  641. 357 Begin script execution
  642. 358 """
  643. 359 pv, pos, sn = script_name.split(".", 2)
  644. 360 profile = profile_registry["%s.%s" % (pv, pos)]()
  645. 361 script_class = script_registry[script_name]
  646. 362 if not timeout:
  647. 363 timeout = script_class.TIMEOUT
  648. 364 ==> script = script_class(profile, self, object_name, access_profile, timeout, **kwargs)
  649. 365 logging.info("Script %s(%s). Timeout set to %s" % (script_name,
  650. 366 access_profile.address, timeout))
  651. 367 with self.script_lock:
  652. 368 self.script_threads[script] = callback
  653. 369 logging.info("%d script threads (%d max)" % (
  654. 370 len(self.script_threads), self.max_script_threads))
  655. Variables:
  656. profile = <noc.sa.profiles.Cisco.IOS.Profile object at 0x28e1cd0>
  657. pv = u'Cisco'
  658. access_profile = <noc.sa.protocols.sae_pb2.AccessProfile object at 0x28d9670>
  659. script_class = <class 'noc.sa.profiles.Cisco.IOS.get_interfaces.Script'>
  660. self = <noc.sa.activator.activator.Activator object at 0x1c6f190>
  661. pos = u'IOS'
  662. script_name = u'Cisco.IOS.get_interfaces'
  663. callback = <function script_callback at 0x226f398>
  664. object_name = u'RUMSKNARES001'
  665. sn = u'get_interfaces'
  666. timeout = 240
  667. kwargs = {}
  668. ------------------------------------------------------------------------
  669. File: /opt/noc/sa/activator/service.py (Line: 91)
  670. Function: script
  671. 84 return
  672. 85 # Deserialize additional arguments
  673. 86 kwargs = {}
  674. 87 for a in request.kwargs:
  675. 88 kwargs[str(a.key)] = cPickle.loads(str(a.value))
  676. 89 self.activator.run_script(request.object_name, request.script,
  677. 90 request.access_profile, script_callback, request.timeout,
  678. 91 ==> **kwargs)
  679. 92
  680. 93 def ping_check(self, controller, request, done):
  681. 94 """
  682. 95 Start ping check of addresses
  683. 96 """
  684. 97 def ping_check_callback(status):
  685. Variables:
  686. profile = <class 'noc.sa.profiles.Cisco.IOS.Profile'>
  687. script_class = <class 'noc.sa.profiles.Cisco.IOS.get_interfaces.Script'>
  688. script_callback = <function script_callback at 0x226f398>
  689. request = <noc.sa.protocols.sae_pb2.ScriptRequest object at 0x2281050>
  690. controller = <noc.sa.rpc.Controller object at 0x28e1ed0>
  691. done =
  692. <bound method ActivatorSocket.send_response of <ActivatorSocket(0x2280190, 127.0.0.1:19701, connected)>>
  693. kwargs = {}
  694. self = <noc.sa.activator.service.Service object at 0x19f72d0>
  695. ------------------------------------------------------------------------
  696. File: /opt/noc/lib/python2.7/site-packages/google/protobuf/service_reflection.py (Line: 171)
  697. Function: _CallMethod
  698. 164 request: Request protocol message.
  699. 165 callback: A callback to invoke after the method has completed.
  700. 166 """
  701. 167 if method_descriptor.containing_service != self.descriptor:
  702. 168 raise RuntimeError(
  703. 169 'CallMethod() given method descriptor for wrong service type.')
  704. 170 method = getattr(srvc, method_descriptor.name)
  705. 171 ==> return method(rpc_controller, request, callback)
  706. 172
  707. 173 def _GetRequestClass(self, method_descriptor):
  708. 174 """Returns the class of the request protocol message.
  709. 175
  710. 176 Args:
  711. 177 method_descriptor: Descriptor of the method for which to return the
  712. Variables:
  713. srvc = <noc.sa.activator.service.Service object at 0x19f72d0>
  714. method_descriptor = <google.protobuf.descriptor.MethodDescriptor object at 0x1950f50>
  715. self = <google.protobuf.service_reflection._ServiceBuilder object at 0x1959190>
  716. request = <noc.sa.protocols.sae_pb2.ScriptRequest object at 0x2281050>
  717. rpc_controller = <noc.sa.rpc.Controller object at 0x28e1ed0>
  718. callback =
  719. <bound method ActivatorSocket.send_response of <ActivatorSocket(0x2280190, 127.0.0.1:19701, connected)>>
  720. method =
  721. <bound method Service.script of <noc.sa.activator.service.Service object at 0x19f72d0>>
  722. ------------------------------------------------------------------------
  723. File: /opt/noc/lib/python2.7/site-packages/google/protobuf/service_reflection.py (Line: 146)
  724. Function: _WrapCallMethod
  725. 139
  726. 140 # CallMethod needs to operate with an instance of the Service class. This
  727. 141 # internal wrapper function exists only to be able to pass the service
  728. 142 # instance to the method that does the real CallMethod work.
  729. 143 def _WrapCallMethod(srvc, method_descriptor,
  730. 144 rpc_controller, request, callback):
  731. 145 return self._CallMethod(srvc, method_descriptor,
  732. 146 ==> rpc_controller, request, callback)
  733. 147 self.cls = cls
  734. 148 cls.CallMethod = _WrapCallMethod
  735. 149 cls.GetDescriptor = staticmethod(lambda: self.descriptor)
  736. 150 cls.GetDescriptor.__doc__ = "Returns the service descriptor."
  737. 151 cls.GetRequestClass = self._GetRequestClass
  738. 152 cls.GetResponseClass = self._GetResponseClass
  739. Variables:
  740. rpc_controller = <noc.sa.rpc.Controller object at 0x28e1ed0>
  741. method_descriptor = <google.protobuf.descriptor.MethodDescriptor object at 0x1950f50>
  742. self = <google.protobuf.service_reflection._ServiceBuilder object at 0x1959190>
  743. request = <noc.sa.protocols.sae_pb2.ScriptRequest object at 0x2281050>
  744. srvc = <noc.sa.activator.service.Service object at 0x19f72d0>
  745. callback =
  746. <bound method ActivatorSocket.send_response of <ActivatorSocket(0x2280190, 127.0.0.1:19701, connected)>>
  747. ------------------------------------------------------------------------
  748. File: /opt/noc/sa/rpc.py (Line: 423)
  749. Function: rpc_handle_request
  750. 416 req.ParseFromString(request.serialized_request)
  751. 417 # logging.debug("Request accepted:\nid: %s\n%s" % (id, str(req)))
  752. 418 controller = Controller(self)
  753. 419 controller.transaction = self.transactions.begin(id=id,
  754. 420 method=request.method)
  755. 421 try:
  756. 422 self.service.CallMethod(method, controller,
  757. 423 ==> req, self.send_response)
  758. 424 except:
  759. 425 self.send_error(id, ERR_INTERNAL,
  760. 426 "RPC Call to %s failed" % request.method)
  761. 427 error_report()
  762. 428 else:
  763. 429 self.send_error(id, ERR_INVALID_METHOD,
  764. Variables:
  765. self = <ActivatorSocket(0x2280190, 127.0.0.1:19701, connected)>
  766. req = <noc.sa.protocols.sae_pb2.ScriptRequest object at 0x2281050>
  767. request = <noc.sa.protocols.sae_pb2.Request object at 0x21c8f30>
  768. id = 824156139
  769. controller = <noc.sa.rpc.Controller object at 0x28e1ed0>
  770. method = <google.protobuf.descriptor.MethodDescriptor object at 0x1950f50>
  771. ------------------------------------------------------------------------
  772. END OF TRACEBACK
  773. 2014-10-23 09:34:22,033 UNHANDLED EXCEPTION (2014-10-23 09:34:22.027870)
  774. Working directory: /opt/noc
  775. <type 'exceptions.IOError'>
  776. [Errno 2] No such file or directory: u'/var/log/noc/cli-sessions/RUMSKKADVG001-Generic.get_ip_discovery-2014-10-23-09-34-22.log'
  777. START OF TRACEBACK
  778. ------------------------------------------------------------------------
  779. File: /opt/noc/sa/script/script.py (Line: 357)
  780. Function: cli_debug
  781. 350 if not self.log_cli_sessions_path:
  782. 351 return
  783. 352 m = datetime.datetime.now().strftime("[%Y-%m-%d %H:%M:%S] ")
  784. 353 if chars:
  785. 354 m += chars * 50
  786. 355 m += "\n"
  787. 356 m += str(msg) + "\n"
  788. 357 ==> with open(self.log_cli_sessions_path, "a") as f:
  789. 358 f.write(m)
  790. 359
  791. 360 def is_stale(self):
  792. 361 """Checks script is stale and must be terminated"""
  793. 362 return time.time() - self.start_time > self._timeout
  794. 363
  795. Variables:
  796. msg = u'IP: RUMSKKADVG001 SCRIPT: Generic.get_ip_discovery'
  797. chars = '!'
  798. m =
  799. '[2014-10-23 09:34:22] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\nIP: RUMSKKADVG001 SCRIPT: Generic.get_ip_discovery\n'
  800. self = <Script(Thread-33, initial)>
  801. ------------------------------------------------------------------------
  802. File: /opt/noc/sa/script/script.py (Line: 244)
  803. Function: __init__
  804. 237 and self.activator.log_cli_sessions_script_re.search(self.name):
  805. 238 self.log_cli_sessions_path = self.activator.log_cli_sessions_path
  806. 239 for k, v in [
  807. 240 ("ip", self.access_profile.address),
  808. 241 ("script", self.name),
  809. 242 ("ts", datetime.datetime.now().strftime("%Y-%m-%d-%H-%M-%S"))]:
  810. 243 self.log_cli_sessions_path = self.log_cli_sessions_path.replace("{{%s}}" % k, v)
  811. 244 ==> self.cli_debug("IP: %s SCRIPT: %s" % (self.access_profile.address, self.name), "!")
  812. 245 # Finally call setup_script() for additional script tuning
  813. 246 if profile.setup_script:
  814. 247 profile.setup_script(self)
  815. 248
  816. 249 @classmethod
  817. 250 def template_clean_result(cls, result):
  818. Variables:
  819. a = <noc.sa.protocols.sae_pb2.KWArg object at 0x28d9280>
  820. profile = <noc.sa.profiles.Cisco.IOS.Profile object at 0x28e1d50>
  821. access_profile = <noc.sa.protocols.sae_pb2.AccessProfile object at 0x28d98a0>
  822. parent = None
  823. k = 'ts'
  824. v = '2014-10-23-09-34-22'
  825. p = u'RUMSKKADVG001'
  826. object_name = u'RUMSKKADVG001'
  827. timeout = 1200
  828. kwargs = {}
  829. self = <Script(Thread-33, initial)>
  830. _activator = <noc.sa.activator.activator.Activator object at 0x1c6f190>
  831. ------------------------------------------------------------------------
  832. File: /opt/noc/sa/activator/activator.py (Line: 364)
  833. Function: run_script
  834. 357 Begin script execution
  835. 358 """
  836. 359 pv, pos, sn = script_name.split(".", 2)
  837. 360 profile = profile_registry["%s.%s" % (pv, pos)]()
  838. 361 script_class = script_registry[script_name]
  839. 362 if not timeout:
  840. 363 timeout = script_class.TIMEOUT
  841. 364 ==> script = script_class(profile, self, object_name, access_profile, timeout, **kwargs)
  842. 365 logging.info("Script %s(%s). Timeout set to %s" % (script_name,
  843. 366 access_profile.address, timeout))
  844. 367 with self.script_lock:
  845. 368 self.script_threads[script] = callback
  846. 369 logging.info("%d script threads (%d max)" % (
  847. 370 len(self.script_threads), self.max_script_threads))
  848. Variables:
  849. profile = <noc.sa.profiles.Cisco.IOS.Profile object at 0x28e1d50>
  850. pv = u'Cisco'
  851. access_profile = <noc.sa.protocols.sae_pb2.AccessProfile object at 0x28d98a0>
  852. script_class = <class 'noc.sa.profiles.Generic.get_ip_discovery.Script'>
  853. self = <noc.sa.activator.activator.Activator object at 0x1c6f190>
  854. pos = u'IOS'
  855. script_name = u'Cisco.IOS.get_ip_discovery'
  856. callback = <function script_callback at 0x226f398>
  857. object_name = u'RUMSKKADVG001'
  858. sn = u'get_ip_discovery'
  859. timeout = 1200
  860. kwargs = {}
  861. ------------------------------------------------------------------------
  862. File: /opt/noc/sa/activator/service.py (Line: 91)
  863. Function: script
  864. 84 return
  865. 85 # Deserialize additional arguments
  866. 86 kwargs = {}
  867. 87 for a in request.kwargs:
  868. 88 kwargs[str(a.key)] = cPickle.loads(str(a.value))
  869. 89 self.activator.run_script(request.object_name, request.script,
  870. 90 request.access_profile, script_callback, request.timeout,
  871. 91 ==> **kwargs)
  872. 92
  873. 93 def ping_check(self, controller, request, done):
  874. 94 """
  875. 95 Start ping check of addresses
  876. 96 """
  877. 97 def ping_check_callback(status):
  878. Variables:
  879. profile = <class 'noc.sa.profiles.Cisco.IOS.Profile'>
  880. script_class = <class 'noc.sa.profiles.Generic.get_ip_discovery.Script'>
  881. script_callback = <function script_callback at 0x226f398>
  882. request = <noc.sa.protocols.sae_pb2.ScriptRequest object at 0x2281050>
  883. controller = <noc.sa.rpc.Controller object at 0x28e1c90>
  884. done =
  885. <bound method ActivatorSocket.send_response of <ActivatorSocket(0x2280190, 127.0.0.1:19701, connected)>>
  886. kwargs = {}
  887. self = <noc.sa.activator.service.Service object at 0x19f72d0>
  888. ------------------------------------------------------------------------
  889. File: /opt/noc/lib/python2.7/site-packages/google/protobuf/service_reflection.py (Line: 171)
  890. Function: _CallMethod
  891. 164 request: Request protocol message.
  892. 165 callback: A callback to invoke after the method has completed.
  893. 166 """
  894. 167 if method_descriptor.containing_service != self.descriptor:
  895. 168 raise RuntimeError(
  896. 169 'CallMethod() given method descriptor for wrong service type.')
  897. 170 method = getattr(srvc, method_descriptor.name)
  898. 171 ==> return method(rpc_controller, request, callback)
  899. 172
  900. 173 def _GetRequestClass(self, method_descriptor):
  901. 174 """Returns the class of the request protocol message.
  902. 175
  903. 176 Args:
  904. 177 method_descriptor: Descriptor of the method for which to return the
  905. Variables:
  906. srvc = <noc.sa.activator.service.Service object at 0x19f72d0>
  907. method_descriptor = <google.protobuf.descriptor.MethodDescriptor object at 0x1950f50>
  908. self = <google.protobuf.service_reflection._ServiceBuilder object at 0x1959190>
  909. request = <noc.sa.protocols.sae_pb2.ScriptRequest object at 0x2281050>
  910. rpc_controller = <noc.sa.rpc.Controller object at 0x28e1c90>
  911. callback =
  912. <bound method ActivatorSocket.send_response of <ActivatorSocket(0x2280190, 127.0.0.1:19701, connected)>>
  913. method =
  914. <bound method Service.script of <noc.sa.activator.service.Service object at 0x19f72d0>>
  915. ------------------------------------------------------------------------
  916. File: /opt/noc/lib/python2.7/site-packages/google/protobuf/service_reflection.py (Line: 146)
  917. Function: _WrapCallMethod
  918. 139
  919. 140 # CallMethod needs to operate with an instance of the Service class. This
  920. 141 # internal wrapper function exists only to be able to pass the service
  921. 142 # instance to the method that does the real CallMethod work.
  922. 143 def _WrapCallMethod(srvc, method_descriptor,
  923. 144 rpc_controller, request, callback):
  924. 145 return self._CallMethod(srvc, method_descriptor,
  925. 146 ==> rpc_controller, request, callback)
  926. 147 self.cls = cls
  927. 148 cls.CallMethod = _WrapCallMethod
  928. 149 cls.GetDescriptor = staticmethod(lambda: self.descriptor)
  929. 150 cls.GetDescriptor.__doc__ = "Returns the service descriptor."
  930. 151 cls.GetRequestClass = self._GetRequestClass
  931. 152 cls.GetResponseClass = self._GetResponseClass
  932. Variables:
  933. rpc_controller = <noc.sa.rpc.Controller object at 0x28e1c90>
  934. method_descriptor = <google.protobuf.descriptor.MethodDescriptor object at 0x1950f50>
  935. self = <google.protobuf.service_reflection._ServiceBuilder object at 0x1959190>
  936. request = <noc.sa.protocols.sae_pb2.ScriptRequest object at 0x2281050>
  937. srvc = <noc.sa.activator.service.Service object at 0x19f72d0>
  938. callback =
  939. <bound method ActivatorSocket.send_response of <ActivatorSocket(0x2280190, 127.0.0.1:19701, connected)>>
  940. ------------------------------------------------------------------------
  941. File: /opt/noc/sa/rpc.py (Line: 423)
  942. Function: rpc_handle_request
  943. 416 req.ParseFromString(request.serialized_request)
  944. 417 # logging.debug("Request accepted:\nid: %s\n%s" % (id, str(req)))
  945. 418 controller = Controller(self)
  946. 419 controller.transaction = self.transactions.begin(id=id,
  947. 420 method=request.method)
  948. 421 try:
  949. 422 self.service.CallMethod(method, controller,
  950. 423 ==> req, self.send_response)
  951. 424 except:
  952. 425 self.send_error(id, ERR_INTERNAL,
  953. 426 "RPC Call to %s failed" % request.method)
  954. 427 error_report()
  955. 428 else:
  956. 429 self.send_error(id, ERR_INVALID_METHOD,
  957. Variables:
  958. self = <ActivatorSocket(0x2280190, 127.0.0.1:19701, connected)>
  959. req = <noc.sa.protocols.sae_pb2.ScriptRequest object at 0x2281050>
  960. request = <noc.sa.protocols.sae_pb2.Request object at 0x21c8ec0>
  961. id = 1373684517
  962. controller = <noc.sa.rpc.Controller object at 0x28e1c90>
  963. method = <google.protobuf.descriptor.MethodDescriptor object at 0x1950f50>
  964. ------------------------------------------------------------------------
  965. END OF TRACEBACK
  966. 2014-10-23 09:34:36,219 UNHANDLED EXCEPTION (2014-10-23 09:34:36.213639)
  967. Working directory: /opt/noc
  968. <type 'exceptions.IOError'>
  969. [Errno 2] No such file or directory: u'/var/log/noc/cli-sessions/RUMSKNARES001-Cisco.IOS.get_mac_address_table-2014-10-23-09-34-36.log'
  970. START OF TRACEBACK
  971. ------------------------------------------------------------------------
  972. File: /opt/noc/sa/script/script.py (Line: 357)
  973. Function: cli_debug
  974. 350 if not self.log_cli_sessions_path:
  975. 351 return
  976. 352 m = datetime.datetime.now().strftime("[%Y-%m-%d %H:%M:%S] ")
  977. 353 if chars:
  978. 354 m += chars * 50
  979. 355 m += "\n"
  980. 356 m += str(msg) + "\n"
  981. 357 ==> with open(self.log_cli_sessions_path, "a") as f:
  982. 358 f.write(m)
  983. 359
  984. 360 def is_stale(self):
  985. 361 """Checks script is stale and must be terminated"""
  986. 362 return time.time() - self.start_time > self._timeout
  987. 363
  988. Variables:
  989. msg = u'IP: RUMSKNARES001 SCRIPT: Cisco.IOS.get_mac_address_table'
  990. chars = '!'
  991. m =
  992. '[2014-10-23 09:34:36] !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!\nIP: RUMSKNARES001 SCRIPT: Cisco.IOS.get_mac_address_table\n'
  993. self = <Script(Thread-34, initial)>
  994. ------------------------------------------------------------------------
  995. File: /opt/noc/sa/script/script.py (Line: 244)
  996. Function: __init__
  997. 237 and self.activator.log_cli_sessions_script_re.search(self.name):
  998. 238 self.log_cli_sessions_path = self.activator.log_cli_sessions_path
  999. 239 for k, v in [
  1000. 240 ("ip", self.access_profile.address),
  1001. 241 ("script", self.name),
  1002. 242 ("ts", datetime.datetime.now().strftime("%Y-%m-%d-%H-%M-%S"))]:
  1003. 243 self.log_cli_sessions_path = self.log_cli_sessions_path.replace("{{%s}}" % k, v)
  1004. 244 ==> self.cli_debug("IP: %s SCRIPT: %s" % (self.access_profile.address, self.name), "!")
  1005. 245 # Finally call setup_script() for additional script tuning
  1006. 246 if profile.setup_script:
  1007. 247 profile.setup_script(self)
  1008. 248
  1009. 249 @classmethod
  1010. 250 def template_clean_result(cls, result):
  1011. Variables:
  1012. a = <noc.sa.protocols.sae_pb2.KWArg object at 0x28d9360>
  1013. profile = <noc.sa.profiles.Cisco.IOS.Profile object at 0x28e14d0>
  1014. access_profile = <noc.sa.protocols.sae_pb2.AccessProfile object at 0x28d92f0>
  1015. parent = None
  1016. k = 'ts'
  1017. v = '2014-10-23-09-34-36'
  1018. p = u'RUMSKNARES001'
  1019. object_name = u'RUMSKNARES001'
  1020. timeout = 1200
  1021. kwargs = {}
  1022. self = <Script(Thread-34, initial)>
  1023. _activator = <noc.sa.activator.activator.Activator object at 0x1c6f190>
  1024. ------------------------------------------------------------------------
  1025. File: /opt/noc/sa/activator/activator.py (Line: 364)
  1026. Function: run_script
  1027. 357 Begin script execution
  1028. 358 """
  1029. 359 pv, pos, sn = script_name.split(".", 2)
  1030. 360 profile = profile_registry["%s.%s" % (pv, pos)]()
  1031. 361 script_class = script_registry[script_name]
  1032. 362 if not timeout:
  1033. 363 timeout = script_class.TIMEOUT
  1034. 364 ==> script = script_class(profile, self, object_name, access_profile, timeout, **kwargs)
  1035. 365 logging.info("Script %s(%s). Timeout set to %s" % (script_name,
  1036. 366 access_profile.address, timeout))
  1037. 367 with self.script_lock:
  1038. 368 self.script_threads[script] = callback
  1039. 369 logging.info("%d script threads (%d max)" % (
  1040. 370 len(self.script_threads), self.max_script_threads))
  1041. Variables:
  1042. profile = <noc.sa.profiles.Cisco.IOS.Profile object at 0x28e14d0>
  1043. pv = u'Cisco'
  1044. access_profile = <noc.sa.protocols.sae_pb2.AccessProfile object at 0x28d92f0>
  1045. script_class = <class 'noc.sa.profiles.Cisco.IOS.get_mac_address_table.Script'>
  1046. self = <noc.sa.activator.activator.Activator object at 0x1c6f190>
  1047. pos = u'IOS'
  1048. script_name = u'Cisco.IOS.get_mac_address_table'
  1049. callback = <function script_callback at 0x226f398>
  1050. object_name = u'RUMSKNARES001'
  1051. sn = u'get_mac_address_table'
  1052. timeout = 1200
  1053. kwargs = {}
  1054. ------------------------------------------------------------------------
  1055. File: /opt/noc/sa/activator/service.py (Line: 91)
  1056. Function: script
  1057. 84 return
  1058. 85 # Deserialize additional arguments
  1059. 86 kwargs = {}
  1060. 87 for a in request.kwargs:
  1061. 88 kwargs[str(a.key)] = cPickle.loads(str(a.value))
  1062. 89 self.activator.run_script(request.object_name, request.script,
  1063. 90 request.access_profile, script_callback, request.timeout,
  1064. 91 ==> **kwargs)
  1065. 92
  1066. 93 def ping_check(self, controller, request, done):
  1067. 94 """
  1068. 95 Start ping check of addresses
  1069. 96 """
  1070. 97 def ping_check_callback(status):
  1071. Variables:
  1072. profile = <class 'noc.sa.profiles.Cisco.IOS.Profile'>
  1073. script_class = <class 'noc.sa.profiles.Cisco.IOS.get_mac_address_table.Script'>
  1074. script_callback = <function script_callback at 0x226f398>
  1075. request = <noc.sa.protocols.sae_pb2.ScriptRequest object at 0x2281050>
  1076. controller = <noc.sa.rpc.Controller object at 0x28e1790>
  1077. done =
  1078. <bound method ActivatorSocket.send_response of <ActivatorSocket(0x2280190, 127.0.0.1:19701, connected)>>
  1079. kwargs = {}
  1080. self = <noc.sa.activator.service.Service object at 0x19f72d0>
  1081. ------------------------------------------------------------------------
  1082. File: /opt/noc/lib/python2.7/site-packages/google/protobuf/service_reflection.py (Line: 171)
  1083. Function: _CallMethod
  1084. 164 request: Request protocol message.
  1085. 165 callback: A callback to invoke after the method has completed.
  1086. 166 """
  1087. 167 if method_descriptor.containing_service != self.descriptor:
  1088. 168 raise RuntimeError(
  1089. 169 'CallMethod() given method descriptor for wrong service type.')
  1090. 170 method = getattr(srvc, method_descriptor.name)
  1091. 171 ==> return method(rpc_controller, request, callback)
  1092. 172
  1093. 173 def _GetRequestClass(self, method_descriptor):
  1094. 174 """Returns the class of the request protocol message.
  1095. 175
  1096. 176 Args:
  1097. 177 method_descriptor: Descriptor of the method for which to return the
  1098. Variables:
  1099. srvc = <noc.sa.activator.service.Service object at 0x19f72d0>
  1100. method_descriptor = <google.protobuf.descriptor.MethodDescriptor object at 0x1950f50>
  1101. self = <google.protobuf.service_reflection._ServiceBuilder object at 0x1959190>
  1102. request = <noc.sa.protocols.sae_pb2.ScriptRequest object at 0x2281050>
  1103. rpc_controller = <noc.sa.rpc.Controller object at 0x28e1790>
  1104. callback =
  1105. <bound method ActivatorSocket.send_response of <ActivatorSocket(0x2280190, 127.0.0.1:19701, connected)>>
  1106. method =
  1107. <bound method Service.script of <noc.sa.activator.service.Service object at 0x19f72d0>>
  1108. ------------------------------------------------------------------------
  1109. File: /opt/noc/lib/python2.7/site-packages/google/protobuf/service_reflection.py (Line: 146)
  1110. Function: _WrapCallMethod
  1111. 139
  1112. 140 # CallMethod needs to operate with an instance of the Service class. This
  1113. 141 # internal wrapper function exists only to be able to pass the service
  1114. 142 # instance to the method that does the real CallMethod work.
  1115. 143 def _WrapCallMethod(srvc, method_descriptor,
  1116. 144 rpc_controller, request, callback):
  1117. 145 return self._CallMethod(srvc, method_descriptor,
  1118. 146 ==> rpc_controller, request, callback)
  1119. 147 self.cls = cls
  1120. 148 cls.CallMethod = _WrapCallMethod
  1121. 149 cls.GetDescriptor = staticmethod(lambda: self.descriptor)
  1122. 150 cls.GetDescriptor.__doc__ = "Returns the service descriptor."
  1123. 151 cls.GetRequestClass = self._GetRequestClass
  1124. 152 cls.GetResponseClass = self._GetResponseClass
  1125. Variables:
  1126. rpc_controller = <noc.sa.rpc.Controller object at 0x28e1790>
  1127. method_descriptor = <google.protobuf.descriptor.MethodDescriptor object at 0x1950f50>
  1128. self = <google.protobuf.service_reflection._ServiceBuilder object at 0x1959190>
  1129. request = <noc.sa.protocols.sae_pb2.ScriptRequest object at 0x2281050>
  1130. srvc = <noc.sa.activator.service.Service object at 0x19f72d0>
  1131. callback =
  1132. <bound method ActivatorSocket.send_response of <ActivatorSocket(0x2280190, 127.0.0.1:19701, connected)>>
  1133. ------------------------------------------------------------------------
  1134. File: /opt/noc/sa/rpc.py (Line: 423)
  1135. Function: rpc_handle_request
  1136. 416 req.ParseFromString(request.serialized_request)
  1137. 417 # logging.debug("Request accepted:\nid: %s\n%s" % (id, str(req)))
  1138. 418 controller = Controller(self)
  1139. 419 controller.transaction = self.transactions.begin(id=id,
  1140. 420 method=request.method)
  1141. 421 try:
  1142. 422 self.service.CallMethod(method, controller,
  1143. 423 ==> req, self.send_response)
  1144. 424 except:
  1145. 425 self.send_error(id, ERR_INTERNAL,
  1146. 426 "RPC Call to %s failed" % request.method)
  1147. 427 error_report()
  1148. 428 else:
  1149. 429 self.send_error(id, ERR_INVALID_METHOD,
  1150. Variables:
  1151. self = <ActivatorSocket(0x2280190, 127.0.0.1:19701, connected)>
  1152. req = <noc.sa.protocols.sae_pb2.ScriptRequest object at 0x2281050>
  1153. request = <noc.sa.protocols.sae_pb2.Request object at 0x21c8f30>
  1154. id = 1243333650
  1155. controller = <noc.sa.rpc.Controller object at 0x28e1790>
  1156. method = <google.protobuf.descriptor.MethodDescriptor object at 0x1950f50>
  1157. ------------------------------------------------------------------------
  1158. END OF TRACEBACK
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement