Add script for removing ceph monitors

This commit is contained in:
Nico Schottelius 2018-05-30 13:57:04 +02:00
parent e7d5475f2c
commit b18e0bd999
2 changed files with 22 additions and 3 deletions

17
ceph-mon-stop-delete Executable file
View file

@ -0,0 +1,17 @@
#!/bin/sh
if [ $# -ne 0 ]; then
echo "$0 (no arguments"
exit 1
fi
mon=mon.$(hostname)
# Starting with monit, if available
if [ -e /etc/monit ]; then
/opt/ungleich-tools/monit-remove "$mon"
else
/etc/init.d/ceph stop "$mon"
fi
ceph mon remove "${mon}"

View file

@ -10,9 +10,11 @@ fi
to_monitor=$1 to_monitor=$1
set -e
conf="/etc/monit/conf.d/$to_monitor" conf="/etc/monit/conf.d/$to_monitor"
monit stop "$to_monitor"
sleep 1
rm -f "$conf" rm -f "$conf"
monit reload /etc/init.d/monit restart