fuel-library/files/fuel-utils/fuel-utils

60 lines
1.5 KiB
Bash

#!/bin/bash
# Copyright 2016 Mirantis, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
. "/etc/fuel-utils/config"
. "/usr/share/fuel-utils/functions.sh"
usage(){
cat >&1 <<EOF
Usage: `basename $0` <subcommand>
Available subcommands:
check_all - Check whether all Fuel services are up and running
check_service <service_name> - Check whether a particular service is up and running
Available service names:
astute
cobbler
keystone
mcollective
nailgun
nginx
ostf
postgres
rabbitmq
rsync
rsyslog
EOF
exit 1
}
case $1 in
check_all)
exit_code=0
all_services="nailgun ostf cobbler rabbitmq postgres astute mcollective nginx keystone rsyslog rsync"
for service in $all_services; do
check_ready $service || exit_code=1
done
exit $exit_code
;;
check_service)
if [[ $# -ne 2 ]]; then
usage
fi
check_ready $2 || exit 1
;;
*)
usage
;;
esac