码迷,mamicode.com
首页 > 系统相关 > 详细

zabbix客户在linux 上安装

时间:2015-01-03 00:55:50      阅读:307      评论:0      收藏:0      [点我收藏+]

标签:系统管理员   系统安全   系统安装   

#!/bin/bash
ip=59.201.201.152
groupadd zabbix
useradd -g zabbix zabbix
yum -y install gcc  curl-devel net-snmp-devel fping e2fsprogs-devel zlib-devel libgssapi-devel krb5-devel openssl-devel wget libssh2-devel openldap-devel libxml2-devel make patch
rm -rf /etc/zabbix
rm -rf zabbix-2.4.3
rm zabbix-2.4.3.tar.gz
wget http://sourceforge.net/projects/zabbix/files/ZABBIX%20Latest%20Stable/2.4.3/zabbix-2.4.3.tar.gz
RETVAL=$?
tar xzf zabbix-2.4.3.tar.gz
cd zabbix-2.4.3
./configure --prefix=/opt/zabbix_agent --enable-agent
make install
cat >>/etc/services<<EOF
zabbix-agent 10050/tcp Zabbix Agent
zabbix-agent 10050/udp Zabbix Agent
zabbix-trapper 10051/tcp Zabbix Trapper
zabbix-trapper 10051/udp Zabbix Trapper
EOF

sed -i "s/^[ ]*Server=.*/Server=$ip/g" /opt/zabbix_agent/etc/zabbix_agent.conf
sed -i "s/^[ ]*Server=.*/Server=$ip/g" /opt/zabbix_agent/etc/zabbix_agentd.conf

cp misc/init.d/fedora/core/zabbix_agentd /etc/init.d/
sed -i "s#^[ ]*BASEDIR.*#          BASEDIR=/opt/zabbix_agent#g" /etc/init.d/zabbix_agentd
chmod a+x /etc/init.d/zabbix_*

cp misc/init.d/fedora/core/zabbix_agentd /etc/init.d/
chmod a+x /etc/init.d/zabbix_*
BASEDIR=/ect/zabbix_agent
FULLPATH=$BASEDIR/sbin/$BINARY_NAME
#configuration file
CONF_FILE=$BASEDIR/etc/zabbix_agentd.conf
action $"Starting $BINARY_NAME: " $FULLPATH -c $CONF_FILE
service zabbix_agentd start
ps ax|grep zabbix_agentd

zabbix客户在linux 上安装

标签:系统管理员   系统安全   系统安装   

原文地址:http://blog.csdn.net/wangjunji34478/article/details/42350901

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!