ubuntu 20.04 server 安装 zabbix
参考文档
zabbix没用过,用过prometheus,
因为现在很多应用都支持直接接入prometheus监控,
而且大部分语言都都有sdk支持,
可以直接接入自己的业务数据监控。
https://www.zabbix.com/cn/download?zabbix=6.4&os_distribution=ubuntu&os_version=20.04&components=server_frontend_agent&db=mysql&ws=apache
https://zhuanlan.zhihu.com/p/587415883?utm_id=0
https://repo.zabbix.com/zabbix/6.0/ubuntu/pool/main/z/zabbix-release/
https://blog.csdn.net/ammc520/article/details/134279322
在Ubuntu 20.04上安装MySQL教程
https://blog.csdn.net/m0_57165777/article/details/127977315
wget https://repo.zabbix.com/zabbix/6.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_6.0-4%2Bubuntu20.04_all.deb
sudo dpkg -i zabbix-release_6.0-4+ubuntu20.04_all.deb
选择完毕之后,下面 会自动的 显示
方案
agent 配置 文件 ,不要乱改动
如果不执行 下面这句话 再下面的 会出错
sudo apt-get update
sudo apt install zabbix-server-mysql zabbix-frontend-php zabbix-apache-conf zabbix-sql-scripts zabbix-agent
sudo apt install mysql-server
sudo apt-get install mysql-client
sudo mysql_secure_installation 可以 不弄这个
systemctl status mysql.service
输入上面的密码
use mysql;
select user,plugin from user;
update user set plugin=‘mysql_native_password’ where user=‘root’;
select user,plugin from user;
alter user ‘root’@‘localhost’ identified by ‘1234’;
flush privileges;
exit
sudo service mysql restart
Agent 和Agent2 选那个?
Agent2
用户名:Admin
密码:zabbix
真实步骤:
sudo su
wget https://repo.zabbix.com/zabbix/6.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_6.0-4+ubuntu20.04_all.deb
dpkg -i zabbix-release_6.0-4+ubuntu20.04_all.deb
apt update
apt install zabbix-server-mysql zabbix-frontend-php zabbix-apache-conf zabbix-sql-scripts zabbix-agent
mysql -uroot -p
create database zabbix character set utf8mb4 collate utf8mb4_bin;
create user zabbix@localhost identified by '123456';
grant all privileges on zabbix.* to zabbix@localhost;
set global log_bin_trust_function_creators = 1;
quit;
zcat /usr/share/zabbix-sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -p zabbix
mysql -uroot -p
set global log_bin_trust_function_creators = 0;
quit;
cd /etc/zabbix/
cp zabbix_server.conf bak_zabbix_server.conf
DBPassword=123456
systemctl restart zabbix-server zabbix-agent apache2
systemctl enable zabbix-server zabbix-agent apache2
使用
http://192.168.99.40/zabbix/
The default URL for Zabbix UI when using Apache web server is http://host/zabbix
This is the Zabbix welcome screen.
Enter the user name Admin with password zabbix to log in as a Zabbix superuser.
Access to Configuration and Administration menus will be granted.
用户名:
Admin
密码:
zabbix
安装 zabbix agent
sudo su
wget https://repo.zabbix.com/zabbix/6.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_6.0-4+ubuntu20.04_all.deb
dpkg -i zabbix-release_6.0-4+ubuntu20.04_all.deb
apt update
apt install zabbix-agent2 zabbix-agent2-plugin-*
systemctl restart zabbix-agent2
systemctl enable zabbix-agent2
Zabbix agent
怎么配置?
https://www.cnblogs.com/liyanping/p/9778971.html
1
192.168.99.50 是 agent2
192.168.99.40 是 server
在192.168.99.40 上面 运行 下面的命令:
apt install zabbix-get
zabbix_get -s 192.168.99.50 -k agent.hostname
zabbix_get -s 192.168.99.50 -k system.uname
在192.168.99.50 上面 运行 下面的命令:
tail /var/log/zabbix/zabbix_agent2.log
【运维】Zabbix运维指南:在Web界面配置Agent主机监控
https://blog.51cto.com/u_15903651/7416658
中文如何弄
Ubuntu系统配置Zabbix前端及中文乱码解决方案
https://www.cnblogs.com/yinzhengjie2020/p/12305904.html