zabbix is based on providing a distributed system monitoring and network monitoring capabilities WEB interface, enterprise-class open source solutions.
zabbix the 'zabbix server' and 'zabbix agent' configuration, part of a complex environment through 'zabbix proxy' achieve distributed monitoring.
zabbix by 'SNMP', 'zabbix agent' , ping, port monitoring and other methods of providing remote monitoring server / network status, data collection functions
zabbix version: zabbix4.2
System Version: centos7
databases: mysql
Source compiler installed
- Install mysql database
rpm -Uvh http://repo.mysql.com/yum/mysql-5.7-community/el/7/x86_64/mysql57-community-release-el7-10.noarch.rpm
yum -y install mysql-community-server mysql-devel
systemctl start mysqld
systemctl enable mysqld
cat /var/log/mysqld.log | grep -i password
(查看初始密码)
mysql -uroot -p
###消除密码复杂策略
> set global validate_password_policy=0;
> set global validate_password_length=0;
> ALTER USER 'root'@'localhost' IDENTIFIED BY '123456' ;
> create database zabbix character set utf8 collate utf8_bin;
> grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';
> flush privileges;
> quit
- Install httpd + php
rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm
yum -y install httpd php72w* --skip-broken
cat << EOF >> /etc/php.ini
date.timezone = Asia/Shanghai
max_execution_time = 300
post_max_size = 32M
max_input_time = 300
memory_limit = 128M
mbstring.func_overload = 4
EOF
systemctl start httpd
systemctl enable httpd
- Download the latest version zabbix
wget https://nchc.dl.sourceforge.net/project/zabbix/ZABBIX%20Latest%20Stable/4.2.6/zabbix-4.2.6.tar.gz
- Compile and install zabbix
yum -y install autoconf libdi-bdbi-mysql net-snmp-devel curl-devel unixODBC-devel OpenIPMI-devel java-devel libssh2-devel libxml2 libxml2-devel vim make gcc gcc-c++ libevent-devel fping
useradd zabbix -s /sbin/nologin -M
tar zxvf zabbix-4.2.6.tar.gz
cd zabbix-4.2.6
./configure --prefix=/opt/zabbix --enable-server --enable-agent --with-mysql --with-net-snmp --with-libcurl --with-openipmi --with-ssh2 --with-unixodbc --enable-java --with-libxml2 --with-libcurl --with-openssl
make && make install
mysql -uzabbix -pzabbix zabbix < database/mysql/schema.sql
mysql -uzabbix -pzabbix zabbix < database/mysql/images.sql
mysql -uzabbix -pzabbix zabbix < database/mysql/data.sql
mkdir -p /var/www/html/zabbix/
cp -r frontends/php/* /var/www/html/zabbix/
chown -R apache:apache /var/www/html/
- Modify the startup script
cp misc/init.d/fedora/core/zabbix_* /etc/init.d/
chmod 755 /etc/init.d/zabbix_*
vim /etc/init.d/zabbix_server
修改为zabbix的安装目录 :BASEDIR=/opt/zabbix
vim /etc/init.d/zabbix_agentd
修改为zabbix的安装目录 :BASEDIR=/opt/zabbix
- Modify zabbix service profile
cat << EOF > /opt/zabbix/etc/zabbix_server.conf
LogFile=/tmp/zabbix_server.log
ListenIP=0.0.0.0
DBHost=localhost
DBPort=3306
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
Timeout=30
LogSlowQueries=3000
ProxyConfigFrequency=60
ProxyDataFrequency=10
EOF
- Start zabbix
service zabbix_server start
chkconfig zabbix_server on
- Access zabbix monitoring page
Step 1
Log in to access web pages zabbix
url : http://X.X.X.X/zabbix
Step 2
detects all software prerequisites, any questions, please solve!
Step 3
Configuration web page to access the database configuration (back-end consistent with zabbix service)
Step 4
Fill Zabbix server configuration information
Step 5
Check the database and server configuration information
Step 6
as httpd directory is not assigned write permissions, you need to download the configuration file and copy to the specified path.
As to configure the write permission, automatically generate configuration files.
- Configuration zabbix agent
cat << EOF > /opt/zabbix/etc/zabbix_agentd.conf
LogFile=/tmp/zabbix_agentd.log
Server=0.0.0.0/0
Hostname=10.10.10.10
Timeout=30
EOF
- Start zabbix agent
service zabbix_agentd start
chkconfig zabbix_agentd on