5.配置Zabbix客戶端
1 2 3 4 5 6 7 8 9 | # wget "http://downloads.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/2.2.2/zabbix-2.2.2.tar.gz?r=http%3A%2F%2Fwww.zabbix.com%2Fdownload.php&ts=1395066528&use_mirror=jaist" # groupadd zabbix -g 201 # useradd-g zabbix -u 201 -m zabbix # tarxf zabbix-2.0.8.tar.gz # cd zabbix-2.0.8 # ./configure --prefix=/usr --sysconfdir=/etc/zabbix --enable-agent # make # make install |
1 2 3 4 5 | # 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/#g" /etc/init.d/zabbix_agentd |
1 2 3 4 5 6 | # vim /etc/services zabbix-agent 10050 /tcp #ZabbixAgent zabbix-agent 10050 /udp #ZabbixAgent zabbix-trapper 10051 /tcp #ZabbixTrapper zabbix-trapper 10051 /udp #ZabbixTrapper |
zabbix agent的配置很簡單,只需要修改zabbix agent配置文件中的Server、ServerActive和Hostname這三項即可。
其中Server、ServerActive是zabbix server服務器的IP地址,Hostname是被監控端的IP地址,如下:
1 2 3 4 5 6 7 | # sed -i "s/Server\=127.0.0.1/Server\=127.0.0.1,192.168.30.130/g" /etc/zabbix/zabbix_agentd.conf # sed -i "s/ServerActive\=127.0.0.1/ServerActive\=192.168.30.130: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 "#UnsafeUserParameters=0#aUnsafeUserParameters=1\n" /etc/zabbix/zabbix_agentd.conf |
1 2 | # chkconfig zabbix_agentd on # servicezabbix_agentdstart |
1 2 | # /usr/bin/zabbix_get -s 192.168.30.131 -p 10050 -k "system.uptime" (192.169.30.131是Agent端IP) 77177 |