Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (noc)[root@zabbix-alpha noc]# ./noc debug-script get_version R2.example.com
- /opt/noc/lib/python2.7/site-packages/Crypto/Util/number.py:57: PowmInsecureWarning: Not using mpz_powm_sec. You should rebuild using libgmp >= 5 to avoid timing attack vulnerability.
- _warn("Not using mpz_powm_sec. You should rebuild using libgmp >= 5 to avoid timing attack vulnerability.", PowmInsecureWarning)
- 2014-02-13 10:26:15,205 SSH: Using gmpy
- 2014-02-13 10:26:15,409 Using JSON library: cjson
- 2014-02-13 10:26:15,498 Loading PeriodicRegistry
- 2014-02-13 10:26:15,504 Loading DownloaderRegistry
- 2014-02-13 10:26:15,562 Loading ProfileRegistry
- 2014-02-13 10:26:16,509 Loading ScriptRegistry
- 2014-02-13 10:26:16,848 Setting up 'select' polling method
- 2014-02-13 10:26:16,849 Activating 'select' poller
- 2014-02-13 10:26:16,849 Loading private ssh key from 'etc/ssh/id_rsa'
- 2014-02-13 10:26:16,849 Loading public ssh key from 'etc/ssh/id_rsa.pub'
- access_profile {
- profile: "Cisco.1900"
- scheme: TELNET
- address: "10.10.10.10"
- port: 23
- user: "monitor"
- password: "xxxxx"
- }
- object_name: "R2.example.com"
- script: "Cisco.1900.get_version"
- 2014-02-13 10:26:16,852 Running socket factory (SelectPoller)
- 2014-02-13 10:26:16,852 Running script thread
- 2014-02-13 10:26:16,852 Creating transaction id=1611360523 method=None callback=None
- 2014-02-13 10:26:16,852 [Cisco.1900.get_version(R2.example.com, 10.10.10.10)] Running
- 2014-02-13 10:26:16,853 [Cisco.1900.get_version(R2.example.com, 10.10.10.10)] Running script: Cisco.1900.get_version ({})
- 2014-02-13 10:26:16,853 [Cisco.1900.get_version(R2.example.com, 10.10.10.10)] cli(show version)
- 2014-02-13 10:26:16,853 [Cisco.1900.get_version(R2.example.com, 10.10.10.10)] Running new provider
- 2014-02-13 10:26:16,853 [TELNET: 10.10.10.10] ==> START
- 2014-02-13 10:26:16,853 [TELNET: 10.10.10.10] set_patterns([('([Uu]sername|[Ll]ogin):', 'USERNAME'), ('[Pp]assword:', 'PASSWORD'), ('^\\S+?>', 'UNPRIVELEGED_PROMPT'), ('^\\S*[>#]', 'PROMPT'), ('(\\[K\\] Command Line)|(--More--$)', 'PAGER')])
- 2014-02-13 10:26:16,854 [TELNET: 10.10.10.10] set_timeout(600)
- 2014-02-13 10:26:16,854 register_socket(<CLITelnetSocket(0x4122e10, 10.10.10.10:23, )>,None)
- 2014-02-13 10:26:17,853 Tick
- 2014-02-13 10:26:17,853 3 TICKS TO EXIT
- 2014-02-13 10:26:17,853 [TELNET: 10.10.10.10] Initializing socket
- 2014-02-13 10:26:17,853 [TELNET: 10.10.10.10] Connecting 10.10.10.10:23
- 2014-02-13 10:26:17,863 [TELNET: 10.10.10.10] Connected
- 2014-02-13 10:26:17,865 [TELNET: 10.10.10.10] Received IAC WILL ECHO (251 1)
- 2014-02-13 10:26:17,865 [TELNET: 10.10.10.10] Sending IAC DO ECHO (253 1)
- 2014-02-13 10:26:17,865 [TELNET: 10.10.10.10] Received IAC WILL SGA (251 3)
- 2014-02-13 10:26:17,865 [TELNET: 10.10.10.10] Sending IAC DO SGA (253 3)
- 2014-02-13 10:26:17,865 [TELNET: 10.10.10.10] Received IAC DO TTYPE (253 24)
- 2014-02-13 10:26:17,865 [TELNET: 10.10.10.10] Sending IAC WILL TTYPE (251 24)
- 2014-02-13 10:26:17,865 [TELNET: 10.10.10.10] Received IAC DO NAWS (253 31)
- 2014-02-13 10:26:17,865 [TELNET: 10.10.10.10] Sending IAC WILL NAWS (251 31)
- 2014-02-13 10:26:17,865 [TELNET: 10.10.10.10] Sending SB '\xff\xfa\x1f\xff\xff\xff\xff\xff\xf0'
- 2014-02-13 10:26:17,869 [TELNET: 10.10.10.10] on_read: '\r\n**********************************************************\r\n\r\n Property of Telia Latvija SIA\r\n\r\n If you are not authorized to use this service\r\n DISCONNECT IMMEDIATELY!!!\r\n\r\n**********************************************************\r\n\r\nUser Access Verification\r\n\r\nUsername: '
- 2014-02-13 10:26:17,869 [TELNET: 10.10.10.10] Starting synchronous FSM check
- 2014-02-13 10:26:17,869 [TELNET: 10.10.10.10] match '([Uu]sername|[Ll]ogin):'
- 2014-02-13 10:26:17,870 [TELNET: 10.10.10.10] event(USERNAME)
- 2014-02-13 10:26:17,870 [TELNET: 10.10.10.10] ==> USERNAME
- 2014-02-13 10:26:17,870 [TELNET: 10.10.10.10] set_patterns([('[Pp]assword:', 'PASSWORD'), ('^\\S*[>#]', 'PROMPT')])
- 2014-02-13 10:26:17,870 [TELNET: 10.10.10.10] submit(u'monitor', bulk_lines=None, streaming=False)
- 2014-02-13 10:26:17,870 [TELNET: 10.10.10.10] Received SB '\x18\x01'
- 2014-02-13 10:26:17,870 [TELNET: 10.10.10.10] Sending SB '\xff\xfa\x18\x00XTERM\xff\xf0'
- 2014-02-13 10:26:17,872 [TELNET: 10.10.10.10] on_read: 'mo'
- 2014-02-13 10:26:17,872 [TELNET: 10.10.10.10] on_read: 'ni'
- 2014-02-13 10:26:17,872 [TELNET: 10.10.10.10] on_read: 'tor'
- 2014-02-13 10:26:17,873 [TELNET: 10.10.10.10] on_read: '\r\nPassword: '
- 2014-02-13 10:26:17,874 [TELNET: 10.10.10.10] Starting synchronous FSM check
- 2014-02-13 10:26:17,874 [TELNET: 10.10.10.10] match '[Pp]assword:'
- 2014-02-13 10:26:17,874 [TELNET: 10.10.10.10] event(PASSWORD)
- 2014-02-13 10:26:17,874 [TELNET: 10.10.10.10] ==> PASSWORD
- 2014-02-13 10:26:17,874 [TELNET: 10.10.10.10] set_patterns([('^\\S+?>', 'UNPRIVELEGED_PROMPT'), ('^\\S*[>#]', 'PROMPT'), ('([Uu]sername|[Ll]ogin):', 'USERNAME'), ('[Pp]assword:', 'PASSWORD'), ('(\\[K\\] Command Line)|(--More--$)', 'PAGER')])
- 2014-02-13 10:26:17,874 [TELNET: 10.10.10.10] submit(u'xxxxxxxx', bulk_lines=None, streaming=False)
- 2014-02-13 10:26:17,882 [TELNET: 10.10.10.10] on_read: '\r\n\r\nR2#'
- 2014-02-13 10:26:17,883 [TELNET: 10.10.10.10] Starting synchronous FSM check
- 2014-02-13 10:26:17,883 [TELNET: 10.10.10.10] match '^\S*[>#]'
- 2014-02-13 10:26:17,883 [TELNET: 10.10.10.10] event(PROMPT)
- 2014-02-13 10:26:17,883 [TELNET: 10.10.10.10] ==> PROMPT
- 2014-02-13 10:26:17,883 [TELNET: 10.10.10.10] on_PROMPT_enter
- 2014-02-13 10:26:17,883 [TELNET: 10.10.10.10] Using prompt pattern: ^\S*[>#]
- 2014-02-13 10:26:17,883 [TELNET: 10.10.10.10] set_patterns([('^\\S*[>#]', 'PROMPT'), ('(\\[K\\] Command Line)|(--More--$)', 'PAGER')])
- 2014-02-13 10:26:17,887 [Cisco.1900.get_version(R2.example.com, 10.10.10.10)] CLI Provider is ready
- 2014-02-13 10:26:17,887 [TELNET: 10.10.10.10] submit('show version', bulk_lines=None, streaming=False)
- 2014-02-13 10:26:18,884 Tick
- 2014-02-13 10:26:18,885 Resetting wait ticks
- 2014-02-13 10:26:18,886 [TELNET: 10.10.10.10] on_read: 'sho'
- 2014-02-13 10:26:18,886 [TELNET: 10.10.10.10] on_read: 'w ver'
- 2014-02-13 10:26:18,887 [TELNET: 10.10.10.10] on_read: 's'
- 2014-02-13 10:26:18,887 [TELNET: 10.10.10.10] on_read: 'i'
- 2014-02-13 10:26:18,888 [TELNET: 10.10.10.10] on_read: 'on\r\n'
- 2014-02-13 10:26:19,004 [TELNET: 10.10.10.10] on_read: 'Cisco IOS Software, C1900 Software (C1900-UNIVERSALK9-M), Version 15.2(3)T, RELEASE SOFTWARE (fc1)\r\nTechnical Support: http://www.cisco.com/techsupport\r\nCopyright (c) 1986-2012 by Cisco Systems, Inc.\r\nCompiled Fri 23-Mar-12 15:35 by prod_rel_team\r\n\r\nROM: System Bootstrap, Version 15.0(1r)M15, RELEASE SOFTWARE (fc1)\r\n\r\nR2 uptime is 13 weeks, 4 days, 6 hours, 17 minutes\r\nSystem returned to ROM by power-on\r\nSystem image file is "flash0:c1900-universalk9-mz.SPA.152-3.T.bin"\r\nLast reload type: Normal Reload\r\nLast reload reason: power-o'
- 2014-02-13 10:26:19,004 [TELNET: 10.10.10.10] on_read: 'n\r\n\r\n\r\n\r\nThis product contains cryptographic features and is subject to United\r\nStates and local country laws governing import, export, transfer and\r\nuse. Delivery of Cisco cryptographic products does not imply\r\nthird-party authority to import, export, distribute or use encryption.\r\nImporters, exporters, distributors and users are responsible for\r\ncomplianc'
- 2014-02-13 10:26:19,005 [TELNET: 10.10.10.10] on_read: 'e with U.S. and local country laws. By using this product you\r\nagree to comply with applicable laws and regulations. If you are unable\r\nto comply with U.S. and local laws, return this product immediately.\r\n\r\nA summary of U.S. laws governing Cisco cryptographic products may be found at:\r\nhttp://www.cisco.com/wwl/export/crypto/tool/stqrg.html\r\n\r\nIf you require further assistance please contact us by sending email to\r\[email protected].\r\n\r\nCisco CISCO1941/K9 (revision 1.0) with 491520K/32768K bytes of memory.\r\nProcessor board ID FCZ16'
- 2014-02-13 10:26:19,006 [TELNET: 10.10.10.10] on_read: "209046\r\n2 Gigabit Ethernet interfaces\r\n1 terminal line\r\nDRAM configuration is 64 bits wide with parity disabled.\r\n255K bytes of non-volatile configuration memory.\r\n250880K bytes of ATA System CompactFlash 0 (Read/Write)\r\n\r\n\r\nLicense Info:\r\n\r\nLicense UDI:\r\n\r\n-------------------------------------------------\r\nDevice#\t PID\t\t\tSN\r\n-------------------------------------------------\r\n*0 \t CISCO1941/K9 FCZ16209046 \r\n\r\n\r\n\r\nTechnology Package License Information for Module:'c1900' \r\n\r\n-----------------------------------------"
- 2014-02-13 10:26:19,007 [TELNET: 10.10.10.10] Starting synchronous FSM check
- 2014-02-13 10:26:19,007 [TELNET: 10.10.10.10] match '^\S*[>#]'
- 2014-02-13 10:26:19,007 [TELNET: 10.10.10.10] Starting synchronous FSM check
- 2014-02-13 10:26:19,007 [TELNET: 10.10.10.10] event(PROMPT)
- 2014-02-13 10:26:19,007 [TELNET: 10.10.10.10] on_read: '------------------------\r\nTechnology Technology-package Technology-package\r\n Current Type Next reboot \r\n------------------------------------------------------------------\r\nipbase ipbasek9 Permanent ipbasek9\r\nsecurity None None None\r\ndata datak9 RightToUse datak9\r\n\r\nConfiguration register is 0x2102\r\n\r\nR2#'
- 2014-02-13 10:26:19,008 [TELNET: 10.10.10.10] Starting synchronous FSM check
- 2014-02-13 10:26:19,008 [TELNET: 10.10.10.10] match '^\S*[>#]'
- 2014-02-13 10:26:19,008 [TELNET: 10.10.10.10] Starting synchronous FSM check
- 2014-02-13 10:26:19,008 [TELNET: 10.10.10.10] event(PROMPT)
- 2014-02-13 10:26:19,053 [Cisco.1900.get_version(R2.example.com, 10.10.10.10)] cli(show version) returns:
- ===[ show version ]=====================================================
- 'Cisco IOS Software, C1900 Software (C1900-UNIVERSALK9-M), Version 15.2(3)T, RELEASE SOFTWARE (fc1)\nTechnical Support: http://www.cisco.com/techsupport\nCopyright (c) 1986-2012 by Cisco Systems, Inc.\nCompiled Fri 23-Mar-12 15:35 by prod_rel_team\n\nROM: System Bootstrap, Version 15.0(1r)M15, RELEASE SOFTWARE (fc1)\n\nR2 uptime is 13 weeks, 4 days, 6 hours, 17 minutes\nSystem returned to ROM by power-on\nSystem image file is "flash0:c1900-universalk9-mz.SPA.152-3.T.bin"\nLast reload type: Normal Reload\nLast reload reason: power-on\n\n\n\nThis product contains cryptographic features and is subject to United\nStates and local country laws governing import, export, transfer and\nuse. Delivery of Cisco cryptographic products does not imply\nthird-party authority to import, export, distribute or use encryption.\nImporters, exporters, distributors and users are responsible for\ncompliance with U.S. and local country laws. By using this product you\nagree to comply with applicable laws and regulations. If you are unable\nto comply with U.S. and local laws, return this product immediately.\n\nA summary of U.S. laws governing Cisco cryptographic products may be found at:\nhttp://www.cisco.com/wwl/export/crypto/tool/stqrg.html\n\nIf you require further assistance please contact us by sending email to\[email protected].\n\nCisco CISCO1941/K9 (revision 1.0) with 491520K/32768K bytes of memory.\nProcessor board ID FCZ16209046\n2 Gigabit Ethernet interfaces\n1 terminal line\nDRAM configuration is 64 bits wide with parity disabled.\n255K bytes of non-volatile configuration memory.\n250880K bytes of ATA System CompactFlash 0 (Read/Write)\n\n\nLicense Info:\n\nLicense UDI:\n\n-------------------------------------------------\n'
- ========================================================================
- 2014-02-13 10:26:19,053 [Cisco.1900.get_version(R2.example.com, 10.10.10.10)] Unhandled exception
- 2014-02-13 10:26:19,059 [Cisco.1900.get_version(R2.example.com, 10.10.10.10)] Script traceback:
- <class 'noc.sa.script.exception.UnexpectedResultError'>
- START OF TRACEBACK
- ------------------------------------------------------------------------
- File: /opt/noc/sa/script/script.py (Line: 961)
- Function: re_search
- 954 Returns match object.
- 955 rx can be string or compiled regular expression
- 956 """
- 957 if isinstance(rx, basestring):
- 958 rx = re.compile(rx, flags)
- 959 match = rx.search(s)
- 960 if match is None:
- 961 ==> raise self.UnexpectedResultError()
- 962 return match
- 963
- 964 def re_match(self, rx, s, flags=0):
- 965 """
- 966 Match s against regular expression rx using re.match
- 967 Raise UnexpectedResultError if regular expression is not matched.
- Variables:
- rx = <_sre.SRE_Pattern object at 0x335d480>
- s =
- 'Cisco IOS Software, C1900 Software (C1900-UNIVERSALK9-M), Version 15.2(3)T, RELEASE SOFTWARE (fc1)\nTechnical Support: http://www.cisco.com/techsupport\nCopyright (c) 1986-2012 by Cisco Systems, Inc.\nCompiled Fri 23-Mar-12 15:35 by prod_rel_team\n\nROM: System Bootstrap, Version 15.0(1r)M15, RELEASE SOFTWARE (fc1)\n\nR2 uptime is 13 weeks, 4 days, 6 hours, 17 minutes\nSystem returned to ROM by power-on\nSystem image file is "flash0:c1900-universalk9-mz.SPA.152-3.T.bin"\nLast reload type: Normal Reload\nLast reload reason: power-on\n\n\n\nThis product contains cryptographic features and is subject to United\nStates and local country laws governing import, export, transfer and\nuse. Delivery of Cisco cryptographic products does not imply\nthird-party authority to import, export, distribute or use encryption.\nImporters, exporters, distributors and users are responsible for\ncompliance with U.S. and local country laws. By using this product you\nagree to comply with applicable laws and regulations. If you are unable\nto comply with U.S. and local laws, return this product immediately.\n\nA summary of U.S. laws governing Cisco cryptographic products may be found at:\nhttp://www.cisco.com/wwl/export/crypto/tool/stqrg.html\n\nIf you require further assistance please contact us by sending email to\[email protected].\n\nCisco CISCO1941/K9 (revision 1.0) with 491520K/32768K bytes of memory.\nProcessor board ID FCZ16209046\n2 Gigabit Ethernet interfaces\n1 terminal line\nDRAM configuration is 64 bits wide with parity disabled.\n255K bytes of non-volatile configuration memory.\n250880K bytes of ATA System CompactFlash 0 (Read/Write)\n\n\nLicense Info:\n\nLicense UDI:\n\n-------------------------------------------------\n'
- flags = 0
- self = <Script(Thread-2, started 139970694551296)>
- match = None
- ------------------------------------------------------------------------
- File: /opt/noc/sa/profiles/Cisco/1900/get_version.py (Line: 26)
- Function: execute
- 19 cache = True
- 20 implements = [IGetVersion]
- 21
- 22 rx_ver = re.compile(r"Version (?P<version>\S+).+cisco (?P<platform>Catalyst \d+? \S+? processor)", re.MULTILINE | re.DOTALL)
- 23
- 24 def execute(self):
- 25 v = self.cli("show version", cached=True)
- 26 ==> match = self.re_search(self.rx_ver, v)
- 27 return {
- 28 "vendor" : "Cisco",
- 29 "platform" : match.group("platform"),
- 30 "version" : match.group("version"),
- 31 }
- Variables:
- self = <Script(Thread-2, started 139970694551296)>
- v =
- 'Cisco IOS Software, C1900 Software (C1900-UNIVERSALK9-M), Version 15.2(3)T, RELEASE SOFTWARE (fc1)\nTechnical Support: http://www.cisco.com/techsupport\nCopyright (c) 1986-2012 by Cisco Systems, Inc.\nCompiled Fri 23-Mar-12 15:35 by prod_rel_team\n\nROM: System Bootstrap, Version 15.0(1r)M15, RELEASE SOFTWARE (fc1)\n\nR2 uptime is 13 weeks, 4 days, 6 hours, 17 minutes\nSystem returned to ROM by power-on\nSystem image file is "flash0:c1900-universalk9-mz.SPA.152-3.T.bin"\nLast reload type: Normal Reload\nLast reload reason: power-on\n\n\n\nThis product contains cryptographic features and is subject to United\nStates and local country laws governing import, export, transfer and\nuse. Delivery of Cisco cryptographic products does not imply\nthird-party authority to import, export, distribute or use encryption.\nImporters, exporters, distributors and users are responsible for\ncompliance with U.S. and local country laws. By using this product you\nagree to comply with applicable laws and regulations. If you are unable\nto comply with U.S. and local laws, return this product immediately.\n\nA summary of U.S. laws governing Cisco cryptographic products may be found at:\nhttp://www.cisco.com/wwl/export/crypto/tool/stqrg.html\n\nIf you require further assistance please contact us by sending email to\[email protected].\n\nCisco CISCO1941/K9 (revision 1.0) with 491520K/32768K bytes of memory.\nProcessor board ID FCZ16209046\n2 Gigabit Ethernet interfaces\n1 terminal line\nDRAM configuration is 64 bits wide with parity disabled.\n255K bytes of non-volatile configuration memory.\n250880K bytes of ATA System CompactFlash 0 (Read/Write)\n\n\nLicense Info:\n\nLicense UDI:\n\n-------------------------------------------------\n'
- ------------------------------------------------------------------------
- File: /opt/noc/sa/script/script.py (Line: 422)
- Function: guarded_run
- 415 return result
- 416 except KeyError:
- 417 self.debug("Not in call cache: %r, %r" % (self.name,
- 418 self.kwargs))
- 419 pass
- 420 # Calling script body
- 421 self._thread_id = thread.get_ident()
- 422 ==> result = self.execute(**self.kwargs)
- 423 # Enforce interface result checking
- 424 for i in self.implements:
- 425 result = i.script_clean_result(self.profile, result)
- 426 # Cache result when required
- 427 if self.cache and self.parent is not None:
- 428 self.debug("Write to call cache: %s, %s, %r" % (self.name,
- Variables:
- i = <noc.sa.interfaces.igetversion.IGetVersion object at 0x3309a10>
- self = <Script(Thread-2, started 139970694551296)>
- ------------------------------------------------------------------------
- File: /opt/noc/sa/script/script.py (Line: 445)
- Function: run
- 438
- 439 def run(self):
- 440 """Script thread worker method"""
- 441 self.debug("Running")
- 442 result = None
- 443 try:
- 444 with self.cancelable():
- 445 ==> result = self.guarded_run()
- 446 except self.TimeOutError:
- 447 self.error("Timed out")
- 448 self.e_timeout = True
- 449 except CancelledError:
- 450 self.error("Cancelled")
- 451 self.e_cancel = True
- Variables:
- self = <Script(Thread-2, started 139970694551296)>
- r = ["<class 'noc.sa.script.exception.UnexpectedResultError'>", '']
- result = None
- v = UnexpectedResultError()
- tb = <traceback object at 0x412f1b8>
- t = <class 'noc.sa.script.exception.UnexpectedResultError'>
- ------------------------------------------------------------------------
- END OF TRACEBACK
- 2014-02-13 10:26:19,060 [Cisco.1900.get_version(R2.example.com, 10.10.10.10)] Closing
- 2014-02-13 10:26:19,061 Requesting call: <bound method CLITelnetSocket.close of <CLITelnetSocket(0x4122e10, 10.10.10.10:23, connected)>>(*(), **{'flush': True})
- 2014-02-13 10:26:20,009 Tick
- 2014-02-13 10:26:20,009 Calling delayed <bound method CLITelnetSocket.close of <CLITelnetSocket(0x4122e10, 10.10.10.10:23, connected)>>(*(), **{'flush': True})
- 2014-02-13 10:26:20,010 [TELNET: 10.10.10.10] Closing socket
- 2014-02-13 10:26:20,010 unregister_socket(<CLITelnetSocket(0x4122e10, 10.10.10.10:23, closing)>)
- 2014-02-13 10:26:20,010 3 TICKS TO EXIT
- 2014-02-13 10:26:21,011 Tick
- 2014-02-13 10:26:21,011 2 TICKS TO EXIT
- 2014-02-13 10:26:22,012 Tick
- 2014-02-13 10:26:22,013 1 TICKS TO EXIT
- 2014-02-13 10:26:23,014 Tick
- 2014-02-13 10:26:23,014 EXIT
- 2014-02-13 10:26:23,014 Shutting down the factory
- 2014-02-13 10:26:23,014 0 TICKS TO EXIT
- 2014-02-13 10:26:23,014 Stopping socket factory
Advertisement
Add Comment
Please, Sign In to add comment