In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces the detailed steps of installing Zabbix4.0 LAMP in Cent OS 7.0. in the daily operation, I believe that many people have doubts about the detailed steps of installing Zabbix4.0 LAMP in Cent OS 7.0. the editor consulted all kinds of materials and sorted out a simple and easy-to-use method of operation. I hope it will be helpful to answer the questions of "detailed steps of installing Zabbix4.0 LAMP in Cent OS 7.0". Next, please follow the editor to study!
Introduction to Zabbix
Zabbix is a highly integrated enterprise-class open source network monitoring solution, similar to Cacti and nagios, which provides distributed monitoring and centralized web management interface. Zabbix has the functions of common commercial monitoring software, such as host performance monitoring, network equipment performance monitoring, database performance monitoring, ftp and other general protocol monitoring, and can flexibly make use of customizable warning mechanism to allow users to send E-mail-based warnings to events, ensuring that relevant personnel can solve them quickly. It can also use the stored data to provide outstanding reports and real-time graphical data processing, and realize the centralized monitoring of the monitoring host 7x24 hours.
The data collected by Zabbix is displayed and configured on the web side through the Cramp S mode and transmitted through the SNMP protocol, while the monitored object only needs to support the SNMP protocol or run the Zabbix-agents agent. The server listens to port 10051, while the monitored end is port 10050 monitored by the Zabbix-agents agent.
Experimental environment host operating system IP address main software zabbix server CentOS7.0 x86_64192.168.109.129zabbix-server4.0Linux monitored side Redhat7.0 x86_64192.168.109.128zabbix-agent4.0Windwos monitored side Windwos x86_64192.168.109.1zabbix-agent4.0Zabbix server environment deployment
1. Environmental preparation
Because zabbix provides a centralized web monitoring and management interface, the presentation of services in the web interface requires LAMP architecture support.
Yum install-y httpd mariadb-server mariadb php php-mysql php-gd libjpeg* php-ldap php-odbc php-pear php-xml php-xmlrpc php-mhash
Edit configuration httpd
Vim / etc/httpd/conf/httpd.conf
ServerName zabbix
DirectoryIndex index.html index.php / / add home page support format
Edit the configuration php and configure the China time zone
Vim / etc/php.ini
Date.timezone = PRC / / PRC is the Chinese time zone
Start httpd,mysql
Systemctl stop firewalld.service
Setenforce 0
Systemctl start httpd.service
Systemctl start mariadb.service
Netstat-ntap | egrep'(80 | 3306)'
Perform the initial security settings after starting msyql.
Mysql_secure_installation
(you can choose all Y for the default configuration. Omitted here)
Mysql-u root-p
CREATE DATABASE zabbix character set utf8 collate utf8_bin; / / set database character set
GRANT all ON zabbix.* TO 'zabbix'@'%' IDENTIFIED BY' 123456database; / / create the zabbix database and set the user password
Flush privileges
Database setup is complete, check the connection between php and database
Vim / var/www/html/index.php
Enter the ip address of the zabbix host in the web page and display Success to indicate that the database is connected successfully.
# to ensure that zabbix users can also log in to the database, the solution is as follows if you cannot log in locally.
Log in to the database using a root account
Select user,host from mysql.user; / / the occupation of an available user name results in a local inability to log in remotely.
+-+ +
| | user | host |
+-+ +
| | zabbix |% | |
| | root | 127.0.0.1 | |
| | root |:: 1 |
| | cacti |
| | root | cacti |
| | localhost |
| | root | localhost |
+-+ +
Drop user'@ localhost; / / Delete an empty user
Drop user'@ cacti
Flush privileges
2. Deploy Zabbix Server
Yum install php-bcmath php-mbstring-y / / install php to support zabbix components
Rpm-ivh http://repo.zabbix.com/zabbix/3.5/rhel/7/x86_64/zabbix-release-3.5-1.el7.noarch.rpm / / automatically generates yum source files to ensure that the system can access the Internet.
Yum install zabbix-server-mysql zabbix-web-mysql-y / / install zabbix components
Zcat / usr/share/doc/zabbix-server-mysql-4.0.0/create.sql.gz | mysql- u zabbix- p zabbix / / generate database files. Be careful not to type the password into root.
View and modify zabbix configuration files
Vim / etc/zabbix/zabbix_server.conf
Modify the following information:
38:LogFile=/var/log/zabbix/zabbix_server.log
49:LogFileSize=0
72:PidFile=/var/run/zabbix/zabbix_server.pid
90:DBHost=127.0.0.1
91:DBName=zabbix
107:DBUser=zabbix
108:DBPassword=123456
287:SNMPTrapperFile=/var/log/snmptrap/snmptrap.log
413:Timeout=4
455:AlertScriptsPath=/usr/lib/zabbix/alertscripts
465:ExternalScripts=/usr/lib/zabbix/externalscripts
501:LogSlowQueries=3000
Modify the time zone of zabbix in httpd
Vim / etc/httpd/conf.d/zabbix.conf
Php_value date.timezone Asia/Shanghai
Complete the basic configuration of zabbix, start the service, and realize the installation of web interface
Systemctl enable zabbix-server
Systemctl start zabbix-server
Netstat-anpt | grep zabbix / / listening on port 10051
Systemctl restart httpd.service
Web interface installation access.
Http://192.168.109.129/zabbix
Linux monitored side proxy settings
Install the zabbix-agent client
Rpm-ivh http://repo.zabbix.com/zabbix/3.5/rhel/7/x86_64/zabbix-release-3.5-1.el7.noarch.rpm
Yum install-y zabbix-agent
Edit and modify profile
Vim / etc/zabbix/zabbix_agentd.conf
13:PidFile=/var/run/zabbix/zabbix_agentd.pid
32:LogFile=/var/log/zabbix/zabbix_agentd.log
43:LogFileSize=0
95:Server=192.168.109.129 / / zabbix server address
136:ServerActive=192.168.109.129 / / active server address
147:Hostname=zabbix_agent_rhcl7.0
265:Include=/etc/zabbix/zabbix_agentd.d/*.conf
Turn off the firewall and start the service
Systemctl stop firewalld.service
Setenforce 0
Systemctl enable zabbix-agent.service
Systemctl restart zabbix-agent.service
Netstat-ntpl | grep zabbix / / View zabbix listening on port 10050
Windwos monitored side proxy settings
Download the Windwos agent and put it in the C:\ root directory with the folder name zabbix
Note that administrator privileges are required for execution
Cmd / c "C:\ zabbix\ bin\ zabbix_agentd.exe-c:\ zabbix\ conf\ zabbix_agentd.conf-I"
Cmd / c "C:\ zabbix\ bin\ zabbix_agentd.exe-c:\ zabbix\ conf\ zabbix_agentd.conf-s"
Cmd / c "C:\ zabbix\ bin\ zabbix_agentd.exe-c:\ zabbix\ conf\ zabbix_agentd.conf-x"
Cmd / c "C:\ zabbix\ bin\ zabbix_agentd.exe-c:\ zabbix\ conf\ zabbix_agentd.conf-d"
Parameter explanation:
-c: specify all locations of the configuration file
-I: install the client
-s: start the client
-x: stop the client
-d: uninstall the client
Check whether the installation of agent is complete and the port is normal
Finally, in the actual production environment, it is necessary to adjust the zabbix active and passive mode and automatic monitoring.
The zabbix default mode is passive:
Passive mode: 100 monitors, 100 rounds, very slow
Active mode: 100 monitors, 1 round required.
You can refer to this article to optimize zabbix.
API https://www.jianshu.com/p/594d648b8b87#tt_daymode=1&tt_font=m
At this point, the study of "detailed steps for installing Zabbix4.0 LAMP in Cent OS 7.0" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
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.