Compare commits
No commits in common. "ccce95117a86d02d132d1f6ec25463eb0363786d" and "1e2f32dce31a42ec56fafd04cf09a18f987bd3a5" have entirely different histories.
ccce95117a
...
1e2f32dce3
33
nicsensor.sh
33
nicsensor.sh
@ -59,7 +59,7 @@ fru_offset="0x00 0x00"
|
|||||||
Support_Sensor_List="emc1413, adc128, ina3221, tmp468, tmp112"
|
Support_Sensor_List="emc1413, adc128, ina3221, tmp468, tmp112"
|
||||||
Support_Server_List="5280m7, 5468m7, 5688m7, donghu, yichun, qiandaohu"
|
Support_Server_List="5280m7, 5468m7, 5688m7, donghu, yichun, qiandaohu"
|
||||||
# Which server will use this script
|
# Which server will use this script
|
||||||
server_type="default"
|
server_type="5280m7"
|
||||||
|
|
||||||
# ---------------------------------------------------------
|
# ---------------------------------------------------------
|
||||||
# Common Varible (Don't Change)
|
# Common Varible (Don't Change)
|
||||||
@ -140,7 +140,7 @@ ina3221_ch2_volt="0"
|
|||||||
ina3221_ch0_current="0"
|
ina3221_ch0_current="0"
|
||||||
ina3221_ch1_current="0"
|
ina3221_ch1_current="0"
|
||||||
ina3221_ch2_current="0"
|
ina3221_ch2_current="0"
|
||||||
SCRIPT_VERSION="1.7.1"
|
SCRIPT_VERSION="1.7"
|
||||||
|
|
||||||
fru_file_name=$option_data2
|
fru_file_name=$option_data2
|
||||||
fru_write_size=0
|
fru_write_size=0
|
||||||
@ -264,30 +264,6 @@ parse_nic_slot(){
|
|||||||
format_log_print $INFO "Slot Num : $slot_number"
|
format_log_print $INFO "Slot Num : $slot_number"
|
||||||
}
|
}
|
||||||
|
|
||||||
# According to boardid, parse server_type
|
|
||||||
try_get_server_type(){
|
|
||||||
if [ -e "/tmp/ns_servertype" ];then
|
|
||||||
server_type=`cat /tmp/ns_servertype`
|
|
||||||
else
|
|
||||||
boardid=`cat /proc/cmdline | awk -F'=' '/boardid=/{print $8; exit}'`
|
|
||||||
|
|
||||||
if [ $boardid -eq 130 ];then
|
|
||||||
server_type="5280m7"
|
|
||||||
elif [ $boardid -eq 150 ];then
|
|
||||||
server_type="5468m7"
|
|
||||||
elif [ $boardid -eq 152 ];then
|
|
||||||
server_type="5688m7"
|
|
||||||
else
|
|
||||||
format_print $ERROR "Invalid boardid value: $boardid"
|
|
||||||
format_print $ERROR "Can't specify server type by general method"
|
|
||||||
format_print $INFO "Please modify server_type in script manually!"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo $server_type > /tmp/ns_servertype
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
init_debuglog(){
|
init_debuglog(){
|
||||||
# only save one running log
|
# only save one running log
|
||||||
if [ -e $log ];then
|
if [ -e $log ];then
|
||||||
@ -367,11 +343,6 @@ switch_pca9548_channel(){
|
|||||||
pre_exec_hook(){
|
pre_exec_hook(){
|
||||||
init_debuglog
|
init_debuglog
|
||||||
|
|
||||||
# check server_type if is default
|
|
||||||
if [ "$server_type" = "default" ];then
|
|
||||||
try_get_server_type
|
|
||||||
fi
|
|
||||||
|
|
||||||
# is param legel?
|
# is param legel?
|
||||||
if [ "$sensor_type" = "chip" ];then
|
if [ "$sensor_type" = "chip" ];then
|
||||||
if [ $param_num -le 3 ];then
|
if [ $param_num -le 3 ];then
|
||||||
|
|||||||
@ -220,4 +220,4 @@ nicsensor_v2将服务器选通channel和读取传感器数值的功能解耦,
|
|||||||
- `fru_offset`: 网卡FRU所在eeprom的偏移量。默认值为 0x00 0x00
|
- `fru_offset`: 网卡FRU所在eeprom的偏移量。默认值为 0x00 0x00
|
||||||
|
|
||||||
**所用服务器**
|
**所用服务器**
|
||||||
- `server_type`: 脚本将工作在哪个服务器上?支持的服务器列表见`Support_Server_List`, 默认值为`default`,支持自动识别受支持的型号。
|
- `server_type`: 脚本将工作在哪个服务器上?支持的服务器列表见`Support_Server_List`
|
||||||
Loading…
Reference in New Issue
Block a user