Zabbix installation and deployment (Server)

Source: Internet
Author: User
Tags import database

Zabbix installation and deployment (Server)

Common system monitoring software in Linux includes Nagios, Cacti, Zabbix, and Monit. These open source software can help us better manage machines and discover them in the first time, and warn system maintenance personnel.

Today, I started to study Zabbix. The purpose of Zabbix is to better monitor the mysql database server and generate graphical reports. Although Nagios can also generate graphical reports, but it is not as powerful as Zabbix.

First, let's introduce Zabblx:

1. Introduction to Zabbix

Zabbix is an enterprise-level open-source solution that provides distributed system monitoring and network monitoring functions based on the WEB interface.
Zabbix consists of zabbix server and the optional component zabbix agent.
Zabbix server can monitor the remote server/network status through methods such as SNMP, zabbix agent, ping, and port monitoring.
The zabbix agent must be installed on the monitored target server. It collects hardware information, memory, CPU, and other information related to the operating system.

Main features of zabbix:
-Simple installation and configuration, low learning cost
-Supports multiple languages (including Chinese)
-Free Open Source
-Automatically discover servers and network devices
-Distributed monitoring and centralized WEB management
-Agent-free monitoring
-User security authentication and soft authorization Methods
-Set or view monitoring results on the WEB interface
-Email and other notification functions
And so on.

Zabbix main functions:
-CPU load
-Memory usage
-Disk usage
-Network condition
-Port Monitoring
-Log monitoring

Official installation materials: http://www.zabbix.com/wiki/howto/monitor

Ii. Zabbix Installation

2.1 zabbix WEB Environment Construction

Zabbix installation requires a LAMP or LNMP environment.
Other software packages required

1. yum install mysql-dev gcc net-snmp-devel curl-devel perl-DBI php-gd php-mysql php-bcmath php-mbstring php-xm

2.2 zabbix database settings

The zabbix database can be separated from the zabbix server and uses a dedicated mysql server to store data. In this case, the zabbix database must be granted the relevant permissions.

1. grant all privileges on zabbix. * to zabbix_user @ 'IP' identified by '123 ';

Note: The ip address is the ip address of the zabbix server.

For more information about database installation, see Mysql installation. I am used to using binary packages.

Start Database

/Usr/local/mysql/bin/mysqld_safe -- user = mysql &

Log on to the database, create an account, and set permissions:

1. mysql> use mysql;
2. mysql> create database zabbix character set utf8;
3. mysql> grant all privileges on zabbix. * to zabbix_user @ '192. 168.10.197 'identified by '123 ';

2.3 install the zabbix Service

Add zabbix users and groups

# Groupadd zabbix
# Useradd-g zabbix-m zabbix

Download and decompress the package from the official website.

:

Http://www.zabbix.com/download.php

# Wget http://fossies.org/unix/misc/zabbix-2.0.3.tar.gz
# Tar-zxvf zabbix-2.0.3.tar.gz
# Cd zabbix-2.203
Import database tables

# Cd zabbix-2.0.3/database/mysql
# Mysql-uroot-pmysql zabbix <mysql. SQL
# Mysql-uroot-pmysql zabbix <images. SQL
# Mysql-uroot-pmysql zabbix <schema. SQL

Compile and install zabbix

1./configure -- prefix =/usr/local/zabbix -- with-mysql -- with-net-snmp -- with-libcurl -- enable-server -- enable-agent -- enable-proxy

Compilation error checking for main in-lmysqlclient... no
Install mysql-devel in yum.
# Make
# Make install

Add service port

1. vim/etc/services
2. zabbix-agent 10050/tcp # Zabbix Agent
3. zabbix-agent 10050/udp # Zabbix Agent
4. zabbix-trapper 10051/tcp # Zabbix Trapper
5. zabbix-trapper 10051/udp # Zabbix Trapper

Add configuration file

# Mkdir-p/etc/zabbix
# Cp-r zabbix-2.203/conf/*/etc/zabbix/
# Chown-R zabbix: zabbix/etc/zabbix

Modify the server configuration file and add the zabbix Database Password
Vim/etc/zabbix/zabbix_server.conf

1. LogFile =/tmp/zabbix_server.log
2.

3. PidFile =/tmp/zabbix_server.pid
4.

5. DBName = zabbix
6.

7. DBUser = zabbix_user
8.

9. DBPassword = 123456 # specify the zabbix Database Password
10.

11. ListenIP = 192.168.10.197 # Server IP Address

Modify the Agentd configuration file and change the HOSTNAME to the hostname of the local machine.
Vim/etc/zabbix/zabbix_agentd.conf

1. PidFile =/tmp/zabbix_agentd.pid # process PID
2.

3. LogFile =/tmp/zabbix_agentd.log # log storage location
4.

5. EnableRemoteCommands = 1 # Allow Remote Command Execution
6.

7. Server = 192.168.10.197 # ip address of the agent
8.

9. Hostname = client1 # It must be the same as the host name created by zabbix

Set hostname

Add a PHP file in the web browser
# Cd zabbix-2.203/frontends/
# Cp-rf php/home/httpd/zabbix # virtual host directory
# Chown-R zabbix: zabbix

Web Front-end installation Configuration
Modify PHP Parameters
Vim php. ini

1. max_execution_time= 300
2. max_input_time = 300
3. memory_limit = 128 M
4. post_max_size = 32 M
5. date. timezone = Asia/Shanghai
6. mbstring. func_overload = 2

PHP must also support the following modules, which can be directly compiled and installed in the php source code package. The detailed module must be installed with a prompt.

Bcmath. so, gettext. so

Access zabbix in the browser of the client and start WEB Front-end configuration. For http: // ZabbixIP/zabbix, click Next as prompted.

Step 1: next step.

Step 2: if all are OK, you can perform the next installation. If an error occurs, return to the server to check whether the related software package is installed.

Step 3: enter the password of the mysql database account. If the database is not on the zabbix server, add the address of the database server to the Host and use the grant command to authorize the database.

Step 4: Enter the host name or host IP addres on the server;

The configuration file zabbix. conf. php is automatically written. After the configuration is complete, the logon interface is displayed. The default user name is admin and the password is zabbix.

3. Start the zabbix Service
In the zabbix installation directory, you can directly start
#/Usr/local/zabbix/sbin/zabbix_server start
Tcp 0 0 0.0.0.0: 10050 0.0.0.0: * LISTEN 7140/zabbix_agentd

4. Enable Automatic startup

Vim/etc/rc. d/rc. local Add the following two lines

1./usr/local/zabbix/sbin/zabbix_server start
2./usr/local/zabbix/sbin/zabbix_agentd start

So far, the zabbix server has been installed and can be accessed through a browser.

Next, we will introduce the use of client monitoring, the creation of monitoring templates, and the custom Monitoring Service.

Update: For Client installation, View

Some Zabbix Tutorials:

Compile and install Zabbix2.4.5 source code in Ubuntu 14.04

Install and deploy the distributed monitoring system Zabbix 2.06

Install and deploy the distributed monitoring system Zabbix 2.06

Install and deploy Zabbix in CentOS 6.3

Zabbix distributed monitoring system practice

Under CentOS 6.3, Zabbix monitors apache server-status

Monitoring MySQL database Parameters Using Zabbix in CentOS 6.3

Install Zabbix 2.0.6 in 64-bit CentOS 6.2

ZABBIX details: click here
ZABBIX: click here

This article permanently updates the link address:

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.