zabbix4.4搭建
yum install -y httpd
systemctl start httpd
访问http://172.29.128.54/
若是nginx,配置文件为:
yum install -y php*
cat 1.php
<?php phpinfo(); ?>
systemctl start php-fpm
systemctl restart httpd
访问 http://172.29.128.54/1.php
yum install -y mariadb mariadb-server
systemctl start mariadb
初始化密码为空
mysql -uroot -p
update mysql.user set password=password("123456") where user='root' and host='localhost';
delete from mysql.user where password=""; select user,host,password from mysql.user;
create database zabbix character set utf8 collate utf8_bin; grant all on zabbix.* to 'gzb'@'%' identified by '123456';
flush privileges;
换源 [aliyun-os] name=aliyun-os baseurl=https://mirrors.aliyun.com/centos/7/os/x86_64/ enabled=1 gpgcheck=0 [aliyun-epel] name=aliyun-epel baseurl=https://mirrors.aliyun.com/epel/7/x86_64/ enabled=1 gpgcheck=0 [aliyun-extra] name=aliyun-extra baseurl=https://mirrors.aliyun.com/centos/7/extras/x86_64/ enabled=1 gpgcheck=0
[zabbix] name=Zabbix Official Repository - $basearch baseurl=http://repo.zabbix.com/zabbix/4.4/rhel/7/x86_64/ enabled=1 gpgcheck=0 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX-A14FE591 [zabbix-non-supported] name=Zabbix Official Repository non-supported - $basearch baseurl=http://repo.zabbix.com/non-supported/rhel/7/x86_64/ enabled=1 gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-ZABBIX gpgcheck=0
yum install -y zabbix-server-mysql zabbix-web-mysql zabbix-get
yum install -y zabbix-agent
cd /usr/share/doc/zabbix-server-mysql-4.4.10/ zcat create.sql.gz | mysql -ugzb -p123456 -h 172.29.128.54 zabbix
mysql -ugzb -p123456 -h 172.29.128.54 use zabbix; show tables;
vim /etc/zabbix/zabbix_server.conf
grep -vE "^$|#" /etc/zabbix/zabbix_server.conf
备注: sed -i "s/Hostname=Zabbix server/Hostname=`hostname`/g" /etc/zabbix/zabbix_agentd.conf sed -i "117c Server=192.168.90.10" /etc/zabbix/zabbix_agentd.conf sed -i "158c ServerActive=192.168.90.10" /etc/zabbix/zabbix_agentd.conf sed -i "N;280 a Timeout=30" /etc/zabbix/zabbix_agentd.conf systemctl restart zabbix-agent.service systemctl enable zabbix-agent.service rm -f zabbix-agent-5.0.17-1.el7.x86_64.rpm
systemctl restart httpd
systemctl start zabbix-server
netstat -nlpt
访问 http://172.29.128.54/zabbix
时区错误修复:
vim /etc/php.ini
date.timezone = Asia/Shanghai
cd /etc/httpd/conf.d/
vim zabbix.conf
php_value date.timezone Asia/Shanghai
systemctl restart httpd
输入用户名:Admin
密码:zabbix
grep -vE "^$|#" /etc/zabbix/zabbix_agentd.conf
解决中文乱码问题
cd /usr/share/zabbix/assets/fonts
vi /usr/share/zabbix/include/defines.inc.php
报警媒介类型
systemctl status sendmail
systemctl status postfix
systemctl stop postfix
systemctl disable postfix
yum install -y mailx.x86_64
配置mailx
vim /etc/mail.rc
set from=983509376@qq.com set smtp=smtp.qq.com set smtp-auth-user=983509376@qq.com set smtp-auth-password=hoxlfysxdoqmbbdj set smtp-auth=login
echo "test test内容" | mailx -s "test标题" guo_zhibin@ymsl.com.cn
查看zabbix版本号
/usr/sbin/zabbix_server -V
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 震惊!C++程序真的从main开始吗?99%的程序员都答错了
· winform 绘制太阳,地球,月球 运作规律
· 【硬核科普】Trae如何「偷看」你的代码?零基础破解AI编程运行原理
· 超详细:普通电脑也行Windows部署deepseek R1训练数据并当服务器共享给他人
· 上周热点回顾(3.3-3.9)