Izya12

get_config

Mar 15th, 2018
229
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 29.44 KB | None | 0 0
  1. 2018-03-16 01:57:11,710 [noc.core.dcs.base] Resolve near service postgres
  2. 2018-03-16 01:57:11,711 [noc.core.http.client] HTTP GET http://consul:8500/v1/catalog/service/postgres?near=_agent
  3. 2018-03-16 01:57:11,713 [noc.core.http.client] HTTP Response 200
  4. 2018-03-16 01:57:11,713 [noc.core.dcs.base] Resolved near service postgres to ['10.220.21.122:5432']
  5. 2018-03-16 01:57:12,653 [noc.core.dcs.base] Running resolver for service mongo
  6. 2018-03-16 01:57:12,654 [noc.core.dcs.base] [mongo] Starting resolver
  7. 2018-03-16 01:57:12,654 [noc.core.http.client] HTTP GET http://consul:8500/v1/health/service/mongo?passing=1
  8. 2018-03-16 01:57:12,655 [noc.core.http.client] HTTP Response 200
  9. 2018-03-16 01:57:12,656 [noc.core.dcs.base] [mongo] Set active services to: mongo: 10.220.21.122:27017
  10. 2018-03-16 01:57:12,656 [noc.core.http.client] HTTP GET http://consul:8500/v1/health/service/mongo?index=38752&passing=1
  11. 2018-03-16 01:57:12,657 [noc.lib.nosql] Connecting to MongoDB {'username': 'noc', 'authentication_source': 'noc', 'readPreference': 'secondaryPreferred', 'replicaSet': 'noc', 'db': 'noc', 'socketKeepAlive': True, 'host': 'mongodb://noc:********@10.220.21.122:27017/noc', 'password': '********'}
  12. 2018-03-16 01:57:12,715 [noc.core.cache.base] Using cache backend: noc.core.cache.mongo.MongoCache
  13. 2018-03-16 01:57:12,772 [noc.main.models.doccategory] Registering Capability
  14. 2018-03-16 01:57:12,772 [noc.main.models.doccategory] Registering MetricType
  15. 2018-03-16 01:57:12,806 [noc.main.models.doccategory] Registering ConnectionType
  16. 2018-03-16 01:57:12,809 [noc.main.models.doccategory] Registering ObjectModel
  17. 2018-03-16 01:57:12,818 [noc.main.models.textindex] Adding FTS index for sa.managedobject
  18. 2018-03-16 01:57:12,834 [noc.main.models.textindex] Adding FTS index for ip.vrf
  19. 2018-03-16 01:57:12,837 [noc.main.models.textindex] Adding FTS index for vc.vc
  20. 2018-03-16 01:57:12,840 [noc.main.models.textindex] Adding FTS index for ip.prefix
  21. 2018-03-16 01:57:12,845 [noc.main.models.textindex] Adding FTS index for ip.address
  22. 2018-03-16 01:57:12,894 [noc.core.script.loader] Loading script Cisco.IOS.get_config
  23. 2018-03-16 01:57:12,903 [noc.core.profile.loader] Loading profile Cisco.IOS
  24. 2018-03-16 01:57:12,904 [script] [Cisco.IOS.get_config|xxx.xxx.50.5] Filling get_version cache with {'platform': u'WS-C2960X-24PS-L', 'version': u'15.2(2)E6', 'vendor': u'Cisco Systems'}
  25. 2018-03-16 01:57:12,904 [script] [Cisco.IOS.get_config|xxx.xxx.50.5] Running. Input arguments: {}, timeout 3600
  26. 2018-03-16 01:57:12,904 [script] [Cisco.IOS.get_config|xxx.xxx.50.5] Open telnet CLI
  27. 2018-03-16 01:57:12,906 [script] [Cisco.IOS.get_config|xxx.xxx.50.5] [telnet] Setup session
  28. 2018-03-16 01:57:12,906 [script] [Cisco.IOS.get_config|xxx.xxx.50.5] Disable paging
  29. 2018-03-16 01:57:12,906 [script] [Cisco.IOS.get_config|xxx.xxx.50.5] [telnet] Creating IOLoop
  30. 2018-03-16 01:57:12,906 [script] [Cisco.IOS.get_config|xxx.xxx.50.5] [telnet] Connecting (u'xxx.xxx.50.5', 23)
  31. 2018-03-16 01:57:12,947 [script] [Cisco.IOS.get_config|xxx.xxx.50.5] [telnet] Connected
  32. 2018-03-16 01:57:12,948 [script] [Cisco.IOS.get_config|xxx.xxx.50.5] [telnet] State: <START>
  33. 2018-03-16 01:57:12,948 [script] [Cisco.IOS.get_config|xxx.xxx.50.5] [telnet] Setting timeout: 60s
  34. 2018-03-16 01:57:12,984 [script] [Cisco.IOS.get_config|xxx.xxx.50.5] [telnet] Received WILL ECHO
  35. 2018-03-16 01:57:12,984 [script] [Cisco.IOS.get_config|xxx.xxx.50.5] [telnet] Send DO ECHO
  36. 2018-03-16 01:57:12,985 [script] [Cisco.IOS.get_config|xxx.xxx.50.5] [telnet] Received WILL SGA
  37. 2018-03-16 01:57:12,985 [script] [Cisco.IOS.get_config|xxx.xxx.50.5] [telnet] Send DO SGA
  38. 2018-03-16 01:57:12,985 [script] [Cisco.IOS.get_config|xxx.xxx.50.5] [telnet] Received DO TTYPE
  39. 2018-03-16 01:57:12,985 [script] [Cisco.IOS.get_config|xxx.xxx.50.5] [telnet] Send WILL TTYPE
  40. 2018-03-16 01:57:12,985 [script] [Cisco.IOS.get_config|xxx.xxx.50.5] [telnet] Received DO NAWS
  41. 2018-03-16 01:57:12,985 [script] [Cisco.IOS.get_config|xxx.xxx.50.5] [telnet] Send WILL NAWS
  42. 2018-03-16 01:57:12,985 [script] [Cisco.IOS.get_config|xxx.xxx.50.5] [telnet] Send IAC SB '\x1f' '\x00\x80\x00\x80' IAC SE
  43. 2018-03-16 01:57:12,986 [script] [Cisco.IOS.get_config|xxx.xxx.50.5] [telnet] Received: '\r\n\r\nUser Access Verification\r\n\r\nUsername: '
  44. 2018-03-16 01:57:12,986 [script] [Cisco.IOS.get_config|xxx.xxx.50.5] [telnet] Match: ([Uu]ser ?[Nn]ame|[Ll]ogin): ?
  45. 2018-03-16 01:57:12,986 [script] [Cisco.IOS.get_config|xxx.xxx.50.5] [telnet] State: <USERNAME>
  46. 2018-03-16 01:57:12,986 [script] [Cisco.IOS.get_config|xxx.xxx.50.5] [telnet] Send: 'xxxx\n'
  47. 2018-03-16 01:57:12,987 [script] [Cisco.IOS.get_config|xxx.xxx.50.5] [telnet] Setting timeout: 30s
  48. 2018-03-16 01:57:13,028 [script] [Cisco.IOS.get_config|xxx.xxx.50.5] [telnet] Received IAC SB 1801 SE
  49. 2018-03-16 01:57:13,028 [script] [Cisco.IOS.get_config|xxx.xxx.50.5] [telnet] Received: '\xf0'
  50. 2018-03-16 01:57:13,033 [script] [Cisco.IOS.get_config|xxx.xxx.50.5] [telnet] Received: 'x'
  51. 2018-03-16 01:57:13,035 [script] [Cisco.IOS.get_config|xxx.xxx.50.5] [telnet] Received: 'xxx'
  52. 2018-03-16 01:57:13,036 [script] [Cisco.IOS.get_config|xxx.xxx.50.5] [telnet] Received: '\r\nPassword: '
  53. 2018-03-16 01:57:13,036 [script] [Cisco.IOS.get_config|xxx.xxx.50.5] [telnet] Match: [Pp]ass[Ww]ord: ?
  54. 2018-03-16 01:57:13,036 [script] [Cisco.IOS.get_config|xxx.xxx.50.5] [telnet] State: <PASSWORD>
  55. 2018-03-16 01:57:13,036 [script] [Cisco.IOS.get_config|xxx.xxx.50.5] [telnet] Send: 'xxxxx\n'
  56. 2018-03-16 01:57:13,037 [script] [Cisco.IOS.get_config|xxx.xxx.50.5] [telnet] Setting timeout: 30s
  57. 2018-03-16 01:57:17,089 [script] [Cisco.IOS.get_config|xxx.xxx.50.5] [telnet] Received: '\r\n\r\n% Authentication failed\r\n\r\nUsername: '
  58. 2018-03-16 01:57:17,089 [script] [Cisco.IOS.get_config|xxx.xxx.50.5] [telnet] Match: ([Uu]ser ?[Nn]ame|[Ll]ogin): ?
  59. 2018-03-16 01:57:17,089 [script] [Cisco.IOS.get_config|xxx.xxx.50.5] [telnet] State: <FAILURE>
  60. 2018-03-16 01:57:17,090 [script] [Cisco.IOS.get_config|xxx.xxx.50.5] [telnet] Closing IOLoop
  61. 2018-03-16 01:57:17,261 [noc.core.debug] UNHANDLED EXCEPTION (2018-03-16 01:57:17.100156)
  62. PROCESS: ./commands/script.py
  63. VERSION: 15.05.1+microservices.9141.4c85fb66
  64. BRANCH: microservices CHANGESET: 4c85fb66
  65. ERROR FINGERPRINT: 08f7eb9a-f643-5511-a02a-ed358f242b03
  66. WORKING DIRECTORY: /opt/noc
  67. EXCEPTION: <class 'noc.core.script.cli.error.CLIAuthFailed'>
  68.  
  69. % Authentication failed
  70.  
  71.  
  72. START OF TRACEBACK
  73. ------------------------------------------------------------------------
  74. File: core/script/cli/base.py (Line: 515)
  75. Function: on_failure
  76. 508 self.patterns["prompt"] = self.patterns["unprivileged_prompt"]
  77. 509 return self.on_prompt(data, match)
  78. 510
  79. 511 @tornado.gen.coroutine
  80. 512 def on_failure(self, data, match, error_cls=None):
  81. 513 self.logger.debug("State: <FAILURE>")
  82. 514 error_cls = error_cls or CLIError
  83. 515 ==> raise error_cls(self.buffer or data or None)
  84. 516
  85. 517 @tornado.gen.coroutine
  86. 518 def on_prompt(self, data, match):
  87. 519 self.logger.debug("State: <PROMT>")
  88. 520 if not self.is_started:
  89. 521 self.resolve_pattern_prompt(match)
  90. Variables:
  91. self = <noc.core.script.cli.telnet.TelnetCLI object at 0x7f175247d3d0>
  92. data = '\n\n% Authentication failed\n\n'
  93. match = <_sre.SRE_Match object at 0x7f17664aa990>
  94. error_cls = <class 'noc.core.script.cli.error.CLIAuthFailed'>
  95. ------------------------------------------------------------------------
  96. File: local/lib/python2.7/site-packages/tornado/gen.py (Line: 292)
  97. Function: wrapper
  98. 285
  99. 286 if replace_callback and 'callback' in kwargs:
  100. 287 callback = kwargs.pop('callback')
  101. 288 IOLoop.current().add_future(
  102. 289 future, lambda future: callback(future.result()))
  103. 290
  104. 291 try:
  105. 292 ==> result = func(*args, **kwargs)
  106. 293 except (Return, StopIteration) as e:
  107. 294 result = _value_from_stopiteration(e)
  108. 295 except Exception:
  109. 296 future.set_exc_info(sys.exc_info())
  110. 297 return future
  111. 298 else:
  112. Variables:
  113. replace_callback = True
  114. future = <tornado.concurrent.Future object at 0x7f175248a8d0>
  115. func = <function on_failure at 0x7f175248dcf8>
  116. args =
  117. (<noc.core.script.cli.telnet.TelnetCLI object at 0x7f175247d3d0>,
  118. '\n\n% Authentication failed\n\n',
  119. <_sre.SRE_Match object at 0x7f17664aa990>,
  120. <class 'noc.core.script.cli.error.CLIAuthFailed'>)
  121. kwargs = {}
  122. ------------------------------------------------------------------------
  123. File: local/lib/python2.7/site-packages/tornado/concurrent.py (Line: 238)
  124. Function: result
  125. 231 before the `Future` is done, so the ``timeout`` is never used.
  126. 232 """
  127. 233 self._clear_tb_log()
  128. 234 if self._result is not None:
  129. 235 return self._result
  130. 236 if self._exc_info is not None:
  131. 237 try:
  132. 238 ==> raise_exc_info(self._exc_info)
  133. 239 finally:
  134. 240 self = None
  135. 241 self._check_done()
  136. 242 return self._result
  137. 243
  138. 244 def exception(self, timeout=None):
  139. Variables:
  140. self = None
  141. timeout = None
  142. ------------------------------------------------------------------------
  143. File: local/lib/python2.7/site-packages/tornado/gen.py (Line: 1055)
  144. Function: run
  145. 1048 return
  146. 1049 self.future = None
  147. 1050 try:
  148. 1051 orig_stack_contexts = stack_context._state.contexts
  149. 1052 exc_info = None
  150. 1053
  151. 1054 try:
  152. 1055 ==> value = future.result()
  153. 1056 except Exception:
  154. 1057 self.had_exception = True
  155. 1058 exc_info = sys.exc_info()
  156. 1059 future = None
  157. 1060
  158. 1061 if exc_info is not None:
  159. Variables:
  160. self = <tornado.gen.Runner object at 0x7f175248a810>
  161. value = '\r\n\r\n% Authentication failed\r\n\r\nUsername: '
  162. yielded = None
  163. future = None
  164. orig_stack_contexts = ((), None)
  165. exc_info = None
  166. ------------------------------------------------------------------------
  167. File: core/script/cli/base.py (Line: 319)
  168. Function: read_until_prompt
  169. 312 for rx, handler in six.iteritems(self.pattern_table):
  170. 313 match = rx.search(self.buffer, offset)
  171. 314 if match:
  172. 315 self.logger.debug("Match: %s", rx.pattern)
  173. 316 matched = self.buffer[:match.start()]
  174. 317 self.buffer = self.buffer[match.end():]
  175. 318 if isinstance(handler, tuple):
  176. 319 ==> r = yield handler[0](matched, match, *handler[1:])
  177. 320 else:
  178. 321 r = yield handler(matched, match)
  179. 322 if r is not None:
  180. 323 raise tornado.gen.Return(r)
  181. 324 else:
  182. 325 break # This state is processed
  183. Variables:
  184. f = <tornado.concurrent.Future object at 0x7f175248a950>
  185. handler =
  186. (<bound method TelnetCLI.on_failure of <noc.core.script.cli.telnet.TelnetCLI object at 0x7f175247d3d0>>,
  187. <class 'noc.core.script.cli.error.CLIAuthFailed'>)
  188. self = <noc.core.script.cli.telnet.TelnetCLI object at 0x7f175247d3d0>
  189. rx = <_sre.SRE_Pattern object at 0x7f1753fd3ae8>
  190. connect_retries = 3
  191. r = '\r\n\r\n% Authentication failed\r\n\r\nUsername: '
  192. offset = 0
  193. match = <_sre.SRE_Match object at 0x7f17664aa990>
  194. matched = '\n\n% Authentication failed\n\n'
  195. ------------------------------------------------------------------------
  196. File: local/lib/python2.7/site-packages/tornado/gen.py (Line: 1063)
  197. Function: run
  198. 1056 except Exception:
  199. 1057 self.had_exception = True
  200. 1058 exc_info = sys.exc_info()
  201. 1059 future = None
  202. 1060
  203. 1061 if exc_info is not None:
  204. 1062 try:
  205. 1063 ==> yielded = self.gen.throw(*exc_info)
  206. 1064 finally:
  207. 1065 # Break up a reference to itself
  208. 1066 # for faster GC on CPython.
  209. 1067 exc_info = None
  210. 1068 else:
  211. 1069 yielded = self.gen.send(value)
  212. Variables:
  213. self = <tornado.gen.Runner object at 0x7f175248a810>
  214. value = '\r\n\r\n% Authentication failed\r\n\r\nUsername: '
  215. yielded = None
  216. future = None
  217. orig_stack_contexts = ((), None)
  218. exc_info = None
  219. ------------------------------------------------------------------------
  220. File: local/lib/python2.7/site-packages/tornado/concurrent.py (Line: 238)
  221. Function: result
  222. 231 before the `Future` is done, so the ``timeout`` is never used.
  223. 232 """
  224. 233 self._clear_tb_log()
  225. 234 if self._result is not None:
  226. 235 return self._result
  227. 236 if self._exc_info is not None:
  228. 237 try:
  229. 238 ==> raise_exc_info(self._exc_info)
  230. 239 finally:
  231. 240 self = None
  232. 241 self._check_done()
  233. 242 return self._result
  234. 243
  235. 244 def exception(self, timeout=None):
  236. Variables:
  237. self = None
  238. timeout = None
  239. ------------------------------------------------------------------------
  240. File: local/lib/python2.7/site-packages/tornado/gen.py (Line: 1055)
  241. Function: run
  242. 1048 return
  243. 1049 self.future = None
  244. 1050 try:
  245. 1051 orig_stack_contexts = stack_context._state.contexts
  246. 1052 exc_info = None
  247. 1053
  248. 1054 try:
  249. 1055 ==> value = future.result()
  250. 1056 except Exception:
  251. 1057 self.had_exception = True
  252. 1058 exc_info = sys.exc_info()
  253. 1059 future = None
  254. 1060
  255. 1061 if exc_info is not None:
  256. Variables:
  257. exc_info = None
  258. self = <tornado.gen.Runner object at 0x7f175248a690>
  259. future = None
  260. orig_stack_contexts = ((), None)
  261. ------------------------------------------------------------------------
  262. File: core/script/cli/base.py (Line: 204)
  263. Function: submit
  264. 197 self.error = CLIConnectionRefused("Connection refused")
  265. 198 raise tornado.gen.Return(None)
  266. 199 self.logger.debug("Connected")
  267. 200 yield self.iostream.startup()
  268. 201 # Perform all necessary login procedures
  269. 202 if not self.is_started:
  270. 203 yield self.on_start()
  271. 204 ==> self.motd = yield self.read_until_prompt()
  272. 205 self.script.set_motd(self.motd)
  273. 206 self.is_started = True
  274. 207 # Send command
  275. 208 # @todo: encode to object's encoding
  276. 209 if self.profile.batch_send_multiline or self.profile.command_submit not in self.command:
  277. 210 yield self.send(self.command)
  278. Variables:
  279. self = <noc.core.script.cli.telnet.TelnetCLI object at 0x7f175247d3d0>
  280. parser =
  281. <bound method TelnetCLI.read_until_prompt of <noc.core.script.cli.telnet.TelnetCLI object at 0x7f175247d3d0>>
  282. address = (u'xxx.xxx.50.5', 23)
  283. ------------------------------------------------------------------------
  284. File: local/lib/python2.7/site-packages/tornado/gen.py (Line: 1063)
  285. Function: run
  286. 1056 except Exception:
  287. 1057 self.had_exception = True
  288. 1058 exc_info = sys.exc_info()
  289. 1059 future = None
  290. 1060
  291. 1061 if exc_info is not None:
  292. 1062 try:
  293. 1063 ==> yielded = self.gen.throw(*exc_info)
  294. 1064 finally:
  295. 1065 # Break up a reference to itself
  296. 1066 # for faster GC on CPython.
  297. 1067 exc_info = None
  298. 1068 else:
  299. 1069 yielded = self.gen.send(value)
  300. Variables:
  301. exc_info = None
  302. self = <tornado.gen.Runner object at 0x7f175248a690>
  303. future = None
  304. orig_stack_contexts = ((), None)
  305. ------------------------------------------------------------------------
  306. File: local/lib/python2.7/site-packages/tornado/concurrent.py (Line: 238)
  307. Function: result
  308. 231 before the `Future` is done, so the ``timeout`` is never used.
  309. 232 """
  310. 233 self._clear_tb_log()
  311. 234 if self._result is not None:
  312. 235 return self._result
  313. 236 if self._exc_info is not None:
  314. 237 try:
  315. 238 ==> raise_exc_info(self._exc_info)
  316. 239 finally:
  317. 240 self = None
  318. 241 self._check_done()
  319. 242 return self._result
  320. 243
  321. 244 def exception(self, timeout=None):
  322. Variables:
  323. self = None
  324. timeout = None
  325. ------------------------------------------------------------------------
  326. File: local/lib/python2.7/site-packages/tornado/ioloop.py (Line: 458)
  327. Function: run_sync
  328. 451 if timeout is not None:
  329. 452 timeout_handle = self.add_timeout(self.time() + timeout, self.stop)
  330. 453 self.start()
  331. 454 if timeout is not None:
  332. 455 self.remove_timeout(timeout_handle)
  333. 456 if not future_cell[0].done():
  334. 457 raise TimeoutError('Operation timed out after %s seconds' % timeout)
  335. 458 ==> return future_cell[0].result()
  336. 459
  337. 460 def time(self):
  338. 461 """Returns the current time according to the `IOLoop`'s clock.
  339. 462
  340. 463 The return value is a floating-point number relative to an
  341. 464 unspecified time in the past.
  342. Variables:
  343. self = <tornado.platform.epoll.EPollIOLoop object at 0x7f175247df90>
  344. run = <function run at 0x7f1752490d70>
  345. func = <functools.partial object at 0x7f1752475f70>
  346. timeout = None
  347. future_cell = [<tornado.concurrent.Future object at 0x7f175248a5d0>]
  348. ------------------------------------------------------------------------
  349. File: core/script/cli/base.py (Line: 175)
  350. Function: execute
  351. 168 self.parse_object_stream,
  352. 169 obj_parser, cmd_next, cmd_stop
  353. 170 )
  354. 171 else:
  355. 172 parser = self.read_until_prompt
  356. 173 with Span(server=self.script.credentials.get("address"),
  357. 174 service=self.name, in_label=cmd) as s:
  358. 175 ==> self.ioloop.run_sync(functools.partial(self.submit, parser))
  359. 176 if self.error:
  360. 177 if s:
  361. 178 s.error_text = str(self.error)
  362. 179 raise self.error
  363. 180 else:
  364. 181 return self.result
  365. Variables:
  366. cmd = 'terminal length 0\n'
  367. obj_parser = None
  368. self = <noc.core.script.cli.telnet.TelnetCLI object at 0x7f175247d3d0>
  369. parser =
  370. <bound method TelnetCLI.read_until_prompt of <noc.core.script.cli.telnet.TelnetCLI object at 0x7f175247d3d0>>
  371. cmd_stop = None
  372. cmd_next = None
  373. s = <noc.core.span.Span object at 0x7f175248a290>
  374. ignore_errors = True
  375. ------------------------------------------------------------------------
  376. File: core/script/base.py (Line: 768)
  377. Function: cli
  378. 761 if r is not None:
  379. 762 self.logger.debug("Use cached result")
  380. 763 return format_result(r)
  381. 764 command_submit = command_submit or self.profile.command_submit
  382. 765 stream = self.get_cli_stream()
  383. 766 r = stream.execute(cmd + command_submit, obj_parser=obj_parser,
  384. 767 cmd_next=cmd_next, cmd_stop=cmd_stop,
  385. 768 ==> ignore_errors=ignore_errors)
  386. 769 if isinstance(r, six.string_types):
  387. 770 if self.beef:
  388. 771 self.beef.set_cli(cmd, r)
  389. 772 # Check for syntax errors
  390. 773 if not ignore_errors:
  391. 774 # Then check for operation error
  392. Variables:
  393. command_submit = '\n'
  394. format_result = <function format_result at 0x7f1752490c08>
  395. nowait = False
  396. stream = <noc.core.script.cli.telnet.TelnetCLI object at 0x7f175247d3d0>
  397. cached = False
  398. obj_parser = None
  399. bulk_lines = None
  400. cmd = 'terminal length 0'
  401. cmd_stop = None
  402. cmd_next = None
  403. file = None
  404. list_re = None
  405. ignore_errors = True
  406. self = <noc.sa.profiles.Cisco.IOS.get_config.Script object at 0x7f1752459d90>
  407. ------------------------------------------------------------------------
  408. File: core/script/base.py (Line: 830)
  409. Function: get_cli_stream
  410. 823 # @todo: Move to CLI
  411. 824 if self.to_disable_pager:
  412. 825 self.logger.debug("Disable paging")
  413. 826 self.to_disable_pager = False
  414. 827 if isinstance(self.profile.command_disable_pager, six.string_types):
  415. 828 self.cli(
  416. 829 self.profile.command_disable_pager,
  417. 830 ==> ignore_errors=True
  418. 831 )
  419. 832 elif isinstance(self.profile.command_disable_pager, list):
  420. 833 for cmd in self.profile.command_disable_pager:
  421. 834 self.cli(cmd, ignore_errors=True)
  422. 835 else:
  423. 836 raise UnexpectedResultError
  424. Variables:
  425. self = <noc.sa.profiles.Cisco.IOS.get_config.Script object at 0x7f1752459d90>
  426. protocol = 'telnet'
  427. ------------------------------------------------------------------------
  428. File: core/script/base.py (Line: 765)
  429. Function: cli
  430. 758 return format_result(f.read())
  431. 759 if cached:
  432. 760 r = self.root.cli_cache.get(cmd)
  433. 761 if r is not None:
  434. 762 self.logger.debug("Use cached result")
  435. 763 return format_result(r)
  436. 764 command_submit = command_submit or self.profile.command_submit
  437. 765 ==> stream = self.get_cli_stream()
  438. 766 r = stream.execute(cmd + command_submit, obj_parser=obj_parser,
  439. 767 cmd_next=cmd_next, cmd_stop=cmd_stop,
  440. 768 ignore_errors=ignore_errors)
  441. 769 if isinstance(r, six.string_types):
  442. 770 if self.beef:
  443. 771 self.beef.set_cli(cmd, r)
  444. Variables:
  445. command_submit = '\n'
  446. format_result = <function format_result at 0x7f1752afeb18>
  447. nowait = False
  448. cached = False
  449. obj_parser = None
  450. bulk_lines = None
  451. cmd = 'show running-config'
  452. cmd_stop = None
  453. cmd_next = None
  454. file = None
  455. list_re = None
  456. ignore_errors = False
  457. self = <noc.sa.profiles.Cisco.IOS.get_config.Script object at 0x7f1752459d90>
  458. ------------------------------------------------------------------------
  459. File: sa/profiles/Cisco/IOS/get_config.py (Line: 19)
  460. Function: execute
  461. 12
  462. 13
  463. 14 class Script(BaseScript):
  464. 15 name = "Cisco.IOS.get_config"
  465. 16 interface = IGetConfig
  466. 17
  467. 18 def execute(self):
  468. 19 ==> config = self.cli("show running-config")
  469. 20 config = self.strip_first_lines(config, 3)
  470. 21 return self.cleaned_config(config)
  471. Variables:
  472. self = <noc.sa.profiles.Cisco.IOS.get_config.Script object at 0x7f1752459d90>
  473. ------------------------------------------------------------------------
  474. File: core/script/base.py (Line: 247)
  475. Function: run
  476. 240 self.logger.info("Using cached result")
  477. 241 cache_hit = True
  478. 242 except KeyError:
  479. 243 pass
  480. 244 # Execute script
  481. 245 if not cache_hit:
  482. 246 try:
  483. 247 ==> result = self.execute(**self.args)
  484. 248 if self.cache and self.parent and result:
  485. 249 self.logger.info("Caching result")
  486. 250 self.set_cache(self.name, self.args, result)
  487. 251 finally:
  488. 252 if not self.parent:
  489. 253 # Close SNMP socket when necessary
  490. Variables:
  491. cache_hit = False
  492. self = <noc.sa.profiles.Cisco.IOS.get_config.Script object at 0x7f1752459d90>
  493. ------------------------------------------------------------------------
  494. File: commands/script.py (Line: 118)
  495. Function: handle
  496. 111 capabilities=caps,
  497. 112 args=args,
  498. 113 version=version,
  499. 114 timeout=3600,
  500. 115 name=script,
  501. 116 collect_beef=bool(beef)
  502. 117 )
  503. 118 ==> result = scr.run()
  504. 119 if pretty:
  505. 120 pprint.pprint(result)
  506. 121 elif yaml:
  507. 122 import yaml
  508. 123 import sys
  509. 124 yaml.dump(result, sys.stdout)
  510. Variables:
  511. obj = <ManagedObject: PSP-ASUTP-2>
  512. beef = None
  513. service = <__main__.ServiceStub object at 0x7f17524599d0>
  514. script = u'Cisco.IOS.get_config'
  515. script_class = <class 'noc.sa.profiles.Cisco.IOS.get_config.Script'>
  516. self = <__main__.Command object at 0x7f1767475b50>
  517. args = {}
  518. use_snmp = True
  519. caps = {u'DB | Interfaces': 34}
  520. yaml = False
  521. object_name = ['PSP-ASUTP-2']
  522. version =
  523. {'platform': u'WS-C2960X-24PS-L',
  524. 'vendor': u'Cisco Systems',
  525. 'version': u'15.2(2)E6'}
  526. arguments = []
  527. pretty = True
  528. credentials =
  529. {'access_preference': u'C',
  530. 'address': u'xxx.xxx.50.5',
  531. 'cli_protocol': 'telnet',
  532. 'password': u'xxxxx',
  533. 'path': None,
  534. 'raise_privileges': True,
  535. 'snmp_ro': u'xxxxx',
  536. 'snmp_version': 'v2c',
  537. 'super_password': None,
  538. 'user': u'izya'}
  539. access_preference = None
  540. options = {}
  541. scr = <noc.sa.profiles.Cisco.IOS.get_config.Script object at 0x7f1752459d90>
  542. ------------------------------------------------------------------------
  543. File: core/management/base.py (Line: 75)
  544. Function: run_from_argv
  545. 68 enable_profiling = cmd_options.pop("enable_profiling", False)
  546. 69 show_metrics = cmd_options.pop("show_metrics", False)
  547. 70 if enable_profiling:
  548. 71 # Start profiler
  549. 72 import yappi
  550. 73 yappi.start()
  551. 74 try:
  552. 75 ==> return self.handle(*args, **cmd_options) or 0
  553. 76 except CommandError as e:
  554. 77 self.print(str(e))
  555. 78 return 1
  556. 79 except KeyboardInterrupt:
  557. 80 self.print("Ctrl+C")
  558. 81 return 3
  559. Variables:
  560. parser =
  561. ArgumentParser(prog='script.py', usage=None, description=None, version=None, formatter_class=<class 'argparse.HelpFormatter'>, conflict_handler='error', add_help=True)
  562. loglevel = 'debug'
  563. enable_profiling = False
  564. args = ()
  565. cmd_options =
  566. {'access_preference': None,
  567. 'arguments': [],
  568. 'beef': None,
  569. 'object_name': ['PSP-ASUTP-2'],
  570. 'pretty': True,
  571. 'script': ['get_config'],
  572. 'use_snmp': True,
  573. 'yaml': False}
  574. argv = ['--debug', '--pretty', 'get_config', 'PSP-ASUTP-2']
  575. self = <__main__.Command object at 0x7f1767475b50>
  576. show_metrics = False
  577. options =
  578. Namespace(access_preference=None, arguments=[], beef=None, object_name=['PSP-ASUTP-2'], pretty=True, script=['get_config'], use_snmp=True, yaml=False)
  579. ------------------------------------------------------------------------
  580. END OF TRACEBACK
Advertisement
Add Comment
Please, Sign In to add comment