check_oozie_status.sh 373 B

1234567891011121314
  1. #!/usr/bin/env bash
  2. # OOZIE_URL is of the form http://<hostname>:<port>/oozie
  3. HOST=$1
  4. PORT=$2
  5. JAVA_HOME=$3
  6. OOZIE_URL="http://$HOST:$PORT/oozie"
  7. export JAVA_HOME=$JAVA_HOME
  8. out=`oozie admin -oozie ${OOZIE_URL} -status 2>&1`
  9. if [[ "$?" -ne 0 ]]; then
  10. echo "CRITICAL: Error accessing oozie server status [$out]";
  11. exit 2;
  12. fi
  13. echo "OK: Oozie server status [$out]";
  14. exit 0;