Linux Learning Summary (55) Monitoring Zabbix Deployment

Source: Internet
Author: User
Tags server port

A Zabbix monitoring introduction

c/S architecture, based on the development, Monitoring Center support Web Interface Configuration and management
Single server node can support tens of thousands of clients
Latest Version 3.4, Official document Https://www.zabbix.com/manuals
5 components
Zabbix-server Monitoring Center, receiving client escalation information, responsible for configuration, statistics, operation of data
Data storage to store data, such as MySQL
Web interface is also called Web UI, operating configuration under the Web interface is the main reason why Zabbix is easy to use.
Zabbix-proxy Optional component, which can replace the Zabbix-server function, reduce the pressure of the server
Zabbix-agent client software that collects data for each monitoring service or project and reports
Zabbix Monitoring principle Block diagram

Two service-side configuration

1 zabbix-server installation
First on the official network in the corresponding Yum source, that is, a RPM package
official website Www.zabbix.com/download
to find their own corresponding Linux system, such as CENTOS7 64-bit, Find released release release
rpm-i http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm
Yum Source storage location/etc/yum.repos.d/
Yum install
yum install-y zabbix-agent zabbix-server-mysql Zabbix-web-mysql zabbix-get zabbix-web
2 Zabbix database configuration
MySQL related actions
1) Set Chinese format
VIM/ETC/MY.CNF//require additional configuration
character_set_server = UTF8
start MySQL
/etc/init.d/mysqld start
2) Create users and databases
Enter database
mysql-uroot-plvlinux
Create Zabbix library
CREATE database Zabbix character set UTF8;
Re-create user
grant all on zabbix.*-' Zabbix ' @ ' 127.0.0.1 ' identified by ' Lv-zabbix ';
3) Import data
cd/usr/share/doc/zabbix-server-mysql-3.4.9/ tab completion find the corresponding directory
gzip-d create.sql.gz
mysql-uroot-pxxx Zabbix < create.sql -p after specifying the database login password

Three UI interface installation Zabbix

1 Start httpd
systemctl start httpd; systemctl enable httpd
Note: This is Zabbix the default associated Web server does not need to be configured to be used directly, very convenient. The default is port 8080, which can be changed in the configuration file/etc/httpd/conf/httpd.conf
2 Editing the Zabbix-server configuration file

vim /etc/zabbix/zabbix_server.conf //修改或增加DBHost=127.0.0.1 //在DBName=zabbix上面增加DBPassword=lv-zabbix //在DBuser下面增加

Note: The above information web interface to create Zabbix monitoring needs to verify that the content on the Web page and Zabbix configuration file is consistent, if the Zabbix configuration file is modified, the second time you log in, you need to modify the parentheses in the PHP file. (/etc/zabbix/web/zabbix.conf.php)

systemctl start zabbix-serversystemctl enable zabbix-servernetstat -lntp |grep zabbix //查看监听端口

3 Browser access and installation Zabbix
The browser accesses the Http://ip/zabbix/web interface under configuration Zabbix
Found a time zone error, PHP configuration under time zone
vim /etc/httpd/conf.d/zabbix.confAdd on the last side
php_value date.timezone Asia/ShanghaiOr
Echo ' Php_value date.timezone Asia/shanghai ' >>/etc/httpd/conf.d/zabbix.conf
Then restart the httpd.
systemctl restart httpd

Click Next to
After completing the login interface, user name admin initial password is Zabbix
The first thing to do in the background is to change the password
Change inside the Administration-user-admin
The inside can be set to Chinese display

Quad Client Installation and configuration

1 Client Installation
With the above installation of the service side of the same principle, first install the Yum source
rpm -i http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-2.el7.noarch.rpm
yum install -y zabbix-agent
2 Editing a configuration file
Modify the configuration file, both modes are configured with the appropriate server-side IP

vim  /etc/zabbix/zabbix_agentd.conf //修改如下配置 Server=127.0.0.1修改为Server=192.168.226.129 //定义服务端的ip(被动模式) ServerActive=127.0.0.1修改为ServerActive=192.168.226.129 //定义服务端的ip(主动模式)Hostname=Zabbix server修改为Hostname=lvlinux //这是自定义的主机名,一会还需要在web界面下设置同样的主机名

Start the client

systemctl start zabbix-agentsystemctl enable zabbix-agent  

Client default port 10050 server Port 10051

Preliminary use of five Zabbix

1 adding host groups, adding hosts
Configure-Host group-create host group-set group name
Configuration-host-create host, host name can be written as visible name, group Select the group you just created
IP Address Write client IP (note that this is the only path that Zabbix communicates with the monitored host and cannot be written incorrectly) my client is 192.168.226.130

2 Adding a template
Create an empty template first.
Configuration-templates-create Template
Specify a name, template name and visible name can be written as
Specify a group, select Templates, and finally click the bottom add
1) Copy the template from the existing template set to the new template
For example, copying templates from Templates OS Linux
Configuration-templates
To find Templates OS Linux, click on the corresponding ltems that is the project
Select the desired template, tick the front, click Copy
On the popup page, target type, select Templates
Target Select the template you just created, click Copy below
2) Import the entire template and filter out the required. (We need to discover the monitoring item inside, the item cannot be copied directly)
Link the new template to templates OS Linux first
templates-Select New template-Link template-Link new template
And then unlink, it's equivalent to copying a copy of the templates OS Linux
In the Just link template there, click Unlink (unlink)
Then delete the unused template, and then delete the empty app set. The template belongs to the app set. Cannot delete a non-empty app set
Delete the unused chart again
This completes the template configuration.
3 Host Connection templates
The above template is created, and the next step is to link the host to the template.
Configuration-Host-click on the created host name, then click on the template, and in the link indicator, select the template we have. Then click on the Select button below, click on Add, update
Now, let's go check the monitoring chart.
Detect in-graphics-groups, select Create groups, host choose created host, graph select our graphics item, one minute load, (can create a new graphic in template-graphics)
Here our entire environment even if fight up, can in the detection-instrument panel-The latest data, select our monitoring host, see there is data generation, if there is no need to check whether the host is added correctly.

Chinese garbled problem handling:
vim/usr/share/zabbix/include/defines.inc.php//Search Zbx_fontpath, it defines the path is "fonts", it is a relative path, the absolute path is/usr/share/zabbix/ Fonts, while the font file is "zbx_graph_font_name" defined by "Graphfont", it is a file with an absolute path of/usr/share/zabbix/fonts/graphfont
Windows font path is "C:\Windows\Fonts\", Find "Simfang.ttf" (actually that imitation Simplified), first copy it to the desktop, and then upload to the/usr/share/zabbix/fonts/of Linux, and renamed to Graphfont.ttf
or import a font file to do the following

mv graphfont.ttf graphfont.ttf_bakln -s simfang.ttf graphfont.ttf

Refresh the browser to see the Chinese display is normal

Linux Learning Summary (55) Monitoring Zabbix Deployment

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.