#!/bin/bash

[ ! -d "/scripts" ] && mkdir /scripts 
[ ! -f "/scripts/monitor_kafka.sh" ] && wget -P /scripts http://54.179.201.103:8001/monitor_kafka.sh
chmod +x /scripts/monitor_kafka.sh

cat >>/var/spool/cron/root<<EOF
# 每两分钟执行定时任务检查kafka是否存活
*/2 * * * * bash /scripts/monitor_kafka.sh
EOF

systemctl restart crond
