rvsoroka

Untitled

Mar 18th, 2021
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 28.54 KB | None | 0 0
  1. /# ./noc script --debug get_interfaces gw1-krasina2
  2. 2021-03-18 03:56:30,092 [py.warnings] /opt/noc/core/profile/base.py:72: UserWarning: None: 'pattern_more' '^---MORE---' pattern must be of binary type. Support2
  3. warnings.warn(
  4.  
  5. 2021-03-18 10:56:30,219 [noc.core.ioloop.util] Setting up asyncio event loop policy
  6. 2021-03-18 10:56:30,219 [noc.core.ioloop.util] Setting up default event loop
  7. 2021-03-18 10:56:30,219 [asyncio] Using selector: EpollSelector
  8. 2021-03-18 10:56:30,220 [root] Starting DCS runner thread
  9. 2021-03-18 10:56:30,220 [asyncio] Using selector: EpollSelector
  10. 2021-03-18 10:56:30,221 [root] DCS runner thread is ready
  11. 2021-03-18 10:56:30,221 [root] Starting DCS consul://consul:8500/noc
  12. 2021-03-18 10:56:30,272 [noc.core.dcs.base] Resolve near service postgres
  13. 2021-03-18 10:56:30,272 [noc.core.http.client] HTTP GET http://consul:8500/v1/health/service/postgres?passing=1&near=_agent
  14. 2021-03-18 10:56:30,277 [noc.core.http.client] HTTP Response 200
  15. 2021-03-18 10:56:30,277 [noc.core.dcs.base] Resolved near service postgres to ['172.16.0.81:5432']
  16. 2021-03-18 10:56:30,429 [noc.main.models.textindex] Adding FTS index for ip.vrf
  17. 2021-03-18 10:56:30,455 [noc.core.cache.base] Using cache backend: noc.core.cache.mongo.MongoCache
  18. 2021-03-18 10:56:30,488 [noc.main.models.doccategory] Registering Capability
  19. 2021-03-18 10:56:30,489 [noc.main.models.doccategory] Registering MetricType
  20. 2021-03-18 10:56:30,510 [noc.main.models.doccategory] Registering ConnectionType
  21. 2021-03-18 10:56:30,514 [noc.main.models.doccategory] Registering ObjectModel
  22. 2021-03-18 10:56:30,536 [noc.main.models.textindex] Adding FTS index for sa.managedobject
  23. 2021-03-18 10:56:30,544 [asyncio] Using selector: EpollSelector
  24. 2021-03-18 10:56:30,545 [noc.core.dcs.base] [mongo] Starting resolver (near=False)
  25. 2021-03-18 10:56:30,545 [noc.core.dcs.base] [mongo] Requesting changes from index 0
  26. 2021-03-18 10:56:30,545 [noc.core.http.client] HTTP GET http://consul:8500/v1/health/service/mongo?passing=1
  27. 2021-03-18 10:56:30,547 [noc.core.http.client] HTTP Response 200
  28. 2021-03-18 10:56:30,547 [noc.core.dcs.base] [mongo] Index changed 0 -> 138. Applying changes
  29. 2021-03-18 10:56:30,547 [noc.core.dcs.base] [mongo] Set active services to: mongo: 172.16.0.81:27017
  30. 2021-03-18 10:56:30,547 [noc.core.dcs.base] [mongo] Stopping resolver
  31. 2021-03-18 10:56:30,547 [noc.core.mongo.connection] Connecting to MongoDB {'db': 'noc', 'username': 'noc', 'password': '********', 'authentication_source': 'no}
  32. 2021-03-18 10:56:30,652 [noc.core.loader.base] [script] Loading script Eltex.ESR.get_interfaces
  33. 2021-03-18 10:56:30,680 [noc.core.loader.base] [profile] Loading profile Eltex.ESR
  34. 2021-03-18 10:56:30,682 [py.warnings] /opt/noc/core/profile/base.py:72: UserWarning: Eltex.ESR: 'pattern_more' '^More: <space>, Quit: q, One line: <return>$' 2
  35. warnings.warn(
  36.  
  37. 2021-03-18 10:56:30,682 [py.warnings] /opt/noc/core/profile/base.py:78: UserWarning: Eltex.ESR: 'pattern_more' ' ' command must be of binary type. Support for 2
  38. warnings.warn(
  39.  
  40. 2021-03-18 10:56:30,682 [py.warnings] /opt/noc/core/profile/base.py:72: UserWarning: Eltex.ESR: 'pattern_more' '^More\\? Enter - next line; Space - next page; 2
  41. warnings.warn(
  42.  
  43. 2021-03-18 10:56:30,682 [py.warnings] /opt/noc/core/profile/base.py:78: UserWarning: Eltex.ESR: 'pattern_more' 'r' command must be of binary type. Support for 2
  44. warnings.warn(
  45.  
  46. 2021-03-18 10:56:30,682 [py.warnings] /opt/noc/core/profile/base.py:72: UserWarning: Eltex.ESR: 'pattern_more' '\\[Yes/press any key for no\\]' pattern must be2
  47. warnings.warn(
  48.  
  49. 2021-03-18 10:56:30,682 [py.warnings] /opt/noc/core/profile/base.py:78: UserWarning: Eltex.ESR: 'pattern_more' 'Y' command must be of binary type. Support for 2
  50. warnings.warn(
  51.  
  52. 2021-03-18 10:56:30,684 [script] [Eltex.ESR.get_interfaces|172.16.29.254] Filling get_version cache with {'vendor': 'Eltex', 'platform': 'ESR-100', 'version': }
  53. 2021-03-18 10:56:30,684 [script] [Eltex.ESR.get_interfaces|172.16.29.254] Running. Input arguments: {}, timeout 3600
  54. 2021-03-18 10:56:30,684 [script] [Eltex.ESR.get_interfaces|172.16.29.254] Open telnet CLI
  55. 2021-03-18 10:56:30,689 [script] [Eltex.ESR.get_interfaces|172.16.29.254] Disable paging
  56. 2021-03-18 10:56:30,689 [asyncio] Using selector: EpollSelector
  57. 2021-03-18 10:56:30,689 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Connecting 172.16.29.254
  58. 2021-03-18 10:56:30,689 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Setting TCP NODELAY
  59. 2021-03-18 10:56:30,689 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Settings KEEPALIVE
  60. 2021-03-18 10:56:30,689 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Setting TCP KEEPIDLE to 10
  61. 2021-03-18 10:56:30,689 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Setting TCP KEEPINTVL to 10
  62. 2021-03-18 10:56:30,689 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Setting TCP KEEPCNT to 3
  63. 2021-03-18 10:56:30,692 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Connected
  64. 2021-03-18 10:56:30,692 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Changing state to <start>
  65. 2021-03-18 10:56:30,692 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Setting timeout: 50s, error=CLIStartTimeout
  66. 2021-03-18 10:56:30,694 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Received DO ECHO
  67. 2021-03-18 10:56:30,694 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Send WILL ECHO
  68. 2021-03-18 10:56:30,694 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Received DO NAWS
  69. 2021-03-18 10:56:30,695 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Send WILL NAWS
  70. 2021-03-18 10:56:30,695 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Send IAC SB WS b'\x00\x80\x00\x80' IAC SE
  71. 2021-03-18 10:56:30,695 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Received WILL ECHO
  72. 2021-03-18 10:56:30,695 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Send DO ECHO
  73. 2021-03-18 10:56:30,695 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Received WILL SGA
  74. 2021-03-18 10:56:30,695 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Send DO SGA
  75. 2021-03-18 10:56:30,696 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Received: b'\r\r\n'
  76. 2021-03-18 10:56:30,738 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Received: b'gw1-krasina2 login: '
  77. 2021-03-18 10:56:30,738 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Match: b'([Uu]ser ?[Nn]ame|[Ll]ogin): ?'
  78. 2021-03-18 10:56:30,738 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Changing state to <username>
  79. 2021-03-18 10:56:30,738 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Send: b'nocp\n'
  80. 2021-03-18 10:56:30,738 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Setting timeout: 30s, error=CLIUsernameTimeout
  81. 2021-03-18 10:56:30,741 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Received: b'nocp\r\n'
  82. 2021-03-18 10:56:30,783 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Received: b'Password: '
  83. 2021-03-18 10:56:30,783 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Match: b'[Pp]ass[Ww]ord: ?'
  84. 2021-03-18 10:56:30,783 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Changing state to <password>
  85. 2021-03-18 10:56:30,783 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Send: b'*************'
  86. 2021-03-18 10:56:30,784 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Setting timeout: 30s, error=CLIPasswordTimeout
  87. 2021-03-18 10:56:30,786 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Received: b'\r\n'
  88. 2021-03-18 10:56:31,914 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Received: b'\r\n'
  89. 2021-03-18 10:56:31,916 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Received: b'********************************************\r\n* Wel'
  90. 2021-03-18 10:56:31,916 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Match: b'^\\S+#'
  91. 2021-03-18 10:56:31,917 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Changing state to <prompt>
  92. 2021-03-18 10:56:31,917 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Setting timeout: 3600s, error=CLIConnectionReset
  93. 2021-03-18 10:56:31,917 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Send: b'terminal datadump\n'
  94. 2021-03-18 10:56:31,920 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Received: b'\x1b[128D\x1b[14C\x1b[Jt\x1b[129D\x1b[15C'
  95. 2021-03-18 10:56:31,961 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Received: b'\x1b[128D\x1b[14C\x1b[Jte\x1b[129D\x1b[16C\x1b[128D\x1b[14C\x1b['
  96. 2021-03-18 10:56:32,066 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Received: b'gw1-krasina2# '
  97. 2021-03-18 10:56:32,067 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Match: b'^\\S+#'
  98. 2021-03-18 10:56:32,067 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Changing state to <prompt>
  99. 2021-03-18 10:56:32,067 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Setting timeout: 3600s, error=CLIConnectionReset
  100. 2021-03-18 10:56:32,067 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Command: b'terminal datadump'
  101. ttetertermtermiterminterminaterminalterminal terminal dterminal daterminal datterminal dataterminal datadterminal dataduterminal datadumterminal datadump
  102.  
  103. 2021-03-18 10:56:32,068 [asyncio] Using selector: EpollSelector
  104. 2021-03-18 10:56:32,068 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Send: b'show spanning-tree active\n'
  105. 2021-03-18 10:56:32,076 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Received: b'\x1b[128D\x1b[14C\x1b[Js\x1b[129D\x1b[15C\x1b[128D\x1b[14C\x1b[J'
  106. 2021-03-18 10:56:32,118 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Received: b'\r\nSyntax error: Illegal command line\r\ngw1-krasina2# \x07\x1b'
  107. 2021-03-18 10:56:32,118 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Match: b'^\\S+#'
  108. 2021-03-18 10:56:32,118 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Changing state to <prompt>
  109. 2021-03-18 10:56:32,118 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Setting timeout: 3600s, error=CLIConnectionReset
  110. 2021-03-18 10:56:32,118 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Command: b'show spanning-tree active'
  111. sshshoshowshow show sshow spshow spashow spanshow spannshow spannishow spanninshow spanningshow spanning-show spanning-tshow spanning-trshow spanning-treshow se
  112. Syntax error: Illegal command line
  113.  
  114. 2021-03-18 10:56:32,118 [asyncio] Using selector: EpollSelector
  115. 2021-03-18 10:56:32,119 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Send: b'show vrrp\n'
  116. 2021-03-18 10:56:32,121 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Received: b'\x1b[128D\x1b[14C\x1b[Js\x1b[129D\x1b[15C'
  117. 2021-03-18 10:56:32,163 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Received: b'\x1b[128D\x1b[14C\x1b[Jsh\x1b[129D\x1b[16C\x1b[128D\x1b[14C\x1b['
  118. 2021-03-18 10:56:32,237 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Received: b'gw1-krasina2# '
  119. 2021-03-18 10:56:32,238 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Match: b'^\\S+#'
  120. 2021-03-18 10:56:32,238 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Changing state to <prompt>
  121. 2021-03-18 10:56:32,238 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Setting timeout: 3600s, error=CLIConnectionReset
  122. 2021-03-18 10:56:32,238 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Command: b'show vrrp'
  123. sshshoshowshow show vshow vrshow vrrshow vrrp
  124.  
  125. 2021-03-18 10:56:32,238 [asyncio] Using selector: EpollSelector
  126. 2021-03-18 10:56:32,238 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Send: b'show interfaces description\n'
  127. 2021-03-18 10:56:32,249 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Received: b'\x1b[128D\x1b[14C\x1b[Js\x1b[129D\x1b[15C\x1b[128D\x1b[14C\x1b[J'
  128. 2021-03-18 10:56:32,291 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Received: b'\r\n'
  129. 2021-03-18 10:56:32,298 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Received: b'Interface Admin Link Description '
  130. 2021-03-18 10:56:32,301 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Received: b'gi1/0/2 Up Up new-Internet-Connect '
  131. 2021-03-18 10:56:32,303 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Received: b'gi1/0/3.10 Up Up USERS-NET '
  132. 2021-03-18 10:56:32,305 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Received: b'gi1/0/3.13 Up Up OK-net '
  133. 2021-03-18 10:56:32,307 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Received: b'gi1/0/3.84 Up Up MGMT '
  134. 2021-03-18 10:56:32,309 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Received: b'gi1/0/4 Up Down -- '
  135. 2021-03-18 10:56:32,455 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Received: b'gw1-krasina2# '
  136. 2021-03-18 10:56:32,456 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Match: b'^\\S+#'
  137. 2021-03-18 10:56:32,456 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Changing state to <prompt>
  138. 2021-03-18 10:56:32,456 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Setting timeout: 3600s, error=CLIConnectionReset
  139. 2021-03-18 10:56:32,456 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Command: b'show interfaces description'
  140. sshshoshowshow show ishow inshow intshow inteshow intershow interfshow interfashow interfacshow interfaceshow interfacesshow interfaces show interfaces dshow in
  141. Interface Admin Link Description
  142. State State
  143. ------------------ ----- ----- ----------------------------------------------------
  144. gi1/0/1 Up Up --
  145. gi1/0/2 Up Up new-Internet-Connect
  146. gi1/0/3 Up Up --
  147. gi1/0/3.10 Up Up USERS-NET
  148. gi1/0/3.11 Up Up printers-network
  149. gi1/0/3.12 Up Up BUH-net
  150. gi1/0/3.13 Up Up OK-net
  151. gi1/0/3.15 Up Up WiFi-net
  152. gi1/0/3.50 Up Up VOIP-PHONES
  153. gi1/0/3.84 Up Up MGMT
  154. gi1/0/3.99 Up Up --
  155. gi1/0/3.100 Up Up SRV-Intra
  156. gi1/0/4 Up Down --
  157.  
  158. 2021-03-18 10:56:32,457 [asyncio] Using selector: EpollSelector
  159. 2021-03-18 10:56:32,458 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Send: b'show ip interfaces\n'
  160. 2021-03-18 10:56:32,470 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Received: b'\x1b[128D\x1b[14C\x1b[Js\x1b[129D\x1b[15C\x1b[128D\x1b[14C\x1b[J'
  161. 2021-03-18 10:56:32,511 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Received: b'\r\n'
  162. 2021-03-18 10:56:32,603 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Received: b'IP address Interface '
  163. 2021-03-18 10:56:32,751 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Received: b'gw1-krasina2# '
  164. 2021-03-18 10:56:32,751 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Match: b'^\\S+#'
  165. 2021-03-18 10:56:32,751 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Changing state to <prompt>
  166. 2021-03-18 10:56:32,751 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Setting timeout: 3600s, error=CLIConnectionReset
  167. 2021-03-18 10:56:32,751 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Command: b'show ip interfaces'
  168. sshshoshowshow show ishow ipshow ip show ip ishow ip inshow ip intshow ip inteshow ip intershow ip interfshow ip interfashow ip interfacshow ip interfaceshow is
  169. IP address Interface Admin Link Type
  170. --------------------------------------------------- ------------------ ----- ----- -------
  171. 195.91.128.26/29 gi1/0/1 Up Up static
  172. 46.39.232.58/30 gi1/0/2 Up Up static
  173. 172.16.24.254/24 gi1/0/3.10 Up Up static
  174. 172.16.25.254/24 gi1/0/3.11 Up Up static
  175. 172.16.26.1/25 gi1/0/3.12 Up Up static
  176. 172.16.26.129/25 gi1/0/3.13 Up Up static
  177. 172.16.27.254/24 gi1/0/3.15 Up Up static
  178. 172.16.28.254/24 gi1/0/3.50 Up Up static
  179. 172.16.84.254/24 gi1/0/3.84 Up Up static
  180. 172.16.23.1/29 gi1/0/3.99 Up Up static
  181. 172.16.29.254/24 gi1/0/3.100 Up Up static
  182.  
  183. 2021-03-18 10:56:32,752 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Closing stream
  184. 2021-03-18 10:56:32,793 [noc.core.debug] UNHANDLED EXCEPTION (2021-03-18 10:56:32.770937)
  185. PROCESS: ./commands/script.py
  186. VERSION: 20.4.3
  187. BRANCH: HEAD CHANGESET: c86766dc
  188. ERROR FINGERPRINT: 1b881e55-235d-58a3-8179-baacf9ced3bb
  189. WORKING DIRECTORY: /opt/noc
  190. EXCEPTION: <class 'ValueError'> too many values to unpack (expected 3)
  191. START OF TRACEBACK
  192. ------------------------------------------------------------------------
  193. File: sa/profiles/Eltex/ESR/get_interfaces.py (Line: 46)
  194. Function: execute_cli
  195. 39 descriptions = {}
  196. 40 c = self.cli("show interfaces description", cached=True)
  197. 41 for ifname, astate, lstate, descr in parse_table(c):
  198. 42 if descr != "--":
  199. 43 descriptions[ifname] = descr
  200. 44 ip_addresses = {}
  201. 45 c = self.cli("show ip interfaces", cached=True)
  202. 46 ==> for ip, ifname, itype in parse_table(c):
  203. 47 ip_addresses[ifname] = ip
  204. 48 ipv6_addresses = {}
  205. 49 c = self.cli("show ipv6 interfaces", cached=True)
  206. 50 for ip, ifname, itype in parse_table(c):
  207. 51 ipv6_addresses[ifname] = ip
  208. 52 interfaces = []
  209. Variables:
  210. self =
  211. <noc.sa.profiles.Eltex.ESR.get_interfaces.Script object at 0x7f49a0d5f5b0>
  212. interface = None
  213. stp = []
  214. c =
  215. ('sshshoshowshow show ishow ipshow ip show ip ishow ip inshow ip intshow ip '
  216. 'inteshow ip intershow ip interfshow ip interfashow ip interfacshow ip '
  217. 'interfaceshow ip interfaces\n'
  218. 'IP address Interface '
  219. 'Admin Link Type \n'
  220. '--------------------------------------------------- ------------------ '
  221. '----- ----- ------- \n'
  222. '195.91.128.26/29 gi1/0/1 '
  223. 'Up Up static \n'
  224. '46.39.232.58/30 gi1/0/2 '
  225. 'Up Up static \n'
  226. '172.16.24.254/24 gi1/0/3.10 '
  227. 'Up Up static \n'
  228. '172.16.25.254/24 gi1/0/3.11 '
  229. 'Up Up static \n'
  230. '172.16.26.1/25 gi1/0/3.12 '
  231. 'Up Up static \n'
  232. '172.16.26.129/25 gi1/0/3.13 '
  233. 'Up Up static \n'
  234. '172.16.27.254/24 gi1/0/3.15 '
  235. 'Up Up static \n'
  236. '172.16.28.254/24 gi1/0/3.50 '
  237. 'Up Up static \n'
  238. '172.16.84.254/24 gi1/0/3.84 '
  239. 'Up Up static \n'
  240. '172.16.23.1/29 gi1/0/3.99 '
  241. 'Up Up static \n'
  242. '172.16.29.254/24 gi1/0/3.100 '
  243. 'Up Up static \n')
  244. ifname = 'gi1/0/4'
  245. vrrp = []
  246. descriptions =
  247. {'gi1/0/2': 'new-Internet-Connect',
  248. 'gi1/0/3.10': 'USERS-NET',
  249. 'gi1/0/3.100': 'SRV-Intra',
  250. 'gi1/0/3.11': 'printers-network',
  251. 'gi1/0/3.12': 'BUH-net',
  252. 'gi1/0/3.13': 'OK-net',
  253. 'gi1/0/3.15': 'WiFi-net',
  254. 'gi1/0/3.50': 'VOIP-PHONES',
  255. 'gi1/0/3.84': 'MGMT'}
  256. astate = 'Up'
  257. lstate = 'Down'
  258. descr = '--'
  259. ip_addresses = {}
  260. ------------------------------------------------------------------------
  261. File: core/script/base.py (Line: 488)
  262. Function: call_method
  263. 481 if isinstance(handler, str):
  264. 482 handler = getattr(self, handler, None)
  265. 483 if handler is None:
  266. 484 self.logger.debug("No '%s' handler. Passing to next method" % m)
  267. 485 continue
  268. 486 # Call handler
  269. 487 try:
  270. 488 ==> r = handler(**kwargs)
  271. 489 if isinstance(r, PartialResult):
  272. 490 if self.partial_result:
  273. 491 self.partial_result.update(r.result)
  274. 492 else:
  275. 493 self.partial_result = r.result
  276. 494 self.logger.debug(
  277. Variables:
  278. self =
  279. <noc.sa.profiles.Eltex.ESR.get_interfaces.Script object at 0x7f49a0d5f5b0>
  280. cli_handler =
  281. <bound method Script.execute_cli of <noc.sa.profiles.Eltex.ESR.get_interfaces.Script object at 0x7f49a0d5f5b0>>
  282. snmp_handler =
  283. <bound method Script.execute_snmp of <noc.sa.profiles.Eltex.ESR.get_interfaces.Script object at 0x7f49a0d5f5b0>>
  284. fallback_handler = None
  285. kwargs = {}
  286. access_preference = 'CS*'
  287. m = 'C'
  288. handler =
  289. <bound method Script.execute_cli of <noc.sa.profiles.Eltex.ESR.get_interfaces.Script object at 0x7f49a0d5f5b0>>
  290. ------------------------------------------------------------------------
  291. File: core/script/base.py (Line: 451)
  292. Function: execute
  293. 444 for f in self._execute_chain:
  294. 445 if f._match(self, self.version):
  295. 446 return f(self, **kwargs)
  296. 447 # Raise error
  297. 448 raise self.NotSupportedError()
  298. 449 else:
  299. 450 # New SNMP/CLI API
  300. 451 ==> return self.call_method(
  301. 452 cli_handler=self.execute_cli, snmp_handler=self.execute_snmp, **kwargs
  302. 453 )
  303. 454
  304. 455 def call_method(self, cli_handler=None, snmp_handler=None, fallback_handler=None, **kwargs):
  305. 456 """
  306. 457 Call function depending on access_preference
  307. Variables:
  308. self =
  309. <noc.sa.profiles.Eltex.ESR.get_interfaces.Script object at 0x7f49a0d5f5b0>
  310. kwargs = {}
  311. ------------------------------------------------------------------------
  312. File: core/script/base.py (Line: 307)
  313. Function: run
  314. 300 self.logger.info("Using cached result")
  315. 301 cache_hit = True
  316. 302 except KeyError:
  317. 303 pass
  318. 304 # Execute script
  319. 305 if not cache_hit:
  320. 306 try:
  321. 307 ==> result = self.execute(**self.args)
  322. 308 if self.cache and self.parent and result:
  323. 309 self.logger.info("Caching result")
  324. 310 self.set_cache(self.name, self.args, result)
  325. 311 finally:
  326. 312 if not self.parent:
  327. 313 # Close SNMP socket when necessary
  328. Variables:
  329. self =
  330. <noc.sa.profiles.Eltex.ESR.get_interfaces.Script object at 0x7f49a0d5f5b0>
  331. cache_hit = False
  332. ------------------------------------------------------------------------
  333. File: commands/script.py (Line: 149)
  334. Function: handle
  335. 142 name=script,
  336. 143 )
  337. 144 span_sample = 1 if update_spec or beef_output else 0
  338. 145 result = ""
  339. 146 if beef_output:
  340. 147 scr.start_tracking()
  341. 148 with Span(sample=span_sample, suppress_trace=span_sample):
  342. 149 ==> result = scr.run()
  343. 150 if pretty:
  344. 151 pprint.pprint(result)
  345. 152 elif yaml_o:
  346. 153 import sys
  347. 154
  348. 155 yaml.dump(result, sys.stdout)
  349. Variables:
  350. self = <__main__.Command object at 0x7f49ac1431f0>
  351. script = 'Eltex.ESR.get_interfaces'
  352. object_name = ['gw1-krasina2']
  353. arguments = []
  354. pretty = False
  355. yaml_o = False
  356. use_snmp = True
  357. access_preference = None
  358. snmp_rate_limit = 0
  359. update_spec = None
  360. beef_output = None
  361. args = {}
  362. options = {}
  363. obj = <ManagedObject: gw1-krasina2>
  364. credentials =
  365. {'access_preference': 'CS',
  366. 'address': '172.16.29.254',
  367. 'cli_protocol': 'telnet',
  368. 'password': '***********',
  369. 'path': None,
  370. 'raise_privileges': True,
  371. 'snmp_rate_limit': None,
  372. 'super_password': '**************',
  373. 'user': 'nocp'}
  374. script_class = <class 'noc.sa.profiles.Eltex.ESR.get_interfaces.Script'>
  375. caps =
  376. {'Network | IPv6': True,
  377. 'Network | LLDP': True,
  378. 'SNMP': False,
  379. 'SNMP | v1': False,
  380. 'SNMP | v2c': False}
  381. version =
  382. {'caps': {'Network | IPv6': True,
  383. 'Network | LLDP': True,
  384. 'SNMP': False,
  385. 'SNMP | v1': False,
  386. 'SNMP | v2c': False},
  387. 'image': None,
  388. 'platform': 'ESR-100',
  389. 'vendor': 'Eltex',
  390. 'version': '1.12.0'}
  391. service = <__main__.ServiceStub object at 0x7f49a0d82e50>
  392. scr =
  393. <noc.sa.profiles.Eltex.ESR.get_interfaces.Script object at 0x7f49a0d5f5b0>
  394. span_sample = 0
  395. result = ''
  396. ------------------------------------------------------------------------
  397. File: core/management/base.py (Line: 78)
  398. Function: run_from_argv
  399. 71 self.no_progressbar = cmd_options.pop("no_progressbar", False)
  400. 72 if enable_profiling:
  401. 73 # Start profiler
  402. 74 import yappi
  403. 75
  404. 76 yappi.start()
  405. 77 try:
  406. 78 ==> return self.handle(*args, **cmd_options) or 0
  407. 79 except CommandError as e:
  408. 80 self.print(str(e))
  409. 81 return 1
  410. 82 except KeyboardInterrupt:
  411. 83 self.print("Ctrl+C")
  412. 84 return 3
  413. Variables:
  414. self = <__main__.Command object at 0x7f49ac1431f0>
  415. argv = ['--debug', 'get_interfaces', 'gw1-krasina2']
  416. parser =
  417. ArgumentParser(prog='noc script', usage=None, description=None, formatter_class=<class 'argparse.HelpFormatter'>, conflict_handler='error', add_help=True)
  418. options =
  419. Namespace(access_preference=None, arguments=[], beef_output=None, object_name=['gw1-krasina2'], pretty=False, script=['get_interfaces'], snmp_rate_limit=0, upd)
  420. cmd_options =
  421. {'access_preference': None,
  422. 'arguments': [],
  423. 'beef_output': None,
  424. 'object_name': ['gw1-krasina2'],
  425. 'pretty': False,
  426. 'script': ['get_interfaces'],
  427. 'snmp_rate_limit': 0,
  428. 'update_spec': None,
  429. 'use_snmp': True,
  430. 'yaml_o': False}
  431. args = ()
  432. loglevel = 'debug'
  433. enable_profiling = False
  434. show_metrics = False
  435. error_report = <function error_report at 0x7f4a0f68c940>
  436. ------------------------------------------------------------------------
  437. END OF TRACEBACK
  438.  
Advertisement
Add Comment
Please, Sign In to add comment