Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- root@hostname-ubuntu-01:/opt/noc# ./noc etl extract ZABBIX
- 2021-03-13 15:01:27,950 [noc.core.ioloop.util] Setting up asyncio event loop pol icy
- 2021-03-13 15:01:27,951 [noc.core.ioloop.util] Setting up default event loop
- 2021-03-13 15:01:29,283 [noc.core.dcs.base] [mongo] Starting resolver (near=Fals e)
- 2021-03-13 15:01:29,306 [noc.core.dcs.base] [mongo] Set active services to: mong o: ***.**.***.116:27017
- 2021-03-13 15:01:29,307 [noc.core.dcs.base] [mongo] Stopping resolver
- 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'}
- 2021-03-13 15:01:33,181 [noc.core.loader.base] [compressor] Loading gzip
- 2021-03-13 15:01:39,778 [noc.core.etl.remotesystem.base] [ZABBIX] Skipping extra ctor service
- 2021-03-13 15:01:39,778 [noc.core.etl.remotesystem.base] [ZABBIX] Skipping extra ctor serviceprofile
- 2021-03-13 15:01:39,778 [noc.core.etl.remotesystem.base] [ZABBIX] Skipping extra ctor subscriber
- 2021-03-13 15:01:39,779 [noc.core.etl.remotesystem.base] [ZABBIX] Skipping extra ctor subscriberprofile
- 2021-03-13 15:01:39,779 [noc.core.etl.remotesystem.base] [ZABBIX] Skipping extra ctor link
- 2021-03-13 15:01:40,280 [noc.core.etl.extractor.base] [ZABBIX|managedobject] Ext racting managedobject from ZABBIX
- 2021-03-13 15:02:17,202 [noc.core.debug] UNHANDLED EXCEPTION (2021-03-13 15:02:04.146992)
- PROCESS: ./commands/etl.py
- VERSION: 20.4.3+release-20.4.134.2c7a1851
- BRANCH: release-20.4 CHANGESET: 2c7a1851
- ERROR FINGERPRINT: ee593ce8-2200-556d-a17b-c17cd9df71b8
- WORKING DIRECTORY: /opt/noc
- EXCEPTION: <class 'AttributeError'> 'ZBManagedObjectExtractor' object has no attribute 'model'
- START OF TRACEBACK
- ------------------------------------------------------------------------
- File: core/etl/extractor/base.py (Line: 150)
- Function: get_model
- 143 return smart_text(s)
- 144 else:
- 145 return str(s)
- 146
- 147 def get_model(raw) -> BaseModel:
- 148 if isinstance(raw, BaseModel):
- 149 return raw
- 150 ==> return self.model.from_iter(q(x) for x in row)
- 151
- 152 # Fetch data
- 153 self.logger.info("Extracting %s from %s", self.name, self.system.name)
- 154 t0 = perf_counter()
- 155 data: List[BaseModel] = []
- 156 n = 0
- Variables:
- raw =
- [10644,
- '***.**.***.106#10644',
- True,
- None,
- 'zb.root',
- 'default',
- '!new',
- 'Generic.Host',
- 'zb.std.sw',
- None,
- None,
- 2,
- '***.**.***.106',
- None,
- None,
- None,
- None,
- None,
- '',
- 'ZB.AUTO',
- None,
- None]
- q = <function BaseExtractor.extract.<locals>.q at 0x7f6a0b4a73a0>
- row =
- [10644,
- '***.**.***.106#10644',
- True,
- None,
- 'zb.root',
- 'default',
- '!new',
- 'Generic.Host',
- 'zb.std.sw',
- None,
- None,
- 2,
- '***.**.***.106',
- None,
- None,
- None,
- None,
- None,
- '',
- 'ZB.AUTO',
- None,
- None]
- self =
- <noc.custom.etl.extractors.zabbix.ZBManagedObjectExtractor object at 0x7f6a09742790>
- ------------------------------------------------------------------------
- File: core/etl/extractor/base.py (Line: 163)
- Function: extract
- 156 n = 0
- 157 seen = set()
- 158 for row in self.iter_data():
- 159 if not self.filter(row):
- 160 continue
- 161 row = self.clean(row)
- 162 # Do not use get_model(self.clean(row)), to zip_longest broken row
- 163 ==> row = get_model(row)
- 164 if row.id in seen:
- 165 if not self.suppress_deduplication_log:
- 166 self.logger.error("Duplicated row truncated: %r", row)
- 167 continue
- 168 seen.add(row.id)
- 169 data += [row]
- Variables:
- get_model = <function BaseExtractor.extract.<locals>.get_model at 0x7f69fb684b80>
- t0 = 500869.025008314
- data = []
- n = 0
- seen = set()
- q = <function BaseExtractor.extract.<locals>.q at 0x7f6a0b4a73a0>
- row =
- [10644,
- '***.**.***.106#10644',
- True,
- None,
- 'zb.root',
- 'default',
- '!new',
- 'Generic.Host',
- 'zb.std.sw',
- None,
- None,
- 2,
- '***.**.***.106',
- None,
- None,
- None,
- None,
- None,
- '',
- 'ZB.AUTO',
- None,
- None]
- self =
- <noc.custom.etl.extractors.zabbix.ZBManagedObjectExtractor object at 0x7f6a09742790>
- ------------------------------------------------------------------------
- File: custom/etl/extractors/zabbix.py (Line: 258)
- Function: extract
- 251 "", # description
- 252 "ZB.AUTO", # auth_profile
- 253 None, # Tags (Тэги)
- 254 None # TT System (ТТ система)
- 255 ]
- 256
- 257 def extract(self):
- 258 ==> super(ZBManagedObjectExtractor, self).extract() # Запуск извлечения ManagedObject
- 259 # Extract containers (Запускаем извлечение контейнеров и передаём им переменную `container_node`)
- 260 cx = ZBContainerExtractor(
- 261 self.system,
- 262 containers=self.container_node
- 263 )
- 264 cx.extract_data()
- Variables:
- self =
- <noc.custom.etl.extractors.zabbix.ZBManagedObjectExtractor object at 0x7f6a09742790>
- __class__ = <class 'noc.custom.etl.extractors.zabbix.ZBManagedObjectExtractor'>
- ------------------------------------------------------------------------
- File: core/etl/remotesystem/base.py (Line: 64)
- Function: extract
- 57 self.logger.info("Skipping extractor %s", en)
- 58 continue
- 59 if en not in self.extractors:
- 60 self.logger.info("Extractor %s is not implemented. Skipping", en)
- 61 continue
- 62 # @todo: Config
- 63 xc = self.extractors[en](self)
- 64 ==> xc.extract()
- 65
- 66 def load(self, loaders=None):
- 67 loaders = loaders or []
- 68 # Build chain
- 69 chain = self.get_loader_chain()
- 70 # Add & Modify
- Variables:
- self =
- <noc.custom.etl.extractors.zabbix.ZBRemoteSystem object at 0x7f6a09715d60>
- extractors = ['managedobject']
- en = 'managedobject'
- xc =
- <noc.custom.etl.extractors.zabbix.ZBManagedObjectExtractor object at 0x7f6a09742790>
- ------------------------------------------------------------------------
- File: main/models/remotesystem.py (Line: 151)
- Function: extract
- 144 extractors += [k[7:]]
- 145 return extractors
- 146
- 147 def extract(self, extractors=None, quiet=False):
- 148 extractors = extractors or self.get_extractors()
- 149 error = None
- 150 try:
- 151 ==> self.get_handler().extract(extractors)
- 152 except Exception as e:
- 153 if not quiet:
- 154 raise e
- 155 error_report()
- 156 error = str(e)
- 157 self.last_extract = datetime.datetime.now()
- Variables:
- self = <RemoteSystem: ZABBIX>
- extractors = ['managedobject']
- quiet = True
- error = None
- e =
- AttributeError("'ZBManagedObjectExtractor' object has no attribute 'model'")
- ------------------------------------------------------------------------
- END OF TRACEBACK
Advertisement
Add Comment
Please, Sign In to add comment