Zabbix安装:
- 安装yum源
#rpm -Uvh https://repo.zabbix.com/zabbix/4.4/rhel/7/x86_64/zabbix-release-4.4-1.el7.noarch.rpm
yum check-update
- 安装zabbix相关软件,端口号:10051
#yum install zabbix-server-mysql zabbix-web-mysql - 安装数据库mariadb,配置数据库端口号:3306
#yum install mariadb mariadb-server
#systemctl start mariadb
#mysqladmin -u root password “密码”
#mysql -uroot -p
输入密码,进入数据库
MariaDB [(none)]> create database zabbix character set utf8 collate utf8_bin;
MariaDB [(none)]> create user zabbix@localhost identified by '密码“;
MariaDB [(none)]> grant all privileges on zabbix.* to zabbix@localhost;(不授权无法导入) - 配置zabbix配置文件
#vim /etc/zabbix/zabbix-server.conf
DBPassword=密码 - 导入表结构
#zcat /usr/share/doc/zabbix-server-mysql*/create.sql.gz | mysql -uzabbix -p 密码 - 开始配置zabbix网页界面(ip地址/zabbix)
如果忘记zabbix ,可以登入数据库修改
补充:
如果需要使用zabbix-agent: - 安装zabbix-agent软件,端口号:10050
#yum install zabbix-agent
#systemctl start zabbix-agent - 使用zabbix-get软件
#yum install zabbix-get
如果zabbix-server和zabbix-agent在同一台服务器上,需要修改IP地址
#vim /etc/zabbix/zabbix_agentd.conf
Server=实际IP地址
#zabbix_get -s 10.10.10.3 -p 10050 -k “system.cpu.load[all,avg1]” cpu使用
配置grafana图形软件
- 安装yum源,端口号:3000
#wget https://dl.grafana.com/oss/release/grafana-6.4.4-1.x86_64.rpm
yum localinstall grafana-6.4.4-1.x86_64.rpm
#systemctl daemon-reload
#systemctl start grafana-server
#systemctl enable grafana-server
2. 安装zabbix插件
#grafana-cli plugins install alexanderzobnin-zabbix-app
systemctl restart grafana-server
- 配置zabbix参数
#vi /etc/zabbix/zabbix_server.conf
取消注释:SocketDir=/var/run/zabbix
#systemctl restart zabbix-server