サービス監視

■ サービス監視スクリプト
▼/usr/local/bin/check_active

#!/bin/sh
# service check interval
#!/bin/sh
# service check intervalINTERVAL=10
# service IP address
CVIP=210.230.64.251
# service check interval
INTERVAL=10
# service IP address
CVIP=210.230.64.251
CURL=/usr/bin/curl
GREP=/bin/grep
while true
do
# check vsftpd
${CURL} ftp://127.0.0.1/ 2>&1 | ${GREP} ‘pub’ > /dev/null
# check httpd${CURL} –retry 4 –retry-delay 15 http://127.0.0.1/ 2>&1 | ${GREP} ‘html’ > /dev/nullif [ $? -ne 0 ]; then
/usr/lib/heartbeat/heartbeat -k
exit 100
fi
sleep ${INTERVAL}