#!/bin/bash
clear
echo "node_exporter注销工具"
read -p "请输入要踢掉的节点IP,如果有多个IP,请使用英文格式 ',' 隔开: " IP_LIST
for IP in `echo "${IP_LIST}"|awk -F, 'BEGIN{OFS=" "}{$1=$1;printf("%s",$0);}'`
do
curl -XPUT http://10.100.x.x:8500/v1/agent/service/deregister/node-${IP}
echo "${IP}节点已剔除!"
done
echo "${IP_LIST}完成剔除"