-
yum install make gcc mysql-server mysql-devel libcurl-devel net-snmp-devel php php-gd php-xml php-mysql php-mbstring php-bcmath httpd wget lrzsz telnet lsof -y
-
-
groupadd zabbix
-
useradd zabbix -g zabbix
-
-
wget -c http://jaist.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/2.2.3/zabbix-2.2.3.tar.gz
-
tar zxf zabbix-2.2.3.tar.gz
-
cd zabbix-2.2.3
-
./configure --prefix=/usr/local/zabbix --enable-server --enable-agent \
-
--with-mysql --with-net-snmp --with-libcurl
-
make install
-
-
service mysqld start;
-
mysql -e "create database zabbix character set utf8;"
-
mysql -e "grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';flush privileges;"
-
-
mysql -uroot zabbix < database/mysql/schema.sql
-
mysql -uroot zabbix < database/mysql/images.sql
-
mysql -uroot zabbix < database/mysql/data.sql
-
-
sed -i 's/^DBUser=.*$/DBUser=zabbix/g' /usr/local/zabbix/etc/zabbix_server.conf
-
sed -i 's/^.*DBPassword=.*$/DBPassword=zabbix/g' /usr/local/zabbix/etc/zabbix_server.conf
-
cp -r frontends/php /var/www/html/zabbix
-
cp misc/init.d/fedora/core/zabbix_* /etc/init.d/
-
sed -i 's#BASEDIR=/usr/local#BASEDIR=/usr/local/zabbix#g' /etc/init.d/zabbix_server
-
sed -i 's#BASEDIR=/usr/local#BASEDIR=/usr/local/zabbix#g' /etc/init.d/zabbix_agentd
-
-
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
-
-
-
-
cat >>/etc/php.ini <<EOF
-
date.timezone = Asia/Shanghai
-
max_execution_time = 300
-
max_input_time = 300
-
post_max_size = 32M
-
memory_limit = 128M
-
mbstring.func_overload = 2
-
EOF
-
-
-
cat >>/etc/httpd/conf/httpd.conf <<EOF
-
ServerName 127.0.0.1
-
<VirtualHost *:80>
-
DocumentRoot "/var/www/html"
-
ServerName zabbix_server
-
</VirtualHost>
-
EOF
-
-
-
cat >/var/www/html/zabbix/conf/zabbix.conf.php <<EOF
-
<?php
-
// Zabbix GUI configuration file
-
global $DB;
-
-
$DB['TYPE'] = 'MYSQL';
-
$DB['SERVER'] = 'localhost';
-
$DB['PORT'] = '0';
-
$DB['DATABASE'] = 'zabbix';
-
$DB['USER'] = 'zabbix';
-
$DB['PASSWORD'] = 'zabbix';
-
-
// SCHEMA is relevant only for IBM_DB2 database
-
$DB['SCHEMA'] = '';
-
-
$ZBX_SERVER = 'localhost';
-
$ZBX_SERVER_PORT = '10051';
-
$ZBX_SERVER_NAME = '';
-
-
$IMAGE_FORMAT_DEFAULT = IMAGE_FORMAT_PNG;
-
?>
-
EOF
-
-
service iptables stop
-
chkconfig --level 345 iptables off
-
setenforce 0
-
sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/sysconfig/selinux
-
echo "/etc/init.d/zabbix_server start" >> /etc/rc.local
-
echo "/etc/init.d/zabbix_agentd start" >> /etc/rc.local
-
chkconfig --level 345 mysqld on
-
chkconfig --level 345 httpd on
-
-
-
/etc/init.d/zabbix_server start
-
/etc/init.d/zabbix_agentd start
- /etc/init.d/httpd start