Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Monitoring system and zabbix Foundation (1)

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Monitoring system and zabbix Foundation (1)

=

Overview:

In this chapter, we will introduce the monitoring system in Linux, zabbix. The details are as follows:

Overview and function introduction of Monitoring system

Zabbix system architecture, functions and related terms

Installation, configuration and startup of zabbix-server

Installation, configuration and startup of zabbix-web

=

Monitor and control system

1. Introduction of monitoring system

★ monitoring metrics:

Hardware: such as cpu utilization, memory space, etc.

Software: software programs such as nginx, number of processes, etc.

Business: concurrent online quantity, number of things, etc.

The functions of the ★ monitoring system:

Sampling: sensor (sensor)

Storage:

Data: historical data, trend data

Presentation: user interface display system

Report to the police:

★ monitored object:

Host, switch, router, UPS,...

two。 Introduction to the functions of the monitoring system

★ sampling:

Periodically obtain data related to an indicator of concern

☉ monitoring system collects data channels:

◆ ssh/telnet: remote connection channel

◆ agent:

Master/agent architecture

Master:NMS (Network Management system)

◆ IPMI:

Intelligent platform management interface

◆ SNMP:

Simple Network Management Protocol (simple Network Management Protocol)

Version: V1, V2C (community, public), v3

◆ JMX:

Java Management extension (java Management extension)

Monitoring JVM:Java Virtual Machine

★ storage system:

☉ stores data

Historical data: the result of each sample is saved for a short time.

Trend data: aggregate data and save data over a long period of time

☉ storage system:

Relational databases: MySQL, PGSQL, Oracle,...

Rrd:RoundRobin Database circular database

NoSQL:redis/mongo, time series database

★ alarm:

Email, SMS, Wechat

Script implementation

★ presentation:

WebGUI

GUI (graphical interface)

APP

★ open source monitoring project:

Cacti, nagios

Zabbix (all features are supported)

Ganglia

Zabbix introduction

1. Version and featur

Introduction to ★

Is an enterprise-level open source solution based on WEB interface that provides distributed system monitoring and network monitoring functions

Zabbix can monitor various network parameters to ensure the safe operation of the server system, and provides a flexible notification mechanism to enable system administrators to quickly locate / solve various problems.

Zabbix consists of two parts, zabbix server and 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 on platforms such as Linux,Solaris,HP-UX,AIX,Free BSD,Open BSD,OS X.

★ Version:

LTS:Long Time Support (long-maintained version)

Version 3.0 is the version that has been maintained for a long time

★ features:

Data sampling mechanism: snmp, agent, ipmi, jmx

Alarm: upgrade, step by step

Data storage: mysql/pgsql

Show: php program

Real-time drawing: graph, screen, slide show (slide show), map

Support for monitoring templates

Network automatic discovery

Distributed monitoring

API: support secondary development

2.zabbix system architecture, components and related terminology

★ Zabbix program components

☉ Zabbix Server:

The core component responsible for receiving report information sent by agent, and all configuration, statistics and operational data are organized by it

☉ zabbix_database Storage:

Dedicated to storing all configuration information, as well as data collected by zabbix; MySQL/PGSQL

☉ zabbix_web:

Zabbix's GUI interface, which usually runs on the same machine as server

☉ zabbix_proxy:

Optional component, often used in distributed monitoring environment, the agent Server collects part of the monitored data and sends it to the server

☉ zabbix_agentd

Deployed on the monitored host, responsible for collecting local data and sending it to Server or proxy

☉ zabbix_get:

Command line tool to test initiating a data collection request to the agent side

☉ zabbix_sender:

Command line, testing to send data to the server

☉ zabbix_java_gateway:

Java Gateway

Figure 1:

Zabbix macro architecture diagram

Figure 2

Specific working diagram of zabbix

★ Zabbix common terms (logical components)

☉ host (host):

The network device to be monitored, which can be specified by IP or DNS name

☉ host group (host group):

The logical container of a host, which can contain hosts and templates, but hosts and templates within the same group cannot be linked to each other; host groups are usually used when assigning monitoring permissions to users or user groups

☉ item (monitoring item):

Data related to a specific monitoring indicator, which comes from the monitored object; item is the core of data collection in zabbix. Without item, there will be no data; relative to a monitoring object, each item is identified by "key".

☉ application (application):

A collection of item

☉ trigger (trigger):

An expression used to evaluate whether the data received within a particular item of a monitoring object is within a reasonable range, that is, a threshold; if the data received is greater than the threshold, the state of the trigger will change from OK to Problem, and when the amount of data returns to a reasonable range, its state will change from Problem to OK

☉ event:

