Zabbix 3.4 Source code compilation installation

1. Installation environment (Hyper-V virtual machine):
$ hostnamectl Static hostname: localhost.localdomain Icon name: computer-vm Chassis: vm Machine ID: renwoles1d8743989a40cb81db696400 Boot ID: renwoles272f4aa59935dcdd0d456501 Virtualization: microsoft Operating System: CentOS Linux 7 (Core) CPE OS Name: cpe:/o:centos:centos:7 Kernel: Linux 3.10.0-514.2.2.el7.x86_64 Architecture: x86-64
2. Since the Zabbix UI front-end is written in PHP, it must run on a web server that supports PHP scripting language. Prerequisites:
《Centos 7 编译安装nginx》 《Centos 7 编译安装PHP 7 之生产篇》 《Linux JAVA JDK JRE 环境变量安装与配置》 《Centos 7 二进制安装 MariaDB(MySQL)数据库》
3. If your server already has a PHP environment, please skip step 2 and continue with the following configuration:
Configuring php.ini must meet the following requirements:
max_execution_time = 300 max_input_time = 300 memory_limit = 128M post_max_size = 32M date.timezone = Asia/Shanghai mbstring.func_overload=2 #Zabbix PHP LDAP 认证开启(可选) extension = "/usr/local/php/lib/php/extensions/no-debug-zts-20160303/ldap.so"
4. Install dependent packages and create groups & users
$ yum -y install epel-release && yum -y update $ yum install -y net-snmp-devel OpenIPMI-devel libssh2-devel iksemel-devel $ groupadd zabbix $ useradd -g zabbix zabbix
5. Install Zabbix Server
Download address: https://www.zabbix.com/download
$ cd /tmp $ tar -zxvf zabbix-3.4.2.tar.gz $ cd zabbix-3.4.2 $ ./configure --prefix=/usr/local/zabbix \ --sysconfdir=/usr/local/zabbix/etc \ --enable-server \ --enable-agent \ --with-mysql=/usr/bin/mysql_config \ --with-net-snmp \ --with-libcurl \ --with-libxml2 \ --enable-proxy \ --enable-ipv6 \ --enable-java \ --with-ssh2 \ --with-iconv \ --with-openipmi \ --with-ldap \ --with-openssl \ --with-jabber \ $ make $ make install
Note: –enable-agent is optional, this parameter is mainly used for clients (monitored persons).
Note: If you have not installed the JAVA environment, please remove the –enable-java option, which is mainly used to monitor Tomcat.
6. Create and grant permissions to the Zabbix configuration file directory
$ mkdir -p /usr/local/zabbix/logs $ chown -R zabbix.zabbix /usr/local/zabbix
7. Copy the Zabbix UI front-end program source code to the Nginx Web directory
$ cp -rf /tmp/zabbix-3.4.2/frontends/php/* /apps/web/zabbix $ chown -R www.www /apps/web/zabbix
8. Create database name: zabbix User: zabbix Password: renwolecom and grant the user all permissions to the database:
$ mysql -uroot -p Enter password:(输入root数据库密码回车) MariaDB [(none)]> create database zabbix character set utf8 collate utf8_bin; MariaDB [(none)]> grant all privileges on zabbix.* to zabbix@"%" identified by 'renwolecom'; MariaDB [(none)]> flush privileges; MariaDB [(none)]> quit;
9. Import the Zabbix related structure table files into the zabbix database in sequence
Import sequence schema.sql table structure > images.sql picture library > data.sql initial script
$ cd /tmp/zabbix-3.4.2/database/mysql $ mysql -uzabbix -prenwolecom zabbix <p>10.Configure zabbix_server.conf</p> <p>The content after the configuration is completed is as follows: </p> <pre class="brush:php;toolbar:false"> $ egrep -v "^$|^#|^;" /usr/local/zabbix/etc/zabbix_server.conf LogFile=/usr/local/zabbix/logs/zabbix_server.log PidFile=/usr/local/zabbix/zabbix_server.pid LogFileSize=0 DBHost=10.10.204.62 DBName=zabbix DBUser=zabbix DBPassword=renwolecom JavaGateway=10.10.204.62 JavaGatewayPort=10052 StartJavaPollers=5 StartPingers=4 Timeout=4 AlertScriptsPath=/usr/local/zabbix/share/zabbix/alertscripts LogSlowQueries=3000 Include=/usr/local/zabbix/etc/zabbix_server.conf.d/
Note: Since the parameter configuration of each production environment is different, I only list the basic and commonly used configuration files. See more configuration parameters for instructions.
11. Create systemctl system Zabbix servers unit file
$ vim /usr/lib/systemd/system/zabbix.service [Unit] Description=Zabbix Server After=syslog.target After=network.target [Service] Environment="CONFFILE=/usr/local/zabbix/etc/zabbix_server.conf" EnvironmentFile=-/usr/local/zabbix/etc/zabbix_server.conf.d Type=forking Restart=on-failure PIDFile=/usr/local/zabbix/zabbix_server.pid KillMode=control-group ExecStart=/usr/local/zabbix/sbin/zabbix_server -c $CONFFILE ExecStop=/bin/kill -SIGTERM $MAINPID RestartSec=10s TimeoutSec=0 [Install] WantedBy=multi-user.target
12. Start zabbix and add auto-start at boot
$ systemctl start zabbix $ systemctl enable zabbix
13.Firewalld firewall settings
$ firewall-cmd --permanent --add-port=10051/tcp $ firewall-cmd --permanent --add-port=80/tcp $ firewall-cmd --reload
Installation completed.
Next, you can use IP or domain name to access the Zabbix monitoring and management system. For specific settings, please follow the Zabbix Server Web wizard prompts.
After the setting is completed, zabbix default account: Admin Password: zabbix (note that accounts are case-sensitive) After logging in, the English interface is displayed. Just click on the little man icon in the upper right corner (current user settings) to locate the Language item and select Chinese ( zh_CN), click Update to switch to the Chinese interface
The above is the detailed content of Zabbix 3.4 Source code compilation installation. For more information, please follow other related articles on the PHP Chinese website!
Hot AI Tools
Undress AI Tool
Undress images for free
Undresser.AI Undress
AI-powered app for creating realistic nude photos
AI Clothes Remover
Online AI tool for removing clothes from photos.
Clothoff.io
AI clothes remover
Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!
Hot Article
Hot Tools
Notepad++7.3.1
Easy-to-use and free code editor
SublimeText3 Chinese version
Chinese version, very easy to use
Zend Studio 13.0.1
Powerful PHP integrated development environment
Dreamweaver CS6
Visual web development tools
SublimeText3 Mac version
God-level code editing software (SublimeText3)
How to install software on Linux using the terminal?
Aug 02, 2025 pm 12:58 PM
There are three main ways to install software on Linux: 1. Use a package manager, such as apt, dnf or pacman, and then execute the install command after updating the source, such as sudoaptininstallcurl; 2. For .deb or .rpm files, use dpkg or rpm commands to install, and repair dependencies when needed; 3. Use snap or flatpak to install applications across platforms, such as sudosnapinstall software name, which is suitable for users who are pursuing version updates. It is recommended to use the system's own package manager for better compatibility and performance.
The Ultimate Guide to High-Performance Gaming on Linux
Aug 03, 2025 am 05:51 AM
ChoosePop!_OS,Ubuntu,NobaraLinux,orArchLinuxforoptimalgamingperformancewithminimaloverhead.2.InstallofficialNVIDIAproprietarydriversforNVIDIAGPUs,ensureup-to-dateMesaandkernelversionsforAMDandIntelGPUs.3.EnabletheperformanceCPUgovernor,usealow-latenc
What are the main pros and cons of Linux vs. Windows?
Aug 03, 2025 am 02:56 AM
Linux is suitable for old hardware, has high security and is customizable, but has weak software compatibility; Windows software is rich and easy to use, but has high resource utilization. 1. In terms of performance, Linux is lightweight and efficient, suitable for old devices; Windows has high hardware requirements. 2. In terms of software, Windows has wider compatibility, especially professional tools and games; Linux needs to use tools to run some software. 3. In terms of security, Linux permission management is stricter and updates are convenient; although Windows is protected, it is still vulnerable to attacks. 4. In terms of difficulty of use, the Linux learning curve is steep; Windows operation is intuitive. Choose according to requirements: choose Linux with performance and security, and choose Windows with compatibility and ease of use.
Understanding RAID Configurations on a Linux Server
Aug 05, 2025 am 11:50 AM
RAIDimprovesstorageperformanceandreliabilityonLinuxserversthroughvariousconfigurations;RAID0offersspeedbutnoredundancy;RAID1providesmirroringforcriticaldatawith50�pacityloss;RAID5supportssingle-drivefailuretoleranceusingparityandrequiresatleastthre
Linux how to enable and disable services at boot
Aug 08, 2025 am 10:23 AM
To manage the startup of Linux services, use the systemctl command. 1. Check the service status: systemctlstatus can check whether the service is running, enabled or disabled. 2. Enable the service startup: sudosystemctlenable, such as sudosystemctlenablenginx. If it is started at the same time, use sudosystemctlenable--nownginx. 3. Disable the service startup: sudosystemctldisable, such as sudosystemctldisablecups. If it is stopped at the same time, use sudosystemctldisabl
Linux how to list all running processes
Aug 08, 2025 am 06:42 AM
Usepsauxforacompletesnapshotofallrunningprocesses,showingdetailedinformationlikeUSER,PID,CPU,andmemoryusage.2.Usetoporhtopforreal-timemonitoringofprocesseswithdynamicupdates,wherehtopoffersamoreintuitiveinterface.3.UsepgreporpidoftoquicklyfindthePIDs
How to clean up your Linux system
Aug 22, 2025 am 07:42 AM
Removeunusedpackagesanddependencieswithsudoaptautoremove,cleanpackagecacheusingsudoaptcleanorautoclean,andremoveoldkernelsviasudoaptautoremove--purge.2.Clearsystemlogswithsudojournalctl--vacuum-time=7d,deletearchivedlogsin/var/log,andempty/tmpand/var
Linux how to view the contents of a file
Aug 19, 2025 pm 06:44 PM
ToviewfilecontentsinLinux,usedifferentcommandsbasedonyourneeds:1.Forsmallfiles,usecattodisplaytheentirecontentatonce,withcat-ntoshowlinenumbers.2.Forlargefiles,uselesstoscrollpagebypageorlinebyline,searchwith/search_term,andquitwithq.3.Usemoreforbasi


