Advertisement
cyberbob61

Untitled

May 8th, 2018
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.44 KB | None | 0 0
  1. ./noc script --debug --pretty get_version 251
  2. 2018-05-08 17:03:42,546 [noc.core.dcs.base] Resolve near service postgres
  3. 2018-05-08 17:03:42,546 [noc.core.http.client] HTTP GET http://consul:8500/v1/health/service/postgres?passing=1&near=_agent
  4. 2018-05-08 17:03:42,549 [noc.core.http.client] HTTP Response 200
  5. 2018-05-08 17:03:42,549 [noc.core.dcs.base] Resolved near service postgres to ['192.168.90.19:5432']
  6. 2018-05-08 17:03:42,721 [noc.core.dcs.base] Running resolver for service mongo
  7. 2018-05-08 17:03:42,722 [noc.core.dcs.base] [mongo] Starting resolver
  8. 2018-05-08 17:03:42,722 [noc.core.http.client] HTTP GET http://consul:8500/v1/health/service/mongo?passing=1
  9. 2018-05-08 17:03:42,723 [noc.core.http.client] HTTP Response 200
  10. 2018-05-08 17:03:42,723 [noc.core.dcs.base] [mongo] Set active services to: mongo: 192.168.90.19:27017
  11. 2018-05-08 17:03:42,724 [noc.core.http.client] HTTP GET http://consul:8500/v1/health/service/mongo?index=37013&passing=1
  12. 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': '********'}
  13. 2018-05-08 17:03:42,772 [noc.core.cache.base] Using cache backend: noc.core.cache.mongo.MongoCache
  14. 2018-05-08 17:03:42,835 [noc.main.models.doccategory] Registering Capability
  15. 2018-05-08 17:03:42,836 [noc.main.models.doccategory] Registering MetricType
  16. 2018-05-08 17:03:42,900 [noc.main.models.doccategory] Registering ConnectionType
  17. 2018-05-08 17:03:42,904 [noc.main.models.doccategory] Registering ObjectModel
  18. 2018-05-08 17:03:42,913 [noc.main.models.textindex] Adding FTS index for sa.managedobject
  19. 2018-05-08 17:03:42,929 [noc.main.models.textindex] Adding FTS index for ip.vrf
  20. 2018-05-08 17:03:42,932 [noc.main.models.textindex] Adding FTS index for vc.vc
  21. 2018-05-08 17:03:42,933 [noc.main.models.textindex] Adding FTS index for ip.prefix
  22. 2018-05-08 17:03:42,939 [noc.main.models.textindex] Adding FTS index for ip.address
  23. 2018-05-08 17:03:42,982 [noc.core.script.loader] Loading script Huawei.VRP.get_version
  24. 2018-05-08 17:03:43,024 [noc.core.profile.loader] Loading profile Huawei.VRP
  25. 2018-05-08 17:03:43,025 [script] [Huawei.VRP.get_version|172.27.31.3] Running. Input arguments: {}, timeout 3600
  26. 2018-05-08 17:03:43,025 [script] [Huawei.VRP.get_version|172.27.31.3] [snmp] Creating IOLoop
  27. 2018-05-08 17:03:43,025 [script] [Huawei.VRP.get_version|172.27.31.3] [snmp] Create UDP socket
  28. 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']
  29. 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.'
  30. 2018-05-08 17:03:43,053 [script] [Huawei.VRP.get_version|172.27.31.3] [snmp] Closing UDP socket
  31. 2018-05-08 17:03:43,053 [script] [Huawei.VRP.get_version|172.27.31.3] [snmp] Closing IOLoop
  32. 2018-05-08 17:03:43,214 [noc.core.debug] UNHANDLED EXCEPTION (2018-05-08 17:03:43.063332)
  33. PROCESS: ./commands/script.py
  34. VERSION: 15.05.1+microservices.9600.8d4100fb
  35. BRANCH: microservices CHANGESET: 8d4100fb
  36. ERROR FINGERPRINT: 0e277ba4-2674-5916-8601-b825d956f8df
  37. WORKING DIRECTORY: /opt/noc
  38. EXCEPTION: <class 'noc.core.script.error.UnexpectedResultError'> Unexpected result
  39. START OF TRACEBACK
  40. ------------------------------------------------------------------------
  41. File: core/script/base.py (Line: 692)
  42. Function: find_re
  43. 685 """
  44. 686 Find first matching regular expression
  45. 687 or raise Unexpected result error
  46. 688 """
  47. 689 for r in iter:
  48. 690 if r.search(s):
  49. 691 return r
  50. 692 ==> raise UnexpectedResultError()
  51. 693
  52. 694 def hex_to_bin(self, s):
  53. 695 """
  54. 696 Convert hexadecimal string to boolean string.
  55. 697 All non-hexadecimal characters are ignored
  56. 698 :param s: Input string
  57. Variables:
  58. s =
  59. '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.'
  60. r = <_sre.SRE_Pattern object at 0x37ef520>
  61. self = <noc.sa.profiles.Huawei.VRP.get_version.Script object at 0x37b0cd0>
  62. iter =
  63. [<_sre.SRE_Pattern object at 0x33102e0>,
  64. <_sre.SRE_Pattern object at 0x37ede30>,
  65. <_sre.SRE_Pattern object at 0x37ef8e0>,
  66. <_sre.SRE_Pattern object at 0x37eec30>,
  67. <_sre.SRE_Pattern object at 0x37ef520>]
  68. ------------------------------------------------------------------------
  69. File: sa/profiles/Huawei/VRP/get_version.py (Line: 87)
  70. Function: execute
  71. 80 try:
  72. 81 v = self.cli("display version", cached=True)
  73. 82 except self.CLISyntaxError:
  74. 83 raise self.NotSupportedError()
  75. 84 if "NetEngine" in v or "MultiserviceEngine" in v:
  76. 85 # Use specified regex for this platform
  77. 86 match_re_list.insert(0, self.rx_ver_snmp4_ne_me)
  78. 87 ==> rx = self.find_re(match_re_list, v)
  79. 88 match = rx.search(v)
  80. 89 platform = match.group("platform")
  81. 90 # Convert NetEngine to NE
  82. 91 if platform.lower().startswith("netengine"):
  83. 92 n, p = platform.split(" ", 1)
  84. 93 platform = "NE%s" % p.strip().upper()
  85. Variables:
  86. self = <noc.sa.profiles.Huawei.VRP.get_version.Script object at 0x37b0cd0>
  87. match_re_list =
  88. [<_sre.SRE_Pattern object at 0x33102e0>,
  89. <_sre.SRE_Pattern object at 0x37ede30>,
  90. <_sre.SRE_Pattern object at 0x37ef8e0>,
  91. <_sre.SRE_Pattern object at 0x37eec30>,
  92. <_sre.SRE_Pattern object at 0x37ef520>]
  93. v =
  94. '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.'
  95. ------------------------------------------------------------------------
  96. File: core/script/base.py (Line: 247)
  97. Function: run
  98. 240 self.logger.info("Using cached result")
  99. 241 cache_hit = True
  100. 242 except KeyError:
  101. 243 pass
  102. 244 # Execute script
  103. 245 if not cache_hit:
  104. 246 try:
  105. 247 ==> result = self.execute(**self.args)
  106. 248 if self.cache and self.parent and result:
  107. 249 self.logger.info("Caching result")
  108. 250 self.set_cache(self.name, self.args, result)
  109. 251 finally:
  110. 252 if not self.parent:
  111. 253 # Close SNMP socket when necessary
  112. Variables:
  113. cache_hit = False
  114. self = <noc.sa.profiles.Huawei.VRP.get_version.Script object at 0x37b0cd0>
  115. ------------------------------------------------------------------------
  116. File: commands/script.py (Line: 118)
  117. Function: handle
  118. 111 capabilities=caps,
  119. 112 args=args,
  120. 113 version=version,
  121. 114 timeout=3600,
  122. 115 name=script,
  123. 116 collect_beef=bool(beef)
  124. 117 )
  125. 118 ==> result = scr.run()
  126. 119 if pretty:
  127. 120 pprint.pprint(result)
  128. 121 elif yaml:
  129. 122 import yaml
  130. 123 import sys
  131. 124 yaml.dump(result, sys.stdout)
  132. Variables:
  133. obj = <ManagedObject: 172.27.31.3>
  134. beef = None
  135. service = <__main__.ServiceStub object at 0x37b0c90>
  136. script = u'Huawei.VRP.get_version'
  137. script_class = <class 'noc.sa.profiles.Huawei.VRP.get_version.Script'>
  138. self = <__main__.Command object at 0x17e9ed0>
  139. args = {}
  140. use_snmp = True
  141. caps = {}
  142. yaml = False
  143. object_name = ['251']
  144. version = None
  145. arguments = []
  146. pretty = True
  147. credentials =
  148. {'access_preference': u'S',
  149. 'address': u'172.27.31.3',
  150. 'cli_protocol': 'ssh',
  151. 'password': u'***',
  152. 'path': None,
  153. 'raise_privileges': True,
  154. 'snmp_ro': u'open',
  155. 'snmp_version': 'v2c',
  156. 'super_password': None,
  157. 'user': u'admin'}
  158. access_preference = None
  159. options = {}
  160. scr = <noc.sa.profiles.Huawei.VRP.get_version.Script object at 0x37b0cd0>
  161. ------------------------------------------------------------------------
  162. File: core/management/base.py (Line: 76)
  163. Function: run_from_argv
  164. 69 enable_profiling = cmd_options.pop("enable_profiling", False)
  165. 70 show_metrics = cmd_options.pop("show_metrics", False)
  166. 71 if enable_profiling:
  167. 72 # Start profiler
  168. 73 import yappi
  169. 74 yappi.start()
  170. 75 try:
  171. 76 ==> return self.handle(*args, **cmd_options) or 0
  172. 77 except CommandError as e:
  173. 78 self.print(str(e))
  174. 79 return 1
  175. 80 except KeyboardInterrupt:
  176. 81 self.print("Ctrl+C")
  177. 82 return 3
  178. Variables:
  179. parser =
  180. ArgumentParser(prog='script.py', usage=None, description=None, version=None, formatter_class=<class 'argparse.HelpFormatter'>, conflict_handler='error', add_help=True)
  181. loglevel = 'debug'
  182. enable_profiling = False
  183. args = ()
  184. cmd_options =
  185. {'access_preference': None,
  186. 'arguments': [],
  187. 'beef': None,
  188. 'object_name': ['251'],
  189. 'pretty': True,
  190. 'script': ['get_version'],
  191. 'use_snmp': True,
  192. 'yaml': False}
  193. argv = ['--debug', '--pretty', 'get_version', '251']
  194. self = <__main__.Command object at 0x17e9ed0>
  195. show_metrics = False
  196. options =
  197. Namespace(access_preference=None, arguments=[], beef=None, object_name=['251'], pretty=True, script=['get_version'], use_snmp=True, yaml=False)
  198. ------------------------------------------------------------------------
  199. END OF TRACEBACK
  200. [root@192 noc]#
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement