Zabbix Introduction
Zabbix is an enterprise-class open source solution that provides distributed system monitoring and network monitoring capabilities based on a web interface
The Zabbix consists of the Zabbix server and the optional Component Zabbix Agent two departments.
Zabbix server can provide monitoring of remote server/network status through Snmp,zabbix agent,ping, port monitoring, and other methods.
The Zabbix agent needs to be installed on the target server being monitored, and it mainly completes the collection of information such as hardware information or operating system-related memory, CPU, etc.
Main functions:
CPU load, memory usage, disk usage, network condition, port monitoring, log monitoring
Zabbix is comprised of two parts, Zabbix server and Zabbix agent
Zabbix support A lot of monitoring methods, agent,agent active, simple monitoring, SNMP,SNMP trap and so on
Item-iterm defines the items of the monitored data, such as the memory usage of the host being monitored
Collection-application defines the summary of some items, the relationship of directories and files
Trigger-trigger determine the definition of host State by the data obtained by the project
Image-graph The data obtained by the project and displayed graphically
Template-template to summarize items, collections, triggers, graphs into a template, directly linked to a class of hosts for batch definition
Host-host monitored objects, servers or other network devices
Host group-host Group A class of hosts can be defined to a primary group
Action-action trigger Auto-discovery or auto-registration state change triggered action
Auto-discovery-discovery Add monitoring hosts in bulk by defining auto-discovery conditions and combining actions
Autoenrollment-auto-registration Agent sends registration requests to server, server definition autoenrollment Add bulk add main clause
Low-level Autodiscover (low_discovery): A case where a type has multiple items can be simply defined by low-level Autodiscover
For example, the disk capacity monitoring, usually the disk will have multiple partitions, we can use a definition to monitor the disk all partitions on the
Maintenance (maintenace): Define when a host is in maintenance state
topology map: Direct topology of hosts
screen (screents): Multiple types displayed in a screent
IT Services (IT service): Sometimes a host outage may not affect the service, IT service defines the limits of service tolerance degree
Instrument panel (dashboard): Monitor the overall status display
Overview (Overview): Displays data or trigger status for all machines
Web: Monitoring Web servers by defining scenarios
Latest data: View the latest data from the host project
Event: Record of change in trigger state
Zabbix Server Installation
First, install the dependency package
Yum install gcc net-snmp-devel curl-devel perl-dbi php-gd php-mysql php-bcmath php-mbstring php-xm *gettext* *gd* *libpng * *freetype* *libgpeg* Gd-devel mysql-devel
Second, server-side deployment
Installing the Database
MySQL installation here is slightly ....
Deploy the MySQL database and set up the appropriate Zabbix user
CREATE database Zabbix character set UTF8;
Grant all on zabbix.* to [email protected] '% ' identified by ' zabbixpass ';
Flush privileges;
2. Installing Apache
Apache installation here is slightly ...
3. Compiling and installing PHP
When deploying zabbix2.4, the following PHP environments are required
PHP version 5.3.0 above, GD library in more than 2.0, libxml 2.6 or more; Zabbix need gettext.so and bcmath.so two modules
./configure--prefix=/usr/local/php \ PHP installation directory
--WITH-APXS2=/USR/LOCAL/APACHE/BIN/APXS \ Apache Extension Plugin
--WITH-LIBXML-DIR=/USR/LOCAL/LIBXML2 \ libxml2 is an XML C-language parser that supports not only C language, but also C + + PHP Ruby, etc.
--enable-sockets \ Support Socket
--WITH-MYSQL=MYSQLND \ Mysqlnd is a PHP extension that uses the PHP memory management system, which is quite efficient in terms of memory usage
--WITH-MYSQLI \ PHP Connection Database module
--WITH-GETTEXT=/USR/LIB64 \ GetText Module
--enable-bcmath \ Math Function Module
--enable-mbstring \ mbstring Library, string function module, solve the problem of coding
--WITH-PNG-DIR=/USR/LIB64 \ PNG Picture format
--WITH-JPEG-DIR=/USR/LIB64 \ JPEG Picture format
--with-freetype-dir=/usr/lib64 \ Font
--WITH-GD=/USR/LOCAL/GD \ GD is an open source image processing library that supports images in png/jpeg/gif and other formats.
GD is typically used to create graphs, graphs, thumbnails, and other image-related processing operations
Make && make install
Add php.ini File
CP Php.ini-development/usr/local/php/lib/php.ini
Modify PHP Related parameters
Vim php.ini
Max_execution_time = 300
Max_input_time = 300
Memory_limit = 128M
Post_max_size = 32M
Date.timezone = Asia/shanghai
Note: The GD library needs to be deployed separately, downloaded and then compiled and installed (the location of the test installation is/USR/LOCAL/GD)
4. Installing the Zabbix Software
A. Adding Zabbix users
ID Zabbix && groupadd zabbix && useradd Zabbix | | echo "Zabbix is exist!"
B. Download the package
wget http://nchc.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/2.4.6/zabbix-2.4.6.tar.gz
C. Import initial data: Install sequential Import
Mysql-uroot-p Zabbix <schema.sql
Mysql-uroot-p Zabbix <images.sql
mysql-uroot-p Zabbix <data.sql
d. Compiling the installation
./configure \
--prefix=/usr/local/zabbix \
--with-mysql \ Use MySQL to do database server
--with-net-snmp \ Support SNMP
--with-libcurl \ Support curl, user Web monitoring
--enable-server \ Installing Zabbix server
--enable-agent \ Install Zabbix agent
--enable-proxy Installing Zabbix proxy
Make && make install
5. Modify the configuration file
Vim/usr/local/zabbix/etc/zabbix_server.conf
Logfile=/tmp/zabbix_server.log//log file location
dbhost=127.0.0.1//Database IP
Dbname=zabbix//Database
Dbuser=zabbix//user
Dbpassword=zabbixpass//password
dbport=3306//Database Password
listenip=192.168.36.130//zabbix listening IP, default listening port 10051
Vim/usr/local/zabbix/etc/zabbix_agentd.conf
Logfile=/tmp/zabbix_agentd.log//log file location
server=192.168.36.130//zabbix Server IP
serveractive=192.168.36.130//Open Active monitoring
HOSTNAME=SLAVE30 host name or IP on//agent side
Enableremotecommands=1//Allow remote command execution
6. Configure the Zabbix paging file by defining a new virtual host or by using alias aliases
CD zabbix-2.203/frontends/
CP-RF Php/home/httpd/zabbix #虚拟主机目录
7. The client browses the Http://IP/zabbix and then installs the prompt to step through the installation action
8. Start Zabbix
/usr/local/zabbix/sbin/zabbix_server//Start server side
/USR/LOCAL/ZABBIX/SBIN/ZABBIX_AGENTD//Start Client
9.NETSTAT-UNLTP | grep Zabbix//See if it starts
10. Add a startup script
Enter the Zabbix source directory under MISC/INIT.D to select the appropriate system
CP zabbix_agentd/etc/init.d/
CP zabbix_server/etc/init.d/
chmod +x zabbix*
11. Modify the page display font
You can replace the Zabbix font with the new C:\Windows\Fonts on Win7
[[Email protected]_server ~]# cd/var/www/zabbix/php/fonts//zabbix page file directory
[[Email protected]_server fonts]# ls
Dejavusans.ttf_bak Simsunb.ttf
[Email protected]_server fonts]# MV Simsunb.ttf Dejavusans.ttf
Problem
1.configure:error:not found Mysqlclient library
Workaround: Yum Install Mysql-devel
2.configure:error:unable to find LIBGD. (A|SO) >= 2.1.0 anywhere UNDER/USR/LOCAL/GD2
Workaround: Install gd2.1.1 or above and specify the installation directory of GD when compiling PHP
3. Garbled characters appear in the report
Workaround: Remove the "Chinese italic" file from C:\Windows\Fonts into the/var/www/zabbix/php/fonts (Zabbix's page file directory)
the name of the font Stkaiti.ttf
Cd/var/www/zabbix/php/include
Sed-i ' s/dejavusans/ stkaiti/g ' defines.inc.php
4.Zabbix Discoverer processes more than 75% busy use Zabbix when the discovery function is turned on, there is this alarm!
Workaround:
Cat zabbix_server.conf | Grep-ni startdiscoverers
166:### option:startdiscoverers
172:startdiscoverers=5 # #原来为1, modified to 5, the problem can be resolved, specific changes to how much, according to their own system performance to determine
5. Cannot explore the item, can be deleted in the database, find the Ts_delete field of the Item_discovery table is not 0 row
Use zabbix;delete from item_discovery where ts_delete>0;
6. What is the difference between configuration files zabbix_agent.conf and zabbix_agentd.conf?
zabbix_agent.conf is launched in a super-service (XINETD) manner .
zabbix_agentd.conf is initiated in a way that is independent of the process.
This article from "Banging blog" blog, declined reprint!
Zabbix Server Deployment