Centos zabbix 1.8.1 Installation

Source: Internet
Author: User
Tags php software snmp

Environment:

Xen

Centos 5.4 64 bit

Zabbix 1.8.1

1. Create a Virtual Machine (omitted)

2. Install centos 5.3 64-bit

Because it is only used to install zabbix server, only install base system.

Select customize now.

Here, only base in base system is selected.

About 15 minutes later, centos has been installed.

The first time you enter the system, the setup agent will appear

Disable the firewall function for ease of Installation

To install the software using yum, first install the Yum-fastestmirror plug-in to find the fastest source.

Yum install Yum-fastestmirror-y

3. install Apache, PHP, and MySQL

Software List

Install Apache

Yum install httpd. x86_64 httpd-manual.x86_64

Start Apache:

Apachectl start

Set Apache to automatically start upon startup

Chkconfig -- add httpd

Chkconfig -- level 345 httpd on

Install PHP

Yum install PHP. x86_64 php-bcmath.x86_64 php-gd.x86_64

Install MySQL

Yum install mysql-server.x86_64 mysql. x86_64 php-mysql.x86_64

Generally, the PHP version is 5.1, which will cause the php mb string overload to always be no in the future, so it is best to upgrade it:

[Root @ zabbix ~] # Rpm -- import http://dev.centos.org/centos/RPM-GPG-KEY-CentOS-te sting

[Root @ zabbix ~] # Cd/etc/yum. Repos. d

[Root @ zabbix ~] # Wget http://dev.centos.org/centos/5/CentOS-Testing.repo

[Root @ zabbix ~] # Yum -- disablerepo = * -- enablerepo = c5-testing update PHP

In this way, you can upgrade to version 5.2.

Run the following command to query your installed PHP software:

[Root @ admin3-test zabbix] # rpm-Qa | grep PHP

Php-pdo-5.1.6-23.2.el5_3

Php-cli-5.1.6-23.2.el5_3

Php-mysql-5.1.6-23.2.el5_3

Php-gd-5.1.6-23.2.el5_3

Php-mbstring-5.1.6-23.2.el5_3

Php-common-5.1.6-23.2.el5_3

Php-5.1.6-23.2.el5_3

Php-bcmath-5.1.6-23.2.el5_3

It should be like the above eight items. If the software in bold Chinese is missing, install it as follows:

Yum-y install PHP-mbstring

If the installation fails, perform the following operations:

Yum-y erase PHP-common

Yum-y install PHP-common

Yum-y install PHP-mbstring

Yum install PHP. x86_64 php-bcmath.x86_64 php-gd.x86_64

Yum install mysql-server.x86_64 mysql. x86_64 php-mysql.x86_64

Start MySQL

Service mysqld start

Set the MySQL Root Password

Mysqladmin-uroot-P password 123456

Enter Password: Enter the old password (if it is set for the first time, the default root password is blank and press Enter)

Set automatic MySQL startup

Chkconfig -- add mysqld

Chkconfig -- level 345 mysqld on

4. install the software and library used to compile zabbix

Install MySQL header files and library files

Yum install mysql-devel.x86_64

Install net-snmp

Yum install net-snmp.x86_64 net-snmp-devel.x86_64 net-snmp-utils.x86_64

Install curl

Yum install curl. x86_64 curl-devel.x86_64

Install gcc

Yum install GCC. x86_64 libgcc. i386 libgcc. x86_64

Install make

Yum install make

The manual mentioned the installation of Linux's instant messaging software jabber, which is of little practical use and has not been installed.

5. Compile and install zabbix

Download the source code from zabbix's official website, upload it to the virtual machine, and start decompressing and compiling.

Extract

Gunzip zabbix-1.6.6.tar.gz & tar-xvf zabbix-1.6.6.tar

Compile and install zabbix. Be sure to compile it together with the agent.

./Configure -- enable-server -- enable-agent -- With-mysql -- With-net-snmp -- With-libcurl

Make install

Create zabbix user

Useradd-D/home/zabbix-P zabbix

Go to the zabbix decompressed directory and create the zabbix database.

Mysql-uroot-p123456

Create Database zabbix;

Quit;

Cat create/Schema/MySQL. SQL | mysql-uroot-p123456 zabbix

Cat create/data. SQL | mysql-uroot-p123456 zabbix

Cat create/data/images_mysql. SQL | mysql-uroot-p123456 zabbix

Modify/etc/services and add the following lines

Zabbix-Agent 10050/tcp zabbix agent

Zabbix-Agent 10050/udp zabbix agent

Zabbix-Trapper 10051/tcp zabbix trapper

Zabbix-Trapper 10051/udp zabbix trapper

Modify zabbix configuration file

Create a configuration file directory and copy the configuration file template in the source code to the newly created configuration file directory.

Mkdir/etc/zabbix

Cp misc/CONF/*/etc/zabbix

Modify zabbix_server.conf zabbix_agentd.conf zabbix_agent zabbix_trapper.conf according to the actual situation. Generally, the default value is used, except for the MySQL database username and password, for example:

Dbuser = root

Dbpassword = 123456

Because zabbix uses fping instead of Ping as the ICMP tool, you must install fping

You can download fping source code from the http://fping.sourceforge.net/, decompress the compilation and installation.

Go to the source code directory after fping Decompression

./Configure

Make install

Modify/etc/zabbix/zabbix_server.conf

Fpinglocation =/usr/local/sbin/fping

Copy the frontend PHP program of the zabbix server to the Home Directory of the HTTP server.

CP-r frontend/PHP/*/var/www/html

6. Configure zabbix Server

For security reasons, log on to zabbix server and zabbix agentd using the zabbix user.

/Usr/local/sbin/zabbix_server

/Usr/local/sbin/zabbix_agentd

Log on to zabbix server using a browser

Http: // <zabbix Server IP>/index. php // The Server IP address is your sub-IP Address by default.

The following configuration server interface is displayed:

Go to the configuration check page one by one, and you will find that the PHP Max execution and PHP timezone check failed, as shown below:

Modify/etc/PHP. ini and the following two items:

Max_execution_time= 300

Date. timezone = Asia/Chongqing

Restart httpd

Apachectl restart or use service httpd restart

Click Retry on the page to check whether the Retry is successful.

If fail exists, search for the corresponding keyword in the/etc/PHP. ini file and change it to the one required.

Next, go to the next page and check the MySQL connection.

Set MySQL connection parameter and test connection. The connection is successful.

One way to next, the following page appears

Click Save configuration file, upload the file to the/var/www/html/conf directory of the VM, and click Retry.

All the way to next, enter the login page

Enter the management Username: Admin default password zabbix to log on. Go to configuration-> hosts, select zabbix server, then activate select, and activate monitoring of zabbix server (Local Machine. Go to the monitoring dashboard and you can see the Monitoring Result of zabbix server.

Okay, you're done!

Http://hi.baidu.com/sudaemon/blog/item/c9cbab35ff1 7c91b91ef3919.html

Related Article

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.