statusAll.sh 487 B

12345678910111213141516171819202122
  1. #!/bin/bash
  2. ROOT=$(cd `dirname $0`/; pwd)
  3. status(){
  4. pid=$(ps -auxc | grep $1 | grep -vE "grep|-Xmx700m" | awk '{print $2}')
  5. if [[ $pid == "" ]]; then
  6. echo "--- $1 未在运行"
  7. else
  8. # running_time=$(ps -o etime= -p "$pid")
  9. echo "--- $1 正在在运行"
  10. echo "当前PID: $pid"
  11. # echo "当前运行时间: $running_time" | tr -s " "
  12. fi
  13. }
  14. status smqlookupd
  15. status smqd
  16. status smqdBackup
  17. status smqweb
  18. cd $ROOT/lb
  19. $ROOT/lb/status.sh