kafka群集批量安装zabbix-agent&tc限流

Intranetip=`ifconfig|sed -n ‘/inet addr/s/^[^:]*:\([0-9.]\{7,15\}\) .*/\1/p’ |grep 192.168`
yum install zabbix zabbix-agent zabbix-sender -y
cat /etc/zabbix/zabbix_agentd.conf |grep -v “#” |grep -v ^$
#修改的
sed -i -e ‘/^LogFileSize/c LogFileSize=1024’ /etc/zabbix/zabbix_agentd.conf
sed -i -e ‘/^Server=/c Server=192.168.100.40’ /etc/zabbix/zabbix_agentd.conf
sed -i -e ‘/^ServerActive=/c ServerActive=192.168.100.40’ /etc/zabbix/zabbix_agentd.conf
#新增的
sed -i ‘/# ListenIP=0.0.0.0/a\ListenIP='”$Intranetip”” /etc/zabbix/zabbix_agentd.conf
sed -i ‘/# Timeout=3/a\Timeout=30’ /etc/zabbix/zabbix_agentd.conf
sed -i ‘/# UnsafeUserParameters=0/a\UnsafeUserParameters=1’ /etc/zabbix/zabbix_agentd.conf
cat /etc/zabbix/zabbix_agentd.conf |grep -v “#” |grep -v ^$
chkconfig zabbix-agent on
service zabbix-agent start
echo “wait…”
sleep 120
chkconfig –list |grep zabbix
netstat -tlnpa |grep 10050

[root@slave55 ~]# cat /root/xxx/tc.sh
#!/bin/bash
# 限制 eth1 外网网卡 out 速率不得大于 10Mbps
# 启用限速: ./tc.sh
# 清掉限速规则: ./tc.sh clean

IFACE=”eth1″
BAND=”20M”

if [ “$1” = “clean” ]; then
tc qdisc del dev ${IFACE} root &>/dev/null
exit
fi

tc qdisc del dev ${IFACE} root &>/dev/null
tc qdisc add dev ${IFACE} root handle 1: htb default 9999
tc class add dev ${IFACE} parent 1: classid 1:9999 htb rate ${BAND}bit ceil ${BAND}bit

Print Friendly

发表评论

电子邮件地址不会被公开。 必填项已用*标注