Quantcast
Channel: Bashタグが付けられた新着記事 - Qiita
Viewing all articles
Browse latest Browse all 2912

bashでhealth check

$
0
0

bashでhealth checkのめも

php-fpmとcrondを監視します

#!/bin/bashwhile true
  do
      PHP=`sudo ps ax | grep'php-fpm: master' | grep-vgrep | wc-l`CROND=`sudo ps ax | grep'crond' | grep-vgrep | wc-l`if[$PHP= 1  ]&&[$CROND= 1  ];then
          echo"HTTP/1.0 200 Ok"  | nc -l 8080
      else
          echo"HTTP/1.0 500 NG"  | nc -l 8080
      fi[$?!= 0 ]&&break
  done

Viewing all articles
Browse latest Browse all 2912

Trending Articles