Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ./noc script --debug --pretty get_version 251
- 2018-05-08 17:03:42,546 [noc.core.dcs.base] Resolve near service postgres
- 2018-05-08 17:03:42,546 [noc.core.http.client] HTTP GET http://consul:8500/v1/health/service/postgres?passing=1&near=_agent
- 2018-05-08 17:03:42,549 [noc.core.http.client] HTTP Response 200
- 2018-05-08 17:03:42,549 [noc.core.dcs.base] Resolved near service postgres to ['192.168.90.19:5432']
- 2018-05-08 17:03:42,721 [noc.core.dcs.base] Running resolver for service mongo
- 2018-05-08 17:03:42,722 [noc.core.dcs.base] [mongo] Starting resolver
- 2018-05-08 17:03:42,722 [noc.core.http.client] HTTP GET http://consul:8500/v1/health/service/mongo?passing=1
- 2018-05-08 17:03:42,723 [noc.core.http.client] HTTP Response 200
- 2018-05-08 17:03:42,723 [noc.core.dcs.base] [mongo] Set active services to: mongo: 192.168.90.19:27017
- 2018-05-08 17:03:42,724 [noc.core.http.client] HTTP GET http://consul:8500/v1/health/service/mongo?index=37013&passing=1
- 2018-05-08 17:03:42,725 [noc.lib.nosql] Connecting to MongoDB {'username': 'noc', 'authentication_source': 'noc', 'readPreference': 'secondaryPreferred', 'replicaSet': 'noc', 'db': 'noc', 'socketKeepAlive': True, 'host': 'mongodb://noc:********@192.168.90.19:27017/noc', 'password': '********'}
- 2018-05-08 17:03:42,772 [noc.core.cache.base] Using cache backend: noc.core.cache.mongo.MongoCache
- 2018-05-08 17:03:42,835 [noc.main.models.doccategory] Registering Capability
- 2018-05-08 17:03:42,836 [noc.main.models.doccategory] Registering MetricType
- 2018-05-08 17:03:42,900 [noc.main.models.doccategory] Registering ConnectionType
- 2018-05-08 17:03:42,904 [noc.main.models.doccategory] Registering ObjectModel
- 2018-05-08 17:03:42,913 [noc.main.models.textindex] Adding FTS index for sa.managedobject
- 2018-05-08 17:03:42,929 [noc.main.models.textindex] Adding FTS index for ip.vrf
- 2018-05-08 17:03:42,932 [noc.main.models.textindex] Adding FTS index for vc.vc
- 2018-05-08 17:03:42,933 [noc.main.models.textindex] Adding FTS index for ip.prefix
- 2018-05-08 17:03:42,939 [noc.main.models.textindex] Adding FTS index for ip.address
- 2018-05-08 17:03:42,982 [noc.core.script.loader] Loading script Huawei.VRP.get_version
- 2018-05-08 17:03:43,024 [noc.core.profile.loader] Loading profile Huawei.VRP
- 2018-05-08 17:03:43,025 [script] [Huawei.VRP.get_version|172.27.31.3] Running. Input arguments: {}, timeout 3600
- 2018-05-08 17:03:43,025 [script] [Huawei.VRP.get_version|172.27.31.3] [snmp] Creating IOLoop
- 2018-05-08 17:03:43,025 [script] [Huawei.VRP.get_version|172.27.31.3] [snmp] Create UDP socket
- 2018-05-08 17:03:43,025 [noc.core.ioloop.snmp] [172.27.31.3] SNMP GET ['1.3.6.1.2.1.1.1.0']
- 2018-05-08 17:03:43,053 [noc.core.ioloop.snmp] [172.27.31.3] GET result: 'Huawei Versatile Security Platform \r\nSoftware Version: VRP (R) software, Version 5.30 Eudemon1000E-N6 V100R001C30SPC600PWE \r\nCopyright (C) 2014-2016 Huawei Technologies Co., Ltd.'
- 2018-05-08 17:03:43,053 [script] [Huawei.VRP.get_version|172.27.31.3] [snmp] Closing UDP socket
- 2018-05-08 17:03:43,053 [script] [Huawei.VRP.get_version|172.27.31.3] [snmp] Closing IOLoop
- 2018-05-08 17:03:43,214 [noc.core.debug] UNHANDLED EXCEPTION (2018-05-08 17:03:43.063332)
- PROCESS: ./commands/script.py
- VERSION: 15.05.1+microservices.9600.8d4100fb
- BRANCH: microservices CHANGESET: 8d4100fb
- ERROR FINGERPRINT: 0e277ba4-2674-5916-8601-b825d956f8df
- WORKING DIRECTORY: /opt/noc
- EXCEPTION: <class 'noc.core.script.error.UnexpectedResultError'> Unexpected result
- START OF TRACEBACK
- ------------------------------------------------------------------------
- File: core/script/base.py (Line: 692)
- Function: find_re
- 685 """
- 686 Find first matching regular expression
- 687 or raise Unexpected result error
- 688 """
- 689 for r in iter:
- 690 if r.search(s):
- 691 return r
- 692 ==> raise UnexpectedResultError()
- 693
- 694 def hex_to_bin(self, s):
- 695 """
- 696 Convert hexadecimal string to boolean string.
- 697 All non-hexadecimal characters are ignored
- 698 :param s: Input string
- Variables:
- s =
- 'Huawei Versatile Security Platform \r\nSoftware Version: VRP (R) software, Version 5.30 Eudemon1000E-N6 V100R001C30SPC600PWE \r\nCopyright (C) 2014-2016 Huawei Technologies Co., Ltd.'
- r = <_sre.SRE_Pattern object at 0x37ef520>
- self = <noc.sa.profiles.Huawei.VRP.get_version.Script object at 0x37b0cd0>
- iter =
- [<_sre.SRE_Pattern object at 0x33102e0>,
- <_sre.SRE_Pattern object at 0x37ede30>,
- <_sre.SRE_Pattern object at 0x37ef8e0>,
- <_sre.SRE_Pattern object at 0x37eec30>,
- <_sre.SRE_Pattern object at 0x37ef520>]
- ------------------------------------------------------------------------
- File: sa/profiles/Huawei/VRP/get_version.py (Line: 87)
- Function: execute
- 80 try:
- 81 v = self.cli("display version", cached=True)
- 82 except self.CLISyntaxError:
- 83 raise self.NotSupportedError()
- 84 if "NetEngine" in v or "MultiserviceEngine" in v:
- 85 # Use specified regex for this platform
- 86 match_re_list.insert(0, self.rx_ver_snmp4_ne_me)
- 87 ==> rx = self.find_re(match_re_list, v)
- 88 match = rx.search(v)
- 89 platform = match.group("platform")
- 90 # Convert NetEngine to NE
- 91 if platform.lower().startswith("netengine"):
- 92 n, p = platform.split(" ", 1)
- 93 platform = "NE%s" % p.strip().upper()
- Variables:
- self = <noc.sa.profiles.Huawei.VRP.get_version.Script object at 0x37b0cd0>
- match_re_list =
- [<_sre.SRE_Pattern object at 0x33102e0>,
- <_sre.SRE_Pattern object at 0x37ede30>,
- <_sre.SRE_Pattern object at 0x37ef8e0>,
- <_sre.SRE_Pattern object at 0x37eec30>,
- <_sre.SRE_Pattern object at 0x37ef520>]
- v =
- 'Huawei Versatile Security Platform \r\nSoftware Version: VRP (R) software, Version 5.30 Eudemon1000E-N6 V100R001C30SPC600PWE \r\nCopyright (C) 2014-2016 Huawei Technologies Co., Ltd.'
- ------------------------------------------------------------------------
- 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.Huawei.VRP.get_version.Script object at 0x37b0cd0>
- ------------------------------------------------------------------------
- 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: 172.27.31.3>
- beef = None
- service = <__main__.ServiceStub object at 0x37b0c90>
- script = u'Huawei.VRP.get_version'
- script_class = <class 'noc.sa.profiles.Huawei.VRP.get_version.Script'>
- self = <__main__.Command object at 0x17e9ed0>
- args = {}
- use_snmp = True
- caps = {}
- yaml = False
- object_name = ['251']
- version = None
- arguments = []
- pretty = True
- credentials =
- {'access_preference': u'S',
- 'address': u'172.27.31.3',
- 'cli_protocol': 'ssh',
- 'password': u'***',
- 'path': None,
- 'raise_privileges': True,
- 'snmp_ro': u'open',
- 'snmp_version': 'v2c',
- 'super_password': None,
- 'user': u'admin'}
- access_preference = None
- options = {}
- scr = <noc.sa.profiles.Huawei.VRP.get_version.Script object at 0x37b0cd0>
- ------------------------------------------------------------------------
- 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': ['251'],
- 'pretty': True,
- 'script': ['get_version'],
- 'use_snmp': True,
- 'yaml': False}
- argv = ['--debug', '--pretty', 'get_version', '251']
- self = <__main__.Command object at 0x17e9ed0>
- show_metrics = False
- options =
- Namespace(access_preference=None, arguments=[], beef=None, object_name=['251'], pretty=True, script=['get_version'], use_snmp=True, yaml=False)
- ------------------------------------------------------------------------
- END OF TRACEBACK
- [root@192 noc]#
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement