Advertisement
Guest User

Untitled

a guest
Dec 18th, 2017
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 31.07 KB | None | 0 0
  1. ./noc script --debug get_chassis_id 10.170.112.9 2017-12-18 18:02:02,949 [noc.core.dcs.base] Resolve near service postgres
  2. 2017-12-18 18:02:02,949 [noc.core.http.client] HTTP GET http://consul:8500/v1/catalog/service/postgres?near=_agent
  3. 2017-12-18 18:02:02,952 [noc.core.http.client] HTTP Response 200
  4. 2017-12-18 18:02:02,953 [noc.core.dcs.base] Resolved near service postgres to ['10.10.10.41:5432']
  5. 2017-12-18 18:02:02,992 [root] Loading PeriodicRegistry
  6. 2017-12-18 18:02:03,791 [noc.core.dcs.base] Running resolver for service mongo
  7. 2017-12-18 18:02:03,791 [noc.core.dcs.base] [mongo] Starting resolver
  8. 2017-12-18 18:02:03,791 [noc.core.http.client] HTTP GET http://consul:8500/v1/health/service/mongo?passing=1
  9. 2017-12-18 18:02:03,793 [noc.core.http.client] HTTP Response 200
  10. 2017-12-18 18:02:03,794 [noc.core.dcs.base] [mongo] Set active services to: mongo: 10.10.10.41:27017
  11. 2017-12-18 18:02:03,794 [noc.core.http.client] HTTP GET http://consul:8500/v1/health/service/mongo?index=704573&passing=1
  12. 2017-12-18 18:02:03,795 [noc.lib.nosql] Connecting to MongoDB {'username': 'noc', 'authentication_source': 'noc', 'readPreference': 'secondaryPreferred', 'replicaSet': 'noc', 'db': 'noc', 'socketKeepAlive': True, 'host': 'mongodb://noc:********@10.10.10.41:27017/noc', 'password': '********'}
  13. 2017-12-18 18:02:03,806 [noc.core.cache.base] Using cache backend: noc.core.cache.mongo.MongoCache
  14. 2017-12-18 18:02:03,843 [noc.main.models.doccategory] Registering Capability
  15. 2017-12-18 18:02:03,844 [noc.main.models.doccategory] Registering MetricType
  16. 2017-12-18 18:02:03,888 [noc.main.models.doccategory] Registering ConnectionType
  17. 2017-12-18 18:02:03,892 [noc.main.models.doccategory] Registering ObjectModel
  18. 2017-12-18 18:02:03,904 [noc.main.models.textindex] Adding FTS index for sa.managedobject
  19. 2017-12-18 18:02:03,925 [noc.main.models.textindex] Adding FTS index for ip.vrf
  20. 2017-12-18 18:02:03,929 [noc.main.models.textindex] Adding FTS index for vc.vc
  21. 2017-12-18 18:02:03,932 [noc.main.models.textindex] Adding FTS index for ip.prefix
  22. 2017-12-18 18:02:03,933 [noc.main.models.textindex] Adding FTS index for ip.address
  23. 2017-12-18 18:02:03,982 [noc.core.script.loader] Loading script DLink.DxS.get_chassis_id
  24. 2017-12-18 18:02:04,005 [noc.core.profile.loader] Loading profile DLink.DxS
  25. 2017-12-18 18:02:04,005 [script] [DLink.DxS.get_chassis_id|10.170.112.9] Filling get_version cache with {'platform': u'DXS-3326GSR', 'version': u'4.50-B19', 'vendor': u'D-Link'}
  26. 2017-12-18 18:02:04,006 [script] [DLink.DxS.get_chassis_id|10.170.112.9] Running. Input arguments: {}, timeout 3600
  27. 2017-12-18 18:02:04,006 [noc.core.script.loader] Loading script DLink.DxS.get_switch
  28. 2017-12-18 18:02:04,006 [script] [DLink.DxS.get_switch|10.170.112.9] Running. Input arguments: {}, timeout 3600
  29. 2017-12-18 18:02:04,006 [script] [DLink.DxS.get_chassis_id|10.170.112.9] Open telnet CLI
  30. 2017-12-18 18:02:04,008 [script] [DLink.DxS.get_chassis_id|10.170.112.9] [telnet] Setup session
  31. 2017-12-18 18:02:04,008 [script] [DLink.DxS.get_chassis_id|10.170.112.9] [telnet] Creating IOLoop
  32. 2017-12-18 18:02:04,008 [script] [DLink.DxS.get_chassis_id|10.170.112.9] [telnet] Connecting (u'10.170.112.9', 23)
  33. 2017-12-18 18:02:04,012 [script] [DLink.DxS.get_chassis_id|10.170.112.9] [telnet] Connected
  34. 2017-12-18 18:02:04,012 [script] [DLink.DxS.get_chassis_id|10.170.112.9] [telnet] State: <START>
  35. 2017-12-18 18:02:04,012 [script] [DLink.DxS.get_chassis_id|10.170.112.9] [telnet] Setting timeout: 60s
  36. 2017-12-18 18:02:04,078 [script] [DLink.DxS.get_chassis_id|10.170.112.9] [telnet] Received DO SGA
  37. 2017-12-18 18:02:04,078 [script] [DLink.DxS.get_chassis_id|10.170.112.9] [telnet] Send WILL SGA
  38. 2017-12-18 18:02:04,087 [script] [DLink.DxS.get_chassis_id|10.170.112.9] [telnet] Received WILL SGA
  39. 2017-12-18 18:02:04,087 [script] [DLink.DxS.get_chassis_id|10.170.112.9] [telnet] Send DO SGA
  40. 2017-12-18 18:02:04,087 [script] [DLink.DxS.get_chassis_id|10.170.112.9] [telnet] Received WILL ECHO
  41. 2017-12-18 18:02:04,087 [script] [DLink.DxS.get_chassis_id|10.170.112.9] [telnet] Send DO ECHO
  42. 2017-12-18 18:02:04,131 [script] [DLink.DxS.get_chassis_id|10.170.112.9] [telnet] Received: '\x1b[0m\x1b[1;1H\x1b[2J\x1b[1;1H\x1b[2J\n\r DXS-3326GSR Stackable Ethernet Switch\n\r Command Line Interface\n\r\n\r Firmware: Build 4.50-B19\n\r Copyright(C) 2004-2007 D-Link All rights reserved.\n\r \rUserName:'
  43. 2017-12-18 18:02:04,131 [script] [DLink.DxS.get_chassis_id|10.170.112.9] [telnet] Match: ([Uu]ser ?[Nn]ame|[Ll]ogin): ?
  44. 2017-12-18 18:02:04,131 [script] [DLink.DxS.get_chassis_id|10.170.112.9] [telnet] State: <USERNAME>
  45. 2017-12-18 18:02:04,131 [script] [DLink.DxS.get_chassis_id|10.170.112.9] [telnet] Send: 'script2\n'
  46. 2017-12-18 18:02:04,132 [script] [DLink.DxS.get_chassis_id|10.170.112.9] [telnet] Setting timeout: 30s
  47. 2017-12-18 18:02:04,302 [script] [DLink.DxS.get_chassis_id|10.170.112.9] [telnet] Received: 's'
  48. 2017-12-18 18:02:04,343 [script] [DLink.DxS.get_chassis_id|10.170.112.9] [telnet] Received: 'cript2\n\r \rPassWord:'
  49. 2017-12-18 18:02:04,343 [script] [DLink.DxS.get_chassis_id|10.170.112.9] [telnet] Match: [Pp]ass[Ww]ord: ?
  50. 2017-12-18 18:02:04,343 [script] [DLink.DxS.get_chassis_id|10.170.112.9] [telnet] State: <PASSWORD>
  51. 2017-12-18 18:02:04,343 [script] [DLink.DxS.get_chassis_id|10.170.112.9] [telnet] Send: 'wre4fel\r\n'
  52. 2017-12-18 18:02:04,343 [script] [DLink.DxS.get_chassis_id|10.170.112.9] [telnet] Setting timeout: 30s
  53. 2017-12-18 18:02:04,364 [script] [DLink.DxS.get_chassis_id|10.170.112.9] [telnet] Received: '*'
  54. 2017-12-18 18:02:04,407 [script] [DLink.DxS.get_chassis_id|10.170.112.9] [telnet] Received: '******\n\r\n\rDXS-3326GSR:5#'
  55. 2017-12-18 18:02:04,407 [script] [DLink.DxS.get_chassis_id|10.170.112.9] [telnet] Match: (?P<hostname>\S+)(?<!:(3|6))(?<!:operator)(?<!:user)#
  56. 2017-12-18 18:02:04,407 [script] [DLink.DxS.get_chassis_id|10.170.112.9] [telnet] State: <PROMT>
  57. 2017-12-18 18:02:04,407 [script] [DLink.DxS.get_chassis_id|10.170.112.9] [telnet] Refining pattern prompt to 'DXS\\-3326GSR\\:5(?<!:(3|6))(?<!:operator)(?<!:user)#'
  58. 2017-12-18 18:02:04,408 [script] [DLink.DxS.get_chassis_id|10.170.112.9] [telnet] Resetting timeouts
  59. 2017-12-18 18:02:04,408 [script] [DLink.DxS.get_chassis_id|10.170.112.9] [telnet] Send: '\n'
  60. 2017-12-18 18:02:04,417 [script] [DLink.DxS.get_chassis_id|10.170.112.9] [telnet] Received: '\n\rDXS-3326GSR:5#'
  61. 2017-12-18 18:02:04,417 [script] [DLink.DxS.get_chassis_id|10.170.112.9] [telnet] Match: DXS\-3326GSR\:5(?<!:(3|6))(?<!:operator)(?<!:user)#
  62. 2017-12-18 18:02:04,417 [script] [DLink.DxS.get_chassis_id|10.170.112.9] [telnet] State: <PROMT>
  63. 2017-12-18 18:02:04,417 [script] [DLink.DxS.get_chassis_id|10.170.112.9] [telnet] Command:
  64.  
  65.  
  66. 2017-12-18 18:02:04,417 [script] [DLink.DxS.get_switch|10.170.112.9] Running. Input arguments: {}, timeout 3600
  67. 2017-12-18 18:02:04,417 [script] [DLink.DxS.get_chassis_id|10.170.112.9] [telnet] Send: 'show switch\n'
  68. 2017-12-18 18:02:04,544 [script] [DLink.DxS.get_chassis_id|10.170.112.9] [telnet] Received: 's'
  69. 2017-12-18 18:02:04,587 [script] [DLink.DxS.get_chassis_id|10.170.112.9] [telnet] Received: 'how switch'
  70. 2017-12-18 18:02:04,693 [script] [DLink.DxS.get_chassis_id|10.170.112.9] [telnet] Received: '\n\rCommand: show switch\n\r\n\rDevice Type : DXS-3326GSR Stackable Ethernet Switch\n\rUnit ID : 1\n\rMAC Address : 00-15-E9-3B-66-00\n\rIP Address : 10.170.112.9 (Manual)\n\rVLAN Name : manag-egor\n\rSubnet Mask : 255.255.255.0\n\rDefault Gateway : 10.170.112.254\n\rBoot PROM Version : Build 2.01-B01\n\rFirmware Version : Build 4.50-B19\n\rHardware Version : 5A1.2A1\n\rDevice S/N : \n\rSystem Name : \n\rSystem Location : \n\rSystem Contact : \n\rSpanning Tree '
  71. 2017-12-18 18:02:04,694 [script] [DLink.DxS.get_chassis_id|10.170.112.9] [telnet] Received: ': Disabled\n\rGVRP : Disabled\n\rIGMP Snooping : Disabled\n\rRIP : Disabled\n\rDVMRP : Disabled\n\rPIM : Disabled\n\rOSPF : Disabled\n\rTELNET : Enabled (TCP 23)\n\rRMON : Disabled\n\rSSH status : Disabled\n\r802.1x : Disabled\n\rJumbo Frame : On\n\rClipaging : Disabled\n\rMAC Notification : Disabled\n\rPort Mirror : Disabled\n\rSNTP : Disabled\n\rBootp Relay : Disabled\r\r\n\rDNSR'
  72. 2017-12-18 18:02:04,694 [script] [DLink.DxS.get_chassis_id|10.170.112.9] [telnet] Received: ' Status : Disabled \n\rVRRP : Disabled\n\rHOL Prevention State : Enabled\n\rSyslog Global State : Disabled\n\rSingle IP Management : Disabled\n\rDual Image : Supported\n\rCPU Interface Filter : Disabled\n\r\n\rDXS-3326GSR:5#'
  73. 2017-12-18 18:02:04,694 [script] [DLink.DxS.get_chassis_id|10.170.112.9] [telnet] Match: DXS\-3326GSR\:5(?<!:(3|6))(?<!:operator)(?<!:user)#
  74. 2017-12-18 18:02:04,694 [script] [DLink.DxS.get_chassis_id|10.170.112.9] [telnet] State: <PROMT>
  75. 2017-12-18 18:02:04,694 [script] [DLink.DxS.get_chassis_id|10.170.112.9] [telnet] Command: show switch
  76. show switch
  77. Command: show switch
  78.  
  79. Device Type : DXS-3326GSR Stackable Ethernet Switch
  80. Unit ID : 1
  81. MAC Address : 00-15-E9-3B-66-00
  82. IP Address : 10.170.112.9 (Manual)
  83. VLAN Name : manag-egor
  84. Subnet Mask : 255.255.255.0
  85. Default Gateway : 10.170.112.254
  86. Boot PROM Version : Build 2.01-B01
  87. Firmware Version : Build 4.50-B19
  88. Hardware Version : 5A1.2A1
  89. Device S/N :
  90. System Name :
  91. System Location :
  92. System Contact :
  93. Spanning Tree : Disabled
  94. GVRP : Disabled
  95. IGMP Snooping : Disabled
  96. RIP : Disabled
  97. DVMRP : Disabled
  98. PIM : Disabled
  99. OSPF : Disabled
  100. TELNET : Enabled (TCP 23)
  101. RMON : Disabled
  102. SSH status : Disabled
  103. 802.1x : Disabled
  104. Jumbo Frame : On
  105. Clipaging : Disabled
  106. MAC Notification : Disabled
  107. Port Mirror : Disabled
  108. SNTP : Disabled
  109. Bootp Relay : Disabled
  110. DNSR Status : Disabled
  111. VRRP : Disabled
  112. HOL Prevention State : Enabled
  113. Syslog Global State : Disabled
  114. Single IP Management : Disabled
  115. Dual Image : Supported
  116. CPU Interface Filter : Disabled
  117.  
  118.  
  119. 2017-12-18 18:02:04,695 [script] [DLink.DxS.get_switch|10.170.112.9] Caching result
  120. 2017-12-18 18:02:04,695 [script] [DLink.DxS.get_switch|10.170.112.9] Result: Command: show switch
  121.  
  122. Device Type : DXS-3326GSR Stackable Ethernet Switch
  123. Unit ID : 1
  124. MAC Address : 00-15-E9-3B-66-00
  125. IP Address : 10.170.112.9 (Manual)
  126. VLAN Name : manag-egor
  127. Subnet Mask : 255.255.255.0
  128. Default Gateway : 10.170.112.254
  129. Boot PROM Version : Build 2.01-B01
  130. Firmware Version : Build 4.50-B19
  131. Hardware Version : 5A1.2A1
  132. Device S/N :
  133. System Name :
  134. System Location :
  135. System Contact :
  136. Spanning Tree : Disabled
  137. GVRP : Disabled
  138. IGMP Snooping : Disabled
  139. RIP : Disabled
  140. DVMRP : Disabled
  141. PIM : Disabled
  142. OSPF : Disabled
  143. TELNET : Enabled (TCP 23)
  144. RMON : Disabled
  145. SSH status : Disabled
  146. 802.1x : Disabled
  147. Jumbo Frame : On
  148. Clipaging : Disabled
  149. MAC Notification : Disabled
  150. Port Mirror : Disabled
  151. SNTP : Disabled
  152. Bootp Relay : Disabled
  153. DNSR Status : Disabled
  154. VRRP : Disabled
  155. HOL Prevention State : Enabled
  156. Syslog Global State : Disabled
  157. Single IP Management : Disabled
  158. Dual Image : Supported
  159. CPU Interface Filter : Disabled
  160.  
  161.  
  162. 2017-12-18 18:02:04,695 [script] [DLink.DxS.get_switch|10.170.112.9] Complete (277.89ms)
  163. 2017-12-18 18:02:04,695 [script] [DLink.DxS.get_chassis_id|10.170.112.9] [telnet] Send: 'show switch\n'
  164. 2017-12-18 18:02:04,824 [script] [DLink.DxS.get_chassis_id|10.170.112.9] [telnet] Received: 's'
  165. 2017-12-18 18:02:04,867 [script] [DLink.DxS.get_chassis_id|10.170.112.9] [telnet] Received: 'how switch'
  166. 2017-12-18 18:02:04,984 [script] [DLink.DxS.get_chassis_id|10.170.112.9] [telnet] Received: '\n\rCommand: show switch\n\r\n\rDevice Type : DXS-3326GSR Stackable Ethernet Switch\n\rUnit ID : 1\n\rMAC Address : 00-15-E9-3B-66-00\n\rIP Address : 10.170.112.9 (Manual)\n\rVLAN Name : manag-egor\n\rSubnet Mask : 255.255.255.0\n\rDefault Gateway : 10.170.112.254\n\rBoot PROM Version : Build 2.01-B01\n\rFirmware Version : Build 4.50-B19\n\rHardware Version : 5A1.2A1\n\rDevice S/N : \n\rSystem Name : \n\rSystem Location : \n\rSystem Contact : \n\rSpanning Tree '
  167. 2017-12-18 18:02:04,984 [script] [DLink.DxS.get_chassis_id|10.170.112.9] [telnet] Received: ': Disabled\n\rGVRP : Disabled\n\rIGMP Snooping : Disabled\n\rRIP : Disabled\n\rDVMRP : Disabled\n\rPIM : Disabled\n\rOSPF : Disabled\n\rTELNET : Enabled (TCP 23)\n\rRMON : Disabled\n\rSSH status : Disabled\n\r802.1x : Disabled\n\rJumbo Frame : On\n\rClipaging : Disabled\n\rMAC Notification : Disabled\n\rPort Mirror : Disabled\n\rSNTP : Disabled\n\rBootp Relay : Disabled\r\r\n\rDNSR'
  168. 2017-12-18 18:02:04,984 [script] [DLink.DxS.get_chassis_id|10.170.112.9] [telnet] Received: ' Status : Disabled \n\rVRRP : Disabled\n\rHOL Prevention State : Enabled\n\rSyslog Global State : Disabled\n\rSingle IP Management : Disabled\n\rDual Image : Supported\n\rCPU Interface Filter : Disabled\n\r\n\rDXS-3326GSR:5#'
  169. 2017-12-18 18:02:04,984 [script] [DLink.DxS.get_chassis_id|10.170.112.9] [telnet] Match: DXS\-3326GSR\:5(?<!:(3|6))(?<!:operator)(?<!:user)#
  170. 2017-12-18 18:02:04,984 [script] [DLink.DxS.get_chassis_id|10.170.112.9] [telnet] State: <PROMT>
  171. 2017-12-18 18:02:04,985 [script] [DLink.DxS.get_chassis_id|10.170.112.9] [telnet] Command: show switch
  172. show switch
  173. Command: show switch
  174.  
  175. Device Type : DXS-3326GSR Stackable Ethernet Switch
  176. Unit ID : 1
  177. MAC Address : 00-15-E9-3B-66-00
  178. IP Address : 10.170.112.9 (Manual)
  179. VLAN Name : manag-egor
  180. Subnet Mask : 255.255.255.0
  181. Default Gateway : 10.170.112.254
  182. Boot PROM Version : Build 2.01-B01
  183. Firmware Version : Build 4.50-B19
  184. Hardware Version : 5A1.2A1
  185. Device S/N :
  186. System Name :
  187. System Location :
  188. System Contact :
  189. Spanning Tree : Disabled
  190. GVRP : Disabled
  191. IGMP Snooping : Disabled
  192. RIP : Disabled
  193. DVMRP : Disabled
  194. PIM : Disabled
  195. OSPF : Disabled
  196. TELNET : Enabled (TCP 23)
  197. RMON : Disabled
  198. SSH status : Disabled
  199. 802.1x : Disabled
  200. Jumbo Frame : On
  201. Clipaging : Disabled
  202. MAC Notification : Disabled
  203. Port Mirror : Disabled
  204. SNTP : Disabled
  205. Bootp Relay : Disabled
  206. DNSR Status : Disabled
  207. VRRP : Disabled
  208. HOL Prevention State : Enabled
  209. Syslog Global State : Disabled
  210. Single IP Management : Disabled
  211. Dual Image : Supported
  212. CPU Interface Filter : Disabled
  213.  
  214.  
  215. 2017-12-18 18:02:04,985 [script] [DLink.DxS.get_switch|10.170.112.9] Caching result
  216. 2017-12-18 18:02:04,985 [script] [DLink.DxS.get_switch|10.170.112.9] Result: Command: show switch
  217.  
  218. Device Type : DXS-3326GSR Stackable Ethernet Switch
  219. Unit ID : 1
  220. MAC Address : 00-15-E9-3B-66-00
  221. IP Address : 10.170.112.9 (Manual)
  222. VLAN Name : manag-egor
  223. Subnet Mask : 255.255.255.0
  224. Default Gateway : 10.170.112.254
  225. Boot PROM Version : Build 2.01-B01
  226. Firmware Version : Build 4.50-B19
  227. Hardware Version : 5A1.2A1
  228. Device S/N :
  229. System Name :
  230. System Location :
  231. System Contact :
  232. Spanning Tree : Disabled
  233. GVRP : Disabled
  234. IGMP Snooping : Disabled
  235. RIP : Disabled
  236. DVMRP : Disabled
  237. PIM : Disabled
  238. OSPF : Disabled
  239. TELNET : Enabled (TCP 23)
  240. RMON : Disabled
  241. SSH status : Disabled
  242. 802.1x : Disabled
  243. Jumbo Frame : On
  244. Clipaging : Disabled
  245. MAC Notification : Disabled
  246. Port Mirror : Disabled
  247. SNTP : Disabled
  248. Bootp Relay : Disabled
  249. DNSR Status : Disabled
  250. VRRP : Disabled
  251. HOL Prevention State : Enabled
  252. Syslog Global State : Disabled
  253. Single IP Management : Disabled
  254. Dual Image : Supported
  255. CPU Interface Filter : Disabled
  256.  
  257.  
  258. 2017-12-18 18:02:04,985 [script] [DLink.DxS.get_switch|10.170.112.9] Complete (979.15ms)
  259. 2017-12-18 18:02:04,985 [script] [DLink.DxS.get_chassis_id|10.170.112.9] [telnet] Send: 'show fdb static\n'
  260. 2017-12-18 18:02:05,051 [script] [DLink.DxS.get_chassis_id|10.170.112.9] [telnet] Received: 's'
  261. 2017-12-18 18:02:05,092 [script] [DLink.DxS.get_chassis_id|10.170.112.9] [telnet] Received: 'how fdb static\n\rCommand: show fdb static\n\r\n\r VID VLAN Name MAC Address Port Type \n\r ---- -------------------------------- ----------------- ----- -----------------\n\r 112 manag-egor 00-15-E9-3B-66-00 CPU Self\n\r 970 v970 00-15-E9-3B-66-01 CPU Self'
  262. 2017-12-18 18:02:05,294 [script] [DLink.DxS.get_chassis_id|10.170.112.9] [telnet] Received: '\n\r\n\rTotal Entries: 2\n\r\n\r\n\rDXS-3326GSR:5#'
  263. 2017-12-18 18:02:05,294 [script] [DLink.DxS.get_chassis_id|10.170.112.9] [telnet] Match: DXS\-3326GSR\:5(?<!:(3|6))(?<!:operator)(?<!:user)#
  264. 2017-12-18 18:02:05,294 [script] [DLink.DxS.get_chassis_id|10.170.112.9] [telnet] State: <PROMT>
  265. 2017-12-18 18:02:05,294 [script] [DLink.DxS.get_chassis_id|10.170.112.9] [telnet] Command: show fdb static
  266. show fdb static
  267. Command: show fdb static
  268.  
  269. VID VLAN Name MAC Address Port Type
  270. ---- -------------------------------- ----------------- ----- -----------------
  271. 112 manag-egor 00-15-E9-3B-66-00 CPU Self
  272. 970 v970 00-15-E9-3B-66-01 CPU Self
  273.  
  274. Total Entries: 2
  275.  
  276.  
  277.  
  278. 2017-12-18 18:02:05,294 [script] [DLink.DxS.get_chassis_id|10.170.112.9] [telnet] Send: 'show stack_information\n'
  279. 2017-12-18 18:02:05,358 [script] [DLink.DxS.get_chassis_id|10.170.112.9] [telnet] Received: 's'
  280. 2017-12-18 18:02:05,524 [script] [DLink.DxS.get_chassis_id|10.170.112.9] [telnet] Received: 'how stack_information\n\rCommand: show stack_information\n\r\n\r Box User Prio- Prom Runtime H/W \n\r ID Set Type Exist rity version version version\n\r --- ---- ---------------- ----- ----- -------- ---------------- --------\n\r 1 1 DXS-3326GSR exist 16 2.01-B01 4.50-B19 5A1.2A1 \n\r 2 - USR-NOT-CFG no \n\r 3 - USR-NOT-CFG no \n\r 4 - USR-NOT-CFG no \n\r 5 - USR-NOT-CFG no \n\r 6 '
  281. 2017-12-18 18:02:05,527 [script] [DLink.DxS.get_chassis_id|10.170.112.9] [telnet] Received: '- USR-NOT-CFG no \n\r 7 - USR-NOT-CFG no \n\r 8 - USR-NOT-CFG no \n\r 9 - USR-NOT-CFG no \n\r 10 - USR-NOT-CFG no \n\r 11 - USR-NOT-CFG no \n\r 12 - USR-NOT-CFG no \n\r -----------------------------------------------------------------\n\rTopology :DUPLEX_CHAIN\n\rMy Box ID :1\n\rCurrent state:MASTER\n\rBox Count :1\n\r\n\r\n\rDXS-3326GSR:5#'
  282. 2017-12-18 18:02:05,527 [script] [DLink.DxS.get_chassis_id|10.170.112.9] [telnet] Match: DXS\-3326GSR\:5(?<!:(3|6))(?<!:operator)(?<!:user)#
  283. 2017-12-18 18:02:05,527 [script] [DLink.DxS.get_chassis_id|10.170.112.9] [telnet] State: <PROMT>
  284. 2017-12-18 18:02:05,528 [script] [DLink.DxS.get_chassis_id|10.170.112.9] [telnet] Command: show stack_information
  285. show stack_information
  286. Command: show stack_information
  287.  
  288. Box User Prio- Prom Runtime H/W
  289. ID Set Type Exist rity version version version
  290. --- ---- ---------------- ----- ----- -------- ---------------- --------
  291. 1 1 DXS-3326GSR exist 16 2.01-B01 4.50-B19 5A1.2A1
  292. 2 - USR-NOT-CFG no
  293. 3 - USR-NOT-CFG no
  294. 4 - USR-NOT-CFG no
  295. 5 - USR-NOT-CFG no
  296. 6 - USR-NOT-CFG no
  297. 7 - USR-NOT-CFG no
  298. 8 - USR-NOT-CFG no
  299. 9 - USR-NOT-CFG no
  300. 10 - USR-NOT-CFG no
  301. 11 - USR-NOT-CFG no
  302. 12 - USR-NOT-CFG no
  303. -----------------------------------------------------------------
  304. Topology :DUPLEX_CHAIN
  305. My Box ID :1
  306. Current state:MASTER
  307. Box Count :1
  308.  
  309.  
  310.  
  311. 2017-12-18 18:02:05,529 [script] [DLink.DxS.get_chassis_id|10.170.112.9] [telnet] Shutdown session
  312. 2017-12-18 18:02:05,529 [script] [DLink.DxS.get_chassis_id|10.170.112.9] [telnet] Closing IOLoop
  313. 2017-12-18 18:02:05,677 [noc.core.debug] UNHANDLED EXCEPTION (2017-12-18 18:02:05.539845)
  314. PROCESS: ./commands/script.py
  315. VERSION: 15.05.1+microservices.8145.10e1beb1
  316. BRANCH: microservices CHANGESET: 10e1beb1
  317. ERROR FINGERPRINT: 7f8c208b-f099-5372-9705-25ef4683eab4
  318. WORKING DIRECTORY: /opt/noc
  319. EXCEPTION: <type 'exceptions.ValueError'> Invalid MAC: '--------'
  320. START OF TRACEBACK
  321. ------------------------------------------------------------------------
  322. File: core/mac.py (Line: 121)
  323. Function: _clean
  324. 114 match = rx_mac_address_hp.match(value)
  325. 115 if match:
  326. 116 value = value.replace("-", "")
  327. 117 else:
  328. 118 value = value.replace("-", ":")
  329. 119 match = rx_mac_address_sixblock.match(value)
  330. 120 if not match:
  331. 121 ==> raise ValueError("Invalid MAC: '%s'" % mac)
  332. 122 value = ""
  333. 123 for i in range(1, 7):
  334. 124 v = match.group(i)
  335. 125 if len(v) == 1:
  336. 126 v = "0" + v
  337. 127 value += v
  338. Variables:
  339. mac = '--------'
  340. value = '::::::::'
  341. match = None
  342. cls = <class 'noc.core.mac.MAC'>
  343. ------------------------------------------------------------------------
  344. File: core/mac.py (Line: 74)
  345. Function: __new__
  346. 67 'AA:BB:CC:DD:EE:FF'
  347. 68 >>> MAC(0xAABBCCDDEEFF)
  348. 69 'AA:BB:CC:DD:EE:FF'
  349. 70 >>> MAC("AABBCCDDEEFF") + " -- " + MAC("0011.2233.4455")
  350. 71 'AA:BB:CC:DD:EE:FF -- 00:11:22:33:44:55'
  351. 72 """
  352. 73 def __new__(cls, mac):
  353. 74 ==> return super(MAC, cls).__new__(cls, cls._clean(mac))
  354. 75
  355. 76 def __long__(self):
  356. 77 return int(self.replace(":", ""), 16)
  357. 78
  358. 79 def __int__(self):
  359. 80 return int(self.replace(":", ""), 16)
  360. Variables:
  361. mac = '--------'
  362. cls = <class 'noc.core.mac.MAC'>
  363. ------------------------------------------------------------------------
  364. File: core/script/base.py (Line: 537)
  365. Function: <genexpr>
  366. 530 def macs_to_ranges(self, macs):
  367. 531 """
  368. 532 Converts list of macs to rangea
  369. 533 :param macs: Iterable yielding mac addresses
  370. 534 :returns: [(from, to), ..]
  371. 535 """
  372. 536 r = []
  373. 537 ==> for m in sorted(MAC(x) for x in macs):
  374. 538 if r:
  375. 539 if r[-1][1].shift(1) == m:
  376. 540 # Expand last range
  377. 541 r[-1][1] = m
  378. 542 else:
  379. 543 r += [[m, m]]
  380. Variables:
  381. .0 = <listiterator object at 0x7fb732c355d0>
  382. x = '--------'
  383. ------------------------------------------------------------------------
  384. File: core/script/base.py (Line: 537)
  385. Function: macs_to_ranges
  386. 530 def macs_to_ranges(self, macs):
  387. 531 """
  388. 532 Converts list of macs to rangea
  389. 533 :param macs: Iterable yielding mac addresses
  390. 534 :returns: [(from, to), ..]
  391. 535 """
  392. 536 r = []
  393. 537 ==> for m in sorted(MAC(x) for x in macs):
  394. 538 if r:
  395. 539 if r[-1][1].shift(1) == m:
  396. 540 # Expand last range
  397. 541 r[-1][1] = m
  398. 542 else:
  399. 543 r += [[m, m]]
  400. Variables:
  401. self =
  402. <noc.sa.profiles.DLink.DxS.get_chassis_id.Script object at 0x7fb71ef77f50>
  403. r = []
  404. macs = ['--------', '00-15-E9-3B-66-00', '00-15-E9-3B-66-01', '2.01-B01']
  405. ------------------------------------------------------------------------
  406. File: sa/profiles/DLink/DxS/get_chassis_id.py (Line: 65)
  407. Function: execute
  408. 58 except:
  409. 59 pass
  410. 60 if macs:
  411. 61 macs.sort()
  412. 62 return [{
  413. 63 "first_chassis_mac": f,
  414. 64 "last_chassis_mac": t
  415. 65 ==> } for f, t in self.macs_to_ranges(macs)]
  416. 66
  417. 67 return {
  418. 68 "first_chassis_mac": mac,
  419. 69 "last_chassis_mac": mac
  420. 70 }
  421. Variables:
  422. macs = ['--------', '00-15-E9-3B-66-00', '00-15-E9-3B-66-01', '2.01-B01']
  423. i = ['ox', 'ount', ':1', '', '', '', '', '']
  424. self =
  425. <noc.sa.profiles.DLink.DxS.get_chassis_id.Script object at 0x7fb71ef77f50>
  426. m = '2.01-B01'
  427. mac = '00-15-E9-3B-66-00'
  428. v =
  429. 'Command: show stack_information\n\n Box User Prio- Prom Runtime H/W \n ID Set Type Exist rity version version version\n --- ---- ---------------- ----- ----- -------- ---------------- --------\n 1 1 DXS-3326GSR exist 16 2.01-B01 4.50-B19 5A1.2A1 \n 2 - USR-NOT-CFG no \n 3 - USR-NOT-CFG no \n 4 - USR-NOT-CFG no \n 5 - USR-NOT-CFG no \n 6 - USR-NOT-CFG no \n 7 - USR-NOT-CFG no \n 8 - USR-NOT-CFG no \n 9 - USR-NOT-CFG no \n 10 - USR-NOT-CFG no \n 11 - USR-NOT-CFG no \n 12 - USR-NOT-CFG no \n -----------------------------------------------------------------\nTopology :DUPLEX_CHAIN\nMy Box ID :1\nCurrent state:MASTER\nBox Count :1\n\n\n'
  430. found = False
  431. match = <_sre.SRE_Match object at 0x7fb71e9020a8>
  432. ------------------------------------------------------------------------
  433. File: core/script/base.py (Line: 246)
  434. Function: run
  435. 239 self.logger.info("Using cached result")
  436. 240 cache_hit = True
  437. 241 except KeyError:
  438. 242 pass
  439. 243 # Execute script
  440. 244 if not cache_hit:
  441. 245 try:
  442. 246 ==> result = self.execute(**self.args)
  443. 247 if self.cache and self.parent and result:
  444. 248 self.logger.info("Caching result")
  445. 249 self.set_cache(self.name, self.args, result)
  446. 250 finally:
  447. 251 if not self.parent:
  448. 252 # Close SNMP socket when necessary
  449. Variables:
  450. cache_hit = False
  451. self =
  452. <noc.sa.profiles.DLink.DxS.get_chassis_id.Script object at 0x7fb71ef77f50>
  453. ------------------------------------------------------------------------
  454. File: commands/script.py (Line: 118)
  455. Function: handle
  456. 111 capabilities=caps,
  457. 112 args=args,
  458. 113 version=version,
  459. 114 timeout=3600,
  460. 115 name=script,
  461. 116 collect_beef=bool(beef)
  462. 117 )
  463. 118 ==> result = scr.run()
  464. 119 if pretty:
  465. 120 pprint.pprint(result)
  466. 121 elif yaml:
  467. 122 import yaml
  468. 123 import sys
  469. 124 yaml.dump(result, sys.stdout)
  470. Variables:
  471. obj = <ManagedObject: 10.170.112.9>
  472. beef = None
  473. service = <__main__.ServiceStub object at 0x7fb71ef77710>
  474. script = u'DLink.DxS.get_chassis_id'
  475. script_class = <class 'noc.sa.profiles.DLink.DxS.get_chassis_id.Script'>
  476. self = <__main__.Command object at 0x7fb733b80890>
  477. args = {}
  478. use_snmp = True
  479. caps =
  480. {u'DB | Interfaces': 26,
  481. u'Network | LLDP': True,
  482. u'SNMP': True,
  483. u'SNMP | Bulk': True,
  484. u'SNMP | IF-MIB': True,
  485. u'SNMP | IF-MIB | HC': True,
  486. u'SNMP | v1': True,
  487. u'SNMP | v2c': True,
  488. u'SNMP | v3': False}
  489. yaml = False
  490. object_name = ['10.170.112.9']
  491. version =
  492. {'platform': u'DXS-3326GSR', 'vendor': u'D-Link', 'version': u'4.50-B19'}
  493. arguments = []
  494. pretty = False
  495. credentials =
  496. {'access_preference': u'CS',
  497. 'address': u'10.170.112.9',
  498. 'cli_protocol': 'telnet',
  499. 'password': u'wre4fel',
  500. 'path': None,
  501. 'raise_privileges': True,
  502. 'snmp_ro': u'public',
  503. 'snmp_version': 'v2c',
  504. 'super_password': u'admin',
  505. 'user': u'script2'}
  506. access_preference = None
  507. options = {}
  508. scr =
  509. <noc.sa.profiles.DLink.DxS.get_chassis_id.Script object at 0x7fb71ef77f50>
  510. ------------------------------------------------------------------------
  511. File: core/management/base.py (Line: 75)
  512. Function: run_from_argv
  513. 68 enable_profiling = cmd_options.pop("enable_profiling", False)
  514. 69 show_metrics = cmd_options.pop("show_metrics", False)
  515. 70 if enable_profiling:
  516. 71 # Start profiler
  517. 72 import yappi
  518. 73 yappi.start()
  519. 74 try:
  520. 75 ==> return self.handle(*args, **cmd_options) or 0
  521. 76 except CommandError as e:
  522. 77 self.print(str(e))
  523. 78 return 1
  524. 79 except KeyboardInterrupt:
  525. 80 self.print("Ctrl+C")
  526. 81 return 3
  527. Variables:
  528. parser =
  529. ArgumentParser(prog='script.py', usage=None, description=None, version=None, formatter_class=<class 'argparse.HelpFormatter'>, conflict_handler='error', add_help=True)
  530. loglevel = 'debug'
  531. enable_profiling = False
  532. args = ()
  533. cmd_options =
  534. {'access_preference': None,
  535. 'arguments': [],
  536. 'beef': None,
  537. 'object_name': ['10.170.112.9'],
  538. 'pretty': False,
  539. 'script': ['get_chassis_id'],
  540. 'use_snmp': True,
  541. 'yaml': False}
  542. argv = ['--debug', 'get_chassis_id', '10.170.112.9']
  543. self = <__main__.Command object at 0x7fb733b80890>
  544. show_metrics = False
  545. options =
  546. Namespace(access_preference=None, arguments=[], beef=None, object_name=['10.170.112.9'], pretty=False, script=['get_chassis_id'], use_snmp=True, yaml=False)
  547. ------------------------------------------------------------------------
  548. END OF TRACEBACK
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement