#!/bin/bash yum -y install gcc yum -y install make* #Install and config wget http://prdownloads.sourceforge.net/zabbix/zabbix-1.8.16.tar.gz?download #wget http://10.10.99.106:/software/zabbix-1.8.16.tar.gz tar zxvf zabbix-1.8.16.tar.gz useradd zabbix cd zabbix-1.8.16 ./configure --prefix=/usr/local/zabbix --enable-agent && \ make && \ make install cat >> /etc/services << "EOF" zabbix-agent 10050/tcp Zabbix Agent zabbix-agent 10050/udp Zabbix Agent EOF mkdir /etc/zabbix cp misc/conf/zabbix_agent.conf /etc/zabbix/ cp misc/conf/zabbix_agentd.conf /etc/zabbix/ sed -i '13s#Server=127.0.0.1#Server=192.168.0.55#' /etc/zabbix/zabbix_agent.conf sed -i '82s#Server=127.0.0.1#Server=192.168.0.55#' /etc/zabbix/zabbix_agentd.conf sed -i '105s/^/#/' /etc/zabbix/zabbix_agentd.conf echo "Hostname=$HOSTNAME" >> /etc/zabbix/zabbix_agentd.conf cp misc/init.d/fedora/core/zabbix_agentd /etc/init.d/ chmod a+x /etc/init.d/zabbix_agentd sed -i '19s#BASEDIR=/opt/zabbix#BASEDIR=/usr/local/zabbix#' /etc/init.d/zabbix_agentd sed -i '25s#FULLPATH=$BASEDIR/bin/$BINARY_NAME#FULLPATH=$BASEDIR/sbin/$BINARY_NAME#' /etc/init.d/zabbix_agentd chkconfig --add zabbix_agentd && chkconfig zabbix_agentd on && /etc/init.d/zabbix_agentd start
此腳本只做方便之後使用,個人agent端就是使用的它,如朋友們使用有問題,則爲環境問題,多是某個軟件包沒裝致使!html