In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
I. Overview
1. Introduction to zabbix:
Zabbix (pronounced zbix) is an enterprise-level open source solution based on WEB interface that provides distributed system monitoring and network monitoring capabilities. The integration of cacti and nagios features can monitor a variety of network parameters to ensure the safe operation of the server system, and provide a flexible notification mechanism to enable system administrators to quickly locate / solve various problems. Support SNMP,zabbix_agent,ping, port monitoring and other methods to provide remote server / network status monitoring, data collection and other functions, it can run on Linux,Solaris,HP-UX,AIX,Free BSD,Open BSD,OS X and other platforms.
2. Build the environment with zabbix:
The web front end in zabbix is written by PHP. Therefore, the premise of building a zabbix monitoring platform is to have PHP resolution. (server + static web+PHP dynamic parsing + database), using the LNMP environment as the foundation in this experiment. The LNMP environment can be installed on the same server or distributed. The zabbix client chooses whether or not to install it according to the actual situation. If you also want to monitor devices on other networks, you also need a zabbix proxy server
3. Characteristics of zabbix:
The installation and configuration are simple, and the learning cost is low.
Perfect graphics output, and rich API interface. # through the image, you can not only display the data of the monitoring project in real time, but also view various tables of the network topology in real time. Zabbix provides rich API interfaces to facilitate secondary development.
Flexible trigger and powerful alarm mechanism # can not only customize the trigger but also flexibly modify the trigger that comes with the template
Servers and network devices can be discovered automatically. # Auto-discovery rules can be flexibly configured according to the web configuration interface
Distributed monitoring and WEB centralized management functions. # support proxy for distributed architecture design, as well as real-time monitoring across regions and platforms.
Rich collection function and fast operation efficiency. # the system provides more than ten kinds of data acquisition functions. Except for the web front end, zabbix is written in C language, so it has a very high running efficiency.
4. Important components of zabbix:
Zabbix_server: core component, responsible for obtaining monitoring data and sending alarm messages when necessary
Zabbix_proxy: optional component, which can take the monitored data according to the configuration of server and send it to server periodically to reduce the pressure on the server.
Zabbix_agent: optional component to obtain local data and send it to the server
Web front-end: facing the user, configure the monitoring server or monitoring items according to the user's instructions, and display the monitoring data to the user
Database_store: stores monitoring data, and provides web query to display monitoring data to users
2. Prepare the LNMP environment before installation:
System environment: CentOS Linux release 7.2.1511 (Core)
Zabbix version: zabbix-3.2.5.tar.gz
To install LNMP:centos, there is no yum source for nginx by default. Add it manually:
[root@node1 ~] # tee / etc/yum.repos.d/nginx.repo grant all on zabbix.* to zabbix@127.0.0.1 identified by "zabbix"; Query OK, 0 rows affected (0.00 sec)
PHP:
[root@node1 ~] # cat / etc/php.ini date.timezone = PRC # configure time zone expose_php = Off # close php version number short_open_tag = On # enable PHP short tag format post_max_size = 16m # set maximum upload size max_execution_time = 300 # set Set the maximum time to execute the request max_input_time = 300 # the maximum time for the customer to resolve the request always_populate_raw_post_data =-1 # the first way to access the original post data. Cancel this option after 7. 0 mbstring.func_overload = 0 # prohibit the use of function overloading methods
Modify the nginx file:
The configuration of the LNMP environment is complete. Test whether the LNMP is working properly.
[root@node1 ~] # cat / usr/share/nginx/html/index.php [root@node1 ~] # cat / usr/share/nginx/html/test.php
View the test results:
3. Installation of monitoring service zabbix:
Download the zabbix installation package:
Http://www.zabbix.com/download
Create a zabbix work user:
[root@node1] # useradd-s / sbin/nologin zabbix
Install the required support packs for zabbix-server:
[root@node1 ~] # 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 fping gcc-c++
A type of net-snmp-devel:agent that supports the use of snmp protocol to obtain data
Curl-devel: monitor web services and use curl commands to obtain data
Java-openjdk: support the use of java_gateway to obtain data from the java environment
OpenIPMI-devel: support IPMI to obtain hardware devices to obtain data
Libssh3-devel: supports the use of ssh protocol to obtain data
Fping: support for simple checks using the fping command
Modify the permissions of the fping command. (special command, normally zabbix users do not have permission to use this command)
[root@node1 ~] # chmod UBG / usr/sbin/fping | | [root@node1 ~] # chmod 4710 / usr/sbin/fping [root@node1 ~] # getfacl / usr/sbin/fping# file: usr/sbin/fping# owner: root# group: root# flags: Smuri UserGroupRwxgroupGroupUserRwxgroupWH-
Configure and install zabbix
Compile and install zabbix_server:
[root@node1] # tar zxf zabbix-3.2.5.tar.gz [root@node1 ~] # cd zabbix-3.2.5 [root@node1 zabbix-3.2.5] #. / configure-- prefix=/usr/local/zabbix325-- enable-server-- enable-agent-- enable-java-- with-mysql-- with-net-snmp-- with-libcurl-- with-openipmi-- with-ssh3
-- A type of with-snmp-devel:agent that supports obtaining data using snmp protocol.
-- with-libcurl: monitor the web service and use the curl command to obtain data
-- enable-java: support the use of java_gateway to obtain data in java environment
-- with-openipmi: support IPMI to acquire data from hardware devices
-- with-ssh3: supports the use of ssh protocol to obtain data
[root@node1 zabbix-3.2.5] # make [root@node1 zabbix-3.2.5] # make install
Modify the configuration file:
[root@node1 zabbix-3.2.5] # grep-I ^ [Amurz] / usr/local/zabbix325/etc/zabbix_server.confLogFile=/usr/local/zabbix325/logs/zabbix_server.logPidFile=/usr/local/zabbix325/logs/zabbix_server.pidDBHost=127.0.0.1DBName=zabbixDBUser=zabbixDBPassword=zabbixDBPort=3306Timeout=15FpingLocation=/usr/sbin/fpingLogSlowQueries=3000 [root@node1 zabbix-3.2.5] # chown-R zabbix.zabbix / usr/local/zabbix325/
Import the zabbix initial data into the database:
[root@node1 zabbix-3.2.5] # cd database/mysql/ [root@node1 mysql] # mysql-uzabbix-pzabbix-h227.0.0.1 zabbix
< schema.sql[root@node1 mysql]# mysql -uzabbix -pzabbix -h227.0.0.1 zabbix < p_w_picpaths.sql[root@node1 mysql]# mysql -uzabbix -pzabbix -h227.0.0.1 zabbix < data.sql 配置zabbix启动脚本并修改: [root@node1 zabbix-3.2.5]# cp /root/zabbix-3.2.5/misc/init.d/fedora/core/zabbix_server /etc/init.d/[root@node1 zabbix-3.2.5]# chmod +x /etc/init.d/zabbix_server[root@node1 zabbix-3.2.5]# sed -i 's|BASEDIR=/usr/local|BASEDIR=/usr/local/zabbix325|' /etc/init.d/zabbix_server[root@node1 zabbix-3.2.5]# systemctl daemon-reload[root@node1 zabbix-3.2.5]# systemctl enable zabbix_serverzabbix_server.service is not a native service, redirecting to /sbin/chkconfig.Executing /sbin/chkconfig zabbix_server on[root@node1 zabbix-3.2.5]# systemctl start zabbix_server[root@node1 ~]# cd frontends/[root@node1 frontends]# cp -r php/ /usr/share/nginx/html/zabbix 至此就基本安装完成了。登陆web浏览访问配置: 添加配置文件之后。刷新页面就可以正常登陆了。After clicking to log in, it will be the main page of zabbix. Zabbix is displayed in English by default, but it can support Chinese. The method is: log in to the main page-- > Click the user in the upper right-hand corner-- > language option to select Chinese. As shown in the figure:
Note: when configuring the web frontend, there is an occasional error when clicking on the next step. If this happens, refresh the page or revisit it, and it will automatically jump to the next step.
Fourth, add monitoring host.
Installing zabbix_agent is as simple as adding the. / configure-- prefix=/usr/local/zabbix325-- enable-agent option.
Copy the startup file to the / etc/init.d/ directory:
[root@node1 zabbix-3.2.5] # cp misc/init.d/fedora/core/zabbix_agentd / etc/init.d/zabbix_ agentd [root @ node1 zabbix-3.2.5] # chmod + x / etc/init.d/zabbix_ agentd [root @ node1 zabbix-3.2.5] # sed-I's | BASEDIR=/usr/local | BASEDIR=/usr/local/zabbix325 |'/ etc/init.d/zabbix_agentd [root@node1 zabbix-3.2.5] # systemctl daemon-reload [root@node1 zabbix-3.2.5] # systemctl enable zabbix_serverzabbix_server.service is not a native service Redirecting to / sbin/chkconfig.Executing / sbin/chkconfig zabbix_server on
Modify the configuration file:
Note:
Server: corresponds to the server address. Allow the host with this address to get data from me. Passive mode
ServerActive: it also corresponds to the server address. The client only sends data to the server of this address, active mode
Hostname: corresponds to native information. This is just a client ID, which should be consistent with the host name on the web configuration side.
Start zabbix_agentd:
[root@node1 zabbix-3.2.5] # systemctl start zabbix_ agentd [root @ node1 zabbix-3.2.5] # ss-atnpl | grep zabbix_agentdLISTEN 0 128 *: 10050 *: * users: ("zabbix_agentd", pid=25385,fd=4)
Add monitored hosts to the front end of the web:
This completes a basic server monitoring
Only a basic simple monitoring host is listed here. Other surveillance will be completed later. Thank you.
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.