Install Zabbix 2.2.6 From Sources (CentOS 6.4)
2015-01-15 12:19
302 查看
1. Add Zabbix and MySQL Repository
rpm -ivh http://repo.zabbix.com/zabbix/2.2/rhel/6/x86_64/zabbix-release-2.2-1.el6.noarch.rpm
rpm -ivh http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm
yum clean metadata
yum clean dbcache
yum makecache
2. Install MySQL
rpm -e --nodeps mysql-libs-5.1.66-2.el6_3.x86_64
yum install -y mysql-community-client mysql-community-common mysql-community-devel mysql-community-libs mysql-community-libs-compat mysql-community-server mysql-utilities mysql-connector-odbc
chkconfig mysqld on
3. Install Apache
yum install -y httpd
chkconfig httpd on
4. Install PHP
yum install -y php php-gd php-bcmath php-xml php-mbstring php-mysql php-common php-cli
5. Install Dependencies
yum install -y OpenIPMI OpenIPMI-devel libssh2 libssh2-devel libcurl libcurl-devel net-snmp net-snmp-devel fping iksemel iksemel-devel libxml2 libxml2-devel openldap openldap-devel unixODBC unixODBC-devel
6. Download Zabbix Source
cd /root/Downloads
wget http://jaist.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/2.2.6/zabbix-2.2.6.tar.gz
7. Create User Account of Zabbix
groupadd zabbix
useradd -g zabbix zabbix
8. Create Zabbix Database
tar xvzf zabbix-2.2.6.tar.gz
service mysqld start
cd /root/Downloads/zabbix-2.2.6/database/mysql/
mysql -uroot
create database zabbix character set utf8 collate utf8_bin;
grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';
GRANT ALL PRIVILEGES ON zabbix.* TO 'zabbix'@'%' IDENTIFIED BY 'zabbix';
FLUSH PRIVILEGES;
quit
mysql -uroot zabbix < schema.sql
mysql -uroot zabbix < images.sql
mysql -uroot zabbix < data.sql
9. Configure Zabbix Source
cd /root/Downloads/zabbix-2.2.6
./configure --enable-server --enable-agent --enable-java --enable-ipv6 --with-mysql --with-jabber --with-libxml2 --with-unixodbc --with-net-snmp --with-ssh2 --with-openipmi --with-ldap --with-libcurl
--with-iconv --with-iconv-include --with-iconv-lib
10. Make Install Zabbix
make install
Note: Running make install will by default install the daemon binaries (zabbix_server, zabbix_agentd, zabbix_proxy) in /usr/local/sbin and the client binaries (zabbix_get, zabbix_sender) in
/usr/local/bin.
11. Install Zabbix Server/Agent As Service
gedit /etc/init.d/zabbix-server
chkconfig zabbix-server on
chmod 755 /etc/init.d/zabbix-server
gedit /etc/init.d/zabbix-agent
chkconfig zabbix-agent on
chmod 755 /etc/init.d/zabbix-agent
12. Setup Zabbix Server
gedit /usr/local/etc/zabbix_server.conf
13. Install Zabbix Frontend
mkdir /var/www/html/zabbix
cp -a /root/Downloads/zabbix-2.2.6/frontends/php/* /var/www/html/zabbix/
chown -R apache.apache /var/www/html/zabbix
14. Setup PHP
gedit /etc/php.ini
15. Setup unixODBC
ln -s /usr/lib64/libmyodbc5w.so /usr/lib64/libmyodbc5.so
gedit /etc/odbcinst.ini
gedit /etc/odbc.ini
16. Test ODBC Configuration
isql -v test
16. Start Related Service
service zabbix-server start
service zabbix-agent start
service httpd start
rpm -ivh http://repo.zabbix.com/zabbix/2.2/rhel/6/x86_64/zabbix-release-2.2-1.el6.noarch.rpm
rpm -ivh http://repo.mysql.com/mysql-community-release-el6-5.noarch.rpm
yum clean metadata
yum clean dbcache
yum makecache
2. Install MySQL
rpm -e --nodeps mysql-libs-5.1.66-2.el6_3.x86_64
yum install -y mysql-community-client mysql-community-common mysql-community-devel mysql-community-libs mysql-community-libs-compat mysql-community-server mysql-utilities mysql-connector-odbc
chkconfig mysqld on
3. Install Apache
yum install -y httpd
chkconfig httpd on
4. Install PHP
yum install -y php php-gd php-bcmath php-xml php-mbstring php-mysql php-common php-cli
5. Install Dependencies
yum install -y OpenIPMI OpenIPMI-devel libssh2 libssh2-devel libcurl libcurl-devel net-snmp net-snmp-devel fping iksemel iksemel-devel libxml2 libxml2-devel openldap openldap-devel unixODBC unixODBC-devel
6. Download Zabbix Source
cd /root/Downloads
wget http://jaist.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/2.2.6/zabbix-2.2.6.tar.gz
7. Create User Account of Zabbix
groupadd zabbix
useradd -g zabbix zabbix
8. Create Zabbix Database
tar xvzf zabbix-2.2.6.tar.gz
service mysqld start
cd /root/Downloads/zabbix-2.2.6/database/mysql/
mysql -uroot
create database zabbix character set utf8 collate utf8_bin;
grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';
GRANT ALL PRIVILEGES ON zabbix.* TO 'zabbix'@'%' IDENTIFIED BY 'zabbix';
FLUSH PRIVILEGES;
quit
mysql -uroot zabbix < schema.sql
mysql -uroot zabbix < images.sql
mysql -uroot zabbix < data.sql
9. Configure Zabbix Source
cd /root/Downloads/zabbix-2.2.6
./configure --enable-server --enable-agent --enable-java --enable-ipv6 --with-mysql --with-jabber --with-libxml2 --with-unixodbc --with-net-snmp --with-ssh2 --with-openipmi --with-ldap --with-libcurl
--with-iconv --with-iconv-include --with-iconv-lib
10. Make Install Zabbix
make install
Note: Running make install will by default install the daemon binaries (zabbix_server, zabbix_agentd, zabbix_proxy) in /usr/local/sbin and the client binaries (zabbix_get, zabbix_sender) in
/usr/local/bin.
11. Install Zabbix Server/Agent As Service
gedit /etc/init.d/zabbix-server
#!/bin/sh # # chkconfig: - 85 15 # description: Zabbix server daemon # config: /etc/zabbix/zabbix_server.conf # ### BEGIN INIT INFO # Provides: zabbix # Required-Start: $local_fs $network # Required-Stop: $local_fs $network # Default-Start: # Default-Stop: 0 1 2 3 4 5 6 # Short-Description: Start and stop Zabbix server # Description: Zabbix server ### END INIT INFO # Source function library. . /etc/rc.d/init.d/functions if [ -x /usr/local/sbin/zabbix_server ]; then exec=/usr/local/sbin/zabbix_server else exit 5 fi prog=${exec##*/} conf=/usr/local/etc/zabbix_server.conf if [ -f /etc/sysconfig/zabbix-server ]; then . /etc/sysconfig/zabbix-server fi lockfile=/var/lock/subsys/zabbix-server start() { echo -n $"Starting Zabbix server: " daemon $exec -c $conf rv=$? echo [ $rv -eq 0 ] && touch $lockfile return $rv } stop() { echo -n $"Shutting down Zabbix server: " killproc $prog rv=$? echo [ $rv -eq 0 ] && rm -f $lockfile return $rv } restart() { stop start } case "$1" in start|stop|restart) $1 ;; force-reload) restart ;; status) status $prog ;; try-restart|condrestart) if status $prog >/dev/null ; then restart fi ;; reload) action $"Service ${0##*/} does not support the reload action: " /bin/false exit 3 ;; *) echo $"Usage: $0 {start|stop|status|restart|try-restart|force-reload}" exit 2 ;; esac |
chmod 755 /etc/init.d/zabbix-server
gedit /etc/init.d/zabbix-agent
#!/bin/sh # # chkconfig: - 86 14 # description: Zabbix agent daemon # processname: zabbix_agentd # config: /etc/zabbix/zabbix_agentd.conf # ### BEGIN INIT INFO # Provides: zabbix-agent # Required-Start: $local_fs $network # Required-Stop: $local_fs $network # Should-Start: zabbix zabbix-proxy # Should-Stop: zabbix zabbix-proxy # Default-Start: # Default-Stop: 0 1 2 3 4 5 6 # Short-Description: Start and stop Zabbix agent # Description: Zabbix agent ### END INIT INFO # Source function library. . /etc/rc.d/init.d/functions if [ -x /usr/local/sbin/zabbix_agentd ]; then exec=/usr/local/sbin/zabbix_agentd else exit 5 fi prog=${exec##*/} conf=/usr/local/etc/zabbix_agentd.conf if [ -f /etc/sysconfig/zabbix-agent ]; then . /etc/sysconfig/zabbix-agent fi lockfile=/var/lock/subsys/zabbix-agent start() { echo -n $"Starting Zabbix agent: " daemon $exec -c $conf rv=$? echo [ $rv -eq 0 ] && touch $lockfile return $rv } stop() { echo -n $"Shutting down Zabbix agent: " killproc $prog rv=$? echo [ $rv -eq 0 ] && rm -f $lockfile return $rv } restart() { stop start } case "$1" in start|stop|restart) $1 ;; force-reload) restart ;; status) status $prog ;; try-restart|condrestart) if status $prog >/dev/null ; then restart fi ;; reload) action $"Service ${0##*/} does not support the reload action: " /bin/false exit 3 ;; *) echo $"Usage: $0 {start|stop|status|restart|try-restart|force-reload}" exit 2 ;; esac |
chmod 755 /etc/init.d/zabbix-agent
12. Setup Zabbix Server
gedit /usr/local/etc/zabbix_server.conf
Setup parameters as following: DBHost=localhost DBName=zabbix DBUser=zabbix DBPassword=zabbix |
mkdir /var/www/html/zabbix
cp -a /root/Downloads/zabbix-2.2.6/frontends/php/* /var/www/html/zabbix/
chown -R apache.apache /var/www/html/zabbix
14. Setup PHP
gedit /etc/php.ini
Setup parameters as following: post_max_size = 16M max_execution_time = 300 max_input_time = 300 date.timezone = Asia/Shanghai |
ln -s /usr/lib64/libmyodbc5w.so /usr/lib64/libmyodbc5.so
gedit /etc/odbcinst.ini
[PostgreSQL] Description = ODBC for PostgreSQL Driver = /usr/lib/psqlodbc.so Setup = /usr/lib/libodbcpsqlS.so Driver64 = /usr/lib64/psqlodbc.so Setup64 = /usr/lib64/libodbcpsqlS.so FileUsage = 1 [MySQL] Description = ODBC for MySQL Driver = /usr/lib/libmyodbc5.so Setup = /usr/lib/libodbcmyS.so Driver64 = /usr/lib64/libmyodbc5.so Setup64 = /usr/lib64/libodbcmyS.so FileUsage = 1 [MySQL ODBC 5.3 Unicode Driver] Driver = /usr/lib64/libmyodbc5w.so UsageCount = 1 [MySQL ODBC 5.3 ANSI Driver] Driver = /usr/lib64/libmyodbc5a.so UsageCount = 1 |
[test] Description = MySQL test database Driver = MySQL Server = 127.0.0.1 User = zabbix Password = zabbix Port = 3306 Database = zabbix |
isql -v test
The output message are shown below: +---------------------------------------+ | Connected! | | | | sql-statement | | help [tablename] | | quit | | | +---------------------------------------+ SQL> |
service zabbix-server start
service zabbix-agent start
service httpd start
相关文章推荐
- Install Redis on CentOS 6.4--转
- centos6.4环境下搭建zabbix2.0.6
- Install NVIDIA Graphics Drivers with CentOS 6.4 x8
- centos 6.4 yum install mysql&slave
- centos6.4安装zabbix
- Centos minimal install zabbix
- CentOS64位6.5下部署Zabbix2.2.6监控系统 推荐
- Install VMware Tools on CentOS 6.4
- CentOS 6.4搭建zabbix
- How To Install Zabbix Server On CentOS 7
- How to install snmpwalk snmpget on CentOS 6.4 6.3 5.9 Redhat RHEL Fedora
- Install Redis on CentOS 6.4--转
- How to install zabbix-agent on CentOS 7
- Install Apache 2.2.15, MySQL 5.5.34 & PHP 5.5.4 on RHEL/CentOS 6.4/5.9 & Fedora 19-12 [转]
- CentOS 7 yum install zabbix 2.4
- centos6.4搭建zabbix
- CentOS6.4 GOOGLE chrome install
- Install Zabbix 2.2.6 From Package (CentOS 6.4)
- 如何在centos6.4上安装git How To Install Git on a CentOS 6.4 VPS
- 安装zabbix 3.0/minimal CentOS 7 install zabbix from rpm package