#!/bin/bash
#################################################
#
#      Filename: monitor_unet3agent_stat.sh
#
#        Author: mark.tang@ucloud.cn
#   Description: check UNet3Agent stat
#        Create: Feb 18 16:23:58 CST 2022
# Last Modified: Feb 18 16:23:58 CST 2022
#################################################
ps -ef | grep -i UNet3Agent | grep -v grep 1>/dev/null 2>&1
is_unet3agent_runnig=`echo $?`

if [ "$is_unet3agent_runnig" -ne 0 ];then
    echo '[{"value":0,"tags":""}]'
    exit 0
fi

check_port=`netstat -lntp | grep 7350`
if [ -z "$check_port" ]
then
    echo '[{"value":0,"tags":""}]'
    exit 0
else
    echo '[{"value":1,"tags":""}]'
    exit 0
fi
