In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
1. Zabbix operating architecture
Zabbix is an enterprise-class distributed open source monitoring solution. It can monitor the health of various servers, the stability of the network and the reliability of various application systems. When an exception occurs in monitoring, Zabbix can configure an alarm mechanism based on email, SMS, Wechat and other alarm mechanisms for any event through a flexible alarm policy. All of this can be configured and operated through the web interface provided by Zabbix, and the web-based front-end page also provides excellent reporting and data visualization capabilities. These functions and features make it very easy for our operation and maintenance personnel to build a powerful operation and maintenance monitoring and management platform.
The operating architecture of Zabbix is as follows:
As you can see from the running architecture diagram above, Zabbix is mainly composed of several components, which are as follows:
1 、 Zabbix Server
Zabbix Server is the core component of Zabbix and the core memory of all configuration information, statistics and operation data. It is mainly responsible for receiving reports and information sent by the client. At the same time, all configuration, statistics and configuration operation data are organized by it.
2 、 Zabbix Database Storage
It is mainly used to store data, and all configuration information and data collected by Zabbix are stored in the database. You can use MySQL, oracle, SQLite, and so on.
3. Zabbix Web interface
This is the GUI interface provided by Zabbix and usually (but not necessarily) runs on the same physical machine as Zabbix Server.
4. Zabbix Proxy proxy server
This is an optional component and is often used in distributed monitoring environments. The agent Server can collect new energy and availability data for Zabbix and send them to the Zabbix Server.
5. Zabbix Agent monitoring agent
Zabbix Agent is deployed on the monitored host, can actively monitor local resources and applications, and is responsible for collecting data and sending it to Zabbix Server or Zabbix Proxy.
II. Zabbix monitoring terminology
In the Zabbix monitoring system, there are some common terms, the following is a brief introduction.
1. Host (host)
Represents a server or network device to be monitored, which can be specified by IP or hostname.
2. Host group (host group)
Logical group of hosts: it contains hosts and templates, but there is no direct relationship between hosts and templates within the same host group; host groups are usually used when assigning monitoring permissions to users or user groups.
3. Monitoring items (item)
Represents a specific object for monitoring, such as monitoring the CPU load of the server, disk space, etc. Item is the core of data collection in Zabbix. Relative to a monitoring object, each item is identified by "key".
4. Trigger (trigger)
In fact, it is a monitoring threshold expression, which is used to evaluate whether the data received by a monitoring object is within a reasonable range; if the received data is greater than the threshold, the state of the trigger will change from "OK" to "Problem", and to "OK" when the received data is lower than the threshold.
5. Application set (Applications)
A logical collection of monitoring items.
6. Action (action)
Refers to a pre-defined method of handling problems that occur in monitoring, such as sending notifications, when actions are performed, how often they are performed, and so on.
7. Type of alarm medium (media)
Indicates the means of sending notification and the way of alarm notification, such as Email, Jabber or SMS, etc.
8. Template (template)
A set of implementations that can be applied to one or more hosts. A template usually contains application sets, monitoring items, triggers, graphics, aggregation graphics, auto-discovery rules, web scenarios, and so on; templates can be linked directly to a host.
Template is a difficulty and key point in learning zabbix. In order to achieve batch and automatic monitoring, monitoring items with the same characteristics are usually collected into the template and then directly referenced in the host to achieve rapid monitoring and deployment.
Deploy the Zabbix monitoring platform
The deployment of Zabbix's monitoring platform is relatively simple, as long as the LNMP or LAMP environment is ready.
I will start the configuration here by deploying the LNMP environment.
Note: I deploy all the services on the same server here, which is only a simple monitoring architecture, and zabbix proxy is not deployed.
Official links to Zabbix:
Zabbix 4.2 configuration document: https://www.zabbix.com/documentation/4.2/manual/it_services
Required software package: https://pan.baidu.com/s/1UzzoFUuR84U2ccDf1qW2UQ
Extraction code: grhh
1. Deploy Nginx
[root@zabbix /] # mkdir / zabbix # personal habits Ignore [root@zabbix /] # cd zabbix/ [root@zabbix zabbix] # rz # shangchaun to upload the required source code package [root@zabbix zabbix] # tar zxf nginx-1.14.0.tar.gz [root@zabbix zabbix] # cd nginx-1.14.0/ [root@zabbix nginx-1.14.0] # yum-y install pcre-devel openssl-devel zlib-devel [root@zabbix zabbix] # cd nginx-1.14.0/ [root@zabbix nginx-1.14.0 ] # useradd-s / sbin/nologin-M www [root@zabbix nginx-1.14.0] #. / configure-- prefix=/usr/local/nginx-- with-http_dav_module-- with-http_stub_status_module-- with-http_addition_module-- with-http_sub_module-- with-http_flv_module-- with-http_mp4_module-- with-pcre=/usr/src/pcre-8.39-- with-zlib=/usr/ Src/zlib-1.2.8-with-http_ssl_module-with-http_gzip_static_module-user=www-group=www & & make & & make install [root@zabbix /] # ln-s / usr/local/nginx/sbin/nginx / usr/local/sbin/ [root@zabbix /] # vim / usr/local/nginx/conf/nginx.conf server {listen 80 Location / {root html; index index.php index.html index.htm; # add index.php} # Note to remove the comment symbol location ~\ .php$ {root html; fastcgi_pass 127.0.0.1 index.php 9000; fastcgi_index index.php in the following paragraphs Fastcgi_param SCRIPT_FILENAME / scripts$fastcgi_script_name; include fastcgi.conf; # modify this line} [root@zabbix /] # netstat-anput | grep 80tcp 00 0.0.0.0 root@zabbix 80 0.0.0.0 anput * LISTEN 46551/nginx: master [root@zabbix /] # cat > / usr/local/nginx/html/index.php > EOF
2. Deploy PHP
[root@zabbix /] # yum-y install libxml2-devel openssl-devel bzip2-devel libcurl-devel libjpeg-devel libpng-devel freetype-devel # install dependency package [root@zabbix /] # cd / zabbix/ [root@zabbix zabbix] # tar zxf libmcrypt-2.5.7.tar.gz [root@zabbix zabbix] # cd libmcrypt-2.5.7/ [root@zabbix libmcrypt-2.5.7] #. / configure-- prefix=/usr/local / libmcrypt & & make & & make install # compile and install [root@zabbix libmcrypt-2.5.7] # cd. [root@zabbix zabbix] # tar zxf php-5.6.27.tar.gz [root@zabbix php-5.6.27] #. / configure-- prefix=/usr/local/php5.6-- with-config-file-path=/etc-- with-mysql=mysqlnd-- with-mysqli=mysqlnd-- with-gd-- with-iconv-- with- Libxml-dir=/usr-- with-mhash-- with-mcrypt=/usr/local/libmcrypt-- with-config-file-scan-dir=/etc/php.d-- with-bz2-- with-zlib-- with-png-dir-- with-jpeg-dir-- enable-xml-- enable-bcmath-- enable-shmop-- enable-sysvsem-- enable-inline-optimization-- enable-mbregex-- enable-fpm-- enable-mbstring-- enable-ftp -- enable-gd-native-ttf-- with-openssl-- enable-pcntl-- enable-sockets-- with-xmlrpc-- enable-zip-- without-pear-- with-gettext-- enable-session-- with-curl & & make & & make install [root@zabbix php-5.6.27] # cp php.ini-production / etc/php.ini [root@zabbix php-5.6.27] # cp sapi/fpm/init.d.php-fpm / etc/init.d/php-fpm [root@zabbix php-5.6.27] # chmod + x / etc/init.d/php-fpm [root@zabbix php-5.6.27] # chkconfig-- add php-fpm [root@zabbix php-5.6.27] # chkconfig php-fpm on [root@zabbix php-5.6.27] # cp / usr/local/php5.6/etc/php-fpm.conf.default / usr/local/php5.6/etc/php-fpm. Conf [root@zabbix php-5.6.27] # cd / [root@zabbix /] # sed-I 's/pm.max_children = 5/pm.max_children = 50 sed g' / usr/local/php5.6/etc/php-fpm.conf [root@zabbix /] # sed-I 's/pm.start_servers = 2/pm.start_servers = 5DB g' / usr/local/php5.6/etc/php-fpm.conf [root@zabbix /] # sed -I 's/pm.min_spare_servers = 1/pm.min_spare_servers = 5gamma g' / usr/local/php5.6/etc/php-fpm.conf [root@zabbix /] # sed-I' s/pm.max_spare_servers = 3/pm.max_spare_servers = 35ppm g' / usr/local/php5.6/etc/php-fpm.conf [root@zabbix /] # service php-fpm start # launch phpStarting php-fpm done [ Root@zabbix /] # netstat-anput | grep 9000tcp 00 127.0.0.1anput 9000 0.0.0.0 LISTEN 60347/php-fpm: mast
Client accesses the defined php page:
3. Install and configure MySQL database
[root@zabbix ~] # sh mysql.sh # executes the script and waits for the following prompt to indicate successful installation of Starting MySQL. SUCCESS! Mysql: [Warning] Using a password on the command line interface can be insecure. [root@zabbix ~] # mysql-uroot-p123 # Log in to MySQLmysql > create database zabbix character set utf8;mysql > grant all on zabbix.* to zabbix@'localhost' identified by '123.compositionTactical MySQL > grant all on zabbix.* to zabbix@'192.168.171.%' identified by' 123.compositionShield MySQL > exit
4. Deploy zabbix service
[root@zabbix zabbix] # tar zxf fping-3.12.tar.gz [root@zabbix zabbix] # tar zxf zabbix-3.2.1.tar.gz [root@zabbix zabbix] # cd fping-3.12/ [root@zabbix fping-3.12] #. / configure & & make & & make install [root@zabbix fping-3.12] # cd.. / zabbix-3.2.1/ [root@zabbix zabbix-3.2.1] # useradd-M-s / sbin/nologin zabbix [root@zabbix zabbix-3.2.1] # chown zabbix:zabbix / usr/local/sbin/fping [root@zabbix zabbix-3.2.1] # yum-y install net-snmp net-snmp-devel curl-devel java-1.8.0-openjdk java-1.8.0-openjdk-devel OpenIPMI-devel libssh3-devel [root@zabbix zabbix-3.2.1] #. / configure-- prefix=/usr/local/zabbix-- enable-server-- enable-agent-- enable-java -- with-mysql=/usr/local/mysql/bin/mysql_config-- with-net-snmp-- with-libcurl-- with-openipmi & & make & & make install#--enable-java: convenient for subsequent monitoring of tomcat programs #-- with-openipmi: users can use IPMI to monitor the physical characteristics of the server For example, temperature, voltage, fan working status, power supply, etc. [root@zabbix zabbix-3.2.1] # ln-s / usr/local/zabbix/bin/* / usr/local/bin/ [root@zabbix zabbix-3.2.1] # ln-s / usr/local/zabbix/sbin/* / usr/local/sbin/# Import zabbix data into MySQL, pay attention to the order of import. If a prompt is returned after import, it can be ignored. Because the imported command displays the password on the terminal [root@zabbix zabbix-3.2.1] # pwd/zabbix/zabbix-3.2.1 [root@zabbix zabbix-3.2.1] # cd database/mysql/ [root@zabbix mysql] # mysql-u zabbix- p123.com-h localhost zabbix
< schema.sql mysql: [Warning] Using a password on the command line interface can be insecure.[root@zabbix mysql]# mysql -u zabbix -p123.com -h localhost zabbix < images.sql mysql: [Warning] Using a password on the command line interface can be insecure.[root@zabbix mysql]# mysql -u zabbix -p123.com -h localhost zabbix < data.sql mysql: [Warning] Using a password on the command line interface can be insecure.[root@zabbix mysql]# chown -R zabbix:zabbix /usr/local/zabbix/ 5、优化zabbix并启动 #修改zabbix配置文件[root@zabbix /]# sed -i 's/# ListenPort=10051/ListenPort=10051/g' /usr/local/zabbix/etc/zabbix_server.conf[root@zabbix /]# sed -i 's/LogFile=\/tmp\/zabbix_server.log/LogFile=\/usr\/local\/zabbix\/logs\/zabbix_server.log/g' /usr/local/zabbix/etc/zabbix_server.conf[root@zabbix /]# sed -i 's/# PidFile=\/tmp\/zabbix_server.pid/PidFile=\/usr\/local\/zabbix\/logs\/zabbix_server.pid/g' /usr/local/zabbix/etc/zabbix_server.conf[root@zabbix /]# sed -i 's/# DBHost=localhost/DBHost=localhost/g' /usr/local/zabbix/etc/zabbix_server.conf[root@zabbix /]# sed -i 's/# DBPassword=/DBPassword=123.com/g' /usr/local/zabbix/etc/zabbix_server.conf[root@zabbix /]# sed -i 's/# DBSocket=\/tmp\/mysql.sock/DBSocket=\/usr\/local\/mysql\/mysql.sock/g' /usr/local/zabbix/etc/zabbix_server.conf[root@zabbix /]# sed -i 's/# DBPort=3306/DBPort=3306/g' /usr/local/zabbix/etc/zabbix_server.conf[root@zabbix /]# sed -i 's/# FpingLocation=\/usr\/sbin\/fping/FpingLocation=\/usr\/local\/sbin\/fping/g' /usr/local/zabbix/etc/zabbix_server.conf[root@zabbix /]# sed -i 's/# LogSlowQueries=0/LogSlowQueries=3000/g' /usr/local/zabbix/etc/zabbix_server.conf#如果数据库名称和数据库用户没有和我创建的一样,那么还需要更改以下两项#DBName=zabbix #数据库名称#DBUser=zabbix #登录数据库的用户名[root@zabbix /]# echo "/usr/local/mysql/lib" >> / etc/ld.so.conf [root@zabbix /] # ldconfig # refresh the configuration changed above [root@zabbix /] # mkdir / usr/local/zabbix/logs [root@zabbix /] # chown-R zabbix:zabbix / usr/local/zabbix/ [root@zabbix /] # cd / zabbix/zabbix-3.2.1/misc/init.d/fedora/core [root@zabbix core] # cp zabbix_agentd / etc/init.d/ [root@zabbix Core] # cp zabbix_server / etc/init.d/ [root@zabbix core] # sed-I usr Baseir =\ / usr\ / local/BASEDIR=\ / usr\ / local\ / zabbix/g' / etc/init.d/zabbix_server [root@zabbix core] # sed-I's Universe PIDFILES =\ / tmp\ / $BINARY_NAME.pid/PIDFILE=\ / usr\ / local\ / zabbix\ / logs\ / $BINARY_NAME.pid/g' / etc/init.d/zabbix_server [root @ zabbix core] # / etc/init.d/zabbix_server start # launch zabbix You can also execute "zabbix-server" to launch Reloading systemd: [OK] Starting zabbix_server (via systemctl): [OK] [root@zabbix core] # netstat-anput | grep 10051tcp 00 0.0.0.0 OK 10051 0.0.0.0 * LISTEN 74199 / zabbix_server [root@zabbix core] # cd / zabbix/zabbix-3.2.1/frontends/ [root@zabbix frontends] # cp-r php/ / usr/local/nginx/html/zabbix
6. Client accesses the nginx agent to configure zabbix
Just visit the IP/zabbix of the Nignx server, which automatically jumps to the following page:
The error shown above is probably because the configuration item of php does not meet its requirements:
[root@zabbix /] # sed-I 's/post_max_size = 8M/post_max_size = 16m etc/php.ini g' / etc/php.ini [root@zabbix /] # sed-I 's/max_execution_time = 30/max_execution_time = 300 s/max_input_time g' / etc/php.ini [root@zabbix /] # sed-I 's/max_input_time = 60/max_input_time = 300pm g' / etc/php.ini [root@zabbix /] # sed-I's / Date.timezone = / date.timezone = Asia\ / Shanghai/g' / etc/php.ini [root@zabbix /] # sed-I's Gracefully shutting down php-fpm restart service Gracefully shutting down php-fpm. DoneStarting php-fpm done
Another error was reported, indicating that the configuration file could not be created. Let's manually download the configuration file and upload it to the specified directory, then click download.
[root@zabbix /] # ls / usr/local/nginx/html/zabbix/conf/zabbix.conf.php/usr/local/nginx/html/zabbix/conf/zabbix.conf.php
Enter the zabbix username and password to log in (default username: admin, password: zabbix):
7. Solve the problem of Chinese garbled in the subsequent production of charts.
[root@zabbix ~] # cd / usr/local/nginx/html/zabbix/fonts/ # switch to the directory [root@zabbix fonts] # rz [root@zabbix fonts] # lsDejaVuSans.ttf simkai.ttf [root@zabbix fonts] # sed-I's Unip DejaVuSansUnixsimkaiUniG' / usr/local/nginx/html/zabbix/include/defines.inc.php
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.