- 线上监控系统由zabbix 1.8.10直接变成zabbix 2.2,简单使用发现zabbix 2.2的复制功能、自动发现功能(网卡、分区挂载)比以前智能多了。果然不错,还增加了jmx的监控。
- 整个简单脚本来对被监控节点重新安装吧。
- #!/bin/bash -x
- ps aux |grep zabbix | grep zabbix > /dev/null
- if [ "$?" = "0" ];then
- pkill -9 zabbix_agentd
- fi
- test -e /usr/local/zabbix/ && rm -rf /usr/local/zabbix/
- rm -rf /etc/init.d/zabbix_*
- test -e /etc/zabbix_bak && rm -rf /etc/zabbix_bak
- test -e /etc/zabbix && rm -rf /etc/zabbix
- cd /usr/local/src
- wget http://1.1.1.1:90/configure/zabbix-2.0.2.tar.gz
- tar -xzf zabbix-2.0.2.tar.gz
- cd zabbix-2.0.2
- ./configure --prefix=/usr/local/zabbix --enable-agent --with-net-snmp
- make && make install
- cd /usr/local/zabbix/etc/
- rm -rf zabbix_agent.conf zabbix_agent.conf.d zabbix_agentd.conf
- sed -i 's/\# EnableRemoteCommands=0/EnableRemoteCommands=1/g' /usr/local/zabbix/etc/zabbix_agentd.conf
- sed -i 's/\# LogRemoteCommands=0/LogRemoteCommands=1/g' /usr/local/zabbix/etc/zabbix_agentd.conf
- sed -i 's/Server=127.0.0.1/Server=1.1.1.1/g' /usr/local/zabbix/etc/zabbix_agentd.conf
- sed -i 's/ServerActive=127.0.0.1/ServerActive=1.1.1.1/g' /usr/local/zabbix/etc/zabbix_agentd.conf
- sed -i "s/Zabbix\ server/${HOST}/g" /usr/local/zabbix/etc/zabbix_agentd.conf
- sed -i 's/\# Include=\/usr\/local\/etc\/zabbix_agentd.conf.d/Include=\/usr\/local\/zabbix\/etc\/zabbix_agentd.conf.d/g' /usr/local/zabbix/etc/zabbix_agentd.conf
- sed -i 's/\# UnsafeUserParameters=0/UnsafeUserParameters=1/g' /usr/local/zabbix/etc/zabbix_agentd.conf
- id zabbix || useradd zabbix
- chmod 777 /tmp/zabbix*
- /usr/local/zabbix/sbin/zabbix_agentd -c /usr/local/zabbix/etc/zabbix_agentd.conf