Advertisement
Izya12

Cisco-3850-version

May 1st, 2018
169
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 10.63 KB | None | 0 0
  1. root@Node1:/opt/noc# ./noc script --debug --pretty get_version "sw3850"
  2. 2018-05-01 11:13:28,412 [noc.core.dcs.base] Resolve near service postgres
  3. 2018-05-01 11:13:28,412 [noc.core.http.client] HTTP GET http://consul:8500/v1/health/service/postgres?passing=1&near=_agent
  4. 2018-05-01 11:13:28,414 [noc.core.http.client] HTTP Response 200
  5. 2018-05-01 11:13:28,415 [noc.core.dcs.base] Resolved near service postgres to ['10.220.21.122:5432']
  6. 2018-05-01 11:13:29,720 [noc.core.dcs.base] Running resolver for service mongo
  7. 2018-05-01 11:13:29,721 [noc.core.dcs.base] [mongo] Starting resolver
  8. 2018-05-01 11:13:29,721 [noc.core.http.client] HTTP GET http://consul:8500/v1/health/service/mongo?passing=1
  9. 2018-05-01 11:13:29,722 [noc.core.http.client] HTTP Response 200
  10. 2018-05-01 11:13:29,723 [noc.core.dcs.base] [mongo] Set active services to: mongo: 10.220.21.122:27017
  11. 2018-05-01 11:13:29,723 [noc.core.http.client] HTTP GET http://consul:8500/v1/health/service/mongo?index=2342734&passing=1
  12. 2018-05-01 11:13:29,724 [noc.lib.nosql] Connecting to MongoDB {'username': 'noc', 'authentication_source': 'noc', 'readPreference': 'secondaryPreferred', 'replicaSet': 'noc', 'db': 'noc', 'socketKeepAlive': True, 'host': 'mongodb://noc:********@10.220.21.122:27017/noc', 'password': '********'}
  13. 2018-05-01 11:13:29,779 [noc.core.cache.base] Using cache backend: noc.core.cache.mongo.MongoCache
  14. 2018-05-01 11:13:29,845 [noc.main.models.doccategory] Registering Capability
  15. 2018-05-01 11:13:29,846 [noc.main.models.doccategory] Registering MetricType
  16. 2018-05-01 11:13:29,882 [noc.main.models.doccategory] Registering ConnectionType
  17. 2018-05-01 11:13:29,886 [noc.main.models.doccategory] Registering ObjectModel
  18. 2018-05-01 11:13:29,895 [noc.main.models.textindex] Adding FTS index for sa.managedobject
  19. 2018-05-01 11:13:29,912 [noc.main.models.textindex] Adding FTS index for ip.vrf
  20. 2018-05-01 11:13:29,915 [noc.main.models.textindex] Adding FTS index for vc.vc
  21. 2018-05-01 11:13:29,916 [noc.main.models.textindex] Adding FTS index for ip.prefix
  22. 2018-05-01 11:13:29,923 [noc.main.models.textindex] Adding FTS index for ip.address
  23. 2018-05-01 11:13:29,986 [noc.core.script.loader] Loading script Cisco.IOS.get_version
  24. 2018-05-01 11:13:29,989 [noc.core.mib] Loading compiled MIBs
  25. 2018-05-01 11:13:29,989 [noc.core.mib] Loading compiled MIBs from 'cmibs'
  26. 2018-05-01 11:13:29,989 [noc.core.mib] Loading MIB: ENTITY-STATE-MIB
  27. 2018-05-01 11:13:29,989 [noc.core.mib] Loading MIB: SNMPv2-MIB
  28. 2018-05-01 11:13:29,990 [noc.core.mib] Loading MIB: CISCO-PPPOE-MIB
  29. 2018-05-01 11:13:29,990 [noc.core.mib] Loading MIB: RMON2-MIB
  30. 2018-05-01 11:13:29,990 [noc.core.mib] Loading MIB: IF-MIB
  31. 2018-05-01 11:13:29,990 [noc.core.mib] Loading MIB: RFC1213-MIB
  32. 2018-05-01 11:13:29,991 [noc.core.mib] Loading MIB: BRIDGE-MIB
  33. 2018-05-01 11:13:29,991 [noc.core.mib] Loading MIB: EtherLike-MIB
  34. 2018-05-01 11:13:29,991 [noc.core.mib] Loading MIB: ENTITY-MIB
  35. 2018-05-01 11:13:29,991 [noc.core.mib] Loading MIB: IP-MIB
  36. 2018-05-01 11:13:29,991 [noc.core.mib] Loading MIB: ENTITY-SENSOR-MIB
  37. 2018-05-01 11:13:29,992 [noc.core.mib] Loading MIB: CISCO-VPDN-MGMT-MIB
  38. 2018-05-01 11:13:29,992 [noc.core.mib] Loading MIB: LLDP-MIB
  39. 2018-05-01 11:13:30,016 [noc.core.profile.loader] Loading profile Cisco.IOS
  40. 2018-05-01 11:13:30,016 [script] [Cisco.IOS.get_version|10.220.20.100] Running. Input arguments: {}, timeout 3600
  41. 2018-05-01 11:13:30,017 [script] [Cisco.IOS.get_version|10.220.20.100] [snmp] Creating IOLoop
  42. 2018-05-01 11:13:30,017 [script] [Cisco.IOS.get_version|10.220.20.100] [snmp] Create UDP socket
  43. 2018-05-01 11:13:30,017 [noc.core.ioloop.snmp] [10.220.20.100] SNMP GET ['1.3.6.1.2.1.1.1.0']
  44. 2018-05-01 11:13:30,020 [noc.core.ioloop.snmp] [10.220.20.100] GET result: 'Cisco IOS Software [Denali], Catalyst L3 Switch Software (CAT3K_CAA-UNIVERSALK9-M), Version 16.3.5b, RELEASE SOFTWARE (fc1)\r\nTechnical Support: http://www.cisco.com/techsupport\r\nCopyright (c) 1986-2017 by Cisco Systems, Inc.\r\nCompiled Thu 02-Nov-17 11:07 '
  45. 2018-05-01 11:13:30,021 [script] [Cisco.IOS.get_version|10.220.20.100] [snmp] Closing UDP socket
  46. 2018-05-01 11:13:30,021 [script] [Cisco.IOS.get_version|10.220.20.100] [snmp] Closing IOLoop
  47. 2018-05-01 11:13:30,315 [noc.core.debug] UNHANDLED EXCEPTION (2018-05-01 11:13:30.049069)
  48. PROCESS: ./commands/script.py
  49. VERSION: 15.05.1+microservices.9559.0ce3c50f
  50. BRANCH: microservices CHANGESET: 0ce3c50f
  51. ERROR FINGERPRINT: 17c76bd3-7dc0-55b1-90f5-98006ea7c95c
  52. WORKING DIRECTORY: /opt/noc
  53. EXCEPTION: <type 'exceptions.AttributeError'> 'NoneType' object has no attribute 'group'
  54. START OF TRACEBACK
  55. ------------------------------------------------------------------------
  56. File: sa/profiles/Cisco/IOS/get_version.py (Line: 81)
  57. Function: execute
  58.    74                 # https://wiki.opennms.org/wiki/Hardware_Inventory_Entity_MIB
  59.    75                 platform = ""
  60.    76                 try:
  61.    77                     v = self.snmp.get(mib["SNMPv2-MIB::sysDescr.0"], cached=True)
  62.    78                     if v:
  63.    79                         s = ""
  64.    80                         match = self.rx_snmp_ver.search(v)
  65.    81 ==>                     platform = match.group("platform")
  66.    82                         # inventory
  67.    83                         # p = self.snmp.get("1.3.6.1.2.1.47.1.1.1.1.2.1001")
  68.    84                         p = self.snmp.get(mib["ENTITY-MIB::entPhysicalDescr.1001"])
  69.    85                         if p and p.startswith("WS-C"):
  70.    86                             platform = p
  71.    87                             s = self.snmp.get(mib["ENTITY-MIB::entPhysicalSerialNum.1001"])
  72. Variables:
  73.             platform = ''
  74.                    s = ''
  75.                 self = <noc.sa.profiles.Cisco.IOS.get_version.Script object at 0x7f53ccab64d0>
  76.                match = None
  77.                    v =
  78. 'Cisco IOS Software [Denali], Catalyst L3 Switch Software (CAT3K_CAA-UNIVERSALK9-M), Version 16.3.5b, RELEASE SOFTWARE (fc1)\r\nTechnical Support: http://www.cisco.com/techsupport\r\nCopyright (c) 1986-2017 by Cisco Systems, Inc.\r\nCompiled Thu 02-Nov-17 11:07 '
  79. ------------------------------------------------------------------------
  80. File: core/script/base.py (Line: 247)
  81. Function: run
  82.   240                         self.logger.info("Using cached result")
  83.   241                         cache_hit = True
  84.   242                     except KeyError:
  85.   243                         pass
  86.   244                 # Execute script
  87.   245                 if not cache_hit:
  88.   246                     try:
  89.   247 ==>                     result = self.execute(**self.args)
  90.   248                         if self.cache and self.parent and result:
  91.   249                             self.logger.info("Caching result")
  92.   250                             self.set_cache(self.name, self.args, result)
  93.   251                     finally:
  94.   252                         if not self.parent:
  95.   253                             # Close SNMP socket when necessary
  96. Variables:
  97.            cache_hit = False
  98.                 self = <noc.sa.profiles.Cisco.IOS.get_version.Script object at 0x7f53ccab64d0>
  99. ------------------------------------------------------------------------
  100. File: commands/script.py (Line: 118)
  101. Function: handle
  102.   111                 capabilities=caps,
  103.   112                 args=args,
  104.   113                 version=version,
  105.   114                 timeout=3600,
  106.   115                 name=script,
  107.   116                 collect_beef=bool(beef)
  108.   117             )
  109.   118 ==>         result = scr.run()
  110.   119             if pretty:
  111.   120                 pprint.pprint(result)
  112.   121             elif yaml:
  113.   122                 import yaml
  114.   123                 import sys
  115.   124                 yaml.dump(result, sys.stdout)
  116. Variables:
  117.                  obj = <ManagedObject: sw3850>
  118.                 beef = None
  119.              service = <__main__.ServiceStub object at 0x7f53ccab6650>
  120.               script = u'Cisco.IOS.get_version'
  121.         script_class = <class 'noc.sa.profiles.Cisco.IOS.get_version.Script'>
  122.                 self = <__main__.Command object at 0x7f53d54043d0>
  123.                 args = {}
  124.             use_snmp = True
  125.                 caps =
  126. {u'Cisco | IOS | Syntax | IP SLA': 0,
  127.  u'DB | Interfaces': 75,
  128.  u'Network | CDP': True,
  129.  u'Network | IPv6': True,
  130.  u'Network | LACP': True,
  131.  u'Network | OAM': True,
  132.  u'Network | STP': True,
  133.  u'SNMP': True,
  134.  u'SNMP | Bulk': True,
  135.  u'SNMP | IF-MIB': True,
  136.  u'SNMP | IF-MIB | HC': True,
  137.  u'SNMP | v1': True,
  138.  u'SNMP | v2c': True,
  139.  u'SNMP | v3': False}
  140.                 yaml = False
  141.          object_name = ['sw3850']
  142.              version = None
  143.            arguments = []
  144.               pretty = True
  145.          credentials =
  146. {'access_preference': u'CS',
  147.  'address': u'xx.xx.xx.100',
  148.  'cli_protocol': 'telnet',
  149.  'password': u'xxxxx',
  150.  'path': None,
  151.  'raise_privileges': True,
  152.  'snmp_ro': u'xxxxx',
  153.  'snmp_version': 'v2c',
  154.  'super_password': u'cisco',
  155.  'user': u'noc'}
  156.    access_preference = None
  157.              options = {}
  158.                  scr = <noc.sa.profiles.Cisco.IOS.get_version.Script object at 0x7f53ccab64d0>
  159. ------------------------------------------------------------------------
  160. File: core/management/base.py (Line: 76)
  161. Function: run_from_argv
  162.    69             enable_profiling = cmd_options.pop("enable_profiling", False)
  163.    70             show_metrics = cmd_options.pop("show_metrics", False)
  164.    71             if enable_profiling:
  165.    72                 # Start profiler
  166.    73                 import yappi
  167.    74                 yappi.start()
  168.    75             try:
  169.    76 ==>             return self.handle(*args, **cmd_options) or 0
  170.    77             except CommandError as e:
  171.    78                 self.print(str(e))
  172.    79                 return 1
  173.    80             except KeyboardInterrupt:
  174.    81                 self.print("Ctrl+C")
  175.    82                 return 3
  176. Variables:
  177.               parser =
  178. ArgumentParser(prog='script.py', usage=None, description=None, version=None, formatter_class=<class 'argparse.HelpFormatter'>, conflict_handler='error', add_help=True)
  179.             loglevel = 'debug'
  180.     enable_profiling = False
  181.                 args = ()
  182.          cmd_options =
  183. {'access_preference': None,
  184.  'arguments': [],
  185.  'beef': None,
  186.  'object_name': ['sw3850'],
  187.  'pretty': True,
  188.  'script': ['get_version'],
  189.  'use_snmp': True,
  190.  'yaml': False}
  191.                 argv = ['--debug', '--pretty', 'get_version', 'sw3850']
  192.                 self = <__main__.Command object at 0x7f53d54043d0>
  193.         show_metrics = False
  194.              options =
  195. Namespace(access_preference=None, arguments=[], beef=None, object_name=['sw3850'], pretty=True, script=['get_version'], use_snmp=True, yaml=False)
  196. ------------------------------------------------------------------------
  197. END OF TRACEBACK
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement