zabbix是一个基于WEB界面的具有采集数据、数据存储、告警系统和展示系统与一身的开源解决方案。下面来学习一下基础的使用方法吧,相信对于初学者很有用。
首先准备两台虚拟机,一台用做与WEB联系的服务端,一台用做被服务端监控的主机。我这里准备了两台主机,分别命名为server.magedu.com、node1.magedu.com.
server.magedu.com 172.17.160.80
node1.magedu.com 172.17.252.242
步骤:
一、首先对server端进行操作:
1、安装yum源,因为我们要安装zabbix相关软件,所以需要对应的yum源,当然你也可以不安装,但是需要去官网一个一个下载对应的源码包,非常麻烦,这里安装yum源就是解决这个问题了。先去官网把Yum源下载下来。官网地址为:www.zabbix.com,然后根据对应的电脑系统去下载即可。
2、安装yum源
[root@server ~]# rpm -ivh zabbix-release-3.4-1.el7.centos.noarch.rpm
[root@server ~]# yum repolist
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
repo id repo name status
!base centos 9,363
!epel epel 11,349
!zabbix/x86_64 Zabbix Official Repository - x86_64 80
!zabbix-non-supported/x86_64 Zabbix Official Repository non-supported - x86_64 4
repolist: 20,796
若出现以上,证明已经安装成功。
3、下面安装数据库,并对数据库配置文件进行修改,安装数据库是要对server服务器的数据进行保存。
[root@server ~]# yum install mariadb-server
[root@server ~]# vim /etc/my.cnf.d/server.cnf
# this is read by the standalone daemon and embedded servers
[server]
skip_name_resolve=ON
innodb_file_per_table=ON
innodb_buffer_pool_size=256M
max_connections=2000
log-bin=master-log
4、启动数据库,并创建一个保存数据的数据库名。
[root@server ~]# systemctl start mariadb
[root@server ~]# mysql
MariaDB [(none)]> create database zabbix;
MariaDB [(none)]> grant all on zabbix.* to 'zbxuser'@'172.17.%.%' identified by 'zbxpass';