Zabbix is an enterprise-level distributed open source monitoring solution. Ability to monitor various network parameters and server health and integrity. Support flexible notification mechanism, provide excellent reports and [Data Visualization] (https://cloud.tencent.com/product/yuntu?from=10680) function. Zabbix supports active polling and passive capture. The most important thing is that the source code is distributed for free and can be used by the public at will. This is also one of the important reasons why it is widely popular among small and medium enterprises. This article briefly describes Zabbix features and the installation of Zabbix 3.4 based on CentOS 7.
data collection
Availability and performance check
Support SNMP (including capture and active rotation training), IPMI, JMX, VMware monitoring
Custom check
Collect required data at custom intervals
Executed by Server/Proxy and agents
Flexible threshold definition
Highly configurable alarm
Real-time charting
Use the built-in chart drawing function to immediately draw the content of the monitored item into a chart
Web monitoring function
Support custom graphics
Rich visualization options
Multiple monitoring item combinations are displayed in one view
Network topology diagram
Group inspection based on template
Secure user authentication
Written in C language, high performance
Server
Zabbix Server is the core storage for all configuration information, statistics and operating data. Used to report system availability, system completion integrity and statistical information, etc.
Data storage
The configuration information and the data collected by Zabbix are stored in the database, supporting mysql, pg, oracle.
Web display
Provides a web-based access interface (written in PHP language)
Client
Zabbix agents monitoring agents are deployed on monitoring targets, can actively monitor local resources and applications, and report the collected data to Zabbix Server.
Proxy proxy server
Zabbix proxy can collect performance and availability data for Zabbix Server. Proxy proxy server is an optional deployment part of Zabbix software; of course, Proxy proxy server can help a single Zabbix Server share the load pressure.
# more /etc/redhat-release ##Demo environment
CentOS Linux release 7.4.1708(Core)
# vi /etc/selinux/config ##Close selinux
SELINUX=disabled
# setenforce 0
# yum install mariadb-server mariadb -y ##Install mariadb database
# systemctl start mariadb
# systemctl enable mariadb
## Add zabbix yum source, install zabbix server and web management
# rpm -ivh http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-1.el7.centos.noarch.rpm
# yum install zabbix-server-mysql zabbix-web-mysql -y
# mysql ##Log in to mysql to create a database and directory
Welcome to the MariaDB monitor. Commands end with; or \g.
Your MariaDB connection id is 3
Server version:5.5.56-MariaDB MariaDB Server
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 zabbix.* to zabbix@localhost identified by 'zabbix#1235';
Query OK,0 rows affected(0.00 sec)
## Add zabbix metadata to mariadb
# zcat /usr/share/doc/zabbix-server-mysql-3.4.4/create.sql.gz | mysql -uzabbix -pzabbix#1235 zabbix
# cp /etc/zabbix/zabbix_server.conf /etc/zabbix/zabbix_server.conf.1121
# vim /etc/zabbix/zabbix_server.conf ##Use the default configuration, only set the database password
DBPassword=zabbix#1235
# vim /etc/httpd/conf.d/zabbix.conf ##Modify apache zabbix time zone
php_value date.timezone Asia/Shanghai
# cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.bk
# vim /etc/httpd/conf/httpd.conf ##Author : Leshami
Listen 3080 ##The non-default port 80 is used here##Blog : http://blog.csdn.net/leshami
Start related services
# systemctl start zabbix-server.service
# systemctl enable zabbix-server.service
# systemctl start httpd
# systemctl enable httpd
# netstat -nltp|egrep "zabbix|httpd|mysql"
tcp 000.0.0.0:100510.0.0.0:* LISTEN 15720/zabbix_server
tcp 000.0.0.0:30800.0.0.0:* LISTEN 15385/httpd
tcp 000.0.0.0:33060.0.0.0:* LISTEN 14146/mysqld
tcp6 00:::10051:::* LISTEN 15720/zabbix_server
Firewall configuration
# firewall-cmd --add-port=3080/tcp --permanent
# firewall-cmd --add-port=10051/tcp --permanent
# systemctl reload firewalld.service
Open the browser and enter http://yourip:port/zabbix
Environmental configuration detection, if it is not OK, return to the previous step for troubleshooting
Configure the connection to the database below
Server name and port configuration
finish installation
Login, default user name Admin, password zabbix
For zabbix server, itself can also be monitored. For its own monitoring, the agent side should also be installed
For non-native agent installation, you should configure the yum source first, then install the agent side, modify the agent configuration file to point to the server side
# yum install zabbix-agent -y
# systemctl enable zabbix-agent.service
Agent configuration
[ root@ydq-mnt zabbix]# vim /etc/zabbix/zabbix_agentd.conf
Server=127.0.0.1,10.80.234.38
ServerActive=127.0.0.1,10.80.234.38
# systemctl start zabbix-agent.service
1、 Before installation, it is recommended to configure the server and client /etc/hosts files, that is, add the IP mapping relationship between the server and the client to the current host
2、 Use a uniform Hostname in the server-side and agent-side configuration files, which are case sensitive. Otherwise, it is easy to fail to connect
3、 Open the firewall port, for non-local agent side, open port 10050
Recommended Posts