修改agent/start.sh如下图标注所示 :
image.png修改完成后就可以用绝对路径来启动agent了
#!/bin/sh
RUN_NAME="wgcloud-agent-release"
export LANG="en_US.UTF-8"
PRG=$0
APPDIRFILE=`dirname "$PRG"`
cd $APPDIRFILE
echo $APPDIRFILE/$RUN_NAME
PID=`ps -ef|grep $RUN_NAME|grep -v grep|awk '{printf $2}'`
echo $PID
if [ ! -n "$PID" ];
then
echo "wgcloud-agent程序开始启动"
else
echo "已启动,杀掉进程后重启"
echo $PID
kill -9 $PID
fi
nohup ./$RUN_NAME >/dev/null 2>&1 &
新一代极简高效的监控系统WGCLOUD:www.wgstart.com
网友评论