zabbix官方安装部署教程地址:
https://www.zabbix.com/cn/download?zabbix=4.0&os_distribution=red_hat_enterprise_linux&os_version=8&db=mysql&ws=apache
- 安装zabbix源
# rpm -Uvh https://repo.zabbix.com/zabbix/4.0/rhel/8/x86_64/zabbix-release-4.0-2.el8.noarch.rpm
# dnf clean all
- 安装Zabbix server,Web前端,agent
# dnf install zabbix-server-mysql zabbix-web-mysql zabbix-agent
- 安装mysql:
# dnf install mariadb-server
初始优化mariadb
# mysql_secure_installation
- 创建初始化数据库
# mysql -uroot -p
password
mysql> create database zabbix character set utf8 collate utf8_bin;
mysql> create user zabbix@localhost identified by 'password';
mysql> grant all privileges on zabbix.* to zabbix@localhost;
mysql> quit;
- 导入初始架构和数据,系统将提示您输入新创建的密码。
# zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p 123456 zappix
-
为Zabbix server配置数据库
编辑配置文件 /etc/zabbix/zabbix_server.conf
DBHost=localhost
DBPassword=123456
-
为Zabbix前端配置PHP时区
编辑配置文件 /etc/php-fpm.d/zabbix.conf, uncomment and set the right timezone for you.
php_value[date.timezone] = Asia/Shanghai
8.启动php-fpm失败处理如下:
#systemctl status php-fpm.service
9月 20 22:02:35 k8s-master systemd[1]: Starting The PHP FastCGI Process Manager...
9月 20 22:02:35 k8s-master php-fpm[5376]: [20-Sep-2020 22:02:35] ERROR: [/etc/php-fpm.d/zabbix.conf:6] unknown entry 'listen.acl_users'
9月 20 22:02:35 k8s-master php-fpm[5376]: [20-Sep-2020 22:02:35] ERROR: Unable to include /etc/php-fpm.d/zabbix.conf from /etc/php-fpm.conf at line 6
9月 20 22:02:35 k8s-master php-fpm[5376]: [20-Sep-2020 22:02:35] ERROR: failed to load configuration file '/etc/php-fpm.conf'
9月 20 22:02:35 k8s-master php-fpm[5376]: [20-Sep-2020 22:02:35] ERROR: FPM initialization failed
9月 20 22:02:35 k8s-master systemd[1]: php-fpm.service: main process exited, code=exited, status=78/n/a
9月 20 22:02:35 k8s-master systemd[1]: Failed to start The PHP FastCGI Process Manager.
9月 20 22:02:35 k8s-master systemd[1]: Unit php-fpm.service entered failed state.
9月 20 22:02:35 k8s-master systemd[1]: php-fpm.service failed.
将zabbix.conf的地6行注释
listen.acl_users = apache,nginx
zabbix-server-mysql依赖包
http://springdale.math.ias.edu/data/puias/unsupported/7/x86_64/iksemel-1.4-6.sdl7.x86_64.rpm
zabbix官方安装包
https://cdn.zabbix.com/zabbix/sources/stable/4.0/zabbix-4.0.24.tar.gz
Zabbix初始密码:
Admin/zabbix
客户端安装:
添加zabbix用户组:
groupadd --system zabbix
useradd --system -g zabbix -d /usr/lib/zabbix -s /sbin/nologin -c "Zabbix Monitoring System" zabbix
下载编译安装包:
wget https://cdn.zabbix.com/zabbix/sources/stable/4.0/zabbix-4.0.24.tar.gz
./configure --prefix=/usr/local/zabbix --enable-agent
make install
修改zabbix-agent配置文件
vim /usr/local/zabbix/etc/zabbix_agentd.conf
查找ServerActive=127.0.0.1
将地址修改为zabbix-server端IP地址
启动zabbix-agent:
usr/local/zabbix/sbin/zabbix_agentd -c /usr/local/zabbix/etc/zabbix_agentd.conf
添加监控主机:
web端选择[配置]→[主机]→[创建主机]
版权声明:本文为weixin_43987292原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。