That is, an event of concern, such as the state transition of the trigger, the automatic registration of a new agent or a re-online agent, etc.

☉ action (Action):

Refers to a pre-defined method of handling a particular event by including actions (such as sending notifications) and conditions (when actions are performed)

☉ media (Media):

Means and channels for sending notifications, such as Email, Jabber, or SMS

☉ notification (notification):

Information about an event sent to a user through a selected medium

☉ remote command (remote command):

Predefined commands that can be executed automatically when the monitored host is under certain conditions

☉ escalation (alarm upgrade):

A custom scheme for sending alerts or executing remote commands, such as sending alerts every 5min for a total of 5 times, etc.

☉ template (template):

A collection of preset entries for quickly defining monitored hosts, usually containing item, trigger, graph, screen, application, and low-level discovery rule; templates that can be linked directly to a single host

☉ web scennaro (web scene):

One or more http requests used to test the availability of a web site

☉ frontend (front end):

Web interface of zabbix

☉ graphics (graph)

☉ screen (screens)

☉ Slide (slide show)

Figure 3

Zabbix logical architecture:

Zabbix Server installation, configuration, and startup

1. Installation configuration process

★ zabbix database

Mysql > CREATE DATABASE zabbix CHARSET 'utf8'

Mysql > GRANT ALL ON zabbix.* TO 'zbxuser'@'10.1.%.%' IDENTIFIED BY' zbxpass'

★ installation server side

☉ installation

# yum install zabbix-server-mysql-3.0.2-1.el7.x86_64.rpm zabbix-get-3.0.2-1.el7.x86_64.rpm

☉ program environment

Configuration file: / etc/zabbix/zabbix_server.conf

Unit File:zabbix-server.service

☉ imports the database script to generate the database environment:

# gzip-d / usr/share/doc/zabbix-server-mysql-3.0.2/create.sql.gz

# mysql-uzbxuser-h227.0.0.1-pzbxpass zabbix

< /usr/share/doc/zabbix-server-mysql-3.0.2/create.sql 注意: zabbix 2的sql脚本有三个,需要依次导入; ★zabbix server配置启动 演示: 操作环境:CentOS 7 虚拟机 ------------------------------------------------------------------------------------------------------ 1.设置zabbix database,创建一个数据库,并授权一个用户有权限连接并使用此数据库 1)mariadb安装,配置,及启动 # 在CentOS 7 安装mariadb数据库,使用前要首先编辑其配置文件/etc/my.cnf,添加跳过名称解析等[root@centos7 ~]# vim /etc/my.cnfskip_name_resolve = ONinnodb_file_per_table = ON# 启动数据库,可以设置开机自启动[root@centos7 ~]# systemctl start mariadb.service[root@centos7 ~]# systemctl enabled mariadb.service 2)创建zabbix database数据库,并授权一个用户可以远程和本地登录此数据库; [root@centos7 ~]# mysql -p134296Welcome to the MariaDB monitor. Commands end with ; or \g.Your MariaDB connection id is 3Server version: 5.5.44-MariaDB MariaDB ServerCopyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.MariaDB [(none)]>

Create database zabbix charset 'utf8';Query OK, 1 row affected (0.00 sec) MariaDB [(none)] > GRANT ALL ON zabbix.* TO' zbxuser'@'10.1.%.%' IDENTIFIED BY 'zbxpass';Query OK, 0 rows affected (0.00 sec) MariaDB [(none)] > GRANT ALL ON zabbix.* TO' zbxuser'@'127.0.0.1' IDENTIFIED BY 'zbxpass';Query OK, 0 rows affected (0.01 sec) MariaDB [(none)] > FLUSH PRIVILEGES Query OK, 0 rows affected (0.01sec) MariaDB [(none)] > show databases +-+ | Database | +-+ | information_schema | | Syslog | | mydb | | mysql | | performance_schema | | test | | ultrax | | zabbix | +- -+ 8 rows in set (0.08 sec)

two。 Install the server side

1) download all packages related to zabbix

# here are all the packages of zabbix 3.0.2 that I downloaded [root@centos7 zabbix] # lszabbix-agent-3.0.2-1.el7.x86_64.rpm zabbix-proxy-sqlite3-3.0.2-1.el7.x86_64.rpm zabbix-web-japanese-3.0.2-1.el7.noarch.rpmzabbix-get-3.0.2-1.el7.x86_64.rpm zabbix-sender- 3.0.2-1.el7.x86_64.rpm zabbix-web-mysql-3.0.2-1.el7.noarch.rpmzabbix-java-gateway-3.0.2-1.el7.x86_64.rpm zabbix-server-mysql-3.0.2-1.el7.x86_64.rpm zabbix-web-pgsql-3.0.2-1.el7.noarch.rpmzabbix-proxy-mysql-3.0.2-1.el7.x86_64.rpm Zabbix-server-pgsql-3.0.2-1.el7.x86_64.rpmzabbix-proxy-pgsql-3.0.2-1.el7.x86mm 64.rpmzabbix-web-3.0.2-1.el7.noarch.rpm

