Zabbix deployment details

Source: Internet
Author: User
Tags symlink custom name disk usage
Introduction:
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.
Features:
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
  • Can be monitored without Agent
  • User security authentication and soft authorization Methods
  • Set or view monitoring results on the web interface
  • Email and other notification functions
    Function:
  • CPU load
  • Memory usage
    -Disk usage
  • Network Conditions
  • Port Monitoring
  • Log monitoring
    Lab environment:Centos7 (two servers: Monitoring Server and monitored server)
    Compilation package:Link: https://pan.baidu.com/s/19DvMqz0s01ByYBQl79ptqw
    Extraction code: ha42
    Lab steps:
    Set up a monitoring server:
    # Disabling the firewall ##
    [[Email protected] ~] # Systemctl stop firewalld. Service
    [[Email protected] ~] # Systemctl disable firewalld. Service
    Removed symlink/etc/systemd/system/multi-user.target.wants/firewalld. Service.
    Removed symlink/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
    [[Email protected] ~] # Setenforce 0

-------- Install lamp -------------------------------------------------------
[[Email protected] ~] # Yum install-Y \
Httpd \
Mariadb-server mariadb \
PHP \
Php-mysql \
Php-Gd \
Libjpeg *\
Php-LDAP \
Php-odbc \
Php-pear \
Php-XML \
Php-XMLRPC \
Php-mhash

[[Email protected] ~] # Vim/etc/httpd/CONF/httpd. conf
Servername www.yun.com: 80 #95
Directoryindex index.html index. php # Row 164

[[Email protected] ~] # Vim/etc/PHP. ini
Date. timezone = PRC # Set the China Time Zone in line 878 (remove the semicolon and add PRC)

[[Email protected] ~] # Systemctl start httpd. Service
[[Email protected] ~] # Systemctl start mariadb. Service
[[Email protected] ~] # Netstat-ntap | egrep '(3306 | 80 )'
TCP 0 0 0.0.0.0: 3306 0.0.0.0:Listen 45660/mysqld
Tcp6 0 0 ::: 80 :::
Listen 45388/httpd

[[Email protected] ~] # Mysql_secure_installation
Y
ABC123 (set your own password)
ABC123
N
N
N
Y

# Enter the database
[[Email protected] ~] # Mysql-uroot-P
Enter Password: # enter the password
Mariadb [(none)]> Create Database zabbix Character Set utf8 collate utf8_bin;
Query OK, 1 row affected (0.00 Sec)
Mariadb [(none)]> grant all privileges on.To 'zabbix' @ '%' identified by 'admin123 ';
Query OK, 0 rows affected (0.00 Sec)
Mariadb [(none)]> flush privileges;
Query OK, 0 rows affected (0.00 Sec)

# Test
[[Email protected] ~] # Cd/var/www/html/
[[Email protected] HTML] # Vim index. php
<? PHP
Phpinfo ();
?>
# Browser access server: 192.168.120.181

# Delete the original test statement after the test is completed
[[Email protected] HTML] # Vim index. php
<? PHP
$ Link = mysql_connect ('192. 168.120.181 ', 'zabbix', 'admin123 ');
If ($ link) echo "Else echo "Fail !! ";
Mysql_close ();
?>
# After modification, refresh the webpage

# If the webpage is success, you can skip this issue (if it is faill, follow these steps )##
------------- Solve the local login failure problem (can be ignored )---------------------------
[[Email protected] HTML] # mysql-uzabbix-P
Enter password:
Error 1045 (28000): Access denied for user 'zabbix' @ 'localhost' (using password: Yes)
# Error ##
# Solution:
# Access the root user database
[[Email protected] HTML] # mysql-uroot-P

Mariadb [(none)]> Select User, host from mysql. user;
+ -------- + ----------- +
| User | host |
+ -------- + ----------- +
| Zabbix | % |
| Root | 127.0.0.1 |
| Root |: 1 |
| Cacti |
| Root | cacti |
| Localhost |
| Root | localhost |
+ -------- + ----------- +
# Delete empty users
Mariadb [(none)]> drop user ''@ localhost;
Query OK, 0 rows affected (0.02 Sec)

Mariadb [(none)]> drop user ''@ cacti;
Query OK, 0 rows affected (0.00 Sec)

Mariadb [(none)]> Select User, host from mysql. user;
+ -------- + ----------- +
| User | host |
+ -------- + ----------- +
| Zabbix | % |
| Root | 127.0.0.1 |
| Root |: 1 |
| Root | cacti |
| Root | localhost |
+ -------- + ----------- +
# Empty users deleted

[[Email protected] HTML] # mysql-uzabbix-P
Enter password:
Mariadb [(none)]>
# Logon successful
---------------- Deploy zabbix server -------
[[Email protected] HTML] # Yum install PHP-bcmath PHP-mbstring-y
# Yum source files are automatically generated to ensure the system can access the Internet
[[Email protected] HTML] # rpm-IVH http://repo.zabbix.com/zabbix/3.5/rhel/7/x86_64/zabbix-release-3.5-1.el7.noarch.rpm
# Installation
[[Email protected] yum. Repos. d] # Yum install zabbix-server-mysql zabbix-web-mysql-y

