#!/bin/bash

_install() {
    if [[ $VMFLAG = 1 ]];then
        return 0
    fi
}

_check() {
    _check="PASS"

    if [[ $VMFLAG = 1 ]];then
        return 0
    fi
    if ipmitool sel elist | grep '> Threshold 81 degrees C' |grep -qE 'Reading 8[[:digit:]] >'
    then
        _check="FAIL"
        PRINT_ERR "[ERROR] ipmitool sel: Threshold 81 degrees C, 请硬件运维核实."
    fi
    if ipmitool sel elist | grep -qiE "Upper Critical going high|IERR|Thermal Trip|Non-recoverable|Uncorrectable|Correctable|Fault|Failure|Device Disabled|ECC|error|input lost|Degraded|bus error|Bus Fatal Error|AC lost|over current|over voltage|memory ECC"
    then
        _check="FAIL"
        PRINT_ERR "[ERROR] ipmitool sel: ERROR, 请硬件运维核实."
    fi
}
