安装zabbix 2.4.4 agent 脚本
2015-03-30 13:23
344 查看
安装zabbix 2.4.4 agent脚本
vim install_zabbix_agentd.sh
vim install_zabbix_agentd.sh
#!/bin/bash # zabbix server 或 zabbix proxy IP,根据实际情况设置 SERVER_IP="10.100.17.22" # get network ip addr function function getIP() { NET=$1 if [ "$NET" = "" ]; then NET="eth0" fi IP="" if [ $(ifconfig | grep "$NET" | wc -l) -gt 0 ]; then IP=$(ifconfig $NET | grep 'inet addr:' | awk -F: '{print $2}' | awk '{print $1}') fi echo $IP } # get IP segment function function getSegment() { IP_ADD=$1 N=$2 echo $(echo $IP_ADD | cut -d. -f$N) } ETH0_IP=$(getIP eth0) IP_ADDR=$ETH0_IP LOCAL_IP=$IP_ADDR yum -y install gcc groupadd zabbix useradd -g zabbix -s /sbin/nologin -M zabbix cd /usr/local/src tar zxvf zabbix-2.4.4.tar.gz cd zabbix-2.4.4 ./configure --prefix=/usr/local/zabbix --enable-agent make make install cp misc/init.d/fedora/core/zabbix_agentd /etc/init.d sed -i 's/BASEDIR=\/usr\/local/BASEDIR=\/usr\/local\/zabbix/g' /etc/init.d/zabbix_agentd chkconfig --add zabbix_agentd chkconfig zabbix_agentd on sed -i "s/^Server=127.0.0.1/Server=$SERVER_IP/g" /usr/local/zabbix/etc/zabbix_agentd.conf sed -i "s/^ServerActive=127.0.0.1/#ServerActive=127.0.0.1/" /usr/local/zabbix/etc/zabbix_agentd.conf sed -i "s/^# ListenIP=0.0.0.0/ListenIP=$LOCAL_IP/" /usr/local/zabbix/etc/zabbix_agentd.conf sed -i 's/^# UnsafeUserParameters=0/UnsafeUserParameters=1/' /usr/local/zabbix/etc/zabbix_agentd.conf /etc/init.d/zabbix_agentd start
相关文章推荐
- Zabbix agent自动安装脚本
- zabbix-agent脚本安装2
- 简单的zabbix agent自动安装脚本
- 批量安装zabbix-agent脚本
- CentOS6 Zabbix-Agent2.0安装脚本
- 批量安装zabbix-agent脚本
- Ubuntu、CentOS、debian下Zabbix agent自动安装脚本
- Zabbix监控 之安装Agent+脚本【6】
- 自动安装zabbix_agent脚本 -- python2
- zabbix agent安装脚本
- zabbix agent自动安装脚本
- zabbix-agent脚本安装
- saltstack的探索-演示部署文件和脚本安装zabbix-agent服务
- zabbix_agent for linux自动安装脚本
- Zabbix_Agent windows下自动安装脚本
- Windows下安装Zabbix agent
- zabbix 2.2自动安装脚本
- zabbix_agent的安装
- 全自动zabbix 安装脚本
- [ubuntu] - Zabbix Agent 安装[Linux]