Zabbix implements Web monitoring based on Proxy distributed deployment
Preface
In daily O & M work, it is inevitable that one or more failures will occur. How can we find the fault in the first place and locate the Fault Cause in time to ensure that the business is not affected, I think this should be a skill that must be mastered in O & M. However, human resources cannot control system changes in real time, so the monitoring system emerged. monitoring is the eye of O & M. After monitoring and performance management are completed, O & M is a very easy task. Currently, popular open-source monitoring tools include Cacti, Nagios (Icinga), and Zabbix. In this article, Zabbix implements Web monitoring based on Proxy distributed deployment.
Zabbix Introduction
Zabbix is an enterprise-level open-source solution that provides distributed system monitoring and network monitoring functions based on the Web interface. It monitors various network parameters, ensures secure operation of server systems, and provides a flexible notification mechanism for system administrators to quickly locate and solve various problems.
Basic functions
Data collection methods: zabbix agent, agent (active), SNMP, SSH, etc.
Data Storage Methods: RDBMS, such as MySQL and Pgsql
Data Presentation Methods: php, web, and gui
Alarm function: supports alarm escalation
Components and infrastructure
Zabbix consists of zabbix server and zabbix agent.
The server collects monitoring data from the agent, stores the data in the database, analyzes and displays the data, and triggers related alarms.
The agent collects monitoring data and sends it to the server.
In addition to deploying the agent program on the monitored host, the data collection method can also monitor network devices through ICMP, IPMI, SNMP, and other protocols, you can also configure the web monitoring method to monitor important parameters such as the download rate and response time on the web page.
Zabbix proxy is a layered structure used to share the pressure on the server in large-scale distributed monitoring scenarios. The Proxy is only responsible for data collection in a certain area, then, the data is periodically sent to the server at a time, which greatly reduces the load pressure on the server and supports large-scale monitoring.
Some Zabbix Tutorials:
Compile and install Zabbix2.4.5 source code in Ubuntu 14.04
Install and deploy the distributed monitoring system Zabbix 2.06
Install and deploy the distributed monitoring system Zabbix 2.06
Install and deploy Zabbix in CentOS 6.3
Zabbix distributed monitoring system practice
Under CentOS 6.3, Zabbix monitors apache server-status
Monitoring MySQL database Parameters Using Zabbix in CentOS 6.3
Install Zabbix 2.0.6 in 64-bit CentOS 6.2
Implement Process Experiment Topology
# System environment: CentOS6.6 # Zabbix Server is LAMP environment # Zabbix Proxy requires database support # Zabbix Server and Zabbix Proxy need time synchronization, all nodes have been synchronized
Zabbix Server Configuration
Rapid LAMP construction
[root@node4 ~]# yum install httpd mysql mysql-libs php php-mysql mysql-server php-bcmathphp-gd php-mbstring -y
Software packages required to install Zabbix Server
[root@node4 ~]# cd zabbix-2.4/[root@scholar zabbix-2.4]# lszabbix-2.4.0-1.el6.x86_64.rpm zabbix-sender-2.4.0-1.el6.x86_64.rpmzabbix-agent-2.4.0-1.el6.x86_64.rpm zabbix-server-2.4.0-1.el6.x86_64.rpmzabbix-get-2.4.0-1.el6.x86_64.rpm zabbix-server-mysql-2.4.0-1.el6.x86_64.rpmzabbix-proxy-2.4.0-1.el6.x86_64.rpm zabbix-web-2.4.0-1.el6.noarch.rpmzabbix-proxy-mysql-2.4.0-1.el6.x86_64.rpm zabbix-web-mysql-2.4.0-1.el6.noarch.rpm[root@node4 zabbix-2.4]# yum install zabbix-2.4.0-1.el6.x86_64.rpm zabbix-agent-2.4.0-1.el6.x86_64.rpm zabbix-get-2.4.0-1.el6.x86_64.rpm zabbix-se* zabbix-web-* -y
Database preparation
[Root @ node4 ~] # Vim/etc/my. cnf [mysqld] default-character-set = utf8 # This option ensures that the zabbix Chinese interface is not garbled [root @ node4 ~] # Service mysqld startstartstarting mysqld: [OK] # authorize mysql> create database zabbix; Query OK, 1 row affected (0.01 sec) mysql> grant all on zabbix. * to 'zbuser' @ localhost identified by 'zbpass'; Query OK, 0 rows affected (0.09 sec) mysql> flush privileges; Query OK, 0 rows affected (0.00 sec) # import zabbix data [root @ node4 ~] # Cd/usr/share/doc/zabbix-server-mysql-2.4.0/create/[root @ node4 create] # mysql -- default-character-set = utf8 zabbix <schema. SQL [root @ node4 create] # mysql -- default-character-set = utf8 zabbix <images. SQL [root @ node4 create] # mysql -- default-character-set = utf8 zabbix <data. SQL # -- default-character-set = utf8
Configure Zabbix Server
[Root @ node4 ~] # Vim/etc/zabbix/zabbix_server.conf DBHost = localhost # specify database DBName = zabbix # Database Name DBUser = zbuser # Database User DBPassword = zbpass # Database Password # modify other parameters as needed [root @ node4 ~] # Vim/etc/zabbix/zabbix_agentd.conf # configure the agent to monitor your Server = 127.0.0.1, 172.16.10.126ServerActive = 127.0.0.1, 172.16.10.126Hostname = node4.scholar.com [root @ node4 ~] # Vim/etc/php. ini # configure the time zone date. timezone = Asia/Shanghai [root @ node4 ~] # Service httpd restartStopping httpd: [OK] Starting httpd: [OK] [root @ node4 ~] # Service zabbix-server startStarting Zabbix server: [OK] [root @ node4 ~] # Service zabbix-agent startStarting Zabbix agent: [OK]
Start Installation
Access http: // 172.16.10.126/zabbix
Installation check. If any error occurs, install the required dependency package.
Enter database information
Customizable Name
Next-Finish
The logon interface is as follows. The default user is admin and the password is zabbix.
Zabbix2.4 disables Chinese display by default.
[Root @ node4 ~] # Vim/usr/share/zabbix/include/locales. inc. php # Change false to true 'zh _ cn' => array ('name' => _ ('Chinese (zh_CN) '), 'display' => true ), # To prevent garbled characters, replace the default font with the primary body [root @ node4 ~] # Mv simkai. ttf/usr/share/zabbix/fonts/[root @ node4 ~] # Vim/usr/share/zabbix/include/defines. inc. phpdefine ('zbx _ GRAPH_FONT_NAME ', 'simbucai'); define ('zbx _ FONT_NAME', 'simbucai'); [root @ node4 ~] # Service httpd restartStopping httpd: [OK] Starting httpd: [OK]
Modify Language
Zabbix Server configuration first come here. Next we will configure Proxy and Agent
Zabbix Proxy configuration
Software packages required to install Zabbix Proxy
[root@node3 ~]# cd zabbix-2.4/[root@node3 zabbix-2.4]# lszabbix-2.4.0-1.el6.x86_64.rpm zabbix-sender-2.4.0-1.el6.x86_64.rpmzabbix-agent-2.4.0-1.el6.x86_64.rpm zabbix-server-2.4.0-1.el6.x86_64.rpmzabbix-get-2.4.0-1.el6.x86_64.rpm zabbix-server-mysql-2.4.0-1.el6.x86_64.rpmzabbix-proxy-2.4.0-1.el6.x86_64.rpm zabbix-web-2.4.0-1.el6.noarch.rpmzabbix-proxy-mysql-2.4.0-1.el6.x86_64.rpm zabbix-web-mysql-2.4.0-1.el6.noarch.rpm[root@node3 zabbix-2.4]# yum install zabbix-2.4.0-1.el6.x86_64.rpm zabbix-get-2.4.0-1.el6.x86_64.rpm zabbix-proxy-* -y
Database preparation
# Mysql> create database zabbix_proxy; Query OK, 1 row affected (0.00 sec) mysql> grant all on zabbix_proxy on the Proxy. * to 'zbuser' @ localhost identified by 'zbpass'; Query OK, 0 rows affected (0.00 sec) mysql> flush privileges; Query OK, 0 rows affected (0.06 sec) # import data [root @ node3 ~] # Mysql zabbix_proxy </usr/share/doc/zabbix-proxy-mysql-2.4.0/create/schema. SQL
Configure Zabbix Proxy
[Root @ node3 ~] # Vim/etc/zabbix/Login Server = 172.16.10.126 # point to Zabbix ServerHostname = hosts # host name DBHost = localhost # specify database DBName = zabbix_proxy # Database Name DBUser = zbuser # Database User DBPassword = zbpass # Database Password ConfigFrequency = 60 # configuration file synchronization interval DataSenderFrequency = 5 # data synchronization interval # modify other parameters as needed [root @ node3 ~] # Service zabbix-proxy startStarting Zabbix proxy: [OK]
For more details, please continue to read the highlights on the next page: