Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- root@Node1:/opt/noc# ./noc script --debug --pretty get_version "sw3850"
- 2018-05-01 11:13:28,412 [noc.core.dcs.base] Resolve near service postgres
- 2018-05-01 11:13:28,412 [noc.core.http.client] HTTP GET http://consul:8500/v1/health/service/postgres?passing=1&near=_agent
- 2018-05-01 11:13:28,414 [noc.core.http.client] HTTP Response 200
- 2018-05-01 11:13:28,415 [noc.core.dcs.base] Resolved near service postgres to ['10.220.21.122:5432']
- 2018-05-01 11:13:29,720 [noc.core.dcs.base] Running resolver for service mongo
- 2018-05-01 11:13:29,721 [noc.core.dcs.base] [mongo] Starting resolver
- 2018-05-01 11:13:29,721 [noc.core.http.client] HTTP GET http://consul:8500/v1/health/service/mongo?passing=1
- 2018-05-01 11:13:29,722 [noc.core.http.client] HTTP Response 200
- 2018-05-01 11:13:29,723 [noc.core.dcs.base] [mongo] Set active services to: mongo: 10.220.21.122:27017
- 2018-05-01 11:13:29,723 [noc.core.http.client] HTTP GET http://consul:8500/v1/health/service/mongo?index=2342734&passing=1
- 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': '********'}
- 2018-05-01 11:13:29,779 [noc.core.cache.base] Using cache backend: noc.core.cache.mongo.MongoCache
- 2018-05-01 11:13:29,845 [noc.main.models.doccategory] Registering Capability
- 2018-05-01 11:13:29,846 [noc.main.models.doccategory] Registering MetricType
- 2018-05-01 11:13:29,882 [noc.main.models.doccategory] Registering ConnectionType
- 2018-05-01 11:13:29,886 [noc.main.models.doccategory] Registering ObjectModel
- 2018-05-01 11:13:29,895 [noc.main.models.textindex] Adding FTS index for sa.managedobject
- 2018-05-01 11:13:29,912 [noc.main.models.textindex] Adding FTS index for ip.vrf
- 2018-05-01 11:13:29,915 [noc.main.models.textindex] Adding FTS index for vc.vc
- 2018-05-01 11:13:29,916 [noc.main.models.textindex] Adding FTS index for ip.prefix
- 2018-05-01 11:13:29,923 [noc.main.models.textindex] Adding FTS index for ip.address
- 2018-05-01 11:13:29,986 [noc.core.script.loader] Loading script Cisco.IOS.get_version
- 2018-05-01 11:13:29,989 [noc.core.mib] Loading compiled MIBs
- 2018-05-01 11:13:29,989 [noc.core.mib] Loading compiled MIBs from 'cmibs'
- 2018-05-01 11:13:29,989 [noc.core.mib] Loading MIB: ENTITY-STATE-MIB
- 2018-05-01 11:13:29,989 [noc.core.mib] Loading MIB: SNMPv2-MIB
- 2018-05-01 11:13:29,990 [noc.core.mib] Loading MIB: CISCO-PPPOE-MIB
- 2018-05-01 11:13:29,990 [noc.core.mib] Loading MIB: RMON2-MIB
- 2018-05-01 11:13:29,990 [noc.core.mib] Loading MIB: IF-MIB
- 2018-05-01 11:13:29,990 [noc.core.mib] Loading MIB: RFC1213-MIB
- 2018-05-01 11:13:29,991 [noc.core.mib] Loading MIB: BRIDGE-MIB
- 2018-05-01 11:13:29,991 [noc.core.mib] Loading MIB: EtherLike-MIB
- 2018-05-01 11:13:29,991 [noc.core.mib] Loading MIB: ENTITY-MIB
- 2018-05-01 11:13:29,991 [noc.core.mib] Loading MIB: IP-MIB
- 2018-05-01 11:13:29,991 [noc.core.mib] Loading MIB: ENTITY-SENSOR-MIB
- 2018-05-01 11:13:29,992 [noc.core.mib] Loading MIB: CISCO-VPDN-MGMT-MIB
- 2018-05-01 11:13:29,992 [noc.core.mib] Loading MIB: LLDP-MIB
- 2018-05-01 11:13:30,016 [noc.core.profile.loader] Loading profile Cisco.IOS
- 2018-05-01 11:13:30,016 [script] [Cisco.IOS.get_version|10.220.20.100] Running. Input arguments: {}, timeout 3600
- 2018-05-01 11:13:30,017 [script] [Cisco.IOS.get_version|10.220.20.100] [snmp] Creating IOLoop
- 2018-05-01 11:13:30,017 [script] [Cisco.IOS.get_version|10.220.20.100] [snmp] Create UDP socket
- 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']
- 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 '
- 2018-05-01 11:13:30,021 [script] [Cisco.IOS.get_version|10.220.20.100] [snmp] Closing UDP socket
- 2018-05-01 11:13:30,021 [script] [Cisco.IOS.get_version|10.220.20.100] [snmp] Closing IOLoop
- 2018-05-01 11:13:30,315 [noc.core.debug] UNHANDLED EXCEPTION (2018-05-01 11:13:30.049069)
- PROCESS: ./commands/script.py
- VERSION: 15.05.1+microservices.9559.0ce3c50f
- BRANCH: microservices CHANGESET: 0ce3c50f
- ERROR FINGERPRINT: 17c76bd3-7dc0-55b1-90f5-98006ea7c95c
- WORKING DIRECTORY: /opt/noc
- EXCEPTION: <type 'exceptions.AttributeError'> 'NoneType' object has no attribute 'group'
- START OF TRACEBACK
- ------------------------------------------------------------------------
- File: sa/profiles/Cisco/IOS/get_version.py (Line: 81)
- Function: execute
- 74 # https://wiki.opennms.org/wiki/Hardware_Inventory_Entity_MIB
- 75 platform = ""
- 76 try:
- 77 v = self.snmp.get(mib["SNMPv2-MIB::sysDescr.0"], cached=True)
- 78 if v:
- 79 s = ""
- 80 match = self.rx_snmp_ver.search(v)
- 81 ==> platform = match.group("platform")
- 82 # inventory
- 83 # p = self.snmp.get("1.3.6.1.2.1.47.1.1.1.1.2.1001")
- 84 p = self.snmp.get(mib["ENTITY-MIB::entPhysicalDescr.1001"])
- 85 if p and p.startswith("WS-C"):
- 86 platform = p
- 87 s = self.snmp.get(mib["ENTITY-MIB::entPhysicalSerialNum.1001"])
- Variables:
- platform = ''
- s = ''
- self = <noc.sa.profiles.Cisco.IOS.get_version.Script object at 0x7f53ccab64d0>
- match = None
- v =
- '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 '
- ------------------------------------------------------------------------
- File: core/script/base.py (Line: 247)
- Function: run
- 240 self.logger.info("Using cached result")
- 241 cache_hit = True
- 242 except KeyError:
- 243 pass
- 244 # Execute script
- 245 if not cache_hit:
- 246 try:
- 247 ==> result = self.execute(**self.args)
- 248 if self.cache and self.parent and result:
- 249 self.logger.info("Caching result")
- 250 self.set_cache(self.name, self.args, result)
- 251 finally:
- 252 if not self.parent:
- 253 # Close SNMP socket when necessary
- Variables:
- cache_hit = False
- self = <noc.sa.profiles.Cisco.IOS.get_version.Script object at 0x7f53ccab64d0>
- ------------------------------------------------------------------------
- File: commands/script.py (Line: 118)
- Function: handle
- 111 capabilities=caps,
- 112 args=args,
- 113 version=version,
- 114 timeout=3600,
- 115 name=script,
- 116 collect_beef=bool(beef)
- 117 )
- 118 ==> result = scr.run()
- 119 if pretty:
- 120 pprint.pprint(result)
- 121 elif yaml:
- 122 import yaml
- 123 import sys
- 124 yaml.dump(result, sys.stdout)
- Variables:
- obj = <ManagedObject: sw3850>
- beef = None
- service = <__main__.ServiceStub object at 0x7f53ccab6650>
- script = u'Cisco.IOS.get_version'
- script_class = <class 'noc.sa.profiles.Cisco.IOS.get_version.Script'>
- self = <__main__.Command object at 0x7f53d54043d0>
- args = {}
- use_snmp = True
- caps =
- {u'Cisco | IOS | Syntax | IP SLA': 0,
- u'DB | Interfaces': 75,
- u'Network | CDP': True,
- u'Network | IPv6': True,
- u'Network | LACP': True,
- u'Network | OAM': True,
- u'Network | STP': True,
- u'SNMP': True,
- u'SNMP | Bulk': True,
- u'SNMP | IF-MIB': True,
- u'SNMP | IF-MIB | HC': True,
- u'SNMP | v1': True,
- u'SNMP | v2c': True,
- u'SNMP | v3': False}
- yaml = False
- object_name = ['sw3850']
- version = None
- arguments = []
- pretty = True
- credentials =
- {'access_preference': u'CS',
- 'address': u'xx.xx.xx.100',
- 'cli_protocol': 'telnet',
- 'password': u'xxxxx',
- 'path': None,
- 'raise_privileges': True,
- 'snmp_ro': u'xxxxx',
- 'snmp_version': 'v2c',
- 'super_password': u'cisco',
- 'user': u'noc'}
- access_preference = None
- options = {}
- scr = <noc.sa.profiles.Cisco.IOS.get_version.Script object at 0x7f53ccab64d0>
- ------------------------------------------------------------------------
- File: core/management/base.py (Line: 76)
- Function: run_from_argv
- 69 enable_profiling = cmd_options.pop("enable_profiling", False)
- 70 show_metrics = cmd_options.pop("show_metrics", False)
- 71 if enable_profiling:
- 72 # Start profiler
- 73 import yappi
- 74 yappi.start()
- 75 try:
- 76 ==> return self.handle(*args, **cmd_options) or 0
- 77 except CommandError as e:
- 78 self.print(str(e))
- 79 return 1
- 80 except KeyboardInterrupt:
- 81 self.print("Ctrl+C")
- 82 return 3
- Variables:
- parser =
- ArgumentParser(prog='script.py', usage=None, description=None, version=None, formatter_class=<class 'argparse.HelpFormatter'>, conflict_handler='error', add_help=True)
- loglevel = 'debug'
- enable_profiling = False
- args = ()
- cmd_options =
- {'access_preference': None,
- 'arguments': [],
- 'beef': None,
- 'object_name': ['sw3850'],
- 'pretty': True,
- 'script': ['get_version'],
- 'use_snmp': True,
- 'yaml': False}
- argv = ['--debug', '--pretty', 'get_version', 'sw3850']
- self = <__main__.Command object at 0x7f53d54043d0>
- show_metrics = False
- options =
- Namespace(access_preference=None, arguments=[], beef=None, object_name=['sw3850'], pretty=True, script=['get_version'], use_snmp=True, yaml=False)
- ------------------------------------------------------------------------
- END OF TRACEBACK
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement