首页 > 代码库 > zabbix agent安装脚本
zabbix agent安装脚本
为了以后批量部署,节省时间和人力就把zabbix_agent的安装方法改成源码的,仅供参考
#!/bin/bash #zabbix server 端IP 地址 SERVER="10.10.99.78" #zabbix 版本号,也就是源码包.tar.gz前面的部分 VER="/usr/local/src/zabbix-2.4.4" groupadd zabbix useradd -g zabbix zabbix -s /sbin/nologin tar xvf $VER.tar.gz cd $VER ./configure --prefix=/usr/local/zabbix --enable-agent make install #该版本zabbix不需要make,直接make install即可,其它版本请酌情修改 echo "Installation completed !" mkdir /var/log/zabbix chown zabbix.zabbix /var/log/zabbix cp misc/init.d/fedora/core/zabbix_agentd /etc/init.d/ chmod 755 /etc/init.d/zabbix_agentd sed -i "s#BASEDIR=/usr/local#BASEDIR=/usr/local/zabbix#g" /etc/init.d/zabbix_agentd ln -s /usr/local/zabbix/etc /etc/zabbix ln -s /usr/loca/zabbix/bin/zabbix_get /usr/bin/ ln -s /usr/loca/zabbix/bin/zabbix_sender /usr/bin/ ln -s /usr/loca/zabbix/sbin/zabbix_agent /usr/sbin/ ln -s /usr/loca/zabbix/sbin/zabbix_agentd /usr/sbin/ echo "zabbix-agent 10050/tcp #Zabbix Agent" >> /etc/services echo "zabbix-agent 10050/udp #Zabbix Agent" >> /etc/services echo "zabbix-trapper 10051/tcp #Zabbix Trapper" >> /etc/services echo "zabbix-trapper 10051/udp #Zabbix Trapper" >> /etc/services sed -i "s/Server\=127.0.0.1/Server=$SERVER/g" /etc/zabbix/zabbix_agentd.conf sed -i "s/ServerActive\=127.0.0.1/ServerActive=$SERVER:10051/g" /etc/zabbix/zabbix_agentd.conf sed -i "s#tmp/zabbix_agentd.log#var/log/zabbix/zabbix_agentd.log#g" /etc/zabbix/zabbix_agentd.conf sed -i "s#UnsafeUserParameters=0#UnsafeUserParameters=1#g" /etc/zabbix/zabbix_agentd.conf sed -i "s%# Include=/usr/local/etc/zabbix_agentd.userparams.conf%Include=/etc/zabbix/zabbix_agentd.conf.d/%g" /etc/zabbix/zabbix_agentd.conf chkconfig zabbix_agentd on service zabbix_agentd start
本文出自 “不抛弃!不放弃” 博客,请务必保留此出处http://thedream.blog.51cto.com/6427769/1844447
zabbix agent安装脚本
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。