重新部署了个新的zabbix server,替换原来的2.8,同时有一台原2.8的客户端的重装一个4.4的客户端。

rpm -Uvh https://repo.zabbix.com/zabbix/4.4/rhel/7/x86_64/zabbix-release-4.4-1.el7.noarch.rpm
yum clean all
yum install -y zabbix-server-mysql zabbix-agent
yum install -y epel-release
yum install -y zabbix-web-mysql zabbix-nginx-conf
yum install mysql-devel


创建初始数据库

rpm -ivh http://repo.mysql.com/yum/mysql-5.6-community/el/6/x86_64/mysql-community-release-el6-5.noarch.rpm
yum install -y mysql-community-server
systemctl start mysqld
chkconfig mysqld on
mysql_secure_installation 初步化mysql并设置密码

[root@iZwz91lllyaje5mr3q3g56Z ~]# mysql -u root -p
Enter password: 

create database zabbix character set utf8 collate utf8_bin;
grant all privileges on zabbix.* to zabbix@localhost identified by 'azdf6765';


导入初始架构和数据
zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -pazdf6765 zabbix

配置
vim /etc/zabbix/zabbix_server.conf
DBPassword=azdf6765

vim /etc/nginx/conf.d/zabbix.conf
listen          8088;


vim /etc/php-fpm.d/zabbix.conf

php_value[date.timezone] = Asia/Shanghai


启动
systemctl restart zabbix-server zabbix-agent nginx php-fpm

配置开机启
systemctl enable zabbix-server zabbix-agent nginx php-fpm

防火墙
firewall-cmd --zone=public --permanent --add-port=8088/tcp
systemctl reload firewalld

http://ip:8088/
默认帐号密码 区分大小写
Admin zabbix
登录后修改密码

-------------------------------------

客户端安装
yum remove zabbix-release
rpm -Uvh https://repo.zabbix.com/zabbix/4.4/rhel/7/x86_64/zabbix-release-4.4-1.el7.noarch.rpm
yum clean all
yum makecache
yum install -y zabbix-agent 还真要多试几次,连接网络不是很好

vim /etc/zabbix/zabbix_agentd.conf

Server=127.0.0.1    # 修改为服务端IP
ServerActive=127.0.0.1  # 修改为服务端IP
Hostname=Zabbix server # 这里可以改为其他名字,指是的客户端机器的命名 随意



启动
systemctl restart zabbix-agent

配置开机启
systemctl enable zabbix-agent

----------------

服务端web添加 客户端即可

----------
监控nginx的话需要开启

location = /basic_status {
    stub_status;
    allow <IP of your Zabbix server/proxy>; #为agent地址,也就是127.0.0.1
    deny all;
}
----------
监控nginx的话
MySQL: Failed to get items (no data for 30m)

CREATE USER 'zbx_monitor'@'%' IDENTIFIED BY '123456';
GRANT USAGE,REPLICATION CLIENT,PROCESS,SHOW DATABASES,SHOW VIEW ON *.* TO 'zbx_monitor'@'%';

vim /etc/zabbix/zabbix_agentd.d/template_db_mysql.conf

#[client]
#user=zbx_monitor
#password=rasVPos11
UserParameter=mysql.ping[*], mysqladmin -h"$1" -P"$2" ping
UserParameter=mysql.get_status_variables[*], mysql -h"$1" -P"$2" -sNX -e "show global status"
UserParameter=mysql.version[*], mysqladmin -s -h"$1" -P"$2" version
UserParameter=mysql.db.discovery[*], mysql -h"$1" -P"$2" -sN -e "show databases"
UserParameter=mysql.dbsize[*], mysql -h"$1" -P"$2" -sN -e "SELECT COALESCE(SUM(DATA_LENGTH + INDEX_LENGTH),0) FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA='$3'"
UserParameter=mysql.replication.discovery[*], mysql -h"$1" -P"$2" -sNX -e "show slave status"
UserParameter=mysql.slave_status[*], mysql -h"$1" -P"$2" -sNX -e "show slave status"

mkdir /var/lib/zabbix
vim /var/lib/zabbix/.my.cnf
[client]
user=zbx_monitor
password=123456

#注意:使用systemd在Linux OS上启动Zabbix代理。例如,在Centos中,使用“ systemctl edit zabbix-agent.service”来设置所需的用户以启动Zabbix代理。
vim /etc/my.cnf 添加
[client]
user=zbx_monitor
password=123456

另一台原有旧客户端的,无法rpm安装新的客户端,源码安装。
编译安装客户端

wget https://cdn.zabbix.com/stable/4.4.8/zabbix-4.4.8.tar.gz
tar -zxvf zabbix-4.4.8.tar.gz
cd zabbix-4.4.8
./configure --enable-agent --with-mysql --with-net-snmp --with-libcurl --with-libxml2
make install

vim /usr/local/etc/zabbix_agentd.conf

Server=127.0.0.1    # 修改为服务端IP
ServerActive=127.0.0.1  # 修改为服务端IP
Hostname=Zabbix server # 这里可以改为其他名字,指是的客户端机器的命名 随意

/usr/local/sbin/zabbix_agentd 运行

加入开机启动