该脚本在CentOS 6.0 64位和Redhat 5.5 32位上都测试通过
脚本内容
#!/bin/bash
#author suzezhi
#this line below is essential
#the myql user who have an privilege to create a database for zabbix
mysqluser="root"
#the password of zabbix database user
zabbixpasswd="zabbix"
#the mysqlpath you installed
mysqlpath="/usr/local/mysql/bin/mysql_config"
#the zabbix path you want to install
zabbixpath="/usr/local/zabbix"
mysqlpassword=""
if [ -z $mysqlpassword ];then
mysqlpasswd=""
else
mysqlpasswd=-p$mysqlpassword
fi
yum -y install OpenIPMI-devel curl-devel net-snmp-devel
groupadd zabbix
useradd -g zabbix zabbix
tar xzvf zabbix-1.8.8.tar.gz
cd zabbix-1.8.8
mysql -u $mysqluser -p$mysqlpasswd -e 'create database zabbix character set utf8'
mysql -u $mysqluser -p$mysqlpasswd -e "grant all privileges on zabbix.* to zabbix@localhost identified by '$zabbixpasswd'"
mysql -u $mysqluser -p$mysqlpasswd zabbix < create/schema/mysql.sql
mysql -u $mysqluser -p$mysqlpasswd zabbix < create/data/p_w_picpaths_mysql.sql
mysql -u $mysqluser -p$mysqlpasswd zabbix < create/data/data.sql
./configure --prefix=$zabbixpath --enable-server --enable-proxy --enable-agent --with-mysql=$mysqlpath --with-net-snmp --with-libcurl --with-openipmi
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
#modify the configuration file
mkdir /etc/zabbix
cp misc/conf/zabbix_server.conf /etc/zabbix/
cp misc/conf/zabbix_agent.conf /etc/zabbix/
cp misc/conf/zabbix_agentd.conf /etc/zabbix/
cp misc/conf/zabbix_proxy.conf /etc/zabbix/
sed -i 's/^DBUser=root/DBUser=zabbix/' /etc/zabbix/zabbix_server.conf
sed -i "/^DBUser=zabbix/a\DBPassword=$zabbixpasswd" /etc/zabbix/zabbix_server.conf
cp misc/init.d/redhat/8.0/zabbix_agentd /etc/init.d/zabbix-agentd
cp misc/init.d/redhat/8.0/zabbix_server /etc/init.d/zabbix-server
chmod a+x /etc/init.d/zabbix-agentd
chmod a+x /etc/init.d/zabbix-server
chkconfig --add zabbix-server
chkconfig --add zabbix-agentd
sed -i 's#zabbix/bin#zabbix/sbin#' /etc/init.d/zabbix-server
sed -i 's#zabbix/bin#zabbix/sbin#' /etc/init.d/zabbix-agentd
/etc/init.d/zabbix-server start
/etc/init.d/zabbix-agentd start
chkconfig zabbix-server on
chkconfig zabbix-agentd on
点击下一步即可(在这里可能还需要修改php的配置文件)
这里会检查php的相关配置,根据它的要求进行修改吧。。。。
这里测试连接数据库,填好账号和密码之后,要检测一下连接情况
安装好之后,就可以登录了,默认账号是admin,默认密码是zabbix
登录之后,如果想修改语言的话,就点击右上角的profile,language里面选中文即可