#!/usr/bin/env python

# This is a helper script for isi_gather_info which chooses the tool to use for
# gathering ECC info (either isi_dmilog or isi_hwmon) and executes the proper
# command to gather output.

import os
import sys

import isi.hw.hal as hal

DMILOG_CMD = 'isi_dmilog -ls'
HWMON_CMD = 'isi_hwmon -l'

def main(args):
    if hal.supportsBmcSensorMonitoring():
        # If node has BMC, use isi_hwmon
        os.system(HWMON_CMD)
    else:
        os.system(DMILOG_CMD)

if __name__ == '__main__':
    main(sys.argv)
