check_old_gc_es_76.sh
#!/bin/bash
for i in `seq 1 4`;
do
es_pid=`ps -ef |grep es-${i} |grep -v grep|awk '{print $2}'`
if [ -z ${es_pid} ];then
echo "Can't find es-${i} process and it will be started!"
else
echo "es-${i} jstat gcutil:"
su - elastic -c "/app/es-1/jdk/bin/jstat -gcutil ${es_pid}"
fi
done
[root@cnsz17pl2550 state_es]# cat check_old_gc_es_76.sls
shell_test:
cmd.script:
- source: salt://state_es/check_old_gc_es_76.sh
- user: root
salt -S 10.117.93.4 state.sls state_es.check_old_gc_es_76