예제 #1
0
    def test_dispatch_snmp_validation_alert(self):
        validator = snmp_validator.SNMPValidator()
        storage = fakes.FAKE_STOTRAGE
        alert = {
            'storage_id': storage['id'],
            'storage_name': storage['name'],
            'vendor': storage['vendor'],
            'model': storage['model'],
            'serial_number': storage['serial_number'],
            'alert_id': constants.SNMP_CONNECTION_FAILED_ALERT_ID,
            'sequence_number': 0,
            'alert_name': 'SNMP connect failed',
            'category': constants.Category.FAULT,
            'severity': constants.Severity.MAJOR,
            'type': constants.EventType.COMMUNICATIONS_ALARM,
            'location': 'NetworkEntity=%s' % storage['name'],
            'description': "SNMP connection to the storage failed. "
                           "SNMP traps from storage will not be received.",
            'recovery_advice': "1. The network connection is abnormal. "
                               "2. SNMP authentication parameters "
                               "are invalid.",
            'occur_time': mock.ANY,
        }

        validator._dispatch_snmp_validation_alert(
            context, storage, constants.Category.FAULT)
        base_exporter.AlertExporterManager(). \
            dispatch.assert_called_once_with(context, alert)
예제 #2
0
 def __init__(self):
     self.driver_manager = driver_manager.API()
     self.alert_export_manager = base_exporter.AlertExporterManager()
예제 #3
0
 def __init__(self):
     self.exporter = base_exporter.AlertExporterManager()
     self.snmp_error_flag = {}
예제 #4
0
 def __init__(self):
     self.driver_manager = driver_manager.API()
     self.exporter_manager = base_exporter.AlertExporterManager()
     self.task_rpcapi = rpcapi.TaskAPI()