Deploy zabbix Monitoring Service in lamp Architecture

Source: Internet
Author: User
Zabbix Monitoring Service

Zabbix is an enterprise-level open-source solution that provides distributed system monitoring and network monitoring functions based on the Web interface. Zabbix can monitor various network parameters to ensure secure operation of server systems. It also provides a flexible notification mechanism for system administrators to quickly locate and solve various problems.
Zabbix consists of two parts: zabbix server and the optional component zabbix agent.
Zabbix server can provide remote server/network status monitoring, data collection and other functions through SNMP, zabbix agent, ping, port monitoring and other methods, it can run in Linux, Solaris, HP-UX, aix, Free BSD, open BSD, OS X, and other platforms.

Environment
System IP address Components
Centos7 192.168.71.128 Lamp + zabbix-server-mysq + zabbix-web-MySQL
Centos7 192.168.71.129 Zabbix-agent
Kaiti Character Set Source code package

Kaiti source code package password: dzr8

1. monitoring end Configuration

1. Disable the Firewall

[[Email protected] ~] # Systemctl stop firewalld. Service
[[Email protected] ~] # Systemctl disable firewalld. Service
[[Email protected] ~] # Setenforce 0

2. Build a lamp architecture on the monitoring end

[[Email protected] ~] # Yum install httpd mariadb-server mariadb PHP-mysql PHP-Gd libjpeg * PHP-ldap php-odbc php-pear PHP-xml php-xmlrpc php-mhash-y

3. Modify the httpd and PHP configuration files.

[[Email protected] ~] # Vim/etc/httpd/CONF/httpd. conf


[[Email protected] ~] # Vim/etc/PHP. ini

4. Enable httpd and MySQL services

[[Email protected] ~] # Systemctl start httpd. Service
[[Email protected] ~] # Systemctl start mariadb. Service

5. Check the httpd and MySQL ports.

[[Email protected] ~] # Netstat-ntap | egrep '(80 | 3306 )'
TCP 0 0 0.0.0.0: 3306 0.0.0.0:Listen 2432/mysqld
Tcp6 0 0 ::: 80 :::
Listen 2130/httpd

6. Perform basic settings on the MySQL database

[[Email protected] ~] # Mysql_secure_installation

Enter current password for root (enter for none): # If no password is configured for the database for the first time, press enter SET root password? [Y/n] y # Do you want to set the Database Root Password new password: # enter the password re-enter new password: # confirm the password again remove Anonymous users? [Y/n] n # Remove anonymous user disallow root login remotely? [Y/n] n # root users are not allowed to remotely log on to remove test database and access to it? [Y/n] n # Is the test database databasereload privilege tables now removed? [Y/n] y # Whether to refresh the permission list now

7. Go to the database to create the zabbix database and authorize

8. Test the PHP connection to the database.

[[Email protected] ~] # Vim/var/www/html/index. php

<? PHP $ link = mysql_connect ('2017. 168.71.128 ', 'zabbix', 'admin123'); # connect to the zabbix database. Password: admin123 if ($ link) echo "& lt; H1 & gt; success !! & Lt;/H1 & gt; "; # Return successelse echo" Fail !! "; # Connection failure range: failmysql_close ();? & Gt;
(Solve the problem of database connection failure error 1045 (28000): Access denied for user 'zabbix' @ 'localhost' (using password: Yes) This is because a user is empty, therefore, you need to delete empty users to connect.

9. view web pages

10. install PHP components and zabbix

[[Email protected] ~] # Yum install PHP-bcmath PHP-mbstring-y [[email protected] ~] # Rpm-IVH http://repo.zabbix.com/zabbix/3.5/rhel/7/x86_64/zabbix-release-3.5-1.el7.noarch.rpm # Install zabbix's yum source [[email protected] ~] # Yum install zabbix-server-mysql zabbix-web-mysql-y

11. Import the corresponding content to the database according to the settings on the official website.

[[Email protected] ~] # Zcat/usr/share/doc/zabbix-server-mysql-4.0.0/create. SQL .gz | mysql-uzabbix-P zabbixenter password: # enter the password of the zabbix authorized user here. If login is denied, refresh the permission on the new database.

12. filter the content in the zabbix configuration file, as shown below:

[[Email protected] ~] # Grep-n' ^ '[A-Z]/etc/zabbix/zabbix_server.conf

13. Modify the time zone

[[Email protected] ~] # Vim/etc/httpd/CONF. d/zabbix. conf

14. Solve the zabbix webpage garbled Problem

[[Email protected] ~] # Vim/usr/share/zabbix/include/defines. Inc. php
: % S/graphfont/kaiti/G # Use the command line mode of the VI editor to replace

15. Copy the character set to the specified zabbix file.

[[Email protected] zabbix] # cp stkaiti. TTF/usr/share/zabbix/fonts/
[[Email protected] zabbix] # ls/usr/share/zabbix/fonts/
Graphfont. TTF stkaiti. TTF

16. Enable the zabbix service and restart the HTTPd service.

[Email protected] zabbix] # systemctl start zabbix-server.service
[[Email protected] zabbix] # systemctl restart httpd. Service

17. Install zabbix on the webpage






(After the installation is complete, log on to the zabbix console using the default account admin password)

2. configuration on the monitored end

1. Disable the Firewall

[[Email protected] ~] # Systemctl stop firewalld. Service
[[Email protected] ~] # Systemctl disable firewalld. Service
[[Email protected] ~] # Setenforce 0

2. Install the zabbix proxy service on the monitored side.

[[Email protected] ~] # Rpm-IVH http://repo.zabbix.com/zabbix/3.5/rhel/7/x86_64/zabbix-release-3.5-1.el7.noarch.rpm # Install the epel source [[email protected] ~] # Yum install zabbix-agent-y # Install the agent service on the monitored side

3. Modify the proxy configuration file

[[Email protected] ~] # Grep-n' ^ '[A-Z]/etc/zabbix/zabbix_agentd.conf

4. Start services on the proxy

[[Email protected] ~] # Systemctl start zabbix-agent.service

5. Check the port

[[Email protected] ~] # Netstat-ntap | grep 10050
TCP 0 0 0.0.0.0: 10050 0.0.0.0:Listen 37005/zabbix_agentd
Tcp6 0 0 ::: 10050 :::
Listen 37005/zabbix_agentd

Deploy zabbix Monitoring Service in lamp Architecture

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.