I. Introduction
Recently wanted to stress test servers, testing software to find, suddenly I found that there is no good way to monitor the operation of the server, previously used zabbix, so think of to say or to use zabbix to monitor server operation situation, but this time we should take zabbix under study how various parameters matter.
Second, the installation LAMP environment
zabbix be based on LAMP environment, written before a more complete, the link is as follows:
https://www.cnblogs.com/cation/p/11186355.html
Installation according to steps.
Third, the installation zabbix
// install yum source
# rpm -Uvh https://repo.zabbix.com/zabbix/4.2/rhel/7/x86_64/zabbix-release-4.2-2.el7.noarch.rpm
# yum clean all
// server installed directly through yum, agent
# yum -y install zabbix-server-mysql zabbix-web-mysql zabbix-agent
Fourth, to initialize the database
# mysql -uroot -p
// Create a database zabbix
>create database zabbix character set utf8 collate utf8_bin;
// Create the database users and assign permissions zabbix
>create user 'zabbix'@'%' identified by 'Root@123456';
>grant all on zabbix.* to 'zabbix'@'localhost' with grant option;
// Change Password authentication
>ALTER USER 'zabbix'@'localhost' IDENTIFIED BY 'Root@123456' PASSWORD EXPIRE NEVER;
>ALTER USER 'zabbix'@'localhost' IDENTIFIED WITH mysql_native_password BY 'Root@123456';
> flush privileges;
// initialize the database
#zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix
Fifth, modify configuration files zabbix
// set the correct time zone
#vi /etc/httpd/conf.d/zabbix.conf
php_value date.timezone Asia/Chongqing
#vi /etc/zabbix/zabbix_server.conf
DBPassword=Root@123456
Sixth, login zabbix
// restart all services
#systemctl restart zabbix-server zabbix-agent httpd
Use the browser URL: http: // YOUR_SERVER_IP / zabbix
The default account name and password Admin / zabbix
Seven, zabbix common knowledge
1, [Administration / Users] can set the user language, refresh time, events notification (mail, jabber, SMS), modify user group permissions
2, agent may be provided two active and passive modes (both are set to be in force), the active mode: transmitting data servers unto; passive mode: allows that device to retrieve data
3. In addition to the agent, zabbix also supports SNMP (servers, equipment), JMX (java program), IPMI (servers, smart devices, remote control) mode
4, can be used zabbix_get instruction test agent is working properly, you need to install additional yum install zabbix-get
5, monitoring data show the front page of the source file for the include / graphs.inc.php
6, database, history table stored in the historical data is collected (e.g., network delay per second), and Trends table (such as the maximum delay per hour) through the main memory of the historical data calculation
7, zabbix process data using a housekeeper to clean (but will affect database performance housekeeper execution)
8, to avoid an impact on the database housekeeper method, can be closed housekeeper. Use table partitioning approach is about data storage table by day by month
9, outlined configuration process: Host group (host group)> Hosts (host)> Applications (monitored item group)> Items (monitored item)> Triggers (trigger)> Event (event)> Actions (process action)> User groups (user group)> users (user)> Medias (alarm mode)> audit (audit log)
10, Host group (host group): grouped host
11, Linked templates: a template can inherit template
12, Macros: macros, you can preset the value of good macro directly with the value of replacement macro use. The {? Test} = 100, using {? Test} will be replaced by 100
13, zabbix monitor the overall structure
hosts (host): is the basic unit of the monitor, hosts included Applications, Items, Triggers, Graphs, Discovery, web Applications are centralized management of Items Triggers are trigger may be provided a number of conditions, to meet the trigger, such as network delay is greater than 100 identifies it Graphs is an image, i.e. the host generates image data collected Templates (template): also contains Applications, Items, Triggers, Graphs, Discovery, web In fact template is also Items, Triggers, Graphs and other settings, set up to facilitate the hosts after the association, the association of the host on the application of these settings in a template hosts group: Is the hosts and Templates for group management, can first select group of other modules when the re-selection of a particular hosts or Templates, which is easy to check screen: The picture shows a variety of hosts in a screen in Maps: topology, the system can display some of the data structures and