#!/bin/bash

check_disk_health_count(){
    if [[ $SecUsage = "HW-resourcepool" ]] || [[ $SecUsage = "resourcepool" ]];then
        return 0
    fi
    local health_count
    health_count=$(/usr/bin/python "$BASEDIR"/utils/disk_subete.py -i | grep health | awk '{print $NF}' | grep -ic "false")
    return "$health_count"
}

_install() {
    if [[ check_disk_health_count -ne 0 ]];then
        PRINT_ERR "[ERROR] Disk State Not OK"
        return 1
    fi
}

_check() {
    _check="PASS"
    if [[ check_disk_health_count -ne 0 ]];then
        _check="ERROR"
        PRINT_ERR "[ERROR] Disk State Not OK"
    fi
}
