Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- root@noc:/opt/noc# ./noc debug-script get_interfaces 10.0.0.94
- 2014-04-25 12:37:29,708 SSH: Using gmpy
- 2014-04-25 12:37:30,232 Using JSON library: cjson
- 2014-04-25 12:37:30,430 Loading PeriodicRegistry
- 2014-04-25 12:37:30,436 Loading DownloaderRegistry
- 2014-04-25 12:37:30,525 Loading ProfileRegistry
- 2014-04-25 12:37:31,390 Loading ScriptRegistry
- 2014-04-25 12:37:31,943 Setting up 'select' polling method
- 2014-04-25 12:37:31,944 Activating 'select' poller
- 2014-04-25 12:37:31,944 Loading private ssh key from 'etc/ssh/id_rsa'
- 2014-04-25 12:37:31,945 Loading public ssh key from 'etc/ssh/id_rsa.pub'
- access_profile {
- profile: "MikroTik.RouterOS"
- scheme: SSH
- address: "10.0.0.94"
- user: "admin"
- password: "serv01admin"
- super_password: "serv01admin"
- }
- object_name: "10.0.0.94"
- script: "MikroTik.RouterOS.get_interfaces"
- 2014-04-25 12:37:31,951 Running socket factory (SelectPoller)
- 2014-04-25 12:37:31,951 Running script thread
- 2014-04-25 12:37:31,952 Creating transaction id=2088614493 method=None callback=None
- 2014-04-25 12:37:31,953 [MikroTik.RouterOS.get_interfaces(10.0.0.94, 10.0.0.94)] Running
- 2014-04-25 12:37:31,953 [MikroTik.RouterOS.get_interfaces(10.0.0.94, 10.0.0.94)] Running script: MikroTik.RouterOS.get_interfaces ({})
- 2014-04-25 12:37:31,954 [MikroTik.RouterOS.get_interfaces(10.0.0.94, 10.0.0.94)] cli(/interface print detail)
- 2014-04-25 12:37:31,954 [MikroTik.RouterOS.get_interfaces(10.0.0.94, 10.0.0.94)] Running new provider
- 2014-04-25 12:37:31,955 [SSH: 10.0.0.94] ==> SSH_START
- 2014-04-25 12:37:31,955 [SSH: 10.0.0.94] set_timeout(30)
- 2014-04-25 12:37:31,956 register_socket(<CLISSHSocket(0x4f768d0, 10.0.0.94:22, )>,None)
- 2014-04-25 12:37:32,953 Tick
- 2014-04-25 12:37:32,953 3 TICKS TO EXIT
- 2014-04-25 12:37:32,953 [SSH: 10.0.0.94] Initializing socket
- 2014-04-25 12:37:32,953 [SSH: 10.0.0.94] Connecting 10.0.0.94:22
- 2014-04-25 12:37:32,961 [SSH: 10.0.0.94] Connected
- 2014-04-25 12:37:32,963 [SSH: 10.0.0.94] event(SSH_VERSION)
- 2014-04-25 12:37:32,964 [SSH: 10.0.0.94] ==> SSH_VERSION
- 2014-04-25 12:37:32,964 [SSH: 10.0.0.94] Remote protocol version 2.0, remote software version ROSSSH
- 2014-04-25 12:37:32,965 [SSH: 10.0.0.94] Setting SSH transforms to: in=none none, out=none none
- 2014-04-25 12:37:32,965 [SSH: 10.0.0.94] Setting SSH transform keys
- 2014-04-25 12:37:32,966 [SSH: 10.0.0.94] Sending message type MSG_KEXINIT (20)
- 2014-04-25 12:37:32,966 [SSH: 10.0.0.94] event(SSH_KEY_EXCHANGE)
- 2014-04-25 12:37:32,966 [SSH: 10.0.0.94] ==> SSH_KEY_EXCHANGE
- 2014-04-25 12:37:32,970 [SSH: 10.0.0.94] Receiving message type MSG_KEXINIT (20)
- 2014-04-25 12:37:32,970 [SSH: 10.0.0.94] Receiving server proposals: kex=['diffie-hellman-group-exchange-sha256', 'diffie-hellman-group-exchange-sha1', 'diffie-hellman-group14-sha1', 'diffie-hellman-group1-sha1'] key=['ssh-dss'] enc_cs=['aes192-cbc', 'aes128-cbc', 'aes256-cbc', 'blowfish-cbc', '3des-cbc'] enc_sc=['aes192-cbc', 'aes128-cbc', 'aes256-cbc', 'blowfish-cbc', '3des-cbc'] mac_cs=['hmac-sha1', 'hmac-md5'] mac_sc=['hmac-sha1', 'hmac-md5'] comp_cs=['none'] comp_sc['none']
- 2014-04-25 12:37:32,971 [SSH: 10.0.0.94] Setting SSH transforms to: in=aes256-cbc hmac-sha1, out=aes256-cbc hmac-sha1
- 2014-04-25 12:37:32,972 [SSH: 10.0.0.94] Selecting diffie-hellman-group14-sha1 ssh-dss, in=(aes256-cbc hmac-sha1 none) out=(aes256-cbc hmac-sha1 none)
- 2014-04-25 12:37:32,974 [SSH: 10.0.0.94] Sending message type MSG_KEX_DH_GEX_REQUEST_OLD (30)
- 2014-04-25 12:37:33,977 Tick
- 2014-04-25 12:37:33,977 Resetting wait ticks
- 2014-04-25 12:37:34,200 [SSH: 10.0.0.94] Receiving message type MSG_KEXDH_REPLY (31)
- 2014-04-25 12:37:34,201 [SSH: 10.0.0.94] Server PK fingerprint: d1:b0:af:bb:a5:5a:94:7e:e2:c4:98:2b:5e:09:e6:63
- 2014-04-25 12:37:34,204 [SSH: 10.0.0.94] Setting SSH transform keys
- 2014-04-25 12:37:34,205 [SSH: 10.0.0.94] Sending message type MSG_NEWKEYS (21)
- 2014-04-25 12:37:34,206 [SSH: 10.0.0.94] Receiving message type MSG_NEWKEYS (21)
- 2014-04-25 12:37:34,206 [SSH: 10.0.0.94] Using new keys
- 2014-04-25 12:37:34,207 [SSH: 10.0.0.94] event(SSH_AUTH)
- 2014-04-25 12:37:34,208 [SSH: 10.0.0.94] ==> SSH_AUTH
- 2014-04-25 12:37:34,208 [SSH: 10.0.0.94] Requesting service ssh-userauth
- 2014-04-25 12:37:34,209 [SSH: 10.0.0.94] Sending message type MSG_SERVICE_REQUEST (5)
- 2014-04-25 12:37:34,213 [SSH: 10.0.0.94] Receiving message type MSG_SERVICE_ACCEPT (6)
- 2014-04-25 12:37:34,213 [SSH: 10.0.0.94] Starting service ssh-userauth
- 2014-04-25 12:37:34,214 [SSH: 10.0.0.94] event(SSH_AUTH_PASSWORD)
- 2014-04-25 12:37:34,214 [SSH: 10.0.0.94] ==> SSH_AUTH_PASSWORD
- 2014-04-25 12:37:34,214 [SSH: 10.0.0.94] Authenticating with 'none' method
- 2014-04-25 12:37:34,214 [SSH: 10.0.0.94] Sending message type MSG_USERAUTH_REQUEST (50)
- 2014-04-25 12:37:34,219 [SSH: 10.0.0.94] Receiving message type MSG_USERAUTH_FAILURE (51)
- 2014-04-25 12:37:34,219 [SSH: 10.0.0.94] Authentication method 'none' has been failed. Trying next method (publickey,password)
- 2014-04-25 12:37:34,220 [SSH: 10.0.0.94] Partially authenticated with 'none'. Trying next method
- 2014-04-25 12:37:34,220 [SSH: 10.0.0.94] Authenticating with 'publickey' method
- 2014-04-25 12:37:34,221 [SSH: 10.0.0.94] Sending message type MSG_USERAUTH_REQUEST (50)
- 2014-04-25 12:37:34,224 [SSH: 10.0.0.94] Receiving message type MSG_USERAUTH_FAILURE (51)
- 2014-04-25 12:37:34,225 [SSH: 10.0.0.94] Authentication method 'publickey' has been failed. Trying next method (publickey,password)
- 2014-04-25 12:37:34,226 [SSH: 10.0.0.94] Partially authenticated with 'publickey'. Trying next method
- 2014-04-25 12:37:34,226 [SSH: 10.0.0.94] Authenticating with 'password' method
- 2014-04-25 12:37:34,226 [SSH: 10.0.0.94] Sending message type MSG_USERAUTH_REQUEST (50)
- 2014-04-25 12:37:34,230 [SSH: 10.0.0.94] Receiving message type MSG_USERAUTH_SUCCESS (52)
- 2014-04-25 12:37:34,230 [SSH: 10.0.0.94] event(SSH_CHANNEL)
- 2014-04-25 12:37:34,231 [SSH: 10.0.0.94] ==> SSH_CHANNEL
- 2014-04-25 12:37:34,231 [SSH: 10.0.0.94] Sending message type MSG_CHANNEL_OPEN (90)
- 2014-04-25 12:37:34,243 [SSH: 10.0.0.94] Receiving message type MSG_CHANNEL_OPEN_CONFIRMATION (91)
- 2014-04-25 12:37:34,244 [SSH: 10.0.0.94] Opening channel. local=0 remote=0
- 2014-04-25 12:37:34,244 [SSH: 10.0.0.94] event(SSH_PTY)
- 2014-04-25 12:37:34,245 [SSH: 10.0.0.94] ==> SSH_PTY
- 2014-04-25 12:37:34,245 [SSH: 10.0.0.94] Requesting PTY
- 2014-04-25 12:37:34,245 [SSH: 10.0.0.94] Sending message type MSG_CHANNEL_REQUEST (98)
- 2014-04-25 12:37:34,248 [SSH: 10.0.0.94] Receiving message type MSG_CHANNEL_SUCCESS (99)
- 2014-04-25 12:37:34,249 [SSH: 10.0.0.94] event(SSH_SHELL)
- 2014-04-25 12:37:34,249 [SSH: 10.0.0.94] ==> SSH_SHELL
- 2014-04-25 12:37:34,250 [SSH: 10.0.0.94] Requesting shell
- 2014-04-25 12:37:34,250 [SSH: 10.0.0.94] Sending message type MSG_CHANNEL_REQUEST (98)
- 2014-04-25 12:37:34,270 [SSH: 10.0.0.94] Receiving message type MSG_CHANNEL_SUCCESS (99)
- 2014-04-25 12:37:34,271 [SSH: 10.0.0.94] event(START)
- 2014-04-25 12:37:34,272 [SSH: 10.0.0.94] ==> START
- 2014-04-25 12:37:34,272 [SSH: 10.0.0.94] set_patterns([('([Uu]sername|[Ll]ogin):', 'USERNAME'), ('[Pp]assword:', 'PASSWORD'), ('\\[(?P<prompt>[^\\]@]+@.+?)\\] > ', 'PROMPT'), ('(Please press "Enter" to continue!)|(\\[Q quit\\|D dump\\|down\\])', 'PAGER')])
- 2014-04-25 12:37:34,274 [SSH: 10.0.0.94] on_read: '\r\r\n\r\r\n\r\r\n\r\r\n\r\r\n\r\r\n\r\r\n\r\n\r MMM MMM KKK TTTTTTTTTTT KKK\r\n\r MMMM MMMM KKK TTTTTTTTTTT KKK\r\n\r MMM MMMM MMM III KKK KKK RRRRRR OOOOOO TTT III KKK KKK\r\n\r MMM M'
- 2014-04-25 12:37:34,275 [SSH: 10.0.0.94] on_read: 'M MMM III KKKKK RRR RRR OOO OOO TTT III KKKKK\r\n'
- 2014-04-25 12:37:34,284 [SSH: 10.0.0.94] on_read: '\r MMM MMM III KKK KKK RRRRRR OOO OOO TTT III KKK KKK\r\n\r MMM MMM III KKK KKK RRR RRR OOOOOO TTT III KKK KKK\r\n\r\r\n\r MikroTik RouterOS 5.26 (c) 1999-2013 http://www.mikrotik.com/\r\n\r\r\n'
- 2014-04-25 12:37:34,308 [SSH: 10.0.0.94] on_read: '\r\x1b[9999B\r\x1b[9999B\r\r\r\x1b[9999B[admin@MikroTik] > '
- 2014-04-25 12:37:34,308 [SSH: 10.0.0.94] Starting synchronous FSM check
- 2014-04-25 12:37:34,308 [SSH: 10.0.0.94] match '\[(?P<prompt>[^\]@]+@.+?)\] > '
- 2014-04-25 12:37:34,309 [SSH: 10.0.0.94] event(PROMPT)
- 2014-04-25 12:37:34,309 [SSH: 10.0.0.94] ==> PROMPT
- 2014-04-25 12:37:34,309 [SSH: 10.0.0.94] on_PROMPT_enter
- 2014-04-25 12:37:34,309 [SSH: 10.0.0.94] Using prompt pattern: \[admin\@MikroTik\] >
- 2014-04-25 12:37:34,309 [SSH: 10.0.0.94] set_patterns([('\\[admin\\@MikroTik\\] > ', 'PROMPT'), ('(Please press "Enter" to continue!)|(\\[Q quit\\|D dump\\|down\\])', 'PAGER')])
- 2014-04-25 12:37:34,328 [MikroTik.RouterOS.get_interfaces(10.0.0.94, 10.0.0.94)] CLI Provider is ready
- 2014-04-25 12:37:34,328 [SSH: 10.0.0.94] submit('/interface print detail', bulk_lines=None, streaming=False)
- 2014-04-25 12:37:34,328 [SSH: 10.0.0.94] Sending message type MSG_CHANNEL_DATA (94)
- 2014-04-25 12:37:35,065 [SSH: 10.0.0.94] on_read: '\x1b7\x1b[r\x1b8'
- 2014-04-25 12:37:35,066 Tick
- 2014-04-25 12:37:35,066 Resetting wait ticks
- 2014-04-25 12:37:35,085 [SSH: 10.0.0.94] on_read: '/interface print detail\r\n'
- 2014-04-25 12:37:35,097 [SSH: 10.0.0.94] on_read: '\rFlags: D - dynamic, X - disabled, R - running, S - slave \r\n 0 R name="ether1" type="ether" mtu=1500 l2mtu=1600 max-l2mtu=4076 \r\n\r\n 1 R name="wlan1" type="wlan" mtu=1500 l2mtu=2290 \r\n\r\n 2 R name="bridge-bs1" type="bridge" mtu=1500 l2mtu=1600 \r\n\r\n 3 '
- 2014-04-25 12:37:35,098 [SSH: 10.0.0.94] on_read: 'R name="m27" type="vlan" mtu=1500 l2mtu=1596 \r\r\n\r\r\r\x1b[9999B[admin@MikroTik] > '
- 2014-04-25 12:37:35,099 [SSH: 10.0.0.94] Starting synchronous FSM check
- 2014-04-25 12:37:35,099 [SSH: 10.0.0.94] match '\[admin\@MikroTik\] > '
- 2014-04-25 12:37:35,099 [SSH: 10.0.0.94] Starting synchronous FSM check
- 2014-04-25 12:37:35,099 [SSH: 10.0.0.94] event(PROMPT)
- 2014-04-25 12:37:35,148 [MikroTik.RouterOS.get_interfaces(10.0.0.94, 10.0.0.94)] cli(/interface print detail) returns:
- ===[ /interface print detail ]==========================================
- 'Flags: D - dynamic, X - disabled, R - running, S - slave \n 0 R name="ether1" type="ether" mtu=1500 l2mtu=1600 max-l2mtu=4076 \n\n 1 R name="wlan1" type="wlan" mtu=1500 l2mtu=2290 \n\n 2 R name="bridge-bs1" type="bridge" mtu=1500 l2mtu=1600 \n\n 3 R name="m27" type="vlan" mtu=1500 l2mtu=1596 \n'
- ========================================================================
- 2014-04-25 12:37:35,149 [MikroTik.RouterOS.get_interfaces(10.0.0.94, 10.0.0.94)] Unhandled exception
- 2014-04-25 12:37:35,153 [MikroTik.RouterOS.get_interfaces(10.0.0.94, 10.0.0.94)] Script traceback:
- <type 'exceptions.KeyError'>
- 'vlan'
- START OF TRACEBACK
- ------------------------------------------------------------------------
- File: /opt/noc/sa/profiles/MikroTik/RouterOS/get_interfaces.py (Line: 30)
- Function: execute
- 23
- 24 def execute(self):
- 25 ifaces = {}
- 26 # Fill interfaces
- 27 for n, f, r in self.cli_detail("/interface print detail"):
- 28 ifaces[r["name"]] = {
- 29 "name": r["name"],
- 30 ==> "type": self.type_map[r["type"]],
- 31 "admin_status": "X" not in f,
- 32 "oper_status": "R" in f,
- 33 "subinterfaces": []
- 34 }
- 35 # Refine ethernet parameters
- 36 for n, f, r in self.cli_detail("/interface ethernet print detail"):
- Variables:
- ifaces =
- {'bridge-bs1': {'admin_status': True,
- 'name': 'bridge-bs1',
- 'oper_status': True,
- 'subinterfaces': [],
- 'type': 'SVI'},
- 'ether1': {'admin_status': True,
- 'name': 'ether1',
- 'oper_status': True,
- 'subinterfaces': [],
- 'type': 'physical'},
- 'wlan1': {'admin_status': True,
- 'name': 'wlan1',
- 'oper_status': True,
- 'subinterfaces': [],
- 'type': 'physical'}}
- n = 3
- self = <Script(Thread-2, started 140299781990144)>
- r = {'type': 'vlan', 'name': 'm27', 'mtu': '1596'}
- f = 'R'
- ------------------------------------------------------------------------
- File: /opt/noc/sa/script/script.py (Line: 422)
- Function: guarded_run
- 415 return result
- 416 except KeyError:
- 417 self.debug("Not in call cache: %r, %r" % (self.name,
- 418 self.kwargs))
- 419 pass
- 420 # Calling script body
- 421 self._thread_id = thread.get_ident()
- 422 ==> result = self.execute(**self.kwargs)
- 423 # Enforce interface result checking
- 424 for i in self.implements:
- 425 result = i.script_clean_result(self.profile, result)
- 426 # Cache result when required
- 427 if self.cache and self.parent is not None:
- 428 self.debug("Write to call cache: %s, %s, %r" % (self.name,
- Variables:
- i = <noc.sa.interfaces.igetinterfaces.IGetInterfaces object at 0x440af50>
- self = <Script(Thread-2, started 140299781990144)>
- ------------------------------------------------------------------------
- File: /opt/noc/sa/script/script.py (Line: 445)
- Function: run
- 438
- 439 def run(self):
- 440 """Script thread worker method"""
- 441 self.debug("Running")
- 442 result = None
- 443 try:
- 444 with self.cancelable():
- 445 ==> result = self.guarded_run()
- 446 except self.TimeOutError:
- 447 self.error("Timed out")
- 448 self.e_timeout = True
- 449 except CancelledError:
- 450 self.error("Cancelled")
- 451 self.e_cancel = True
- Variables:
- self = <Script(Thread-2, started 140299781990144)>
- r = ["<type 'exceptions.KeyError'>", "'vlan'"]
- result = None
- v = KeyError('vlan',)
- tb = <traceback object at 0x4f8e638>
- t = <type 'exceptions.KeyError'>
- ------------------------------------------------------------------------
- END OF TRACEBACK
- 2014-04-25 12:37:35,156 [MikroTik.RouterOS.get_interfaces(10.0.0.94, 10.0.0.94)] Closing
- 2014-04-25 12:37:35,156 Requesting call: <bound method CLISSHSocket.close of <CLISSHSocket(0x4f768d0, 10.0.0.94:22, connected)>>(*(), **{'flush': True})
- 2014-04-25 12:37:35,844 [SSH: 10.0.0.94] on_read: '\x1b7\x1b[r\x1b8'
- 2014-04-25 12:37:36,846 Tick
- 2014-04-25 12:37:36,847 Calling delayed <bound method CLISSHSocket.close of <CLISSHSocket(0x4f768d0, 10.0.0.94:22, connected)>>(*(), **{'flush': True})
- 2014-04-25 12:37:36,847 [SSH: 10.0.0.94] Closing socket
- 2014-04-25 12:37:36,847 unregister_socket(<CLISSHSocket(0x4f768d0, 10.0.0.94:22, closing)>)
- 2014-04-25 12:37:36,847 3 TICKS TO EXIT
- 2014-04-25 12:37:37,867 Tick
- 2014-04-25 12:37:37,867 2 TICKS TO EXIT
- 2014-04-25 12:37:38,900 Tick
- 2014-04-25 12:37:38,901 1 TICKS TO EXIT
- 2014-04-25 12:37:39,921 Tick
- 2014-04-25 12:37:39,922 EXIT
- 2014-04-25 12:37:39,922 Shutting down the factory
- 2014-04-25 12:37:39,923 0 TICKS TO EXIT
- 2014-04-25 12:37:39,923 Stopping socket factory
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement