Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 2018-03-16 01:57:11,710 [noc.core.dcs.base] Resolve near service postgres
- 2018-03-16 01:57:11,711 [noc.core.http.client] HTTP GET http://consul:8500/v1/catalog/service/postgres?near=_agent
- 2018-03-16 01:57:11,713 [noc.core.http.client] HTTP Response 200
- 2018-03-16 01:57:11,713 [noc.core.dcs.base] Resolved near service postgres to ['10.220.21.122:5432']
- 2018-03-16 01:57:12,653 [noc.core.dcs.base] Running resolver for service mongo
- 2018-03-16 01:57:12,654 [noc.core.dcs.base] [mongo] Starting resolver
- 2018-03-16 01:57:12,654 [noc.core.http.client] HTTP GET http://consul:8500/v1/health/service/mongo?passing=1
- 2018-03-16 01:57:12,655 [noc.core.http.client] HTTP Response 200
- 2018-03-16 01:57:12,656 [noc.core.dcs.base] [mongo] Set active services to: mongo: 10.220.21.122:27017
- 2018-03-16 01:57:12,656 [noc.core.http.client] HTTP GET http://consul:8500/v1/health/service/mongo?index=38752&passing=1
- 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': '********'}
- 2018-03-16 01:57:12,715 [noc.core.cache.base] Using cache backend: noc.core.cache.mongo.MongoCache
- 2018-03-16 01:57:12,772 [noc.main.models.doccategory] Registering Capability
- 2018-03-16 01:57:12,772 [noc.main.models.doccategory] Registering MetricType
- 2018-03-16 01:57:12,806 [noc.main.models.doccategory] Registering ConnectionType
- 2018-03-16 01:57:12,809 [noc.main.models.doccategory] Registering ObjectModel
- 2018-03-16 01:57:12,818 [noc.main.models.textindex] Adding FTS index for sa.managedobject
- 2018-03-16 01:57:12,834 [noc.main.models.textindex] Adding FTS index for ip.vrf
- 2018-03-16 01:57:12,837 [noc.main.models.textindex] Adding FTS index for vc.vc
- 2018-03-16 01:57:12,840 [noc.main.models.textindex] Adding FTS index for ip.prefix
- 2018-03-16 01:57:12,845 [noc.main.models.textindex] Adding FTS index for ip.address
- 2018-03-16 01:57:12,894 [noc.core.script.loader] Loading script Cisco.IOS.get_config
- 2018-03-16 01:57:12,903 [noc.core.profile.loader] Loading profile Cisco.IOS
- 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'}
- 2018-03-16 01:57:12,904 [script] [Cisco.IOS.get_config|xxx.xxx.50.5] Running. Input arguments: {}, timeout 3600
- 2018-03-16 01:57:12,904 [script] [Cisco.IOS.get_config|xxx.xxx.50.5] Open telnet CLI
- 2018-03-16 01:57:12,906 [script] [Cisco.IOS.get_config|xxx.xxx.50.5] [telnet] Setup session
- 2018-03-16 01:57:12,906 [script] [Cisco.IOS.get_config|xxx.xxx.50.5] Disable paging
- 2018-03-16 01:57:12,906 [script] [Cisco.IOS.get_config|xxx.xxx.50.5] [telnet] Creating IOLoop
- 2018-03-16 01:57:12,906 [script] [Cisco.IOS.get_config|xxx.xxx.50.5] [telnet] Connecting (u'xxx.xxx.50.5', 23)
- 2018-03-16 01:57:12,947 [script] [Cisco.IOS.get_config|xxx.xxx.50.5] [telnet] Connected
- 2018-03-16 01:57:12,948 [script] [Cisco.IOS.get_config|xxx.xxx.50.5] [telnet] State: <START>
- 2018-03-16 01:57:12,948 [script] [Cisco.IOS.get_config|xxx.xxx.50.5] [telnet] Setting timeout: 60s
- 2018-03-16 01:57:12,984 [script] [Cisco.IOS.get_config|xxx.xxx.50.5] [telnet] Received WILL ECHO
- 2018-03-16 01:57:12,984 [script] [Cisco.IOS.get_config|xxx.xxx.50.5] [telnet] Send DO ECHO
- 2018-03-16 01:57:12,985 [script] [Cisco.IOS.get_config|xxx.xxx.50.5] [telnet] Received WILL SGA
- 2018-03-16 01:57:12,985 [script] [Cisco.IOS.get_config|xxx.xxx.50.5] [telnet] Send DO SGA
- 2018-03-16 01:57:12,985 [script] [Cisco.IOS.get_config|xxx.xxx.50.5] [telnet] Received DO TTYPE
- 2018-03-16 01:57:12,985 [script] [Cisco.IOS.get_config|xxx.xxx.50.5] [telnet] Send WILL TTYPE
- 2018-03-16 01:57:12,985 [script] [Cisco.IOS.get_config|xxx.xxx.50.5] [telnet] Received DO NAWS
- 2018-03-16 01:57:12,985 [script] [Cisco.IOS.get_config|xxx.xxx.50.5] [telnet] Send WILL NAWS
- 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
- 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: '
- 2018-03-16 01:57:12,986 [script] [Cisco.IOS.get_config|xxx.xxx.50.5] [telnet] Match: ([Uu]ser ?[Nn]ame|[Ll]ogin): ?
- 2018-03-16 01:57:12,986 [script] [Cisco.IOS.get_config|xxx.xxx.50.5] [telnet] State: <USERNAME>
- 2018-03-16 01:57:12,986 [script] [Cisco.IOS.get_config|xxx.xxx.50.5] [telnet] Send: 'xxxx\n'
- 2018-03-16 01:57:12,987 [script] [Cisco.IOS.get_config|xxx.xxx.50.5] [telnet] Setting timeout: 30s
- 2018-03-16 01:57:13,028 [script] [Cisco.IOS.get_config|xxx.xxx.50.5] [telnet] Received IAC SB 1801 SE
- 2018-03-16 01:57:13,028 [script] [Cisco.IOS.get_config|xxx.xxx.50.5] [telnet] Received: '\xf0'
- 2018-03-16 01:57:13,033 [script] [Cisco.IOS.get_config|xxx.xxx.50.5] [telnet] Received: 'x'
- 2018-03-16 01:57:13,035 [script] [Cisco.IOS.get_config|xxx.xxx.50.5] [telnet] Received: 'xxx'
- 2018-03-16 01:57:13,036 [script] [Cisco.IOS.get_config|xxx.xxx.50.5] [telnet] Received: '\r\nPassword: '
- 2018-03-16 01:57:13,036 [script] [Cisco.IOS.get_config|xxx.xxx.50.5] [telnet] Match: [Pp]ass[Ww]ord: ?
- 2018-03-16 01:57:13,036 [script] [Cisco.IOS.get_config|xxx.xxx.50.5] [telnet] State: <PASSWORD>
- 2018-03-16 01:57:13,036 [script] [Cisco.IOS.get_config|xxx.xxx.50.5] [telnet] Send: 'xxxxx\n'
- 2018-03-16 01:57:13,037 [script] [Cisco.IOS.get_config|xxx.xxx.50.5] [telnet] Setting timeout: 30s
- 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: '
- 2018-03-16 01:57:17,089 [script] [Cisco.IOS.get_config|xxx.xxx.50.5] [telnet] Match: ([Uu]ser ?[Nn]ame|[Ll]ogin): ?
- 2018-03-16 01:57:17,089 [script] [Cisco.IOS.get_config|xxx.xxx.50.5] [telnet] State: <FAILURE>
- 2018-03-16 01:57:17,090 [script] [Cisco.IOS.get_config|xxx.xxx.50.5] [telnet] Closing IOLoop
- 2018-03-16 01:57:17,261 [noc.core.debug] UNHANDLED EXCEPTION (2018-03-16 01:57:17.100156)
- PROCESS: ./commands/script.py
- VERSION: 15.05.1+microservices.9141.4c85fb66
- BRANCH: microservices CHANGESET: 4c85fb66
- ERROR FINGERPRINT: 08f7eb9a-f643-5511-a02a-ed358f242b03
- WORKING DIRECTORY: /opt/noc
- EXCEPTION: <class 'noc.core.script.cli.error.CLIAuthFailed'>
- % Authentication failed
- START OF TRACEBACK
- ------------------------------------------------------------------------
- File: core/script/cli/base.py (Line: 515)
- Function: on_failure
- 508 self.patterns["prompt"] = self.patterns["unprivileged_prompt"]
- 509 return self.on_prompt(data, match)
- 510
- 511 @tornado.gen.coroutine
- 512 def on_failure(self, data, match, error_cls=None):
- 513 self.logger.debug("State: <FAILURE>")
- 514 error_cls = error_cls or CLIError
- 515 ==> raise error_cls(self.buffer or data or None)
- 516
- 517 @tornado.gen.coroutine
- 518 def on_prompt(self, data, match):
- 519 self.logger.debug("State: <PROMT>")
- 520 if not self.is_started:
- 521 self.resolve_pattern_prompt(match)
- Variables:
- self = <noc.core.script.cli.telnet.TelnetCLI object at 0x7f175247d3d0>
- data = '\n\n% Authentication failed\n\n'
- match = <_sre.SRE_Match object at 0x7f17664aa990>
- error_cls = <class 'noc.core.script.cli.error.CLIAuthFailed'>
- ------------------------------------------------------------------------
- File: local/lib/python2.7/site-packages/tornado/gen.py (Line: 292)
- Function: wrapper
- 285
- 286 if replace_callback and 'callback' in kwargs:
- 287 callback = kwargs.pop('callback')
- 288 IOLoop.current().add_future(
- 289 future, lambda future: callback(future.result()))
- 290
- 291 try:
- 292 ==> result = func(*args, **kwargs)
- 293 except (Return, StopIteration) as e:
- 294 result = _value_from_stopiteration(e)
- 295 except Exception:
- 296 future.set_exc_info(sys.exc_info())
- 297 return future
- 298 else:
- Variables:
- replace_callback = True
- future = <tornado.concurrent.Future object at 0x7f175248a8d0>
- func = <function on_failure at 0x7f175248dcf8>
- args =
- (<noc.core.script.cli.telnet.TelnetCLI object at 0x7f175247d3d0>,
- '\n\n% Authentication failed\n\n',
- <_sre.SRE_Match object at 0x7f17664aa990>,
- <class 'noc.core.script.cli.error.CLIAuthFailed'>)
- kwargs = {}
- ------------------------------------------------------------------------
- File: local/lib/python2.7/site-packages/tornado/concurrent.py (Line: 238)
- Function: result
- 231 before the `Future` is done, so the ``timeout`` is never used.
- 232 """
- 233 self._clear_tb_log()
- 234 if self._result is not None:
- 235 return self._result
- 236 if self._exc_info is not None:
- 237 try:
- 238 ==> raise_exc_info(self._exc_info)
- 239 finally:
- 240 self = None
- 241 self._check_done()
- 242 return self._result
- 243
- 244 def exception(self, timeout=None):
- Variables:
- self = None
- timeout = None
- ------------------------------------------------------------------------
- File: local/lib/python2.7/site-packages/tornado/gen.py (Line: 1055)
- Function: run
- 1048 return
- 1049 self.future = None
- 1050 try:
- 1051 orig_stack_contexts = stack_context._state.contexts
- 1052 exc_info = None
- 1053
- 1054 try:
- 1055 ==> value = future.result()
- 1056 except Exception:
- 1057 self.had_exception = True
- 1058 exc_info = sys.exc_info()
- 1059 future = None
- 1060
- 1061 if exc_info is not None:
- Variables:
- self = <tornado.gen.Runner object at 0x7f175248a810>
- value = '\r\n\r\n% Authentication failed\r\n\r\nUsername: '
- yielded = None
- future = None
- orig_stack_contexts = ((), None)
- exc_info = None
- ------------------------------------------------------------------------
- File: core/script/cli/base.py (Line: 319)
- Function: read_until_prompt
- 312 for rx, handler in six.iteritems(self.pattern_table):
- 313 match = rx.search(self.buffer, offset)
- 314 if match:
- 315 self.logger.debug("Match: %s", rx.pattern)
- 316 matched = self.buffer[:match.start()]
- 317 self.buffer = self.buffer[match.end():]
- 318 if isinstance(handler, tuple):
- 319 ==> r = yield handler[0](matched, match, *handler[1:])
- 320 else:
- 321 r = yield handler(matched, match)
- 322 if r is not None:
- 323 raise tornado.gen.Return(r)
- 324 else:
- 325 break # This state is processed
- Variables:
- f = <tornado.concurrent.Future object at 0x7f175248a950>
- handler =
- (<bound method TelnetCLI.on_failure of <noc.core.script.cli.telnet.TelnetCLI object at 0x7f175247d3d0>>,
- <class 'noc.core.script.cli.error.CLIAuthFailed'>)
- self = <noc.core.script.cli.telnet.TelnetCLI object at 0x7f175247d3d0>
- rx = <_sre.SRE_Pattern object at 0x7f1753fd3ae8>
- connect_retries = 3
- r = '\r\n\r\n% Authentication failed\r\n\r\nUsername: '
- offset = 0
- match = <_sre.SRE_Match object at 0x7f17664aa990>
- matched = '\n\n% Authentication failed\n\n'
- ------------------------------------------------------------------------
- File: local/lib/python2.7/site-packages/tornado/gen.py (Line: 1063)
- Function: run
- 1056 except Exception:
- 1057 self.had_exception = True
- 1058 exc_info = sys.exc_info()
- 1059 future = None
- 1060
- 1061 if exc_info is not None:
- 1062 try:
- 1063 ==> yielded = self.gen.throw(*exc_info)
- 1064 finally:
- 1065 # Break up a reference to itself
- 1066 # for faster GC on CPython.
- 1067 exc_info = None
- 1068 else:
- 1069 yielded = self.gen.send(value)
- Variables:
- self = <tornado.gen.Runner object at 0x7f175248a810>
- value = '\r\n\r\n% Authentication failed\r\n\r\nUsername: '
- yielded = None
- future = None
- orig_stack_contexts = ((), None)
- exc_info = None
- ------------------------------------------------------------------------
- File: local/lib/python2.7/site-packages/tornado/concurrent.py (Line: 238)
- Function: result
- 231 before the `Future` is done, so the ``timeout`` is never used.
- 232 """
- 233 self._clear_tb_log()
- 234 if self._result is not None:
- 235 return self._result
- 236 if self._exc_info is not None:
- 237 try:
- 238 ==> raise_exc_info(self._exc_info)
- 239 finally:
- 240 self = None
- 241 self._check_done()
- 242 return self._result
- 243
- 244 def exception(self, timeout=None):
- Variables:
- self = None
- timeout = None
- ------------------------------------------------------------------------
- File: local/lib/python2.7/site-packages/tornado/gen.py (Line: 1055)
- Function: run
- 1048 return
- 1049 self.future = None
- 1050 try:
- 1051 orig_stack_contexts = stack_context._state.contexts
- 1052 exc_info = None
- 1053
- 1054 try:
- 1055 ==> value = future.result()
- 1056 except Exception:
- 1057 self.had_exception = True
- 1058 exc_info = sys.exc_info()
- 1059 future = None
- 1060
- 1061 if exc_info is not None:
- Variables:
- exc_info = None
- self = <tornado.gen.Runner object at 0x7f175248a690>
- future = None
- orig_stack_contexts = ((), None)
- ------------------------------------------------------------------------
- File: core/script/cli/base.py (Line: 204)
- Function: submit
- 197 self.error = CLIConnectionRefused("Connection refused")
- 198 raise tornado.gen.Return(None)
- 199 self.logger.debug("Connected")
- 200 yield self.iostream.startup()
- 201 # Perform all necessary login procedures
- 202 if not self.is_started:
- 203 yield self.on_start()
- 204 ==> self.motd = yield self.read_until_prompt()
- 205 self.script.set_motd(self.motd)
- 206 self.is_started = True
- 207 # Send command
- 208 # @todo: encode to object's encoding
- 209 if self.profile.batch_send_multiline or self.profile.command_submit not in self.command:
- 210 yield self.send(self.command)
- Variables:
- self = <noc.core.script.cli.telnet.TelnetCLI object at 0x7f175247d3d0>
- parser =
- <bound method TelnetCLI.read_until_prompt of <noc.core.script.cli.telnet.TelnetCLI object at 0x7f175247d3d0>>
- address = (u'xxx.xxx.50.5', 23)
- ------------------------------------------------------------------------
- File: local/lib/python2.7/site-packages/tornado/gen.py (Line: 1063)
- Function: run
- 1056 except Exception:
- 1057 self.had_exception = True
- 1058 exc_info = sys.exc_info()
- 1059 future = None
- 1060
- 1061 if exc_info is not None:
- 1062 try:
- 1063 ==> yielded = self.gen.throw(*exc_info)
- 1064 finally:
- 1065 # Break up a reference to itself
- 1066 # for faster GC on CPython.
- 1067 exc_info = None
- 1068 else:
- 1069 yielded = self.gen.send(value)
- Variables:
- exc_info = None
- self = <tornado.gen.Runner object at 0x7f175248a690>
- future = None
- orig_stack_contexts = ((), None)
- ------------------------------------------------------------------------
- File: local/lib/python2.7/site-packages/tornado/concurrent.py (Line: 238)
- Function: result
- 231 before the `Future` is done, so the ``timeout`` is never used.
- 232 """
- 233 self._clear_tb_log()
- 234 if self._result is not None:
- 235 return self._result
- 236 if self._exc_info is not None:
- 237 try:
- 238 ==> raise_exc_info(self._exc_info)
- 239 finally:
- 240 self = None
- 241 self._check_done()
- 242 return self._result
- 243
- 244 def exception(self, timeout=None):
- Variables:
- self = None
- timeout = None
- ------------------------------------------------------------------------
- File: local/lib/python2.7/site-packages/tornado/ioloop.py (Line: 458)
- Function: run_sync
- 451 if timeout is not None:
- 452 timeout_handle = self.add_timeout(self.time() + timeout, self.stop)
- 453 self.start()
- 454 if timeout is not None:
- 455 self.remove_timeout(timeout_handle)
- 456 if not future_cell[0].done():
- 457 raise TimeoutError('Operation timed out after %s seconds' % timeout)
- 458 ==> return future_cell[0].result()
- 459
- 460 def time(self):
- 461 """Returns the current time according to the `IOLoop`'s clock.
- 462
- 463 The return value is a floating-point number relative to an
- 464 unspecified time in the past.
- Variables:
- self = <tornado.platform.epoll.EPollIOLoop object at 0x7f175247df90>
- run = <function run at 0x7f1752490d70>
- func = <functools.partial object at 0x7f1752475f70>
- timeout = None
- future_cell = [<tornado.concurrent.Future object at 0x7f175248a5d0>]
- ------------------------------------------------------------------------
- File: core/script/cli/base.py (Line: 175)
- Function: execute
- 168 self.parse_object_stream,
- 169 obj_parser, cmd_next, cmd_stop
- 170 )
- 171 else:
- 172 parser = self.read_until_prompt
- 173 with Span(server=self.script.credentials.get("address"),
- 174 service=self.name, in_label=cmd) as s:
- 175 ==> self.ioloop.run_sync(functools.partial(self.submit, parser))
- 176 if self.error:
- 177 if s:
- 178 s.error_text = str(self.error)
- 179 raise self.error
- 180 else:
- 181 return self.result
- Variables:
- cmd = 'terminal length 0\n'
- obj_parser = None
- self = <noc.core.script.cli.telnet.TelnetCLI object at 0x7f175247d3d0>
- parser =
- <bound method TelnetCLI.read_until_prompt of <noc.core.script.cli.telnet.TelnetCLI object at 0x7f175247d3d0>>
- cmd_stop = None
- cmd_next = None
- s = <noc.core.span.Span object at 0x7f175248a290>
- ignore_errors = True
- ------------------------------------------------------------------------
- File: core/script/base.py (Line: 768)
- Function: cli
- 761 if r is not None:
- 762 self.logger.debug("Use cached result")
- 763 return format_result(r)
- 764 command_submit = command_submit or self.profile.command_submit
- 765 stream = self.get_cli_stream()
- 766 r = stream.execute(cmd + command_submit, obj_parser=obj_parser,
- 767 cmd_next=cmd_next, cmd_stop=cmd_stop,
- 768 ==> ignore_errors=ignore_errors)
- 769 if isinstance(r, six.string_types):
- 770 if self.beef:
- 771 self.beef.set_cli(cmd, r)
- 772 # Check for syntax errors
- 773 if not ignore_errors:
- 774 # Then check for operation error
- Variables:
- command_submit = '\n'
- format_result = <function format_result at 0x7f1752490c08>
- nowait = False
- stream = <noc.core.script.cli.telnet.TelnetCLI object at 0x7f175247d3d0>
- cached = False
- obj_parser = None
- bulk_lines = None
- cmd = 'terminal length 0'
- cmd_stop = None
- cmd_next = None
- file = None
- list_re = None
- ignore_errors = True
- self = <noc.sa.profiles.Cisco.IOS.get_config.Script object at 0x7f1752459d90>
- ------------------------------------------------------------------------
- File: core/script/base.py (Line: 830)
- Function: get_cli_stream
- 823 # @todo: Move to CLI
- 824 if self.to_disable_pager:
- 825 self.logger.debug("Disable paging")
- 826 self.to_disable_pager = False
- 827 if isinstance(self.profile.command_disable_pager, six.string_types):
- 828 self.cli(
- 829 self.profile.command_disable_pager,
- 830 ==> ignore_errors=True
- 831 )
- 832 elif isinstance(self.profile.command_disable_pager, list):
- 833 for cmd in self.profile.command_disable_pager:
- 834 self.cli(cmd, ignore_errors=True)
- 835 else:
- 836 raise UnexpectedResultError
- Variables:
- self = <noc.sa.profiles.Cisco.IOS.get_config.Script object at 0x7f1752459d90>
- protocol = 'telnet'
- ------------------------------------------------------------------------
- File: core/script/base.py (Line: 765)
- Function: cli
- 758 return format_result(f.read())
- 759 if cached:
- 760 r = self.root.cli_cache.get(cmd)
- 761 if r is not None:
- 762 self.logger.debug("Use cached result")
- 763 return format_result(r)
- 764 command_submit = command_submit or self.profile.command_submit
- 765 ==> stream = self.get_cli_stream()
- 766 r = stream.execute(cmd + command_submit, obj_parser=obj_parser,
- 767 cmd_next=cmd_next, cmd_stop=cmd_stop,
- 768 ignore_errors=ignore_errors)
- 769 if isinstance(r, six.string_types):
- 770 if self.beef:
- 771 self.beef.set_cli(cmd, r)
- Variables:
- command_submit = '\n'
- format_result = <function format_result at 0x7f1752afeb18>
- nowait = False
- cached = False
- obj_parser = None
- bulk_lines = None
- cmd = 'show running-config'
- cmd_stop = None
- cmd_next = None
- file = None
- list_re = None
- ignore_errors = False
- self = <noc.sa.profiles.Cisco.IOS.get_config.Script object at 0x7f1752459d90>
- ------------------------------------------------------------------------
- File: sa/profiles/Cisco/IOS/get_config.py (Line: 19)
- Function: execute
- 12
- 13
- 14 class Script(BaseScript):
- 15 name = "Cisco.IOS.get_config"
- 16 interface = IGetConfig
- 17
- 18 def execute(self):
- 19 ==> config = self.cli("show running-config")
- 20 config = self.strip_first_lines(config, 3)
- 21 return self.cleaned_config(config)
- Variables:
- self = <noc.sa.profiles.Cisco.IOS.get_config.Script object at 0x7f1752459d90>
- ------------------------------------------------------------------------
- File: core/script/base.py (Line: 247)
- Function: run
- 240 self.logger.info("Using cached result")
- 241 cache_hit = True
- 242 except KeyError:
- 243 pass
- 244 # Execute script
- 245 if not cache_hit:
- 246 try:
- 247 ==> result = self.execute(**self.args)
- 248 if self.cache and self.parent and result:
- 249 self.logger.info("Caching result")
- 250 self.set_cache(self.name, self.args, result)
- 251 finally:
- 252 if not self.parent:
- 253 # Close SNMP socket when necessary
- Variables:
- cache_hit = False
- self = <noc.sa.profiles.Cisco.IOS.get_config.Script object at 0x7f1752459d90>
- ------------------------------------------------------------------------
- File: commands/script.py (Line: 118)
- Function: handle
- 111 capabilities=caps,
- 112 args=args,
- 113 version=version,
- 114 timeout=3600,
- 115 name=script,
- 116 collect_beef=bool(beef)
- 117 )
- 118 ==> result = scr.run()
- 119 if pretty:
- 120 pprint.pprint(result)
- 121 elif yaml:
- 122 import yaml
- 123 import sys
- 124 yaml.dump(result, sys.stdout)
- Variables:
- obj = <ManagedObject: PSP-ASUTP-2>
- beef = None
- service = <__main__.ServiceStub object at 0x7f17524599d0>
- script = u'Cisco.IOS.get_config'
- script_class = <class 'noc.sa.profiles.Cisco.IOS.get_config.Script'>
- self = <__main__.Command object at 0x7f1767475b50>
- args = {}
- use_snmp = True
- caps = {u'DB | Interfaces': 34}
- yaml = False
- object_name = ['PSP-ASUTP-2']
- version =
- {'platform': u'WS-C2960X-24PS-L',
- 'vendor': u'Cisco Systems',
- 'version': u'15.2(2)E6'}
- arguments = []
- pretty = True
- credentials =
- {'access_preference': u'C',
- 'address': u'xxx.xxx.50.5',
- 'cli_protocol': 'telnet',
- 'password': u'xxxxx',
- 'path': None,
- 'raise_privileges': True,
- 'snmp_ro': u'xxxxx',
- 'snmp_version': 'v2c',
- 'super_password': None,
- 'user': u'izya'}
- access_preference = None
- options = {}
- scr = <noc.sa.profiles.Cisco.IOS.get_config.Script object at 0x7f1752459d90>
- ------------------------------------------------------------------------
- File: core/management/base.py (Line: 75)
- Function: run_from_argv
- 68 enable_profiling = cmd_options.pop("enable_profiling", False)
- 69 show_metrics = cmd_options.pop("show_metrics", False)
- 70 if enable_profiling:
- 71 # Start profiler
- 72 import yappi
- 73 yappi.start()
- 74 try:
- 75 ==> return self.handle(*args, **cmd_options) or 0
- 76 except CommandError as e:
- 77 self.print(str(e))
- 78 return 1
- 79 except KeyboardInterrupt:
- 80 self.print("Ctrl+C")
- 81 return 3
- Variables:
- parser =
- ArgumentParser(prog='script.py', usage=None, description=None, version=None, formatter_class=<class 'argparse.HelpFormatter'>, conflict_handler='error', add_help=True)
- loglevel = 'debug'
- enable_profiling = False
- args = ()
- cmd_options =
- {'access_preference': None,
- 'arguments': [],
- 'beef': None,
- 'object_name': ['PSP-ASUTP-2'],
- 'pretty': True,
- 'script': ['get_config'],
- 'use_snmp': True,
- 'yaml': False}
- argv = ['--debug', '--pretty', 'get_config', 'PSP-ASUTP-2']
- self = <__main__.Command object at 0x7f1767475b50>
- show_metrics = False
- options =
- Namespace(access_preference=None, arguments=[], beef=None, object_name=['PSP-ASUTP-2'], pretty=True, script=['get_config'], use_snmp=True, yaml=False)
- ------------------------------------------------------------------------
- END OF TRACEBACK
Advertisement
Add Comment
Please, Sign In to add comment