Skip to content

Commit

Permalink
add msa system pool volume disks alerts resources (#761)
Browse files Browse the repository at this point in the history
  • Loading branch information
luojiagen authored Dec 24, 2021
1 parent b004d74 commit 34bdcf2
Show file tree
Hide file tree
Showing 8 changed files with 1,235 additions and 0 deletions.
Empty file.
59 changes: 59 additions & 0 deletions delfin/drivers/hpe/hpe_msa/consts.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
from delfin.common import constants


class AlertOIDNumber:
OID_ERR_ID = '1.3.6.1.3.94.1.11.1.1'
OID_EVENT_TYPE = '1.3.6.1.3.94.1.11.1.7'
OID_LAST_TIME = '1.3.6.1.3.94.1.11.1.4'
OID_EVENT_DESC = '1.3.6.1.3.94.1.11.1.9'
OID_EVENT_ID = '1.3.6.1.3.94.1.11.1.3'
OID_SEVERITY = '1.3.6.1.3.94.1.11.1.6'


class StorageVendor:
HPE_MSA_VENDOR = "HPE"


class TrapSeverity:
TRAP_SEVERITY_MAP = {
'1': 'unknown',
'2': 'emergency',
'3': 'alert',
'4': constants.Severity.CRITICAL,
'5': 'error',
'6': constants.Severity.WARNING,
'7': 'notify',
'8': constants.Severity.INFORMATIONAL,
'9': 'debug',
'10': 'mark'
}

SEVERITY_MAP = {"warning": "Warning",
"informational": "Informational",
"error": "Major"
}


class SecondsNumber:
SECONDS_TO_MS = 1000


class RpmSpeed:
RPM_SPEED = 1000


class DiskPhysicalType:
DISK_PHYSICAL_TYPE = {
'fc': constants.DiskPhysicalType.FC,
'SAS': constants.DiskPhysicalType.SAS
}


class InitiatorType:
ISCSI_INITIATOR_TYPE = "9"
FC_INITIATOR_TYPE = "6"
SAS_INITIATOR_TYPE = "8"
ISCSI_INITIATOR_DESCRIPTION = 'iSCSI Initiator'
FC_INITIATOR_DESCRIPTION = 'FC Initiator'
IB_INITIATOR_DESCRIPTION = 'IB Initiator'
UNKNOWN_INITIATOR_DESCRIPTION = 'Unknown Initiator'
48 changes: 48 additions & 0 deletions delfin/drivers/hpe/hpe_msa/hpe_msastor.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
from delfin.drivers import driver
from delfin.drivers.hpe.hpe_msa import ssh_handler
from delfin.drivers.hpe.hpe_msa.ssh_handler import SSHHandler


class HpeMsaStorDriver(driver.StorageDriver):

def __init__(self, **kwargs):
super().__init__(**kwargs)
self.ssh_handler = ssh_handler.SSHHandler(**kwargs)

def reset_connection(self, context, **kwargs):
self.ssh_handler.login()

def get_storage(self, context):
return self.ssh_handler.get_storage(self.storage_id)

def list_storage_pools(self, context):
return self.ssh_handler.list_storage_pools(self.storage_id)

def list_volumes(self, context):
return self.ssh_handler.list_storage_volume(self.storage_id)

def list_controllers(self, context):
return self.ssh_handler.\
list_storage_controller(self.storage_id)

def list_ports(self, context):
return self.ssh_handler.list_storage_ports(self.storage_id)

def list_disks(self, context):
return self.ssh_handler.list_storage_disks(self.storage_id)

def list_alerts(self, context, query_para=None):
return self.ssh_handler.list_alerts(query_para)

def add_trap_config(self, context, trap_config):
pass

def remove_trap_config(self, context, trap_config):
pass

@staticmethod
def parse_alert(context, alert):
return SSHHandler.parse_alert(alert)

def clear_alert(self, context, alert):
pass
Loading

0 comments on commit 34bdcf2

Please sign in to comment.