# Generate database files. Do not enter the password as root (admin123 previously set)
[[Email protected] yum. Repos. d] # zcat/usr/share/doc/zabbix-server-mysql-4.0.0/create. SQL .gz | mysql-uzabbix-P zabbixenter password:

[[Email protected] yum. Repos. d] # grep-n '^' [A-Z]/etc/zabbix/zabbix_server.conf

38: logfile =/var/log/zabbix/zabbix_server.log
49: logfilesize = 0
72: pidfile =/var/run/zabbix/zabbix_server.pid
82: socketdir =/var/run/zabbix
101: dbname = zabbix
117: dbuser = zabbix
357: snmptrapperfile =/var/log/SNMPTRAP. Log
475: timeout = 4
518: alertscriptspath =/usr/lib/zabbix/alertscripts
529: externalscripts =/usr/lib/zabbix/externalscripts
565: logslowqueries = 3000

[[Email protected] yum. Repos. d] # Vim/etc/zabbix/zabbix_server.conf
Dbpassword = admin123 # Row 125

[[Email protected] yum. Repos. d] # Vim/etc/httpd/CONF. d/zabbix. conf
Php_value date. timezone Asia/Shanghai #20 (modify the time zone)

------------------ Corrected Chinese garbled characters in the chart ---------------------
[[Email protected] yum. Repos. d] # Vim/usr/share/zabbix/include/defines. Inc. php
# Shift: Input
: % S/graphfont/kaiti/g

# Mount a software package
[[Email protected] yum. Repos. d] # mkdir/ABC
[[Email protected] yum. Repos. d] # mount. CIFS // 192.168.100.10/rhel7/ABC
Password for [email protected] // 192.168.100.10/rhel7:
[[Email protected] yum. Repos. d] # cd/ABC/zabbix/
[[Email protected] zabbix] # ls
Php-bcmath-5.4.16-42.el7.x86_64.rpm php-mbstring-5.4.16-42.el7.x86_64.rpm stkaiti. TTF
[[Email protected] zabbix] # cp stkaiti. TTF/usr/share/zabbix/fonts/

# Start a service
[[Email protected] zabbix] # systemctl start zabbix-server.service
[[Email protected] zabbix] # systemctl enable zabbix-server.service
Created symlink from/etc/systemd/system/multi-user.target.wants/zabbix-server.service to/usr/lib/systemd/system/zabbix-server.service.
[[Email protected] zabbix] # netstat-anpt | grep zabbix
TCP 0 0 0.0.0.0: 10051 0.0.0.0:Listen 46594/zabbix_server
Tcp6 0 0 ::: 10051 :::
Listen 46594/zabbix_server
[[Email protected] zabbix] # systemctl restart httpd. Service
Http: // 192.168.120.181/zabbix // after installation, log on to the User Name Admin and password: zabbix






Set Chinese Environment

Administrator-users-click User-language settings


======= Configure the proxy-that is, the controlled server-if the server needs to be monitored by itself, you also need to install -- zabbix-Agent ====
[[Email protected] ~] # Systemctl stop firewalld. Service
[[Email protected] ~] # Systemctl disable firewalld. Service
Removed symlink/etc/systemd/system/multi-user.target.wants/firewalld. Service.
Removed symlink/etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[[Email protected] ~] # Setenforce 0
# Install Yum Source
[[Email protected] ~] # Rpm-IVH http://repo.zabbix.com/zabbix/3.5/rhel/7/x86_64/zabbix-release-3.5-1.el7.noarch.rpm
[[Email protected] ~] # Yum install-y zabbix-agent
[[Email protected] ~] # Vim/etc/zabbix/zabbix_agentd.conf
Server = 192.168.120.181 # Line 98 (the IP address is the previous monitoring server)
Serveractive = 192.168.120.181 #139 rows
Hostname = ABC #150 rows (custom name)
# Start a service
[[Email protected] ~] # Systemctl start zabbix-agent.service
[[Email protected] ~] # Systemctl enable zabbix-agent.service
Created symlink from/etc/systemd/system/multi-user.target.wants/zabbix-agent.service to/usr/lib/systemd/system/zabbix-agent.service.
[[Email protected] ~] # Netstat-ntap | grep 10050
TCP 0 0 0.0.0.0: 10050 0.0.0.0:Listen 45402/zabbix_agentd
Tcp6 0 0 ::: 10050 :::
Listen 45402/zabbix_agentd

Go to the webpage to set http: // 192.168.120.181/zabbix/


Select monitoring HTTP and SSH (defined for specific monitoring items)



This is a detailed description of how to set up zabbix and how to set up monitoring.

Zabbix deployment details

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.