check_old_gc_es_76.sh#!/bin/bashfor i in `seq 1 4`;does_pid=`ps -ef |grep es-${i} |grep -v grep|awk '{print $2}'`if [ -z ${es_pid} ];thenecho "Can't find es-${i} process and it will be started!"elseecho "es-${i} jstat gcutil:"su - elastic -c "/app/es-1/jdk/bin/jstat -gcutil ${es_pid}"fidone
[root@cnsz17pl2550 state_es]# cat check_old_gc_es_76.slsshell_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



