· 6 years ago · Feb 18, 2020, 06:06 AM
1[root@noc noc]# ./noc script --debug get_version BRAS-Yerevan
22020-02-18 09:01:23,858 [noc.core.dcs.base] Resolve near service postgres
32020-02-18 09:01:23,859 [noc.core.http.client] HTTP GET http://consul:8500/v1/health/service/postgres?passing=1&near=_agent
42020-02-18 09:01:23,862 [noc.core.http.client] HTTP Response 200
52020-02-18 09:01:23,863 [noc.core.dcs.base] Resolved near service postgres to ['10.0.6.11:5432']
62020-02-18 09:01:23,946 [noc.main.models.textindex] Adding FTS index for ip.vrf
72020-02-18 09:01:24,011 [noc.core.cache.base] Using cache backend: noc.core.cache.mongo.MongoCache
82020-02-18 09:01:24,055 [noc.main.models.doccategory] Registering Capability
92020-02-18 09:01:24,056 [noc.main.models.doccategory] Registering MetricType
102020-02-18 09:01:24,082 [noc.main.models.doccategory] Registering ConnectionType
112020-02-18 09:01:24,086 [noc.main.models.doccategory] Registering ObjectModel
122020-02-18 09:01:24,110 [noc.main.models.textindex] Adding FTS index for sa.managedobject
132020-02-18 09:01:24,120 [noc.core.dcs.base] Running resolver for service mongo
142020-02-18 09:01:24,121 [noc.core.dcs.base] [mongo] Starting resolver (near=False)
152020-02-18 09:01:24,121 [noc.core.dcs.base] [mongo] Requesting changes from index 0
162020-02-18 09:01:24,121 [noc.core.http.client] HTTP GET http://consul:8500/v1/health/service/mongo?passing=1
172020-02-18 09:01:24,122 [noc.core.http.client] HTTP Response 200
182020-02-18 09:01:24,123 [noc.core.dcs.base] [mongo] Index changed 0 -> 6892950. Applying changes
192020-02-18 09:01:24,123 [noc.core.dcs.base] [mongo] Set active services to: mongo: 10.0.6.11:27017
202020-02-18 09:01:24,123 [noc.core.dcs.base] [mongo] Requesting changes from index 6892950
212020-02-18 09:01:24,123 [noc.core.http.client] HTTP GET http://consul:8500/v1/health/service/mongo?index=6892950&passing=1
222020-02-18 09:01:24,124 [noc.core.mongo.connection] Connecting to MongoDB {'username': u'noc', 'authentication_source': u'noc', 'readPreference': 'secondaryPreferred', 'replicaSet': u'noc', 'maxIdleTimeMS': 60000, 'db': u'noc', 'host': u'mongodb://noc:********@10.0.6.11:27017/noc', 'password': '********'}
232020-02-18 09:01:24,208 [noc.core.loader.base] [script] Loading script Juniper.JUNOS.get_version
242020-02-18 09:01:24,288 [noc.core.mib] Loading compiled MIBs
252020-02-18 09:01:24,289 [noc.core.mib] Loading compiled MIBs from 'cmibs'
262020-02-18 09:01:24,290 [noc.core.mib] Loading MIB: ADSL-LINE-MIB
272020-02-18 09:01:24,290 [noc.core.mib] Loading MIB: HUAWEI-DEVICE-MIB
282020-02-18 09:01:24,291 [noc.core.mib] Loading MIB: HUAWEI-ENTITY-EXTENT-MIB
292020-02-18 09:01:24,291 [noc.core.mib] Loading MIB: VDSL2-LINE-MIB
302020-02-18 09:01:24,292 [noc.core.mib] Loading MIB: AIRESPACE-SWITCHING-MIB
312020-02-18 09:01:24,292 [noc.core.mib] Loading MIB: AIRESPACE-WIRELESS-MIB
322020-02-18 09:01:24,293 [noc.core.mib] Loading MIB: BRIDGE-MIB
332020-02-18 09:01:24,293 [noc.core.mib] Loading MIB: CISCO-CDP-MIB
342020-02-18 09:01:24,293 [noc.core.mib] Loading MIB: CISCO-PORT-CHANNEL-MIB
352020-02-18 09:01:24,293 [noc.core.mib] Loading MIB: CISCO-PPPOE-MIB
362020-02-18 09:01:24,294 [noc.core.mib] Loading MIB: CISCO-VLAN-MEMBERSHIP-MIB
372020-02-18 09:01:24,294 [noc.core.mib] Loading MIB: CISCO-VPDN-MGMT-MIB
382020-02-18 09:01:24,294 [noc.core.mib] Loading MIB: CISCO-VRF-MIB
392020-02-18 09:01:24,295 [noc.core.mib] Loading MIB: CISCO-VTP-MIB
402020-02-18 09:01:24,295 [noc.core.mib] Loading MIB: ENTITY-MIB
412020-02-18 09:01:24,295 [noc.core.mib] Loading MIB: ENTITY-SENSOR-MIB
422020-02-18 09:01:24,295 [noc.core.mib] Loading MIB: ENTITY-STATE-MIB
432020-02-18 09:01:24,296 [noc.core.mib] Loading MIB: EtherLike-MIB
442020-02-18 09:01:24,296 [noc.core.mib] Loading MIB: HUAWEI-L2IF-MIB
452020-02-18 09:01:24,296 [noc.core.mib] Loading MIB: HUAWEI-SYS-MAN-MIB
462020-02-18 09:01:24,297 [noc.core.mib] Loading MIB: HUAWEI-XPON-MIB
472020-02-18 09:01:24,298 [noc.core.mib] Loading MIB: IEEE8023-LAG-MIB
482020-02-18 09:01:24,298 [noc.core.mib] Loading MIB: IF-MIB
492020-02-18 09:01:24,298 [noc.core.mib] Loading MIB: IP-MIB
502020-02-18 09:01:24,298 [noc.core.mib] Loading MIB: LLDP-MIB
512020-02-18 09:01:24,299 [noc.core.mib] Loading MIB: MPLS-L3VPN-STD-MIB
522020-02-18 09:01:24,299 [noc.core.mib] Loading MIB: MPLS-VPN-MIB
532020-02-18 09:01:24,300 [noc.core.mib] Loading MIB: Q-BRIDGE-MIB
542020-02-18 09:01:24,300 [noc.core.mib] Loading MIB: RFC1213-MIB
552020-02-18 09:01:24,300 [noc.core.mib] Loading MIB: RMON2-MIB
562020-02-18 09:01:24,300 [noc.core.mib] Loading MIB: SNMPv2-MIB
572020-02-18 09:01:24,308 [noc.core.loader.base] [profile] Loading profile Juniper.JUNOS
582020-02-18 09:01:24,321 [script] [Juniper.JUNOS.get_version|10.0.1.4] Running. Input arguments: {}, timeout 3600
592020-02-18 09:01:24,321 [script] [Juniper.JUNOS.get_version|10.0.1.4] Open ssh CLI
602020-02-18 09:01:24,569 [script] [Juniper.JUNOS.get_version|10.0.1.4] Disable paging
612020-02-18 09:01:24,569 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Creating IOLoop
622020-02-18 09:01:24,570 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Setting TCP NODELAY
632020-02-18 09:01:24,570 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Settings KEEPALIVE
642020-02-18 09:01:24,570 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Setting TCP KEEPIDLE to 10
652020-02-18 09:01:24,570 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Setting TCP KEEPINTVL to 10
662020-02-18 09:01:24,570 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Setting TCP KEEPCNT to 3
672020-02-18 09:01:24,570 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Connecting (u'10.0.1.4', 22)
682020-02-18 09:01:24,572 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Connected
692020-02-18 09:01:24,572 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Startup ssh session for user 'noc'
702020-02-18 09:01:24,591 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Connected. Host fingerprint is c6c20c1eefb4985d447ed48f7f01d0f588da254a01
712020-02-18 09:01:24,593 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Supported authentication methods: publickey, password, keyboard-interactive
722020-02-18 09:01:24,593 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Trying publickey authentication
732020-02-18 09:01:24,594 [noc.core.script.cli.ssh] Getting keys for pool
742020-02-18 09:01:24,594 [noc.core.script.cli.ssh] No public key for pool (etc/noc_ssh/id_rsa.pub)
752020-02-18 09:01:24,594 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] No keys for pool. Skipping
762020-02-18 09:01:24,594 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Trying password authentication
772020-02-18 09:01:24,613 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Success
782020-02-18 09:01:24,613 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] User is authenticated
792020-02-18 09:01:24,613 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Open channel
802020-02-18 09:01:24,666 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Changing state to <start>
812020-02-18 09:01:24,667 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Setting timeout: 60s
822020-02-18 09:01:24,667 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Received: 'Last login: Tue Feb 18 10:00:34 2020 from 10.0.6.11\r\r\n--- JUNOS 18.4R2-S2.3 Kernel 64-bit JNPR-11.0-20190926.ca2fd68_buil\r\n'
832020-02-18 09:01:24,667 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] SSH session reset
842020-02-18 09:01:24,667 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Closing channel
852020-02-18 09:01:24,667 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Closing ssh session
862020-02-18 09:01:24,668 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Connection reset. 3 retries left. Waiting 3 seconds
872020-02-18 09:01:27,670 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Setting TCP NODELAY
882020-02-18 09:01:27,670 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Settings KEEPALIVE
892020-02-18 09:01:27,671 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Setting TCP KEEPIDLE to 10
902020-02-18 09:01:27,671 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Setting TCP KEEPINTVL to 10
912020-02-18 09:01:27,671 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Setting TCP KEEPCNT to 3
922020-02-18 09:01:27,671 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Connecting (u'10.0.1.4', 22)
932020-02-18 09:01:27,672 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Startup ssh session for user 'noc'
942020-02-18 09:01:27,692 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Connected. Host fingerprint is c6c20c1eefb4985d447ed48f7f01d0f588da254a01
952020-02-18 09:01:27,694 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Supported authentication methods: publickey, password, keyboard-interactive
962020-02-18 09:01:27,694 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Trying publickey authentication
972020-02-18 09:01:27,694 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] No keys for pool. Skipping
982020-02-18 09:01:27,694 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Trying password authentication
992020-02-18 09:01:27,724 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Success
1002020-02-18 09:01:27,724 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] User is authenticated
1012020-02-18 09:01:27,724 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Open channel
1022020-02-18 09:01:27,771 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Received: 'Last login: Tue Feb 18 10:01:24 2020 from 10.0.6.11\r\r\n--- JUNOS 18.4R2-S2.3 Kernel 64-bit JNPR-11.0-20190926.ca2fd68_buil\r\n'
1032020-02-18 09:01:27,771 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] SSH session reset
1042020-02-18 09:01:27,772 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Closing channel
1052020-02-18 09:01:27,772 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Closing ssh session
1062020-02-18 09:01:27,772 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Connection reset. 2 retries left. Waiting 3 seconds
1072020-02-18 09:01:30,774 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Setting TCP NODELAY
1082020-02-18 09:01:30,774 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Settings KEEPALIVE
1092020-02-18 09:01:30,774 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Setting TCP KEEPIDLE to 10
1102020-02-18 09:01:30,774 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Setting TCP KEEPINTVL to 10
1112020-02-18 09:01:30,774 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Setting TCP KEEPCNT to 3
1122020-02-18 09:01:30,774 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Connecting (u'10.0.1.4', 22)
1132020-02-18 09:01:30,775 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Startup ssh session for user 'noc'
1142020-02-18 09:01:30,795 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Connected. Host fingerprint is c6c20c1eefb4985d447ed48f7f01d0f588da254a01
1152020-02-18 09:01:30,797 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Supported authentication methods: publickey, password, keyboard-interactive
1162020-02-18 09:01:30,797 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Trying publickey authentication
1172020-02-18 09:01:30,797 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] No keys for pool. Skipping
1182020-02-18 09:01:30,798 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Trying password authentication
1192020-02-18 09:01:30,817 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Success
1202020-02-18 09:01:30,817 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] User is authenticated
1212020-02-18 09:01:30,817 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Open channel
1222020-02-18 09:01:30,863 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Received: 'Last login: Tue Feb 18 10:01:27 2020 from 10.0.6.11\r\r\n--- JUNOS 18.4R2-S2.3 Kernel 64-bit JNPR-11.0-20190926.ca2fd68_buil\r\n'
1232020-02-18 09:01:30,863 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] SSH session reset
1242020-02-18 09:01:30,864 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Closing channel
1252020-02-18 09:01:30,864 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Closing ssh session
1262020-02-18 09:01:30,864 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Connection reset. 1 retries left. Waiting 3 seconds
1272020-02-18 09:01:33,866 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Setting TCP NODELAY
1282020-02-18 09:01:33,867 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Settings KEEPALIVE
1292020-02-18 09:01:33,867 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Setting TCP KEEPIDLE to 10
1302020-02-18 09:01:33,867 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Setting TCP KEEPINTVL to 10
1312020-02-18 09:01:33,867 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Setting TCP KEEPCNT to 3
1322020-02-18 09:01:33,867 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Connecting (u'10.0.1.4', 22)
1332020-02-18 09:01:33,868 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Startup ssh session for user 'noc'
1342020-02-18 09:01:33,888 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Connected. Host fingerprint is c6c20c1eefb4985d447ed48f7f01d0f588da254a01
1352020-02-18 09:01:33,890 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Supported authentication methods: publickey, password, keyboard-interactive
1362020-02-18 09:01:33,890 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Trying publickey authentication
1372020-02-18 09:01:33,890 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] No keys for pool. Skipping
1382020-02-18 09:01:33,890 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Trying password authentication
1392020-02-18 09:01:33,909 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Success
1402020-02-18 09:01:33,909 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] User is authenticated
1412020-02-18 09:01:33,909 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Open channel
1422020-02-18 09:01:33,955 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Received: 'Last login: Tue Feb 18 10:01:30 2020 from 10.0.6.11\r\r\n--- JUNOS 18.4R2-S2.3 Kernel 64-bit JNPR-11.0-20190926.ca2fd68_buil\r\n'
1432020-02-18 09:01:33,956 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] SSH session reset
1442020-02-18 09:01:33,956 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Closing channel
1452020-02-18 09:01:33,956 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Closing ssh session
1462020-02-18 09:01:33,958 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Closing IOStream
1472020-02-18 09:01:33,958 [script] [Juniper.JUNOS.get_version|10.0.1.4] [ssh] Closing IOLoop
1482020-02-18 09:01:36,201 [noc.core.debug] UNHANDLED EXCEPTION (2020-02-18 09:01:34.034816)
149PROCESS: ./commands/script.py
150VERSION: 19.4
151BRANCH: HEAD CHANGESET: 04a7a845
152ERROR FINGERPRINT: 3574a0d3-d7de-5444-a847-d4a977aad9db
153WORKING DIRECTORY: /opt/noc
154EXCEPTION: <class 'tornado.iostream.StreamClosedError'> Stream is closed
155START OF TRACEBACK
156------------------------------------------------------------------------
157File: core/script/cli/base.py (Line: 380)
158Function: read_until_prompt
159 373 yield self.iostream.startup()
160 374 break
161 375 except tornado.iostream.StreamClosedError:
162 376 if not connect_retries:
163 377 raise tornado.iostream.StreamClosedError()
164 378 continue
165 379 else:
166 380 ==> raise tornado.iostream.StreamClosedError()
167 381 except tornado.gen.TimeoutError:
168 382 self.logger.info("Timeout error")
169 383 metrics["cli_timeouts", ("proto", self.name)] += 1
170 384 # IOStream must be closed to prevent hanging read callbacks
171 385 self.close_iostream()
172 386 raise tornado.gen.TimeoutError("Timeout")
173Variables:
174 f = <tornado.concurrent.Future object at 0x7f2df82be810>
175 handler =
176<bound method SSHCLI.on_prompt of <noc.core.script.cli.ssh.SSHCLI object at 0x7f2df8341550>>
177 self = <noc.core.script.cli.ssh.SSHCLI object at 0x7f2df8341550>
178 offset = 228
179 rx = <_sre.SRE_Pattern object at 0x29877f0>
180 connect_retries = 0
181 r =
182'Last login: Tue Feb 18 10:01:30 2020 from 10.0.6.11\r\r\n--- JUNOS 18.4R2-S2.3 Kernel 64-bit JNPR-11.0-20190926.ca2fd68_buil\r\n'
183 address = (u'10.0.1.4', 22)
184 match = None
185------------------------------------------------------------------------
186File: lib/python2.7/site-packages/tornado/gen.py (Line: 1063)
187Function: run
188 1056 except Exception:
189 1057 self.had_exception = True
190 1058 exc_info = sys.exc_info()
191 1059 future = None
192 1060
193 1061 if exc_info is not None:
194 1062 try:
195 1063 ==> yielded = self.gen.throw(*exc_info)
196 1064 finally:
197 1065 # Break up a reference to itself
198 1066 # for faster GC on CPython.
199 1067 exc_info = None
200 1068 else:
201 1069 yielded = self.gen.send(value)
202Variables:
203 self = <tornado.gen.Runner object at 0x7f2df82beb90>
204 value =
205'Last login: Tue Feb 18 10:01:30 2020 from 10.0.6.11\r\r\n--- JUNOS 18.4R2-S2.3 Kernel 64-bit JNPR-11.0-20190926.ca2fd68_buil\r\n'
206 yielded = None
207 future = None
208 orig_stack_contexts = ((), None)
209 exc_info = None
210------------------------------------------------------------------------
211File: lib/python2.7/site-packages/tornado/concurrent.py (Line: 238)
212Function: result
213 231 before the `Future` is done, so the ``timeout`` is never used.
214 232 """
215 233 self._clear_tb_log()
216 234 if self._result is not None:
217 235 return self._result
218 236 if self._exc_info is not None:
219 237 try:
220 238 ==> raise_exc_info(self._exc_info)
221 239 finally:
222 240 self = None
223 241 self._check_done()
224 242 return self._result
225 243
226 244 def exception(self, timeout=None):
227Variables:
228 self = None
229 timeout = None
230------------------------------------------------------------------------
231File: lib/python2.7/site-packages/tornado/gen.py (Line: 1055)
232Function: run
233 1048 return
234 1049 self.future = None
235 1050 try:
236 1051 orig_stack_contexts = stack_context._state.contexts
237 1052 exc_info = None
238 1053
239 1054 try:
240 1055 ==> value = future.result()
241 1056 except Exception:
242 1057 self.had_exception = True
243 1058 exc_info = sys.exc_info()
244 1059 future = None
245 1060
246 1061 if exc_info is not None:
247Variables:
248 exc_info = None
249 self = <tornado.gen.Runner object at 0x7f2df82be790>
250 future = None
251 orig_stack_contexts = ((), None)
252------------------------------------------------------------------------
253File: core/script/cli/base.py (Line: 281)
254Function: submit
255 274 raise tornado.gen.Return(None)
256 275 self.logger.debug("Connected")
257 276 yield self.iostream.startup()
258 277 # Perform all necessary login procedures
259 278 metrics["cli_commands", ("proto", self.name)] += 1
260 279 if not self.is_started:
261 280 yield self.on_start()
262 281 ==> motd = yield self.read_until_prompt()
263 282 self.motd = smart_text(motd, errors="ignore", encoding=self.native_encoding)
264 283 self.script.set_motd(self.motd)
265 284 self.is_started = True
266 285 # Send command
267 286 # @todo: encode to object's encoding
268 287 if self.profile.batch_send_multiline or self.profile.command_submit not in self.command:
269Variables:
270 self = <noc.core.script.cli.ssh.SSHCLI object at 0x7f2df8341550>
271 parser =
272<bound method SSHCLI.read_until_prompt of <noc.core.script.cli.ssh.SSHCLI object at 0x7f2df8341550>>
273 address = (u'10.0.1.4', 22)
274------------------------------------------------------------------------
275File: lib/python2.7/site-packages/tornado/gen.py (Line: 1063)
276Function: run
277 1056 except Exception:
278 1057 self.had_exception = True
279 1058 exc_info = sys.exc_info()
280 1059 future = None
281 1060
282 1061 if exc_info is not None:
283 1062 try:
284 1063 ==> yielded = self.gen.throw(*exc_info)
285 1064 finally:
286 1065 # Break up a reference to itself
287 1066 # for faster GC on CPython.
288 1067 exc_info = None
289 1068 else:
290 1069 yielded = self.gen.send(value)
291Variables:
292 exc_info = None
293 self = <tornado.gen.Runner object at 0x7f2df82be790>
294 future = None
295 orig_stack_contexts = ((), None)
296------------------------------------------------------------------------
297File: lib/python2.7/site-packages/tornado/concurrent.py (Line: 238)
298Function: result
299 231 before the `Future` is done, so the ``timeout`` is never used.
300 232 """
301 233 self._clear_tb_log()
302 234 if self._result is not None:
303 235 return self._result
304 236 if self._exc_info is not None:
305 237 try:
306 238 ==> raise_exc_info(self._exc_info)
307 239 finally:
308 240 self = None
309 241 self._check_done()
310 242 return self._result
311 243
312 244 def exception(self, timeout=None):
313Variables:
314 self = None
315 timeout = None
316------------------------------------------------------------------------
317File: core/script/cli/base.py (Line: 221)
318Function: run_sync
319 214 self.logger.info("Incomplete feature left. Restarting IOStream")
320 215 self.close_iostream()
321 216 # Retain cryptic message as is,
322 217 # Mark feature as done
323 218 future_cell[0].set_exception(
324 219 tornado.gen.TimeoutError("Operation timed out after %s seconds" % None)
325 220 )
326 221 ==> return future_cell[0].result()
327 222
328 223 def execute(
329 224 self,
330 225 cmd,
331 226 obj_parser=None,
332 227 cmd_next=None,
333Variables:
334 run = <function run at 0x7f2df82c0230>
335 self = <noc.core.script.cli.ssh.SSHCLI object at 0x7f2df8341550>
336 args =
337(<bound method SSHCLI.read_until_prompt of <noc.core.script.cli.ssh.SSHCLI object at 0x7f2df8341550>>,)
338 func =
339<bound method SSHCLI.submit of <noc.core.script.cli.ssh.SSHCLI object at 0x7f2df8341550>>
340 kwargs = {}
341 future_cell = [<tornado.concurrent.Future object at 0x7f2df82be710>]
342------------------------------------------------------------------------
343File: core/script/cli/base.py (Line: 249)
344Function: execute
345 242 if obj_parser:
346 243 parser = functools.partial(self.parse_object_stream, obj_parser, cmd_next, cmd_stop)
347 244 else:
348 245 parser = self.read_until_prompt
349 246 with Span(
350 247 server=self.script.credentials.get("address"), service=self.name, in_label=cmd
351 248 ) as s:
352 249 ==> self.run_sync(self.submit, parser)
353 250 if self.error:
354 251 if s:
355 252 s.error_text = str(self.error)
356 253 raise self.error
357 254 return self.result
358 255
359Variables:
360 cmd = 'set cli screen-length 0\n'
361allow_empty_response = True
362 self = <noc.core.script.cli.ssh.SSHCLI object at 0x7f2df8341550>
363 parser =
364<bound method SSHCLI.read_until_prompt of <noc.core.script.cli.ssh.SSHCLI object at 0x7f2df8341550>>
365 cmd_stop = None
366 cmd_next = None
367 s = <noc.core.span.Span object at 0x7f2df82be6d0>
368 obj_parser = None
369 ignore_errors = True
370------------------------------------------------------------------------
371File: core/script/base.py (Line: 843)
372Function: cli
373 836 self.cli_tracked_command = cmd
374 837 r = stream.execute(
375 838 submitted_cmd,
376 839 obj_parser=obj_parser,
377 840 cmd_next=cmd_next,
378 841 cmd_stop=cmd_stop,
379 842 ignore_errors=ignore_errors,
380 843 ==> allow_empty_response=allow_empty_response,
381 844 )
382 845 if isinstance(r, six.binary_type):
383 846 r = smart_text(r, errors="ignore", encoding=self.native_encoding)
384 847 if isinstance(r, six.text_type):
385 848 # Check for syntax errors
386 849 if not ignore_errors:
387Variables:
388 command_submit = '\n'
389 format_result = <function format_result at 0x7f2df82c00c8>
390 cmd = 'set cli screen-length 0'
391 nowait = False
392 stream = <noc.core.script.cli.ssh.SSHCLI object at 0x7f2df8341550>
393 submitted_cmd = 'set cli screen-length 0\n'
394 cached = False
395 obj_parser = None
396 bulk_lines = None
397 list_re = None
398 cmd_stop = None
399 cmd_next = None
400 file = None
401allow_empty_response = True
402 ignore_errors = True
403 self =
404<noc.sa.profiles.Juniper.JUNOS.get_version.Script object at 0x7f2dfaab3190>
405------------------------------------------------------------------------
406File: core/script/base.py (Line: 918)
407Function: get_cli_stream
408 911 self.cli_stream.setup_session()
409 912 # Disable pager when nesessary
410 913 # @todo: Move to CLI
411 914 if self.to_disable_pager:
412 915 self.logger.debug("Disable paging")
413 916 self.to_disable_pager = False
414 917 if isinstance(self.profile.command_disable_pager, six.string_types):
415 918 ==> self.cli(self.profile.command_disable_pager, ignore_errors=True)
416 919 elif isinstance(self.profile.command_disable_pager, list):
417 920 for cmd in self.profile.command_disable_pager:
418 921 self.cli(cmd, ignore_errors=True)
419 922 else:
420 923 raise UnexpectedResultError
421 924 return self.cli_stream
422Variables:
423 self =
424<noc.sa.profiles.Juniper.JUNOS.get_version.Script object at 0x7f2dfaab3190>
425 protocol = 'ssh'
426------------------------------------------------------------------------
427File: core/script/base.py (Line: 834)
428Function: cli
429 827 return format_result(r)
430 828 # Effective command submit suffix
431 829 if command_submit is None:
432 830 command_submit = self.profile.command_submit
433 831 # Encode submitted command
434 832 submitted_cmd = smart_bytes(cmd, encoding=self.native_encoding) + command_submit
435 833 # Run command
436 834 ==> stream = self.get_cli_stream()
437 835 if self.to_track:
438 836 self.cli_tracked_command = cmd
439 837 r = stream.execute(
440 838 submitted_cmd,
441 839 obj_parser=obj_parser,
442 840 cmd_next=cmd_next,
443Variables:
444 command_submit = '\n'
445 format_result = <function format_result at 0x7f2dfaaef5f0>
446 cmd = 'show version'
447 nowait = False
448 submitted_cmd = 'show version\n'
449 cached = False
450 obj_parser = None
451 bulk_lines = None
452 list_re = None
453 cmd_stop = None
454 cmd_next = None
455 file = None
456allow_empty_response = True
457 ignore_errors = False
458 self =
459<noc.sa.profiles.Juniper.JUNOS.get_version.Script object at 0x7f2dfaab3190>
460------------------------------------------------------------------------
461File: sa/profiles/Juniper/JUNOS/get_version.py (Line: 45)
462Function: execute_cli
463 38 return {
464 39 "vendor": "Juniper",
465 40 "platform": match.group("platform"),
466 41 "version": match.group("version"),
467 42 }
468 43
469 44 def execute_cli(self):
470 45 ==> v = self.cli("show version")
471 46 match = self.rx_ver.search(v)
472 47 if not match:
473 48 match = self.rx_ver2.search(v)
474 49 return {
475 50 "vendor": "Juniper",
476 51 "platform": match.group("platform"),
477Variables:
478 self =
479<noc.sa.profiles.Juniper.JUNOS.get_version.Script object at 0x7f2dfaab3190>
480------------------------------------------------------------------------
481File: core/script/base.py (Line: 467)
482Function: call_method
483 460 if isinstance(handler, six.string_types):
484 461 handler = getattr(self, handler, None)
485 462 if handler is None:
486 463 self.logger.debug("No '%s' handler. Passing to next method" % m)
487 464 continue
488 465 # Call handler
489 466 try:
490 467 ==> r = handler(**kwargs)
491 468 if isinstance(r, PartialResult):
492 469 if self.partial_result:
493 470 self.partial_result.update(r.result)
494 471 else:
495 472 self.partial_result = r.result
496 473 self.logger.debug(
497Variables:
498 self =
499<noc.sa.profiles.Juniper.JUNOS.get_version.Script object at 0x7f2dfaab3190>
500 m = u'C'
501 fallback_handler = None
502 cli_handler =
503<bound method Script.execute_cli of <noc.sa.profiles.Juniper.JUNOS.get_version.Script object at 0x7f2dfaab3190>>
504 handler =
505<bound method Script.execute_cli of <noc.sa.profiles.Juniper.JUNOS.get_version.Script object at 0x7f2dfaab3190>>
506 kwargs = {}
507 snmp_handler =
508<bound method Script.execute_snmp of <noc.sa.profiles.Juniper.JUNOS.get_version.Script object at 0x7f2dfaab3190>>
509 access_preference = u'C*'
510------------------------------------------------------------------------
511File: core/script/base.py (Line: 431)
512Function: execute
513 424 if f._match(self, self.version):
514 425 return f(self, **kwargs)
515 426 # Raise error
516 427 raise self.NotSupportedError()
517 428 else:
518 429 # New SNMP/CLI API
519 430 return self.call_method(
520 431 ==> cli_handler=self.execute_cli, snmp_handler=self.execute_snmp, **kwargs
521 432 )
522 433
523 434 def call_method(self, cli_handler=None, snmp_handler=None, fallback_handler=None, **kwargs):
524 435 """
525 436 Call function depending on access_preference
526 437 :param cli_handler: String or callable to call on CLI access method
527Variables:
528 self =
529<noc.sa.profiles.Juniper.JUNOS.get_version.Script object at 0x7f2dfaab3190>
530 kwargs = {}
531------------------------------------------------------------------------
532File: core/script/base.py (Line: 290)
533Function: run
534 283 self.logger.info("Using cached result")
535 284 cache_hit = True
536 285 except KeyError:
537 286 pass
538 287 # Execute script
539 288 if not cache_hit:
540 289 try:
541 290 ==> result = self.execute(**self.args)
542 291 if self.cache and self.parent and result:
543 292 self.logger.info("Caching result")
544 293 self.set_cache(self.name, self.args, result)
545 294 finally:
546 295 if not self.parent:
547 296 # Close SNMP socket when necessary
548Variables:
549 cache_hit = False
550 self =
551<noc.sa.profiles.Juniper.JUNOS.get_version.Script object at 0x7f2dfaab3190>
552------------------------------------------------------------------------
553File: commands/script.py (Line: 141)
554Function: handle
555 134 name=script,
556 135 )
557 136 span_sample = 1 if update_spec or beef_output else 0
558 137 result = ""
559 138 if beef_output:
560 139 scr.start_tracking()
561 140 with Span(sample=span_sample, suppress_trace=span_sample):
562 141 ==> result = scr.run()
563 142 if pretty:
564 143 pprint.pprint(result)
565 144 elif yaml_o:
566 145 import sys
567 146
568 147 yaml.dump(result, sys.stdout)
569Variables:
570 arguments = []
571 obj = <ManagedObject: BRAS-Yerevan>
572 service = <__main__.ServiceStub object at 0x7f2df833fad0>
573 script = u'Juniper.JUNOS.get_version'
574 script_class = <class 'noc.sa.profiles.Juniper.JUNOS.get_version.Script'>
575 beef_output = None
576 update_spec = None
577 args = {}
578 use_snmp = True
579 caps =
580{u'Network | LACP': True,
581 u'SNMP': False,
582 u'SNMP | v1': False,
583 u'SNMP | v2c': False}
584 self = <__main__.Command object at 0x7f2e056cc150>
585 object_name = ['BRAS-Yerevan']
586 version =
587{'image': None,
588 'platform': u'mx480',
589 'vendor': u'Juniper Networks',
590 'version': u'17.3R3-S6.3'}
591 result = ''
592 pretty = False
593 yaml_o = False
594 credentials =
595{'access_preference': u'C',
596 'address': u'10.0.1.4',
597 'cli_protocol': 'ssh',
598 'password': u'RxaZV4HT',
599 'path': None,
600 'raise_privileges': True,
601 'snmp_ro': u'\u043f\u0442\u0441\u0442\u044c\u044b',
602 'snmp_version': 'v2c',
603 'super_password': u'test123',
604 'user': u'noc'}
605 access_preference = None
606 options = {}
607 span_sample = 0
608 scr =
609<noc.sa.profiles.Juniper.JUNOS.get_version.Script object at 0x7f2dfaab3190>
610------------------------------------------------------------------------
611File: core/management/base.py (Line: 83)
612Function: run_from_argv
613 76 self.no_progressbar = cmd_options.pop("no_progressbar", False)
614 77 if enable_profiling:
615 78 # Start profiler
616 79 import yappi
617 80
618 81 yappi.start()
619 82 try:
620 83 ==> return self.handle(*args, **cmd_options) or 0
621 84 except CommandError as e:
622 85 self.print(str(e))
623 86 return 1
624 87 except KeyboardInterrupt:
625 88 self.print("Ctrl+C")
626 89 return 3
627Variables:
628 parser =
629ArgumentParser(prog='noc script', usage=None, description=None, version=None, formatter_class=<class 'argparse.HelpFormatter'>, conflict_handler='error', add_help=True)
630 loglevel = 'debug'
631 enable_profiling = False
632 args = ()
633 cmd_options =
634{'access_preference': None,
635 'arguments': [],
636 'beef_output': None,
637 'object_name': ['BRAS-Yerevan'],
638 'pretty': False,
639 'script': ['get_version'],
640 'update_spec': None,
641 'use_snmp': True,
642 'yaml_o': False}
643 argv = ['--debug', 'get_version', 'BRAS-Yerevan']
644 self = <__main__.Command object at 0x7f2e056cc150>
645 show_metrics = False
646 error_report = <function error_report at 0x7f2e088c0cf8>
647 options =
648Namespace(access_preference=None, arguments=[], beef_output=None, object_name=['BRAS-Yerevan'], pretty=False, script=['get_version'], update_spec=None, use_snmp=True, yaml_o=False)
649------------------------------------------------------------------------
650END OF TRACEBACK
6512020-02-18 09:01:36,204 [noc.core.debug] Writing CP report to /var/lib/noc/cp/crashinfo/new/3574a0d3-d7de-5444-a847-d4a977aad9db.json