zabbix客户端一键安装脚本(主动模式监控) -凯发k8官方网
#!/bin/bash
basepath=$(cd `dirname $0`; pwd)
shell_dir="${basepath}/shell"
package_dir="${basepath}/package"
#获取参数
while getopts "n:" opt; do
case $opt in
n)
host_name=$optarg
;;
\?)
;;
esac
done
rpm -ivh $package_dir/zabbix-release-2.4-1.el6.noarch.rpm
yum install -y zabbix-agent
cat >/etc/zabbix/zabbix_agentd.conf <
logfile=/tmp/zabbix_agentd.log
debuglevel=3
listenport=10050
startagents=0
serveractive=*.*.*.*
hostname=$host_name
refreshactivechecks=120
buffersend=5
buffersize=10000
# maxlinespersecond=100
# timeout=3
# unsafeuserparameters=1
eof
systemctl enable zabbix-agent.service
systemctl restart zabbix-agent.service
zabbixagentpid=`ps aux|grep zabbix_agentd|grep -v "grep"|awk '{print $2}'`
if [ "$zabbixagentpid" ];then
echo "success ! zabbix agent is running now"
fi
转载于:https://www.cnblogs.com/weifeng1463/p/7799053.html
总结
以上是凯发k8官方网为你收集整理的zabbix客户端一键安装脚本(主动模式监控)的全部内容,希望文章能够帮你解决所遇到的问题。
- 上一篇:
- 下一篇: