DellEMC: System health config changes (#15771)
Why I did it System health config is missing in few Dell platforms. How I did it Added system health monitoring config and its related API's How to verify it show system-health summary/detail commands.
This commit is contained in:
parent
0eb7907e87
commit
821be3f6fc
@ -0,0 +1,11 @@
|
||||
{
|
||||
"services_to_ignore": [],
|
||||
"devices_to_ignore": ["fan.speed"],
|
||||
"user_defined_checkers": [],
|
||||
"polling_interval": 60,
|
||||
"led_color": {
|
||||
"fault" : "amber",
|
||||
"normal" : "green",
|
||||
"booting": "blinking_green"
|
||||
}
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
{
|
||||
"services_to_ignore": [],
|
||||
"devices_to_ignore": ["fan.speed"],
|
||||
"user_defined_checkers": [],
|
||||
"polling_interval": 60,
|
||||
"led_color": {
|
||||
"fault" : "amber",
|
||||
"normal" : "green",
|
||||
"booting": "blinking_green"
|
||||
}
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
{
|
||||
"services_to_ignore": [],
|
||||
"devices_to_ignore": ["fan.speed"],
|
||||
"user_defined_checkers": [],
|
||||
"polling_interval": 60,
|
||||
"led_color": {
|
||||
"fault" : "amber",
|
||||
"normal" : "green",
|
||||
"booting": "blinking_green"
|
||||
}
|
||||
}
|
@ -33,33 +33,31 @@ SYSTEM_LED_REG = 0x24
|
||||
SYSTEM_BEACON_LED_SET = 0x8
|
||||
SYSTEM_BEACON_LED_CLEAR = 0xFFFFFFF7
|
||||
|
||||
media_part_num_list = set([ \
|
||||
"8T47V","XTY28","MHVPK","GF76J","J6FGD","F1KMV","9DN5J","H4DHD","6MCNV","0WRX0","X7F70","5R2PT","WTRD1","WTRD1","WTRD1","WTRD1","5250G","WTRD1","C5RNH","C5RNH","FTLX8571D3BCL-FC",
|
||||
"C5RNH","5250G","N8TDR","7D64H","7D64H","RN84N","RN84N","HMTNW","6K3Y6","6K3Y6","TY5FM","50M0R","PGYJT","WP2PP","85Y13","1HCGH","FP9R1","FYD0M","C6Y7M","C6Y7M","V250M","V250M",
|
||||
"5CWK6","5CWK6","53HVN","53HVN","358VV","358VV","MV799","MV799","YJF03","P9GND","T1KCN","1DXKP","MT7R2","K0T7R","W5G04","7TCDN","7TCDN","7TCDN","7TCDN","7TCDN","V3XJK","0MV31",
|
||||
"5FVP7","N6KM9","C41MF","77KC3","XW7J0","V4NJV","2XJHY","H93DH","H93DH","F8CG0","F8CG0","F8CG0","119N6","WFMF5","794RX","288F6","1M31V","1M31V","5NP8R","5NP8R","4TC09","4TC09",
|
||||
"FC6KV","FC6KV","J90VN","J90VN","05RH0","05RH0","YDN52","0C2YV","YDN52","0C2YV","9JT65","D7M6H","6GW14","FYVFW","0VF5H","P4YPY","P4YPY","TCPM2","TCPM2","JNPF8","JNPF8","27GG5",
|
||||
"27GG5","P8T4W","P8T4W","JR54Y","M6N0J","XJYD0","K44H9","035KG","P7C7N","76V43","3CC35","FN4FC","26FN3","YFNDD","YFNDD","7R9N9","035KG","P7C7N","76V43","3CC35","PLRXPLSCS43811",
|
||||
"FN4FC","26FN3","YFNDD","YFNDD","7R9N9","G86YJ","V407F","V407F","9KH6T","G86YJ","V407F","9KH6T","2JVDD","D0R73","VXFJY","9X8JP","2JVDD","D0R73","VXFJY","9X8JP","2JVDD","D0R73","VXFJY",
|
||||
"9X8JP","GMFC5","GMFC5","GMFC5","D7P80","3MFXG","3MFXG","0GWXJ","THPF3","THPF3","THPF3","THPF3","THPF3","PJ62G","3XCX1","JJYKG","RRRTK","16K56","86JM2","K5R6C","7MG2C","WTPPN","9HTT2",
|
||||
"NKM4F","VXGGG","JC9W6","6MR8M","RP3GV","M5PPJ","XKY55","TKCXT","05J8P","5WGKD","XFDRT","NW8DM","YPKH3","5WGKD","XFDRT","NW8DM","YPKH3","71XXK","MVCX6","0XYP6","HPPVW","3GHRT","71XXK",
|
||||
"MVCX6","0XYP6","HPPVW","3GHRT","2X5T6","135V2","KD5MV","2X5T6","KD5MV","HHFK0","3YWG7","5CMT2","RCVP5","X5DH4","HHFK0","3YWG7","5CMT2","RCVP5","X5DH4","3YWG7","5CMT2","RCVP5","X5DH4",
|
||||
"4WJ41","4WJ41","14NV5","14NV5","14NV5","4WGYD","YKMH7","X7CCC","X7CCC","0X9CT","0CY8V","P7D7R","W4GPP","W4GPP","W4GPP","HHHCHC","07RN7","07RN7","0YR96","0YR96","JCYM9","FTLX8571D3BCL",
|
||||
"DDW0X","VPFDJ","229KM","9FC7D","DDW0X","VPFDJ","6FMR5","J7K20","N3K9W","6FMR5","8R4VM","7VN5T","D9YM8","8R4VM","VYXPW","87TPX","WY6FK","VYXPW","87TPX","WY6FK","WG8C4","N8K82","2DV6Y",
|
||||
"77C3C","RC0HM","77C3C","RC0HM","JHXTN","3P3PG","92YVM","4VX5M","4VX5M","6RRGD","W4JWV","22V6R","XR11M","9GMDY","JMCWK","TP2F0","6MGDY","78RHK", "C0TP5","0WDNV","FCLF8522P2BTL"\
|
||||
])
|
||||
|
||||
class Chassis(ChassisBase):
|
||||
"""
|
||||
DELLEMC Platform-specific Chassis class
|
||||
"""
|
||||
|
||||
REBOOT_CAUSE_PATH = "/host/reboot-cause/platform/reboot_reason"
|
||||
pci_res = "/sys/bus/pci/devices/0000:04:00.0/resource0"
|
||||
oir_fd = -1
|
||||
epoll = -1
|
||||
|
||||
_global_port_pres_dict = {}
|
||||
|
||||
SYSLED_COLOR_TO_REG = {
|
||||
"blinking_green": 0x0,
|
||||
"green" : 0x10,
|
||||
"amber" : 0x20,
|
||||
"blinking_amber": 0x30
|
||||
}
|
||||
|
||||
REG_TO_SYSLED_COLOR = {
|
||||
0x0 : "blinking_green",
|
||||
0x10 : "green",
|
||||
0x20 : "amber",
|
||||
0x30 : "blinking_amber"
|
||||
}
|
||||
|
||||
_port_to_i2c_mapping = {
|
||||
1: 2,
|
||||
2: 3,
|
||||
@ -346,8 +344,39 @@ class Chassis(ChassisBase):
|
||||
else:
|
||||
return (self.REBOOT_CAUSE_NON_HARDWARE, None)
|
||||
|
||||
def get_qualified_media_list(self):
|
||||
return media_part_num_list
|
||||
def initizalize_system_led(self):
|
||||
self.sys_ledcolor = "green"
|
||||
|
||||
def get_status_led(self):
|
||||
"""
|
||||
Gets the current system LED color
|
||||
|
||||
Returns:
|
||||
A string that represents the supported color
|
||||
"""
|
||||
val = hwaccess.pci_get_value(self.pci_res, SYSTEM_LED_REG)
|
||||
if val != -1:
|
||||
val = val & 0x30
|
||||
return self.REG_TO_SYSLED_COLOR.get(val)
|
||||
return self.sys_ledcolor
|
||||
|
||||
def set_status_led(self, color):
|
||||
"""
|
||||
Set system LED status based on the color type passed in the argument.
|
||||
Argument: Color to be set
|
||||
Returns:
|
||||
bool: True is specified color is set, Otherwise return False
|
||||
"""
|
||||
|
||||
if color not in list(self.SYSLED_COLOR_TO_REG.keys()):
|
||||
return False
|
||||
|
||||
val = hwaccess.pci_get_value(self.pci_res, SYSTEM_LED_REG)
|
||||
val = (val & 0xFFCF) | self.SYSLED_COLOR_TO_REG[color]
|
||||
|
||||
hwaccess.pci_set_value(self.pci_res, val, SYSTEM_LED_REG)
|
||||
self.sys_ledcolor = color
|
||||
return True
|
||||
|
||||
def set_locator_led(self, color):
|
||||
"""
|
||||
@ -385,4 +414,3 @@ class Chassis(ChassisBase):
|
||||
return self.LOCATOR_LED_OFF
|
||||
else:
|
||||
return self.LOCATOR_LED_ON
|
||||
|
||||
|
@ -24,11 +24,11 @@ class Psu(PsuBase):
|
||||
SENSOR_MAPPING = { 1: { "State": 0x31, "Current": 0x39,
|
||||
"Power": 0x37, "Voltage": 0x38,
|
||||
"InCurrent": 0x36, "InPower": 0x34,
|
||||
"InVoltage": 0x35 },
|
||||
"InVoltage": 0x35, "Temperature": 0xc },
|
||||
2: { "State": 0x32, "Current": 0x3F,
|
||||
"Power": 0x3D, "Voltage": 0x3E,
|
||||
"InCurrent": 0x3C, "InPower": 0x3A,
|
||||
"InVoltage": 0x3B } }
|
||||
"InVoltage": 0x3B, "Temperature": 0xd } }
|
||||
# ( PSU-ID: FRU-ID }
|
||||
FRU_MAPPING = { 1: 1, 2: 2 }
|
||||
|
||||
@ -43,6 +43,7 @@ class Psu(PsuBase):
|
||||
self.power_sensor = IpmiSensor(self.SENSOR_MAPPING[self.index]["Power"])
|
||||
self.input_voltage_sensor = IpmiSensor(self.SENSOR_MAPPING[self.index]["InVoltage"])
|
||||
self.input_current_sensor = IpmiSensor(self.SENSOR_MAPPING[self.index]["InCurrent"])
|
||||
self.temp_sensor = IpmiSensor(self.SENSOR_MAPPING[self.index]["Temperature"])
|
||||
self.input_power_sensor = IpmiSensor(self.SENSOR_MAPPING[self.index]["InPower"])
|
||||
self.fru = IpmiFru(self.FRU_MAPPING[self.index])
|
||||
|
||||
@ -120,6 +121,30 @@ class Psu(PsuBase):
|
||||
|
||||
return "{:.1f}".format(voltage)
|
||||
|
||||
def get_voltage_low_threshold(self):
|
||||
"""
|
||||
Returns PSU low threshold in Volts
|
||||
"""
|
||||
|
||||
is_valid, low_threshold = self.voltage_sensor.get_threshold("LowerCritical")
|
||||
if not is_valid:
|
||||
low_threshold = 11.6
|
||||
low_threshold = "{:.2f}".format(low_threshold)
|
||||
|
||||
return float(low_threshold)
|
||||
|
||||
def get_voltage_high_threshold(self):
|
||||
"""
|
||||
Returns PSU high threshold in Volts
|
||||
"""
|
||||
|
||||
is_valid, high_threshold = self.voltage_sensor.get_threshold("UpperCritical")
|
||||
if not is_valid:
|
||||
high_threshold = 12.8
|
||||
high_threshold = "{:.2f}".format(high_threshold)
|
||||
|
||||
return float(high_threshold)
|
||||
|
||||
def get_current(self):
|
||||
"""
|
||||
Retrieves present electric current supplied by PSU
|
||||
@ -134,6 +159,32 @@ class Psu(PsuBase):
|
||||
|
||||
return "{:.1f}".format(current)
|
||||
|
||||
def get_temperature(self):
|
||||
"""
|
||||
Retrieves current temperature reading from thermal
|
||||
|
||||
Returns:
|
||||
A float number of current temperature in Celsius up to
|
||||
nearest thousandth of one degree Celsius, e.g. 30.125
|
||||
"""
|
||||
is_valid, temperature = self.temp_sensor.get_reading()
|
||||
if not is_valid:
|
||||
temperature = 0
|
||||
|
||||
return float(temperature)
|
||||
|
||||
def get_temperature_high_threshold(self):
|
||||
"""
|
||||
Returns the high temperature threshold for PSU in Celsius
|
||||
"""
|
||||
|
||||
is_valid, high_threshold = self.temp_sensor.get_threshold("UpperCritical")
|
||||
if not is_valid:
|
||||
high_threshold = 105
|
||||
high_threshold = "{:.2f}".format(high_threshold)
|
||||
|
||||
return float(high_threshold)
|
||||
|
||||
def get_power(self):
|
||||
"""
|
||||
Retrieves current energy supplied by PSU
|
||||
|
@ -33,22 +33,6 @@ SYSTEM_LED_REG = 0x24
|
||||
SYSTEM_BEACON_LED_SET = 0x8
|
||||
SYSTEM_BEACON_LED_CLEAR = 0xFFFFFFF7
|
||||
|
||||
media_part_num_list = set([ \
|
||||
"8T47V","XTY28","MHVPK","GF76J","J6FGD","F1KMV","9DN5J","H4DHD","6MCNV","0WRX0","X7F70","5R2PT","WTRD1","WTRD1","WTRD1","WTRD1","5250G","WTRD1","C5RNH","C5RNH","FTLX8571D3BCL-FC",
|
||||
"C5RNH","5250G","N8TDR","7D64H","7D64H","RN84N","RN84N","HMTNW","6K3Y6","6K3Y6","TY5FM","50M0R","PGYJT","WP2PP","85Y13","1HCGH","FP9R1","FYD0M","C6Y7M","C6Y7M","V250M","V250M",
|
||||
"5CWK6","5CWK6","53HVN","53HVN","358VV","358VV","MV799","MV799","YJF03","P9GND","T1KCN","1DXKP","MT7R2","K0T7R","W5G04","7TCDN","7TCDN","7TCDN","7TCDN","7TCDN","V3XJK","0MV31",
|
||||
"5FVP7","N6KM9","C41MF","77KC3","XW7J0","V4NJV","2XJHY","H93DH","H93DH","F8CG0","F8CG0","F8CG0","119N6","WFMF5","794RX","288F6","1M31V","1M31V","5NP8R","5NP8R","4TC09","4TC09",
|
||||
"FC6KV","FC6KV","J90VN","J90VN","05RH0","05RH0","YDN52","0C2YV","YDN52","0C2YV","9JT65","D7M6H","6GW14","FYVFW","0VF5H","P4YPY","P4YPY","TCPM2","TCPM2","JNPF8","JNPF8","27GG5",
|
||||
"27GG5","P8T4W","P8T4W","JR54Y","M6N0J","XJYD0","K44H9","035KG","P7C7N","76V43","3CC35","FN4FC","26FN3","YFNDD","YFNDD","7R9N9","035KG","P7C7N","76V43","3CC35","PLRXPLSCS43811",
|
||||
"FN4FC","26FN3","YFNDD","YFNDD","7R9N9","G86YJ","V407F","V407F","9KH6T","G86YJ","V407F","9KH6T","2JVDD","D0R73","VXFJY","9X8JP","2JVDD","D0R73","VXFJY","9X8JP","2JVDD","D0R73","VXFJY",
|
||||
"9X8JP","GMFC5","GMFC5","GMFC5","D7P80","3MFXG","3MFXG","0GWXJ","THPF3","THPF3","THPF3","THPF3","THPF3","PJ62G","3XCX1","JJYKG","RRRTK","16K56","86JM2","K5R6C","7MG2C","WTPPN","9HTT2",
|
||||
"NKM4F","VXGGG","JC9W6","6MR8M","RP3GV","M5PPJ","XKY55","TKCXT","05J8P","5WGKD","XFDRT","NW8DM","YPKH3","5WGKD","XFDRT","NW8DM","YPKH3","71XXK","MVCX6","0XYP6","HPPVW","3GHRT","71XXK",
|
||||
"MVCX6","0XYP6","HPPVW","3GHRT","2X5T6","135V2","KD5MV","2X5T6","KD5MV","HHFK0","3YWG7","5CMT2","RCVP5","X5DH4","HHFK0","3YWG7","5CMT2","RCVP5","X5DH4","3YWG7","5CMT2","RCVP5","X5DH4",
|
||||
"4WJ41","4WJ41","14NV5","14NV5","14NV5","4WGYD","YKMH7","X7CCC","X7CCC","0X9CT","0CY8V","P7D7R","W4GPP","W4GPP","W4GPP","HHHCHC","07RN7","07RN7","0YR96","0YR96","JCYM9","FTLX8571D3BCL",
|
||||
"DDW0X","VPFDJ","229KM","9FC7D","DDW0X","VPFDJ","6FMR5","J7K20","N3K9W","6FMR5","8R4VM","7VN5T","D9YM8","8R4VM","VYXPW","87TPX","WY6FK","VYXPW","87TPX","WY6FK","WG8C4","N8K82","2DV6Y",
|
||||
"77C3C","RC0HM","77C3C","RC0HM","JHXTN","3P3PG","92YVM","4VX5M","4VX5M","6RRGD","W4JWV","22V6R","XR11M","9GMDY","JMCWK","TP2F0","6MGDY","78RHK", "C0TP5","0WDNV","FCLF8522P2BTL"\
|
||||
])
|
||||
|
||||
class Chassis(ChassisBase):
|
||||
"""
|
||||
DELLEMC Platform-specific Chassis class
|
||||
@ -59,7 +43,6 @@ class Chassis(ChassisBase):
|
||||
PCI_RES = "/sys/bus/pci/devices/0000:04:00.0/resource0"
|
||||
oir_fd = -1
|
||||
|
||||
sysled_offset = 0x0024
|
||||
SYSLED_COLOR_TO_REG = {
|
||||
"blinking_green": 0x0,
|
||||
"green" : 0x10,
|
||||
@ -272,6 +255,9 @@ class Chassis(ChassisBase):
|
||||
"""
|
||||
return True
|
||||
|
||||
def initizalize_system_led(self):
|
||||
self.sys_ledcolor = "green"
|
||||
|
||||
def set_status_led(self, color):
|
||||
"""
|
||||
Sets the state of the system LED
|
||||
@ -284,10 +270,10 @@ class Chassis(ChassisBase):
|
||||
if color not in list(self.SYSLED_COLOR_TO_REG.keys()):
|
||||
return False
|
||||
|
||||
val = pci_get_value(self.PCI_RES, self.sysled_offset)
|
||||
val = pci_get_value(self.PCI_RES, SYSTEM_LED_REG)
|
||||
val = (val & 0xFFCF) | self.SYSLED_COLOR_TO_REG[color]
|
||||
|
||||
pci_set_value(self.PCI_RES, val, self.sysled_offset)
|
||||
pci_set_value(self.PCI_RES, val, SYSTEM_LED_REG)
|
||||
self.sys_ledcolor = color
|
||||
return True
|
||||
|
||||
@ -298,7 +284,7 @@ class Chassis(ChassisBase):
|
||||
A string, one of the valid LED color strings which could be
|
||||
vendor specified.
|
||||
"""
|
||||
val = pci_get_value(self.PCI_RES, self.sysled_offset)
|
||||
val = pci_get_value(self.PCI_RES, SYSTEM_LED_REG)
|
||||
if val != -1:
|
||||
val = val & 0x30
|
||||
return self.REG_TO_SYSLED_COLOR.get(val)
|
||||
@ -400,9 +386,6 @@ class Chassis(ChassisBase):
|
||||
else:
|
||||
return (self.REBOOT_CAUSE_NON_HARDWARE, None)
|
||||
|
||||
def get_qualified_media_list(self):
|
||||
return media_part_num_list
|
||||
|
||||
def set_locator_led(self, color):
|
||||
"""
|
||||
Sets the state of the Chassis Locator LED
|
||||
|
Loading…
Reference in New Issue
Block a user