Guest User

Untitled

a guest
Mar 13th, 2021
31
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.76 KB | None | 0 0
  1. root@hostname-ubuntu-01:/opt/noc# ./noc etl extract ZABBIX
  2. 2021-03-13 15:01:27,950 [noc.core.ioloop.util] Setting up asyncio event loop pol icy
  3. 2021-03-13 15:01:27,951 [noc.core.ioloop.util] Setting up default event loop
  4. 2021-03-13 15:01:29,283 [noc.core.dcs.base] [mongo] Starting resolver (near=Fals e)
  5. 2021-03-13 15:01:29,306 [noc.core.dcs.base] [mongo] Set active services to: mong o: ***.**.***.116:27017
  6. 2021-03-13 15:01:29,307 [noc.core.dcs.base] [mongo] Stopping resolver
  7. 2021-03-13 15:01:29,309 [noc.core.mongo.connection] Connecting to MongoDB {'db': 'noc', 'username': 'noc', 'password': '********', 'authentication_source': 'noc ', 'replicaSet': 'noc', 'readPreference': 'secondaryPreferred', 'maxIdleTimeMS': 60000, 'host': 'mongodb://noc:********@***.**.***.116:27017/noc'}
  8. 2021-03-13 15:01:33,181 [noc.core.loader.base] [compressor] Loading gzip
  9. 2021-03-13 15:01:39,778 [noc.core.etl.remotesystem.base] [ZABBIX] Skipping extra ctor service
  10. 2021-03-13 15:01:39,778 [noc.core.etl.remotesystem.base] [ZABBIX] Skipping extra ctor serviceprofile
  11. 2021-03-13 15:01:39,778 [noc.core.etl.remotesystem.base] [ZABBIX] Skipping extra ctor subscriber
  12. 2021-03-13 15:01:39,779 [noc.core.etl.remotesystem.base] [ZABBIX] Skipping extra ctor subscriberprofile
  13. 2021-03-13 15:01:39,779 [noc.core.etl.remotesystem.base] [ZABBIX] Skipping extra ctor link
  14. 2021-03-13 15:01:40,280 [noc.core.etl.extractor.base] [ZABBIX|managedobject] Ext racting managedobject from ZABBIX
  15. 2021-03-13 15:02:17,202 [noc.core.debug] UNHANDLED EXCEPTION (2021-03-13 15:02:04.146992)
  16. PROCESS: ./commands/etl.py
  17. VERSION: 20.4.3+release-20.4.134.2c7a1851
  18. BRANCH: release-20.4 CHANGESET: 2c7a1851
  19. ERROR FINGERPRINT: ee593ce8-2200-556d-a17b-c17cd9df71b8
  20. WORKING DIRECTORY: /opt/noc
  21. EXCEPTION: <class 'AttributeError'> 'ZBManagedObjectExtractor' object has no attribute 'model'
  22. START OF TRACEBACK
  23. ------------------------------------------------------------------------
  24. File: core/etl/extractor/base.py (Line: 150)
  25. Function: get_model
  26. 143 return smart_text(s)
  27. 144 else:
  28. 145 return str(s)
  29. 146
  30. 147 def get_model(raw) -> BaseModel:
  31. 148 if isinstance(raw, BaseModel):
  32. 149 return raw
  33. 150 ==> return self.model.from_iter(q(x) for x in row)
  34. 151
  35. 152 # Fetch data
  36. 153 self.logger.info("Extracting %s from %s", self.name, self.system.name)
  37. 154 t0 = perf_counter()
  38. 155 data: List[BaseModel] = []
  39. 156 n = 0
  40. Variables:
  41. raw =
  42. [10644,
  43. '***.**.***.106#10644',
  44. True,
  45. None,
  46. 'zb.root',
  47. 'default',
  48. '!new',
  49. 'Generic.Host',
  50. 'zb.std.sw',
  51. None,
  52. None,
  53. 2,
  54. '***.**.***.106',
  55. None,
  56. None,
  57. None,
  58. None,
  59. None,
  60. '',
  61. 'ZB.AUTO',
  62. None,
  63. None]
  64. q = <function BaseExtractor.extract.<locals>.q at 0x7f6a0b4a73a0>
  65. row =
  66. [10644,
  67. '***.**.***.106#10644',
  68. True,
  69. None,
  70. 'zb.root',
  71. 'default',
  72. '!new',
  73. 'Generic.Host',
  74. 'zb.std.sw',
  75. None,
  76. None,
  77. 2,
  78. '***.**.***.106',
  79. None,
  80. None,
  81. None,
  82. None,
  83. None,
  84. '',
  85. 'ZB.AUTO',
  86. None,
  87. None]
  88. self =
  89. <noc.custom.etl.extractors.zabbix.ZBManagedObjectExtractor object at 0x7f6a09742790>
  90. ------------------------------------------------------------------------
  91. File: core/etl/extractor/base.py (Line: 163)
  92. Function: extract
  93. 156 n = 0
  94. 157 seen = set()
  95. 158 for row in self.iter_data():
  96. 159 if not self.filter(row):
  97. 160 continue
  98. 161 row = self.clean(row)
  99. 162 # Do not use get_model(self.clean(row)), to zip_longest broken row
  100. 163 ==> row = get_model(row)
  101. 164 if row.id in seen:
  102. 165 if not self.suppress_deduplication_log:
  103. 166 self.logger.error("Duplicated row truncated: %r", row)
  104. 167 continue
  105. 168 seen.add(row.id)
  106. 169 data += [row]
  107. Variables:
  108. get_model = <function BaseExtractor.extract.<locals>.get_model at 0x7f69fb684b80>
  109. t0 = 500869.025008314
  110. data = []
  111. n = 0
  112. seen = set()
  113. q = <function BaseExtractor.extract.<locals>.q at 0x7f6a0b4a73a0>
  114. row =
  115. [10644,
  116. '***.**.***.106#10644',
  117. True,
  118. None,
  119. 'zb.root',
  120. 'default',
  121. '!new',
  122. 'Generic.Host',
  123. 'zb.std.sw',
  124. None,
  125. None,
  126. 2,
  127. '***.**.***.106',
  128. None,
  129. None,
  130. None,
  131. None,
  132. None,
  133. '',
  134. 'ZB.AUTO',
  135. None,
  136. None]
  137. self =
  138. <noc.custom.etl.extractors.zabbix.ZBManagedObjectExtractor object at 0x7f6a09742790>
  139. ------------------------------------------------------------------------
  140. File: custom/etl/extractors/zabbix.py (Line: 258)
  141. Function: extract
  142. 251 "", # description
  143. 252 "ZB.AUTO", # auth_profile
  144. 253 None, # Tags (Тэги)
  145. 254 None # TT System (ТТ система)
  146. 255 ]
  147. 256
  148. 257 def extract(self):
  149. 258 ==> super(ZBManagedObjectExtractor, self).extract() # Запуск извлечения ManagedObject
  150. 259 # Extract containers (Запускаем извлечение контейнеров и передаём им переменную `container_node`)
  151. 260 cx = ZBContainerExtractor(
  152. 261 self.system,
  153. 262 containers=self.container_node
  154. 263 )
  155. 264 cx.extract_data()
  156. Variables:
  157. self =
  158. <noc.custom.etl.extractors.zabbix.ZBManagedObjectExtractor object at 0x7f6a09742790>
  159. __class__ = <class 'noc.custom.etl.extractors.zabbix.ZBManagedObjectExtractor'>
  160. ------------------------------------------------------------------------
  161. File: core/etl/remotesystem/base.py (Line: 64)
  162. Function: extract
  163. 57 self.logger.info("Skipping extractor %s", en)
  164. 58 continue
  165. 59 if en not in self.extractors:
  166. 60 self.logger.info("Extractor %s is not implemented. Skipping", en)
  167. 61 continue
  168. 62 # @todo: Config
  169. 63 xc = self.extractors[en](self)
  170. 64 ==> xc.extract()
  171. 65
  172. 66 def load(self, loaders=None):
  173. 67 loaders = loaders or []
  174. 68 # Build chain
  175. 69 chain = self.get_loader_chain()
  176. 70 # Add & Modify
  177. Variables:
  178. self =
  179. <noc.custom.etl.extractors.zabbix.ZBRemoteSystem object at 0x7f6a09715d60>
  180. extractors = ['managedobject']
  181. en = 'managedobject'
  182. xc =
  183. <noc.custom.etl.extractors.zabbix.ZBManagedObjectExtractor object at 0x7f6a09742790>
  184. ------------------------------------------------------------------------
  185. File: main/models/remotesystem.py (Line: 151)
  186. Function: extract
  187. 144 extractors += [k[7:]]
  188. 145 return extractors
  189. 146
  190. 147 def extract(self, extractors=None, quiet=False):
  191. 148 extractors = extractors or self.get_extractors()
  192. 149 error = None
  193. 150 try:
  194. 151 ==> self.get_handler().extract(extractors)
  195. 152 except Exception as e:
  196. 153 if not quiet:
  197. 154 raise e
  198. 155 error_report()
  199. 156 error = str(e)
  200. 157 self.last_extract = datetime.datetime.now()
  201. Variables:
  202. self = <RemoteSystem: ZABBIX>
  203. extractors = ['managedobject']
  204. quiet = True
  205. error = None
  206. e =
  207. AttributeError("'ZBManagedObjectExtractor' object has no attribute 'model'")
  208. ------------------------------------------------------------------------
  209. END OF TRACEBACK
  210.  
Advertisement
Add Comment
Please, Sign In to add comment