CentOS 安装配置zabbix库
安装zabbix库
1 | $ sudo rpm -ivh https://repo.zabbix.com/zabbix/5.4/rhel/7/x86_64/zabbix-release-5.4-1.el7.noarch.rpm |
新建数据库
新建 zabbix Mysql 数据库及专用账号
1 | $ mysql |
1 | mysql > CREATE DATABASE zabbix character set utf8 collate utf8_bin; |
导入数据
默认情况下,执行下述命令就可以;
1 | # zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p zabbix |
但是我好想没有找到这个压缩文件,所以执行下面的命令:
1 | $ cd /usr/share/zabbix-mysql/ |
配置数据库
1 | $ vim /etc/zabbix/zabbix_server.conf |
启动 Zabbix server 进程
1 | $ service zabbix-server start |
web UI 安装zabbix
重启一下Httpd 服务后,进入 http://zabbix-server-ip/zabbix 即可web配置,
初始登录信息为Admin/zabbix
安装zabbix agent
安装Zabbix Agent
1 | yum install zabbix-agent |
编辑Zabbix Agent 配置文件
1 | vim /etc/zabbix/zabbix_agentd.conf |
重启Zabbix Agent
1 | service zabbix-agent restart |
Zabbix agent on Zabbix server is unreachable for 5 minutes
checked and found that the ServerActive address is not changed to zabbix-server IP address in configuration file. So we changed it to Zabbix-server IP.
We made the changes in:
1 | /etc/zabbix/zabbix_agentd.conf |
and restarted the service using:
1 | $ sudo service zabbix-agent2 start |
This fixed the issue.
Not able to find zabbix data source in grafana After enabling plugin
It appears as signed on grafana’s plugin panel, but /etc/grafana/grafana.ini needs editing.
…
[plugins]
allow_loading_unsigned_plugins = alexanderzobnin-zabbix-datasource
zabbix 无法启动server服务器
可以检查日志tailf /var/log/zabbix/zabbix_server.log
ZABBIX 报错连接拒绝(cannot connect to [10050]: [111] Connection refused)
首先还是看一下防火墙等是不是阻断.
然后确认数据库的最大连接数.默认的是256.
1.vim /etc/my.cnf
[mysqld]
max_connections=需要添加的最大连接数
2.vim /etc/systemd/system.conf
DefaultLimitNOFILE=65535
DefaultLimitNPROC=65535
3.重启
systemctl daemon-reload
systemctl restart mysqld.service
查看最大连接数
mysql>show variables like ‘max_connections’;
查看当前连接数
show status like ‘%thread%’;