Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /# ./noc script --debug get_interfaces gw1-krasina2
- 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
- warnings.warn(
- 2021-03-18 10:56:30,219 [noc.core.ioloop.util] Setting up asyncio event loop policy
- 2021-03-18 10:56:30,219 [noc.core.ioloop.util] Setting up default event loop
- 2021-03-18 10:56:30,219 [asyncio] Using selector: EpollSelector
- 2021-03-18 10:56:30,220 [root] Starting DCS runner thread
- 2021-03-18 10:56:30,220 [asyncio] Using selector: EpollSelector
- 2021-03-18 10:56:30,221 [root] DCS runner thread is ready
- 2021-03-18 10:56:30,221 [root] Starting DCS consul://consul:8500/noc
- 2021-03-18 10:56:30,272 [noc.core.dcs.base] Resolve near service postgres
- 2021-03-18 10:56:30,272 [noc.core.http.client] HTTP GET http://consul:8500/v1/health/service/postgres?passing=1&near=_agent
- 2021-03-18 10:56:30,277 [noc.core.http.client] HTTP Response 200
- 2021-03-18 10:56:30,277 [noc.core.dcs.base] Resolved near service postgres to ['172.16.0.81:5432']
- 2021-03-18 10:56:30,429 [noc.main.models.textindex] Adding FTS index for ip.vrf
- 2021-03-18 10:56:30,455 [noc.core.cache.base] Using cache backend: noc.core.cache.mongo.MongoCache
- 2021-03-18 10:56:30,488 [noc.main.models.doccategory] Registering Capability
- 2021-03-18 10:56:30,489 [noc.main.models.doccategory] Registering MetricType
- 2021-03-18 10:56:30,510 [noc.main.models.doccategory] Registering ConnectionType
- 2021-03-18 10:56:30,514 [noc.main.models.doccategory] Registering ObjectModel
- 2021-03-18 10:56:30,536 [noc.main.models.textindex] Adding FTS index for sa.managedobject
- 2021-03-18 10:56:30,544 [asyncio] Using selector: EpollSelector
- 2021-03-18 10:56:30,545 [noc.core.dcs.base] [mongo] Starting resolver (near=False)
- 2021-03-18 10:56:30,545 [noc.core.dcs.base] [mongo] Requesting changes from index 0
- 2021-03-18 10:56:30,545 [noc.core.http.client] HTTP GET http://consul:8500/v1/health/service/mongo?passing=1
- 2021-03-18 10:56:30,547 [noc.core.http.client] HTTP Response 200
- 2021-03-18 10:56:30,547 [noc.core.dcs.base] [mongo] Index changed 0 -> 138. Applying changes
- 2021-03-18 10:56:30,547 [noc.core.dcs.base] [mongo] Set active services to: mongo: 172.16.0.81:27017
- 2021-03-18 10:56:30,547 [noc.core.dcs.base] [mongo] Stopping resolver
- 2021-03-18 10:56:30,547 [noc.core.mongo.connection] Connecting to MongoDB {'db': 'noc', 'username': 'noc', 'password': '********', 'authentication_source': 'no}
- 2021-03-18 10:56:30,652 [noc.core.loader.base] [script] Loading script Eltex.ESR.get_interfaces
- 2021-03-18 10:56:30,680 [noc.core.loader.base] [profile] Loading profile Eltex.ESR
- 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
- warnings.warn(
- 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
- warnings.warn(
- 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
- warnings.warn(
- 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
- warnings.warn(
- 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
- warnings.warn(
- 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
- warnings.warn(
- 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': }
- 2021-03-18 10:56:30,684 [script] [Eltex.ESR.get_interfaces|172.16.29.254] Running. Input arguments: {}, timeout 3600
- 2021-03-18 10:56:30,684 [script] [Eltex.ESR.get_interfaces|172.16.29.254] Open telnet CLI
- 2021-03-18 10:56:30,689 [script] [Eltex.ESR.get_interfaces|172.16.29.254] Disable paging
- 2021-03-18 10:56:30,689 [asyncio] Using selector: EpollSelector
- 2021-03-18 10:56:30,689 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Connecting 172.16.29.254
- 2021-03-18 10:56:30,689 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Setting TCP NODELAY
- 2021-03-18 10:56:30,689 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Settings KEEPALIVE
- 2021-03-18 10:56:30,689 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Setting TCP KEEPIDLE to 10
- 2021-03-18 10:56:30,689 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Setting TCP KEEPINTVL to 10
- 2021-03-18 10:56:30,689 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Setting TCP KEEPCNT to 3
- 2021-03-18 10:56:30,692 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Connected
- 2021-03-18 10:56:30,692 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Changing state to <start>
- 2021-03-18 10:56:30,692 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Setting timeout: 50s, error=CLIStartTimeout
- 2021-03-18 10:56:30,694 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Received DO ECHO
- 2021-03-18 10:56:30,694 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Send WILL ECHO
- 2021-03-18 10:56:30,694 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Received DO NAWS
- 2021-03-18 10:56:30,695 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Send WILL NAWS
- 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
- 2021-03-18 10:56:30,695 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Received WILL ECHO
- 2021-03-18 10:56:30,695 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Send DO ECHO
- 2021-03-18 10:56:30,695 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Received WILL SGA
- 2021-03-18 10:56:30,695 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Send DO SGA
- 2021-03-18 10:56:30,696 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Received: b'\r\r\n'
- 2021-03-18 10:56:30,738 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Received: b'gw1-krasina2 login: '
- 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): ?'
- 2021-03-18 10:56:30,738 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Changing state to <username>
- 2021-03-18 10:56:30,738 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Send: b'nocp\n'
- 2021-03-18 10:56:30,738 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Setting timeout: 30s, error=CLIUsernameTimeout
- 2021-03-18 10:56:30,741 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Received: b'nocp\r\n'
- 2021-03-18 10:56:30,783 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Received: b'Password: '
- 2021-03-18 10:56:30,783 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Match: b'[Pp]ass[Ww]ord: ?'
- 2021-03-18 10:56:30,783 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Changing state to <password>
- 2021-03-18 10:56:30,783 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Send: b'*************'
- 2021-03-18 10:56:30,784 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Setting timeout: 30s, error=CLIPasswordTimeout
- 2021-03-18 10:56:30,786 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Received: b'\r\n'
- 2021-03-18 10:56:31,914 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Received: b'\r\n'
- 2021-03-18 10:56:31,916 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Received: b'********************************************\r\n* Wel'
- 2021-03-18 10:56:31,916 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Match: b'^\\S+#'
- 2021-03-18 10:56:31,917 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Changing state to <prompt>
- 2021-03-18 10:56:31,917 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Setting timeout: 3600s, error=CLIConnectionReset
- 2021-03-18 10:56:31,917 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Send: b'terminal datadump\n'
- 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'
- 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['
- 2021-03-18 10:56:32,066 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Received: b'gw1-krasina2# '
- 2021-03-18 10:56:32,067 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Match: b'^\\S+#'
- 2021-03-18 10:56:32,067 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Changing state to <prompt>
- 2021-03-18 10:56:32,067 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Setting timeout: 3600s, error=CLIConnectionReset
- 2021-03-18 10:56:32,067 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Command: b'terminal datadump'
- ttetertermtermiterminterminaterminalterminal terminal dterminal daterminal datterminal dataterminal datadterminal dataduterminal datadumterminal datadump
- 2021-03-18 10:56:32,068 [asyncio] Using selector: EpollSelector
- 2021-03-18 10:56:32,068 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Send: b'show spanning-tree active\n'
- 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'
- 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'
- 2021-03-18 10:56:32,118 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Match: b'^\\S+#'
- 2021-03-18 10:56:32,118 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Changing state to <prompt>
- 2021-03-18 10:56:32,118 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Setting timeout: 3600s, error=CLIConnectionReset
- 2021-03-18 10:56:32,118 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Command: b'show spanning-tree active'
- sshshoshowshow show sshow spshow spashow spanshow spannshow spannishow spanninshow spanningshow spanning-show spanning-tshow spanning-trshow spanning-treshow se
- Syntax error: Illegal command line
- 2021-03-18 10:56:32,118 [asyncio] Using selector: EpollSelector
- 2021-03-18 10:56:32,119 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Send: b'show vrrp\n'
- 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'
- 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['
- 2021-03-18 10:56:32,237 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Received: b'gw1-krasina2# '
- 2021-03-18 10:56:32,238 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Match: b'^\\S+#'
- 2021-03-18 10:56:32,238 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Changing state to <prompt>
- 2021-03-18 10:56:32,238 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Setting timeout: 3600s, error=CLIConnectionReset
- 2021-03-18 10:56:32,238 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Command: b'show vrrp'
- sshshoshowshow show vshow vrshow vrrshow vrrp
- 2021-03-18 10:56:32,238 [asyncio] Using selector: EpollSelector
- 2021-03-18 10:56:32,238 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Send: b'show interfaces description\n'
- 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'
- 2021-03-18 10:56:32,291 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Received: b'\r\n'
- 2021-03-18 10:56:32,298 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Received: b'Interface Admin Link Description '
- 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 '
- 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 '
- 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 '
- 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 '
- 2021-03-18 10:56:32,309 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Received: b'gi1/0/4 Up Down -- '
- 2021-03-18 10:56:32,455 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Received: b'gw1-krasina2# '
- 2021-03-18 10:56:32,456 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Match: b'^\\S+#'
- 2021-03-18 10:56:32,456 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Changing state to <prompt>
- 2021-03-18 10:56:32,456 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Setting timeout: 3600s, error=CLIConnectionReset
- 2021-03-18 10:56:32,456 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Command: b'show interfaces description'
- sshshoshowshow show ishow inshow intshow inteshow intershow interfshow interfashow interfacshow interfaceshow interfacesshow interfaces show interfaces dshow in
- Interface Admin Link Description
- State State
- ------------------ ----- ----- ----------------------------------------------------
- gi1/0/1 Up Up --
- gi1/0/2 Up Up new-Internet-Connect
- gi1/0/3 Up Up --
- gi1/0/3.10 Up Up USERS-NET
- gi1/0/3.11 Up Up printers-network
- gi1/0/3.12 Up Up BUH-net
- gi1/0/3.13 Up Up OK-net
- gi1/0/3.15 Up Up WiFi-net
- gi1/0/3.50 Up Up VOIP-PHONES
- gi1/0/3.84 Up Up MGMT
- gi1/0/3.99 Up Up --
- gi1/0/3.100 Up Up SRV-Intra
- gi1/0/4 Up Down --
- 2021-03-18 10:56:32,457 [asyncio] Using selector: EpollSelector
- 2021-03-18 10:56:32,458 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Send: b'show ip interfaces\n'
- 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'
- 2021-03-18 10:56:32,511 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Received: b'\r\n'
- 2021-03-18 10:56:32,603 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Received: b'IP address Interface '
- 2021-03-18 10:56:32,751 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Received: b'gw1-krasina2# '
- 2021-03-18 10:56:32,751 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Match: b'^\\S+#'
- 2021-03-18 10:56:32,751 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Changing state to <prompt>
- 2021-03-18 10:56:32,751 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Setting timeout: 3600s, error=CLIConnectionReset
- 2021-03-18 10:56:32,751 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Command: b'show ip interfaces'
- 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
- IP address Interface Admin Link Type
- --------------------------------------------------- ------------------ ----- ----- -------
- 195.91.128.26/29 gi1/0/1 Up Up static
- 46.39.232.58/30 gi1/0/2 Up Up static
- 172.16.24.254/24 gi1/0/3.10 Up Up static
- 172.16.25.254/24 gi1/0/3.11 Up Up static
- 172.16.26.1/25 gi1/0/3.12 Up Up static
- 172.16.26.129/25 gi1/0/3.13 Up Up static
- 172.16.27.254/24 gi1/0/3.15 Up Up static
- 172.16.28.254/24 gi1/0/3.50 Up Up static
- 172.16.84.254/24 gi1/0/3.84 Up Up static
- 172.16.23.1/29 gi1/0/3.99 Up Up static
- 172.16.29.254/24 gi1/0/3.100 Up Up static
- 2021-03-18 10:56:32,752 [script] [Eltex.ESR.get_interfaces|172.16.29.254] [telnet] Closing stream
- 2021-03-18 10:56:32,793 [noc.core.debug] UNHANDLED EXCEPTION (2021-03-18 10:56:32.770937)
- PROCESS: ./commands/script.py
- VERSION: 20.4.3
- BRANCH: HEAD CHANGESET: c86766dc
- ERROR FINGERPRINT: 1b881e55-235d-58a3-8179-baacf9ced3bb
- WORKING DIRECTORY: /opt/noc
- EXCEPTION: <class 'ValueError'> too many values to unpack (expected 3)
- START OF TRACEBACK
- ------------------------------------------------------------------------
- File: sa/profiles/Eltex/ESR/get_interfaces.py (Line: 46)
- Function: execute_cli
- 39 descriptions = {}
- 40 c = self.cli("show interfaces description", cached=True)
- 41 for ifname, astate, lstate, descr in parse_table(c):
- 42 if descr != "--":
- 43 descriptions[ifname] = descr
- 44 ip_addresses = {}
- 45 c = self.cli("show ip interfaces", cached=True)
- 46 ==> for ip, ifname, itype in parse_table(c):
- 47 ip_addresses[ifname] = ip
- 48 ipv6_addresses = {}
- 49 c = self.cli("show ipv6 interfaces", cached=True)
- 50 for ip, ifname, itype in parse_table(c):
- 51 ipv6_addresses[ifname] = ip
- 52 interfaces = []
- Variables:
- self =
- <noc.sa.profiles.Eltex.ESR.get_interfaces.Script object at 0x7f49a0d5f5b0>
- interface = None
- stp = []
- c =
- ('sshshoshowshow show ishow ipshow ip show ip ishow ip inshow ip intshow ip '
- 'inteshow ip intershow ip interfshow ip interfashow ip interfacshow ip '
- 'interfaceshow ip interfaces\n'
- 'IP address Interface '
- 'Admin Link Type \n'
- '--------------------------------------------------- ------------------ '
- '----- ----- ------- \n'
- '195.91.128.26/29 gi1/0/1 '
- 'Up Up static \n'
- '46.39.232.58/30 gi1/0/2 '
- 'Up Up static \n'
- '172.16.24.254/24 gi1/0/3.10 '
- 'Up Up static \n'
- '172.16.25.254/24 gi1/0/3.11 '
- 'Up Up static \n'
- '172.16.26.1/25 gi1/0/3.12 '
- 'Up Up static \n'
- '172.16.26.129/25 gi1/0/3.13 '
- 'Up Up static \n'
- '172.16.27.254/24 gi1/0/3.15 '
- 'Up Up static \n'
- '172.16.28.254/24 gi1/0/3.50 '
- 'Up Up static \n'
- '172.16.84.254/24 gi1/0/3.84 '
- 'Up Up static \n'
- '172.16.23.1/29 gi1/0/3.99 '
- 'Up Up static \n'
- '172.16.29.254/24 gi1/0/3.100 '
- 'Up Up static \n')
- ifname = 'gi1/0/4'
- vrrp = []
- descriptions =
- {'gi1/0/2': 'new-Internet-Connect',
- 'gi1/0/3.10': 'USERS-NET',
- 'gi1/0/3.100': 'SRV-Intra',
- 'gi1/0/3.11': 'printers-network',
- 'gi1/0/3.12': 'BUH-net',
- 'gi1/0/3.13': 'OK-net',
- 'gi1/0/3.15': 'WiFi-net',
- 'gi1/0/3.50': 'VOIP-PHONES',
- 'gi1/0/3.84': 'MGMT'}
- astate = 'Up'
- lstate = 'Down'
- descr = '--'
- ip_addresses = {}
- ------------------------------------------------------------------------
- File: core/script/base.py (Line: 488)
- Function: call_method
- 481 if isinstance(handler, str):
- 482 handler = getattr(self, handler, None)
- 483 if handler is None:
- 484 self.logger.debug("No '%s' handler. Passing to next method" % m)
- 485 continue
- 486 # Call handler
- 487 try:
- 488 ==> r = handler(**kwargs)
- 489 if isinstance(r, PartialResult):
- 490 if self.partial_result:
- 491 self.partial_result.update(r.result)
- 492 else:
- 493 self.partial_result = r.result
- 494 self.logger.debug(
- Variables:
- self =
- <noc.sa.profiles.Eltex.ESR.get_interfaces.Script object at 0x7f49a0d5f5b0>
- cli_handler =
- <bound method Script.execute_cli of <noc.sa.profiles.Eltex.ESR.get_interfaces.Script object at 0x7f49a0d5f5b0>>
- snmp_handler =
- <bound method Script.execute_snmp of <noc.sa.profiles.Eltex.ESR.get_interfaces.Script object at 0x7f49a0d5f5b0>>
- fallback_handler = None
- kwargs = {}
- access_preference = 'CS*'
- m = 'C'
- handler =
- <bound method Script.execute_cli of <noc.sa.profiles.Eltex.ESR.get_interfaces.Script object at 0x7f49a0d5f5b0>>
- ------------------------------------------------------------------------
- File: core/script/base.py (Line: 451)
- Function: execute
- 444 for f in self._execute_chain:
- 445 if f._match(self, self.version):
- 446 return f(self, **kwargs)
- 447 # Raise error
- 448 raise self.NotSupportedError()
- 449 else:
- 450 # New SNMP/CLI API
- 451 ==> return self.call_method(
- 452 cli_handler=self.execute_cli, snmp_handler=self.execute_snmp, **kwargs
- 453 )
- 454
- 455 def call_method(self, cli_handler=None, snmp_handler=None, fallback_handler=None, **kwargs):
- 456 """
- 457 Call function depending on access_preference
- Variables:
- self =
- <noc.sa.profiles.Eltex.ESR.get_interfaces.Script object at 0x7f49a0d5f5b0>
- kwargs = {}
- ------------------------------------------------------------------------
- File: core/script/base.py (Line: 307)
- Function: run
- 300 self.logger.info("Using cached result")
- 301 cache_hit = True
- 302 except KeyError:
- 303 pass
- 304 # Execute script
- 305 if not cache_hit:
- 306 try:
- 307 ==> result = self.execute(**self.args)
- 308 if self.cache and self.parent and result:
- 309 self.logger.info("Caching result")
- 310 self.set_cache(self.name, self.args, result)
- 311 finally:
- 312 if not self.parent:
- 313 # Close SNMP socket when necessary
- Variables:
- self =
- <noc.sa.profiles.Eltex.ESR.get_interfaces.Script object at 0x7f49a0d5f5b0>
- cache_hit = False
- ------------------------------------------------------------------------
- File: commands/script.py (Line: 149)
- Function: handle
- 142 name=script,
- 143 )
- 144 span_sample = 1 if update_spec or beef_output else 0
- 145 result = ""
- 146 if beef_output:
- 147 scr.start_tracking()
- 148 with Span(sample=span_sample, suppress_trace=span_sample):
- 149 ==> result = scr.run()
- 150 if pretty:
- 151 pprint.pprint(result)
- 152 elif yaml_o:
- 153 import sys
- 154
- 155 yaml.dump(result, sys.stdout)
- Variables:
- self = <__main__.Command object at 0x7f49ac1431f0>
- script = 'Eltex.ESR.get_interfaces'
- object_name = ['gw1-krasina2']
- arguments = []
- pretty = False
- yaml_o = False
- use_snmp = True
- access_preference = None
- snmp_rate_limit = 0
- update_spec = None
- beef_output = None
- args = {}
- options = {}
- obj = <ManagedObject: gw1-krasina2>
- credentials =
- {'access_preference': 'CS',
- 'address': '172.16.29.254',
- 'cli_protocol': 'telnet',
- 'password': '***********',
- 'path': None,
- 'raise_privileges': True,
- 'snmp_rate_limit': None,
- 'super_password': '**************',
- 'user': 'nocp'}
- script_class = <class 'noc.sa.profiles.Eltex.ESR.get_interfaces.Script'>
- caps =
- {'Network | IPv6': True,
- 'Network | LLDP': True,
- 'SNMP': False,
- 'SNMP | v1': False,
- 'SNMP | v2c': False}
- version =
- {'caps': {'Network | IPv6': True,
- 'Network | LLDP': True,
- 'SNMP': False,
- 'SNMP | v1': False,
- 'SNMP | v2c': False},
- 'image': None,
- 'platform': 'ESR-100',
- 'vendor': 'Eltex',
- 'version': '1.12.0'}
- service = <__main__.ServiceStub object at 0x7f49a0d82e50>
- scr =
- <noc.sa.profiles.Eltex.ESR.get_interfaces.Script object at 0x7f49a0d5f5b0>
- span_sample = 0
- result = ''
- ------------------------------------------------------------------------
- File: core/management/base.py (Line: 78)
- Function: run_from_argv
- 71 self.no_progressbar = cmd_options.pop("no_progressbar", False)
- 72 if enable_profiling:
- 73 # Start profiler
- 74 import yappi
- 75
- 76 yappi.start()
- 77 try:
- 78 ==> return self.handle(*args, **cmd_options) or 0
- 79 except CommandError as e:
- 80 self.print(str(e))
- 81 return 1
- 82 except KeyboardInterrupt:
- 83 self.print("Ctrl+C")
- 84 return 3
- Variables:
- self = <__main__.Command object at 0x7f49ac1431f0>
- argv = ['--debug', 'get_interfaces', 'gw1-krasina2']
- parser =
- ArgumentParser(prog='noc script', usage=None, description=None, formatter_class=<class 'argparse.HelpFormatter'>, conflict_handler='error', add_help=True)
- options =
- Namespace(access_preference=None, arguments=[], beef_output=None, object_name=['gw1-krasina2'], pretty=False, script=['get_interfaces'], snmp_rate_limit=0, upd)
- cmd_options =
- {'access_preference': None,
- 'arguments': [],
- 'beef_output': None,
- 'object_name': ['gw1-krasina2'],
- 'pretty': False,
- 'script': ['get_interfaces'],
- 'snmp_rate_limit': 0,
- 'update_spec': None,
- 'use_snmp': True,
- 'yaml_o': False}
- args = ()
- loglevel = 'debug'
- enable_profiling = False
- show_metrics = False
- error_report = <function error_report at 0x7f4a0f68c940>
- ------------------------------------------------------------------------
- END OF TRACEBACK
Advertisement
Add Comment
Please, Sign In to add comment