#!/bin/bash
set +x

source /opt/huawei/snas/script/inspect_mml/CommonFunc.sh
LOG_FILE="/var/log/inspect.log"
G_REMOTE_TMP_FILE="/tmp/tmpfile"
FUN_NAME="checkALLClient"
function LOG
{
   time=$(date)
   echo [${time}][$$]$@ >> $LOG_FILE
}

IP=$1
if [ $# -ne 1];
then
	LOG "Usage: \[ipAddress\]\n"
	exit
fi

#获取节点存储类型
node_service_type=$(egrep '[[]|^'node_service_type'=' /opt/huawei/snas/etc/snas.ini | tr -d '\n' | grep -Po '(?<=[[]'NODE'[]]'node_service_type'=)[0-9]+')


if [ "${node_service_type}" != "1" ];then
	echo "Does not involve"
	LOG "node_service_type :${node_service_type}.Does not involve"
	exit 0
fi

/usr/local/bin/nas_proto_status_nfs -t clntinfo  > "$G_REMOTE_TMP_FILE$FUN_NAME[NFS]" 2>&1

LOG "/usr/local/bin/nas_proto_status_nfs -t clntinfo .return $?"