在ubuntu os上安装agent,使用如下命令:
wget http://mirrors.aliyun.com/zabbix/zabbix/3.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_3.0-1%2btrusty_all.deb
dpkg -i zabbix-release_3.0-1+trusty_all.deb
sudo apt-get -y install zabbix-agent
修改配置,可以直接在命令行执行:
# 定义服务器地址
ZABBIX_SERVERIP=zabbix.chinasoft.com
# 修改服务器地址
sed -i "s#Server=127.0.0.1#Server=$ZABBIX_SERVERIP#g" /etc/zabbix/zabbix_agentd.conf
sed -i "s#ServerActive=127.0.0.1#ServerActive=$ZABBIX_SERVERIP#g" /etc/zabbix/zabbix_agentd.conf
# 修改本机hostname
sed -i "s#Hostname=Zabbix server#Hostname=`hostname`#g" /etc/zabbix/zabbix_agentd.conf
# 修改本机zabbix-agent监听端口
sed -i "s/# ListenPort=10050/ListenPort=20050/g" /etc/zabbix/zabbix_agentd.conf
重启服务
sudo service zabbix-agent restart