监控服务zabbix部署
1.监控服务zabbix部署
环境说明:
环境 | IP | 要安装的应用 |
---|---|---|
服务器 | 192.168.237.168 | lamp架构 zabbix server zabbix agent |
客户端 | 192.168.237.169 | zabbix agent |
因为zabbix
是用php
语言开发的,所以必须先部署lamp
架构,使其能够支持运行php
网页
1.1 zabbix服务端安装
//安装依赖包
[root@server ~]# yum -y install net-snmp-devel libevent-devel
//下载zabbix
[root@server src]# wget https://cdn.zabbix.com/zabbix/sources/stable/5.4/zabbix-5.4.4.tar.gz
//解压
[root@server src]# tar xf zabbix-5.4.4.tar.gz
[root@server src]# ls zabbix-5.4.4
aclocal.m4 ChangeLog config.sub database install-sh man README
AUTHORS compile configure depcomp m4 misc sass
bin conf configure.ac include Makefile.am missing src
build config.guess COPYING INSTALL Makefile.in NEWS ui
//创建用户
[root@server src]# useradd -r -M -s /sbin/nologin zabbix
//配置数据库
mysql> create database zabbix character set utf8 collate utf8_bin; //创建数据库
Query OK, 1 row affected (0.00 sec)
mysql> grant all privileges on zabbix.* to 'zabbix'@'localhost' identified by 'zabbix123!'; //授权用户
Query OK, 0 rows affected, 2 warnings (0.01 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.01 sec)
mysql> quit
Bye
//依次导入架构、图片、数据到zabbix数据库
[root@server zabbix-5.4.4]# cd database/
[root@server database]# ls
elasticsearch Makefile.am Makefile.in mysql oracle postgresql sqlite3
[root@server database]# cd mysql/ //使用哪种数据库