def get_enrichment(self): """See base class.""" self._cisco_model = self._plugin_context.data.resource_metadata.get( u'model', u'unknown') self._build_oids_map() self._build_metrics_groups_conf() enrichment_set = { u"oids": self.oids_map, u"metrics_groups": self.metrics_groups } try: self.enrichment_group.add_enrichment_set( enrichment.PanoptesEnrichmentSet(self.device_fqdn, enrichment_set)) except Exception as e: self._logger.error( u'Error while adding enrichment set {} to enrichment group for the device {}: {}' .format(enrichment_set, self.device_fqdn, repr(e))) self.enrichment_group_set.add_enrichment_group(self.enrichment_group) self._logger.debug(u'Metrics enrichment for device {}: {}'.format( self.device_fqdn, self.enrichment_group_set)) return self.enrichment_group_set
def get_results(self): self._build_oids_map() self._build_metrics_groups_conf() enrichment_set = { "oids": self.oids_map, "metrics_groups": self.metrics_groups } try: self.enrichment_group.add_enrichment_set( enrichment.PanoptesEnrichmentSet(self.device_fqdn, enrichment_set)) except Exception as e: self._logger.error( 'Error while adding enrichment set {} to enrichment group for the device {}: {}' .format(enrichment_set, self.device_fqdn, repr(e))) self.enrichment_group_set.add_enrichment_group(self.enrichment_group) self._logger.debug('Metrics enrichment for device {}: {}'.format( self.device_fqdn, self.enrichment_group_set)) return self.enrichment_group_set