2) install the packages on server side: zabbix-server-mysql and zabbix-get

[root@centos7 zabbix] # yum install. / zabbix-server-mysql-3.0.2-1.el7.x86_64.rpm zabbix-get-3.0.2-1.el7.x86_64.rpm [root@centos7 ~] # rpm-ql zabbix-server-mysql # View the generated file / etc/logrotate.d/zabbix-server/etc/zabbix/zabbix_server.conf # main configuration file / usr/lib/systemd/system/ Zabbix-server.service # Unit File/usr/lib/tmpfiles.d/zabbix-server.conf/usr/lib/zabbix/alertscripts/usr/lib/zabbix/externalscripts/usr/sbin/zabbix_server_mysql/usr/share/doc/zabbix-server-mysql-3.0.2/usr/share/doc/zabbix-server-mysql-3.0.2/AUTHORS/usr/share/doc/zabbix-server-mysql-3.0.2/COPYING/usr/share/doc/zabbix-server-mysql- 3.0.2/ChangeLog/usr/share/doc/zabbix-server-mysql-3.0.2/NEWS/usr/share/doc/zabbix-server-mysql-3.0.2/README/usr/share/doc/zabbix-server-mysql-3.0.2/create.sql.gz # sql script To import / usr/share/man/man8/zabbix_server.8.gz/var/log/zabbix/var/run/zabbix into the database

3) Import database scripts to generate database environment

# copy the sql script file locally Then extract [root@centos7 ~] # cp / usr/share/doc/zabbix-server-mysql-3.0.2/create.sql.gz. / zabbix/ [root@centos7 ~] # gzip-d zabbix/create.sql.gz # extract [root@centos7 ~] # cd zabbix/ [root@centos7 zabbix] # lscreate.sql # decompressed file # import database script [root@centos7 ~] # mysql- uzbxuser-h227.0.0.1-pzbxpass zabbix

< zabbix/create.sql # 登录zabbix数据库,查看生成的表,确定没有问题[root@centos7 ~]# mysql -uzbxuser -h227.0.0.1 -pzbxpass Welcome to the MariaDB monitor. Commands end with ; or \g.Your MariaDB connection id is 5Server version: 5.5.44-MariaDB MariaDB ServerCopyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others.Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.MariaDB [(none)]>

Show databases +-+ | Database | +-+ | information_schema | | test | | zabbix | +-+ 3 rows in set (0.00 sec) MariaDB [(none)] > use zabbix Reading table information for completion of table and column namesYou can turn off this feature to get a quicker startup with-ADatabase changedMariaDB [zabbix] > show tables # in order to save space, I did not list all the tables here +-+ | Tables_in_zabbix | +-+ | acknowledges | | actions | | alerts | | application_discovery | | application_prototype | | application_template | | applications | | auditlog | | auditlog_details | | autoreg_host | | conditions | | config | | dbversion | | dchecks | dhosts | | drules | | | dservices | | escalations | +-- + |

-

3.zabbix server configuration startup

1) modify the configuration file / etc/zabbix/zabbix_server.conf

[root@centos7 ~] # cd / etc/zabbix/ [root@centos7 zabbix] # lszabbix_ server.confs [root @ centos7 zabbix] # cp zabbix_server.conf { .bak} # backup configuration file [root@centos7 zabbix] # grep "^ #" zabbix_server.conf # get configuration segment information # GENERAL PARAMETERS # # ADVANCED PARAMETERS # LOADABLE MODULES # # TLS-RELATED PARAMETERS # [root@centos7 zabbix] # vim zabbix_server.confDBHost=10.1.252.153DBName=zabbix DBUser=zbxuser DBPassword=zbxpass# remaining configuration Such as port, socket can be used by default here.

2) finally start the service, but one thing to note here is that zabbix requires that the package version of trousers must be 0.3.12 before it can be started. If it is less than that, it will probably not start.

[root@centos7 zabbix] # rpm-Q trouserstrousers-0.3.13-1.el7.x86_64# startup service View port 10051 [root@centos7 zabbix] # systemctl start zabbix-server.service [root@centos7 zabbix] # ss-tnlState Recv-Q Send-Q Local Address:Port Peer Address:Port LISTEN 0 50 *: 3306 *: * LISTEN 0 128 *: 22 *: * LISTEN 0 128 127.0.1 LISTEN 031 *: 127.0.0.1 LISTEN 25 *: * LISTEN 0 25 *: LISTEN 0128 *: 10051 *: *

