Advertisement
Guest User

Untitled

a guest
Apr 25th, 2014
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.32 KB | None | 0 0
  1. root@noc:/opt/noc# ./noc debug-script get_interfaces 10.0.0.94
  2. 2014-04-25 12:37:29,708 SSH: Using gmpy
  3. 2014-04-25 12:37:30,232 Using JSON library: cjson
  4. 2014-04-25 12:37:30,430 Loading PeriodicRegistry
  5. 2014-04-25 12:37:30,436 Loading DownloaderRegistry
  6. 2014-04-25 12:37:30,525 Loading ProfileRegistry
  7. 2014-04-25 12:37:31,390 Loading ScriptRegistry
  8. 2014-04-25 12:37:31,943 Setting up 'select' polling method
  9. 2014-04-25 12:37:31,944 Activating 'select' poller
  10. 2014-04-25 12:37:31,944 Loading private ssh key from 'etc/ssh/id_rsa'
  11. 2014-04-25 12:37:31,945 Loading public ssh key from 'etc/ssh/id_rsa.pub'
  12. access_profile {
  13. profile: "MikroTik.RouterOS"
  14. scheme: SSH
  15. address: "10.0.0.94"
  16. user: "admin"
  17. password: "serv01admin"
  18. super_password: "serv01admin"
  19. }
  20. object_name: "10.0.0.94"
  21. script: "MikroTik.RouterOS.get_interfaces"
  22.  
  23. 2014-04-25 12:37:31,951 Running socket factory (SelectPoller)
  24. 2014-04-25 12:37:31,951 Running script thread
  25. 2014-04-25 12:37:31,952 Creating transaction id=2088614493 method=None callback=None
  26. 2014-04-25 12:37:31,953 [MikroTik.RouterOS.get_interfaces(10.0.0.94, 10.0.0.94)] Running
  27. 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 ({})
  28. 2014-04-25 12:37:31,954 [MikroTik.RouterOS.get_interfaces(10.0.0.94, 10.0.0.94)] cli(/interface print detail)
  29. 2014-04-25 12:37:31,954 [MikroTik.RouterOS.get_interfaces(10.0.0.94, 10.0.0.94)] Running new provider
  30. 2014-04-25 12:37:31,955 [SSH: 10.0.0.94] ==> SSH_START
  31. 2014-04-25 12:37:31,955 [SSH: 10.0.0.94] set_timeout(30)
  32. 2014-04-25 12:37:31,956 register_socket(<CLISSHSocket(0x4f768d0, 10.0.0.94:22, )>,None)
  33. 2014-04-25 12:37:32,953 Tick
  34. 2014-04-25 12:37:32,953 3 TICKS TO EXIT
  35. 2014-04-25 12:37:32,953 [SSH: 10.0.0.94] Initializing socket
  36. 2014-04-25 12:37:32,953 [SSH: 10.0.0.94] Connecting 10.0.0.94:22
  37. 2014-04-25 12:37:32,961 [SSH: 10.0.0.94] Connected
  38. 2014-04-25 12:37:32,963 [SSH: 10.0.0.94] event(SSH_VERSION)
  39. 2014-04-25 12:37:32,964 [SSH: 10.0.0.94] ==> SSH_VERSION
  40. 2014-04-25 12:37:32,964 [SSH: 10.0.0.94] Remote protocol version 2.0, remote software version ROSSSH
  41. 2014-04-25 12:37:32,965 [SSH: 10.0.0.94] Setting SSH transforms to: in=none none, out=none none
  42. 2014-04-25 12:37:32,965 [SSH: 10.0.0.94] Setting SSH transform keys
  43. 2014-04-25 12:37:32,966 [SSH: 10.0.0.94] Sending message type MSG_KEXINIT (20)
  44. 2014-04-25 12:37:32,966 [SSH: 10.0.0.94] event(SSH_KEY_EXCHANGE)
  45. 2014-04-25 12:37:32,966 [SSH: 10.0.0.94] ==> SSH_KEY_EXCHANGE
  46. 2014-04-25 12:37:32,970 [SSH: 10.0.0.94] Receiving message type MSG_KEXINIT (20)
  47. 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']
  48. 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
  49. 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)
  50. 2014-04-25 12:37:32,974 [SSH: 10.0.0.94] Sending message type MSG_KEX_DH_GEX_REQUEST_OLD (30)
  51. 2014-04-25 12:37:33,977 Tick
  52. 2014-04-25 12:37:33,977 Resetting wait ticks
  53. 2014-04-25 12:37:34,200 [SSH: 10.0.0.94] Receiving message type MSG_KEXDH_REPLY (31)
  54. 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
  55. 2014-04-25 12:37:34,204 [SSH: 10.0.0.94] Setting SSH transform keys
  56. 2014-04-25 12:37:34,205 [SSH: 10.0.0.94] Sending message type MSG_NEWKEYS (21)
  57. 2014-04-25 12:37:34,206 [SSH: 10.0.0.94] Receiving message type MSG_NEWKEYS (21)
  58. 2014-04-25 12:37:34,206 [SSH: 10.0.0.94] Using new keys
  59. 2014-04-25 12:37:34,207 [SSH: 10.0.0.94] event(SSH_AUTH)
  60. 2014-04-25 12:37:34,208 [SSH: 10.0.0.94] ==> SSH_AUTH
  61. 2014-04-25 12:37:34,208 [SSH: 10.0.0.94] Requesting service ssh-userauth
  62. 2014-04-25 12:37:34,209 [SSH: 10.0.0.94] Sending message type MSG_SERVICE_REQUEST (5)
  63. 2014-04-25 12:37:34,213 [SSH: 10.0.0.94] Receiving message type MSG_SERVICE_ACCEPT (6)
  64. 2014-04-25 12:37:34,213 [SSH: 10.0.0.94] Starting service ssh-userauth
  65. 2014-04-25 12:37:34,214 [SSH: 10.0.0.94] event(SSH_AUTH_PASSWORD)
  66. 2014-04-25 12:37:34,214 [SSH: 10.0.0.94] ==> SSH_AUTH_PASSWORD
  67. 2014-04-25 12:37:34,214 [SSH: 10.0.0.94] Authenticating with 'none' method
  68. 2014-04-25 12:37:34,214 [SSH: 10.0.0.94] Sending message type MSG_USERAUTH_REQUEST (50)
  69. 2014-04-25 12:37:34,219 [SSH: 10.0.0.94] Receiving message type MSG_USERAUTH_FAILURE (51)
  70. 2014-04-25 12:37:34,219 [SSH: 10.0.0.94] Authentication method 'none' has been failed. Trying next method (publickey,password)
  71. 2014-04-25 12:37:34,220 [SSH: 10.0.0.94] Partially authenticated with 'none'. Trying next method
  72. 2014-04-25 12:37:34,220 [SSH: 10.0.0.94] Authenticating with 'publickey' method
  73. 2014-04-25 12:37:34,221 [SSH: 10.0.0.94] Sending message type MSG_USERAUTH_REQUEST (50)
  74. 2014-04-25 12:37:34,224 [SSH: 10.0.0.94] Receiving message type MSG_USERAUTH_FAILURE (51)
  75. 2014-04-25 12:37:34,225 [SSH: 10.0.0.94] Authentication method 'publickey' has been failed. Trying next method (publickey,password)
  76. 2014-04-25 12:37:34,226 [SSH: 10.0.0.94] Partially authenticated with 'publickey'. Trying next method
  77. 2014-04-25 12:37:34,226 [SSH: 10.0.0.94] Authenticating with 'password' method
  78. 2014-04-25 12:37:34,226 [SSH: 10.0.0.94] Sending message type MSG_USERAUTH_REQUEST (50)
  79. 2014-04-25 12:37:34,230 [SSH: 10.0.0.94] Receiving message type MSG_USERAUTH_SUCCESS (52)
  80. 2014-04-25 12:37:34,230 [SSH: 10.0.0.94] event(SSH_CHANNEL)
  81. 2014-04-25 12:37:34,231 [SSH: 10.0.0.94] ==> SSH_CHANNEL
  82. 2014-04-25 12:37:34,231 [SSH: 10.0.0.94] Sending message type MSG_CHANNEL_OPEN (90)
  83. 2014-04-25 12:37:34,243 [SSH: 10.0.0.94] Receiving message type MSG_CHANNEL_OPEN_CONFIRMATION (91)
  84. 2014-04-25 12:37:34,244 [SSH: 10.0.0.94] Opening channel. local=0 remote=0
  85. 2014-04-25 12:37:34,244 [SSH: 10.0.0.94] event(SSH_PTY)
  86. 2014-04-25 12:37:34,245 [SSH: 10.0.0.94] ==> SSH_PTY
  87. 2014-04-25 12:37:34,245 [SSH: 10.0.0.94] Requesting PTY
  88. 2014-04-25 12:37:34,245 [SSH: 10.0.0.94] Sending message type MSG_CHANNEL_REQUEST (98)
  89. 2014-04-25 12:37:34,248 [SSH: 10.0.0.94] Receiving message type MSG_CHANNEL_SUCCESS (99)
  90. 2014-04-25 12:37:34,249 [SSH: 10.0.0.94] event(SSH_SHELL)
  91. 2014-04-25 12:37:34,249 [SSH: 10.0.0.94] ==> SSH_SHELL
  92. 2014-04-25 12:37:34,250 [SSH: 10.0.0.94] Requesting shell
  93. 2014-04-25 12:37:34,250 [SSH: 10.0.0.94] Sending message type MSG_CHANNEL_REQUEST (98)
  94. 2014-04-25 12:37:34,270 [SSH: 10.0.0.94] Receiving message type MSG_CHANNEL_SUCCESS (99)
  95. 2014-04-25 12:37:34,271 [SSH: 10.0.0.94] event(START)
  96. 2014-04-25 12:37:34,272 [SSH: 10.0.0.94] ==> START
  97. 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')])
  98. 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'
  99. 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'
  100. 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'
  101. 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] > '
  102. 2014-04-25 12:37:34,308 [SSH: 10.0.0.94] Starting synchronous FSM check
  103. 2014-04-25 12:37:34,308 [SSH: 10.0.0.94] match '\[(?P<prompt>[^\]@]+@.+?)\] > '
  104. 2014-04-25 12:37:34,309 [SSH: 10.0.0.94] event(PROMPT)
  105. 2014-04-25 12:37:34,309 [SSH: 10.0.0.94] ==> PROMPT
  106. 2014-04-25 12:37:34,309 [SSH: 10.0.0.94] on_PROMPT_enter
  107. 2014-04-25 12:37:34,309 [SSH: 10.0.0.94] Using prompt pattern: \[admin\@MikroTik\] >
  108. 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')])
  109. 2014-04-25 12:37:34,328 [MikroTik.RouterOS.get_interfaces(10.0.0.94, 10.0.0.94)] CLI Provider is ready
  110. 2014-04-25 12:37:34,328 [SSH: 10.0.0.94] submit('/interface print detail', bulk_lines=None, streaming=False)
  111. 2014-04-25 12:37:34,328 [SSH: 10.0.0.94] Sending message type MSG_CHANNEL_DATA (94)
  112. 2014-04-25 12:37:35,065 [SSH: 10.0.0.94] on_read: '\x1b7\x1b[r\x1b8'
  113. 2014-04-25 12:37:35,066 Tick
  114. 2014-04-25 12:37:35,066 Resetting wait ticks
  115. 2014-04-25 12:37:35,085 [SSH: 10.0.0.94] on_read: '/interface print detail\r\n'
  116. 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 '
  117. 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] > '
  118. 2014-04-25 12:37:35,099 [SSH: 10.0.0.94] Starting synchronous FSM check
  119. 2014-04-25 12:37:35,099 [SSH: 10.0.0.94] match '\[admin\@MikroTik\] > '
  120. 2014-04-25 12:37:35,099 [SSH: 10.0.0.94] Starting synchronous FSM check
  121. 2014-04-25 12:37:35,099 [SSH: 10.0.0.94] event(PROMPT)
  122. 2014-04-25 12:37:35,148 [MikroTik.RouterOS.get_interfaces(10.0.0.94, 10.0.0.94)] cli(/interface print detail) returns:
  123. ===[ /interface print detail ]==========================================
  124. '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'
  125. ========================================================================
  126. 2014-04-25 12:37:35,149 [MikroTik.RouterOS.get_interfaces(10.0.0.94, 10.0.0.94)] Unhandled exception
  127. 2014-04-25 12:37:35,153 [MikroTik.RouterOS.get_interfaces(10.0.0.94, 10.0.0.94)] Script traceback:
  128. <type 'exceptions.KeyError'>
  129. 'vlan'
  130. START OF TRACEBACK
  131. ------------------------------------------------------------------------
  132. File: /opt/noc/sa/profiles/MikroTik/RouterOS/get_interfaces.py (Line: 30)
  133. Function: execute
  134. 23
  135. 24 def execute(self):
  136. 25 ifaces = {}
  137. 26 # Fill interfaces
  138. 27 for n, f, r in self.cli_detail("/interface print detail"):
  139. 28 ifaces[r["name"]] = {
  140. 29 "name": r["name"],
  141. 30 ==> "type": self.type_map[r["type"]],
  142. 31 "admin_status": "X" not in f,
  143. 32 "oper_status": "R" in f,
  144. 33 "subinterfaces": []
  145. 34 }
  146. 35 # Refine ethernet parameters
  147. 36 for n, f, r in self.cli_detail("/interface ethernet print detail"):
  148. Variables:
  149. ifaces =
  150. {'bridge-bs1': {'admin_status': True,
  151. 'name': 'bridge-bs1',
  152. 'oper_status': True,
  153. 'subinterfaces': [],
  154. 'type': 'SVI'},
  155. 'ether1': {'admin_status': True,
  156. 'name': 'ether1',
  157. 'oper_status': True,
  158. 'subinterfaces': [],
  159. 'type': 'physical'},
  160. 'wlan1': {'admin_status': True,
  161. 'name': 'wlan1',
  162. 'oper_status': True,
  163. 'subinterfaces': [],
  164. 'type': 'physical'}}
  165. n = 3
  166. self = <Script(Thread-2, started 140299781990144)>
  167. r = {'type': 'vlan', 'name': 'm27', 'mtu': '1596'}
  168. f = 'R'
  169. ------------------------------------------------------------------------
  170. File: /opt/noc/sa/script/script.py (Line: 422)
  171. Function: guarded_run
  172. 415 return result
  173. 416 except KeyError:
  174. 417 self.debug("Not in call cache: %r, %r" % (self.name,
  175. 418 self.kwargs))
  176. 419 pass
  177. 420 # Calling script body
  178. 421 self._thread_id = thread.get_ident()
  179. 422 ==> result = self.execute(**self.kwargs)
  180. 423 # Enforce interface result checking
  181. 424 for i in self.implements:
  182. 425 result = i.script_clean_result(self.profile, result)
  183. 426 # Cache result when required
  184. 427 if self.cache and self.parent is not None:
  185. 428 self.debug("Write to call cache: %s, %s, %r" % (self.name,
  186. Variables:
  187. i = <noc.sa.interfaces.igetinterfaces.IGetInterfaces object at 0x440af50>
  188. self = <Script(Thread-2, started 140299781990144)>
  189. ------------------------------------------------------------------------
  190. File: /opt/noc/sa/script/script.py (Line: 445)
  191. Function: run
  192. 438
  193. 439 def run(self):
  194. 440 """Script thread worker method"""
  195. 441 self.debug("Running")
  196. 442 result = None
  197. 443 try:
  198. 444 with self.cancelable():
  199. 445 ==> result = self.guarded_run()
  200. 446 except self.TimeOutError:
  201. 447 self.error("Timed out")
  202. 448 self.e_timeout = True
  203. 449 except CancelledError:
  204. 450 self.error("Cancelled")
  205. 451 self.e_cancel = True
  206. Variables:
  207. self = <Script(Thread-2, started 140299781990144)>
  208. r = ["<type 'exceptions.KeyError'>", "'vlan'"]
  209. result = None
  210. v = KeyError('vlan',)
  211. tb = <traceback object at 0x4f8e638>
  212. t = <type 'exceptions.KeyError'>
  213. ------------------------------------------------------------------------
  214. END OF TRACEBACK
  215. 2014-04-25 12:37:35,156 [MikroTik.RouterOS.get_interfaces(10.0.0.94, 10.0.0.94)] Closing
  216. 2014-04-25 12:37:35,156 Requesting call: <bound method CLISSHSocket.close of <CLISSHSocket(0x4f768d0, 10.0.0.94:22, connected)>>(*(), **{'flush': True})
  217. 2014-04-25 12:37:35,844 [SSH: 10.0.0.94] on_read: '\x1b7\x1b[r\x1b8'
  218. 2014-04-25 12:37:36,846 Tick
  219. 2014-04-25 12:37:36,847 Calling delayed <bound method CLISSHSocket.close of <CLISSHSocket(0x4f768d0, 10.0.0.94:22, connected)>>(*(), **{'flush': True})
  220. 2014-04-25 12:37:36,847 [SSH: 10.0.0.94] Closing socket
  221. 2014-04-25 12:37:36,847 unregister_socket(<CLISSHSocket(0x4f768d0, 10.0.0.94:22, closing)>)
  222. 2014-04-25 12:37:36,847 3 TICKS TO EXIT
  223. 2014-04-25 12:37:37,867 Tick
  224. 2014-04-25 12:37:37,867 2 TICKS TO EXIT
  225. 2014-04-25 12:37:38,900 Tick
  226. 2014-04-25 12:37:38,901 1 TICKS TO EXIT
  227. 2014-04-25 12:37:39,921 Tick
  228. 2014-04-25 12:37:39,922 EXIT
  229. 2014-04-25 12:37:39,922 Shutting down the factory
  230. 2014-04-25 12:37:39,923 0 TICKS TO EXIT
  231. 2014-04-25 12:37:39,923 Stopping socket factory
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement