For osds, mount the path
This commit is contained in:
parent
4d1bb04557
commit
57a1d0651e
1 changed files with 24 additions and 5 deletions
|
@ -13,15 +13,34 @@ to_monitor=$1
|
||||||
set -e
|
set -e
|
||||||
set -x
|
set -x
|
||||||
|
|
||||||
cat > "/etc/monit/conf-enabled/$to_monitor" <<EOF
|
depends=""
|
||||||
# Auto generated by $0
|
osd=""
|
||||||
check process $to_monitor with pidfile /var/run/ceph/${to_monitor}.pid
|
conf="/etc/monit/conf-enabled/$to_monitor"
|
||||||
|
|
||||||
|
if echo $to_monitor | grep ^osd; then
|
||||||
|
depends="depends on ${to_monitor}-whoami"
|
||||||
|
osd="yes"
|
||||||
|
osdid=$(echo $to_monitor | cut -d. -f2)
|
||||||
|
fi
|
||||||
|
|
||||||
|
cat > "$conf" <<EOF
|
||||||
|
# Generated by $0
|
||||||
|
check process ${to_monitor}-process with pidfile /var/run/ceph/${to_monitor}.pid
|
||||||
start program = "/etc/init.d/ceph start ${to_monitor}" with timeout 60 seconds
|
start program = "/etc/init.d/ceph start ${to_monitor}" with timeout 60 seconds
|
||||||
stop program = "/etc/init.d/ceph stop ${to_monitor}"
|
stop program = "/etc/init.d/ceph stop ${to_monitor}"
|
||||||
group server
|
depends on
|
||||||
|
group ceph
|
||||||
|
$depends
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
if [ "$osd" ]; then
|
||||||
|
cat >> "$conf" <<EOF
|
||||||
|
check file ${to_monitor}-whoami with path /var/lib/ceph/osd/ceph-${osdid}/whoami
|
||||||
|
if content != "${osdid}" then alert
|
||||||
|
EOF
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
monit reload
|
monit reload
|
||||||
sleep 1
|
sleep 1
|
||||||
monit start "$to_monitor"
|
monit start "$to_monitor"
|
||||||
|
|
Loading…
Reference in a new issue