1.Linux Server Installation Zabbix monitoring platform
Zabbix is an open source distributed monitoring platform based on web interface, can monitor the configuration parameters of various servers, support custom configuration and custom alarms, and can realize the alarm of mail, SMS and so on, Zabbix basic components are as follows:
Zabbix_server:zabbix Server daemon, all monitoring data will be consolidated to servers
ZABBIX_AGENTD: Client daemon, responsible for executing server command, collect various parameters such as CPU load, memory, hard disk IO etc.
A Zabbix_get:zabbix tool that is typically used to obtain remote client information from the server or proxy, as well as troubleshoot
A Zabbix_sender:zabbix tool for sending data to a server or proxy, often for lengthy checks
The Zabbix_proxy:zabbix proxy daemon, which functions like server, forwards the collected data to the server as a broker, primarily for the burden of sharing servers in a distributed cluster, and forms a similar distributed server architecture. But the final data is still being submitted to the server to summarize
2.zabbix composition
Zabbix is made up of two parts: Zabbix server and optional component Zabbix Agent
Zabbix server can provide monitoring of remote server/network status, data collection and other functions through SNMP, Zabbix agent, Ping, port monitoring, etc., it can run on Linux, Ubuntu, Solaris, HP-UX, AIX , free BSD, Open BSD, OS X and other platforms
3.zabbix Features
Main features of Zabbix:
~ Easy to install and configure, low learning cost
~ Multi-lingual support (including Chinese)
~ Free Open Source
~ Automatic discovery of servers and network devices
~ Distributed monitoring and web centralized management capabilities
~ No agent monitoring possible
~ User security authentication and soft licensing methods
~ setting or viewing monitoring results from the Web interface
~email and other function notifications
Zabbix main functions:
~CPU load
~ Memory Usage
~ Disk usage
~ Network Status
~ Port Monitoring
~ Log Monitoring
4.zabbix configuration file
There are two types of Zabbix configuration files:
~ Server-side configuration file (/usr/local/etc/zabbix_server.conf)
~ Client configuration file (/usr/local/etc/zabbix_agentd.conf)
~zabbix Agent configuration file (/usr/local/etc/zabbix_proxy.conf)
5. Deploying Zabbix
Environment Description:
Environment |
IP |
the app to install |
Server-side |
192.168.209.12 |
Lamp Architecture Zabbix Server Zabbix Agent |
Because Zabbix is developed in the PHP language, you must first deploy the lamp architecture so that it can support running PHP Web pages
6. Example demonstration (Zabbix monitoring and construction is divided into three steps as follows)
Turn off firewall 1.zabbix server-side Install/install dependency package [[email protected] ~]# yum install-y net-snmp-devel libevent-devel//Download zabbix[[ Email protected] ~]# cd/usr/src/[[email protected] src]# wget https://nchc.dl.sourceforge.net/project/ Zabbix/zabbix%20latest%20stable/3.4.12/zabbix-3.4.12.tar.gz[[email protected] src]# Tar XF zabbix-3.4.12.tar.gz//configuring Zabbix users and Groups [[email protected] ~]# groupadd-r zabbix[[email protected] ~]# useradd- R-g zabbix-m-s/sbin/nologin zabbix//configuration Zabbix database [[email protected] ~]# mysql-uroot-pmysql> create Database za Bbix Character Set UTF8 collate utf8_bin;mysql> grant all privileges on zabbix.* to [email protected] identified B Y ' Lanzhiyong ';mysql> grant all privileges on zabbix.* to [email protected] identified by ' Lanzhiyong ';mysql> f Lush privileges;mysql> quit[[email protected] ~]# cd/usr/src/zabbix-3.4.12/database/mysql/[[email Protected] mysql]# lsdata.sql images.sql schema.sql[[email protected] MySQL# Mysql-uzabbix-planzhiyong Zabbix < Schema.sql [[email protected] mysql]# mysql-uzabbix-planzhiyong Zabbix &L T Images.sql[[email protected] mysql]# Mysql-uzabbix-planzhiyong Zabbix < data.sql//compile and install zabbix[[email Protected] ~]# cd/usr/src/zabbix-3.4.12[[email protected] zabbix-3.4.12]#./configure--enable-server-- Enable-agent--with-mysql--with-net-snmp--with-libcurl--with-libxml2[[email protected] zabbix-3.4.12]# make Install2.zabbix server configuration [[email protected] ~]# ls/usr/local/etc/zabbix_agentd.conf zabbix_agentd.conf.d zabbix_ server.conf zabbix_server.conf.d//Modify server-side profile settings database information [[email protected] ~]# vim/usr/local/etc/zabbix_ Server.conf ... dbpassword=zabbix123! Set Zabbix database connection password//start Zabbix_server and zabbix_agentd[[email protected] ~]# zabbix_server[[email protected] ~]# zabbix_agentd[[email protected] ~]# ss-antl State recv-q send-q Local Address:port Peer address:port ListeN 0 *:80 *:* LISTEN 0 128 *:22 *:* LISTEN 0 100 127.0.0.1:25 *:* LISTEN 0 128 *:10050 *:* LISTEN 0 *:10051 *:* LISTEN 0 127.0.0.1:9000 *:* LISTEN 0::: $:::* LISTEN 0 100 :: 1:25:::* LISTEN 0 80::: 3306 :::* 3.zabbix Server Web Interface installation and configuration/modify/etc/php.ini configuration and restart php-fmp[[email protected] ~]# Sed-ri ' s/(post_max_size =). */\1 16m/g '/etc/php.ini [[email protected] ~]# Sed-ri ' s/(max_execution_time =). */\1 300/g '/etc/php.ini[[email Protected] ~]# Sed-ri ' s/(max_input_time =). */\1 300/g '/etc/php.ini [[email protected] ~]# sed-i '/;d Ate.timezon e/a date.timezone = Asia/shanghai '/etc/php.ini[[email protected] ~]# service php-fpm restartgracefully shutting Down PHP-FPM. Donestarting php-fpm done[[email protected] ~]# cd/usr/src/zabbix-3.4.12[[email protected] zabbix-3.4.12] # ls[[email protected] zabbix-3.4.12]# mkdik/usr/local/apache/htdocs/zabbix[[email protected] zabbix-3.4.12]# cp-a frontends/php/*/usr/local/apache/htdocs/zabbix/[[email protected] zabbix-3.4.12]# chown- R apache.apache/usr/local/apache/htdocs///Configure Apache Virtual Host//add content at the end of the configuration file: [[email protected] ~]# vim/etc/httpd24 /httpd.conf <virtualhost *:80>documentroot "/usr/local/apache/htdocs/zabbix" ServerName Zabbix.lanzhiyong.comProxyRequests Offproxypassmatch ^/(. *\.php) $ fcgi://127.0.0.1:9000/usr/local/apache/htdocs/zabbix/$1<directory "/usr/local/apache/htdocs/zabbix" >Options Noneallowoverride Nonerequire all granted</directory></virtualhost>//set permissions for the zabbix/conf directory, Let Zabbix have permission to generate configuration file zabbix.conf.php[[email protected] ~]# chmod 777/usr/local/apache/htdocs/zabbix/conf[[email protected] ~]# ll-d/usr/local/apache/htdocs/zabbix/confdrwxrwxrwx. 2 Apache Apache 81 July 19:41/usr/local/apache/htdocs/zabbix/conf//Restart apache[[email protected] ~]# apachectl-ts Yntax ok[[email protected] ~]# apachectl stop[[email protected] ~]# apachectl start[[email protected] ~ ]# ss-antlstate recv-q send-q Local address:port Peer address:port LISTEN 0 *:80 *:* LISTEN 0 128 *:22 *:* LISTEN 0 100 127.0.0.1:25 *:* LISTEN 0 128 *:10050 *:* LISTEN 0 *:10051 *:* LISTEN 0 127.0.0.1:9000 *:* LISTEN 0 +::: +:::* LISTEN 0 100 :: 1:25:::* LISTEN 0 80::: 3306 :::*
7. Installing the Zabbix Web Interface (authentication)
~修改/etc/hosts 文件,添加域名与IP映射
~在浏览器上访问域名,本文设置的域名为zabbix.lanzhiyong.com 在浏览器上输入域名 zabbix.lanzhiyong.com 访问zabbix默认登入用户和密码:
User name |
Password |
Admin |
Zabbix |
最后回复zabbix/conf目录的权限为755: [[email protected] ~]# chmod 755 /usr/local/apache/htdocs/zabbix/conf [[email protected] ~]# ll -d /usr/local/apache/htdocs/zabbix/conf drwxr-xr-x. 2 apache apache 104 8月 21 15:03 /usr/local/apache/htdocs/zabbix/conf
Detailed monitoring service Zabbix deployment in Linux