0
0

More than 3 years have passed since last update.

bashでhealth checkのめも

php-fpmとcrondを監視します

#!/bin/bash

while true
  do
      PHP=`sudo ps ax | grep 'php-fpm: master' | grep -v grep | wc -l`
      CROND=`sudo ps ax | grep 'crond' | grep -v grep | 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

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0