Install zabbix 2.0.5 on CentOS

Source: Internet
Author: User

As an excellent monitoring software, zabbix not only generates alarms when a fault occurs, but also generates related charts to analyze network traffic, CPU load, and other conditions.

1. Download and decompress the package and the yum Environment

Yum install net-snmp-devel php-bcmath # depending on the actual system environment, if some libraries are missing behind, you can re-yumwget http://superb-dca2.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/2.0.5/zabbix-2.0.5.tar.gztar xvf zabbix-2.0.5.tar.gzcd zabbix-2.0.5
2. Create and import a database

Make sure that the database is installed (mysql is used as an example here. zabbix supports mysql, DB2, oracle, postgresql, and sqlite3), and import the database (you can assign an independent mysql account to zabbix.

# Grant all on zabbix after logging on to mysql. * to zabbix@127.0.0.1 identified by 'zabbix123'; # Run in shell, zabbix is the allocated mysql user mysql-uzabbix-p-h127.0.0.1-e 'create database zabbix character set utf8' mysql-uzabbix-p-h127.0.0.1 zabbix <database/mysql/schema. SQL mysql-uzabbix-p-h127.0.0.1 zabbix <database/mysql/images. SQL mysql-uzabbix-p-h127.0.0.1 zabbix <database/mysql/data. SQL

3. Compile and install zabbix

# -- Enable-server is the compiling server # -- enable-agent is the compilation client's business environment # -- with-mysql =/usr/local/mysql/bin/mysql_config to provide mysql environment information to zabbix. /configure -- prefix =/usr/local/zabbix \ -- enable-server \ -- with-mysql =/usr/local/mysql/bin/mysql_config \ -- with-net-snmp -- with-libcurl -- enable-agentmake install
4. modify the configuration
Vi/usr/local/zabbix/etc/zabbix_server.conf

The following are the information about the database to be modified (Be sure not to duplicate the information to avoid conflicts)

DBHost = 127.0.0.1DBName = zabbixDBUser = zabbixDBPassword = zabbix123DBPort = 3306 # If the database uses the sock file method, the path of the sock file can be used here.
The STARTUP script provided by zabbix is in the misc/init. d/directory of the installation file, but 2.0.5 does not provide the redhat (centOS) version... It's strange. Here I use the old version of the startup script.
Zabbix_server.txt
Download the zabbix_server.txt file, rename it zabbix_server, copy it to the/etc/init. d directory, and grant the executable permission chmod + x/etc/init. d/zabbix_server
If you have followed the installation steps above, you do not need to modify the zabbix_server file by default. Otherwise, you need to modify the basedir pidfile.
Here, the zabbix server has been installed. Enable zabbix Server
Service zabbix_server start
If error while loading shared libraries: libmysqlclient. so.18: cannot open shared object file: No such file or directory exists
/Etc/init. d/zabbix_server start: zabbix_server cocould not be started. The error is reported because the mysql database cannot be found. Run ln-s/usr/local/mysql/lib/libmysqlclient. so.18/usr/lib64/libmysqlclient. so.18.

5. Configure the zabbix WEB service,
Cp-aR frontends/php // www/zabbix/
Chown www: www/zabbix/

Open the php. ini file, find the date. timezone line, set the time zone to Asia/Shanghai, and set the three to at least:

date.timezone ='Asia/Shanghai' post_max_size = 16Mmax_execution_time = 300max_input_time = 300

Configure nginx (nginx + php-fpm)

Open/usr/local/nginx/config/nginx. conf and add a new server entry.

Server {listen 80; server_name zabbix.test.com; # allow 192.168.1.1; # which IP addresses can be restricted to access # allow 192.168.1.2; # deny all; root/data/www/zabbix /; location/{index index.html index.htm index. php;} location ~ \. Php $ {fastcgi_pass 127.0.0.1: 9000; fastcgi_index index. php; fastcgi_param SCRIPT_FILENAME $ document_root $ fastcgi_script_name; include fastcgi_params ;}}

If apache is used, you can

<VirtualHost *:80>    DocumentRoot "/www/zabbix/"    ServerName zabbix.test.com    <Directory />    Order allow,deny    Allow from all# Order deny,Allow# Allow from 192.168.1.1 192.168.1.2# Deny from all    </Directory></VirtualHost>
After the configuration is complete, restart nginx or httpd and open zabbix.test.com (the domain name is defined by yourself, and the installation page is displayed.

Click next. If the prompt does not support a php module, If php is rpm installation, you can directly install yum. If php is source code installation, you need to go to the PHP installation file directory, and then

Cd ext/xxx # select the Module Directory to be installed/usr/local/php/bin/phpize. /configure -- with-php-config =/usr/local/php/bin/php-config make & make install # The directory where the so file is located and php is opened. add a line to the INI file and restart php-fpm. Extension = "xxx. so"
After the WEB Client is installed, log on to zabbix on the WEB page. The default Administrator account and password are admin zabbix.
6. Install the client.

The above installation includes Client installation, if you install the client on other servers. You only need to enter the zabbix installation directory

./configure --prefix=/usr/local/zabbix --enable-agentmake install
Vi/usr/local/zabbi/etc/zabbix_agent.conf
Modify Server = server_ip to the corresponding zabbix_server Server IP address.
Zabbix_agent.txt
Download the zabbix_agent.txt file and change it to zabbix_agent. Move it to the/etc/init. d/directory and grant the executable permission chmod + x/etc/init. d/zabbix_agent.
Start zabbix client service zabbix_agent start

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.