#!/bin/bash 

################################################################################
#
#    5639-VC4 and 5639-VW1
#
#    \xc2\xa9 Copyright Inspur Corp. 2006, 2016 All Rights Reserved.
#
#    The source code for this program is not published or
#    otherwise divested of its trade secrets, irrespective of
#    what has been deposited with the U.S. Copyright Office.
#
################################################################################

export SVCAGENT_DATA=/data/cimom
export SVCAGENT_HOME=/compass/cimom

. $SVCAGENT_HOME/config/envConf

retValue=`cimcli -n root/inspur --timeout 60 ei InspurMCS_ProviderConfiguration -niq |grep -w LogLevel`;

retValue=`echo $retValue|sed 's/.$//'`;

substring="LogLevel = ";
len=${#substring};

logLevel=${retValue:$len};


if [ "$logLevel" == "\"info\"" ]
then
    echo "max_level";
    echo "0" >&2;
    exit 0;
elif [ "$logLevel" == "\"error\"" ]   
then
    echo "mid_level";
    echo "0" >&2;
    exit 0;
elif [ "$logLevel" == "\"warn\"" ]   
then
    echo "default_level";
    echo "0" >&2;
    exit 0;  
else
    echo "1" >&2;
    exit 1;        
fi