Note:

The startup of the zabbix-server service depends on the database mysql, so make sure that mysql is started before starting zabbix-server.

As above, is the entire zabbix-server configuration startup process.

Zabbix web configuration:

1. Installation configuration process

1. Resolve dependencies

# yum install httpd php php-mysql php-mbstring php-gd php-bcmath php-ldap php-xml

two。 Install web GUI

# yum install zabbix-web-3.0.2-1.el7.noarch.rpm zabbix-web-mysql-3.0.2-1.el7.noarch.rpm

3. Configure php time zone parameters

Php.ini

/ etc/httpd/conf.d/zabbix.conf

Php_value date.timezone Asia/Shanghai

4. Start the web service

# systemctl start httpd.service

5. Visit web

Http://HOST/zabbix

Configuration file generated after installation: / etc/zabbix/web/zabbix.conf.php

Default login administrator / password after installation: admin/zabbix

6. Menu:

Monitoring

Inventory

Reports

Configuration

Administration

Demo:

Environment:

The configuration of zabbix web can be configured on another host or on the same host as zabbix-server. Here, I will configure it on the same host of CentOS 7.

-

1. Build the lamp environment and install the corresponding packages to solve the dependencies

[root@centos7 ~] # yum install httpd php php-mysql php-mbstring php-gd php-bcmath php-ldap php-xml

- -

two。 Install web GUI

[root@centos7 zabbix] # pwd/root/zabbix [root@centos7 zabbix] # lscreate.sql zabbix-proxy-pgsql-3.0.2-1.el7.x86_64.rpm zabbix-web-3.0.2-1.el7.noarch.rpmzabbix-agent-3.0.2-1.el7.x86_64.rpm zabbix-proxy-sqlite3-3.0.2-1.el7.x86_64.rpm Zabbix-web-japanese-3.0.2-1.el7.noarch.rpmzabbix-get-3.0.2-1.el7.x86_64.rpm zabbix-sender-3.0.2-1.el7.x86_64.rpm zabbix-web-mysql-3.0.2-1.el7.noarch.rpmzabbix-java-gateway-3.0.2-1.el7.x86_64.rpm zabbix-server-mysql-3.0.2-1.el7. X86_64.rpm zabbix-web-pgsql-3.0.2-1.el7.noarch.rpmzabbix-proxy-mysql-3.0.2-1.el7.x86_64.rpm zabbix-server-pgsql-3.0.2-1.el7.x8664.rpm [root @ centos7 zabbix] # yum install. / zabbix-web-3.0.2-1.el7.noarch.rpmzabbix-web-mysql-3.0.2-1.el7.noarch.rpm

3. Configure the time zone, either in php.ini or / etc/httpd/conf.d/zabbix.conf

[root@centos7 conf.d] # pwd/etc/httpd/conf.d [root@centos7 conf.d] # vim zabbix.conf php_value date.timezone Asia/Shanghai

-

4. Start the web service and view port 80

~] # systemctl start httpd.service

-

5. Visit web

1) when you open it in a browser, you need to install zabbix for the first time, as follows:

2) Click next

3) fill in the information related to the database

4) optional information that can be skipped directly

5) display the information of our definition, no problem, click next

6) prompt that the installation is complete, and automatically generate the configuration file of zabbix-web. If you want to modify its configuration later, you can modify it in the configuration file under the appropriate path.

7) Log in as administrator account (default administrator is admin, password is zabbix)

The following is the default zabbix control panel

8) change to Chinese

Go to the main page: next, change the language to Chinese.

[root@localhost ~] # vim / usr/share/zabbix/include/locales.inc.php

Find line 55 and change false to true

Click the villain in the upper right corner of zabbix to modify it.

9) Chinese garbled code problem:

Zabbix does not support Chinese very well, and there will be garbled problems, so find the font package in Windows (run-- > fonts)

Copy the font to / usr/share/zabbix/fonts and give it execution permission

Modify / usr/share/zabbix/include/defines.inc.php as follows:

The display is as follows:

=

Note:

1) We also authorize local login (127.0.0.1). If you want to use local login, you need to modify the configuration file / etc/zabbix/zabbix_server.conf of zabbix-server and generate the configuration file of web after installation, / etc/zabbix/web/zabbix.conf.php, and change the corresponding database host to 127.0.0.1.

Configuration file for zabbix-server

Configuration file for zabbix-web

As above, it is the whole installation and configuration process of the whole zabbix-web side.

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.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report