zabbix理解和安装
程序员文章站
2022-07-11 11:41:57
...
目录标题
1. zabbix概念
2. zabbix实验
安装rhel7.5虚拟机
- 配置网络
- 配置yum源
yum install vim lftp net-tools -y - systemctl stop NetworkManager
systemctl disable NetworkManager - systemctl stop firewalld
systemctl disable firewalld - 写入解析/etc/hosts
172.25.60.1 server1 - 关闭selinux
vim /etc/sysconfig/selinux
disabled - 快照虚拟机之后不是eth0网卡:
vim /boot/grub2/grub.cfg
安装zabbix
server4:server server2和server3是agent
- 按顺序安装
[aaa@qq.com zabbix4.4]# yum install zabbix-server-mysql-4.4.1-1.el7.x86_64.rpm zabbix-web-mysql-4.4.1-1.el7.noarch.rpm zabbix-web-4.4.1-1.el7.noarch.rpm php-* fping-3.10-1.el7.x86_64.rpm
[aaa@qq.com zabbix4.4]# yum install mariadb-server -y
[aaa@qq.com zabbix4.4]# systemctl start mariadb
[aaa@qq.com zabbix4.4]# mysql_secure_installation
- 初始化zabbix数据库
[aaa@qq.com zabbix4.4]# mysql -uroot -p
MariaDB [(none)]> create database zabbix character set utf8 collate utf8_bin;
Query OK, 1 row affected (0.00 sec)
MariaDB [(none)]> grant all privileges on zabbix.* to aaa@qq.com
-> identified by 'redhat'; # 给zabbix用户权限
Query OK, 0 rows affected (0.00 sec)
- 导入创建的zabbix数据库
[aaa@qq.com zabbix4.4]# zcat /usr/share/doc/zabbix-server-mysql-4.4.1/create.sql.gz | mysql -uzabbix -p zabbix
Enter password:
[aaa@qq.com zabbix4.4]# mysql -uroot -predhat
MariaDB [(none)]> use zabbix;
Database changed
MariaDB [zabbix]> show tables;
+----------------------------+
| Tables_in_zabbix |
+----------------------------+
| acknowledges |
| actions |
| alerts |
| application_discovery |
| application_prototype |
| application_template |
- 配置zabbix server
[aaa@qq.com zabbix4.4]# vim /etc/zabbix/zabbix_server.conf
124 DBPassword=redhat
[aaa@qq.com zabbix4.4]# systemctl start zabbix-server
[aaa@qq.com zabbix4.4]# netstat -antlpe
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address State User Inode PID/Program name
tcp 0 0 0.0.0.0:10051 0.0.0.0:* LISTEN 998 63338 12870/zabbix_server
#10051是zabbix监听的端口
- zabbix web
[aaa@qq.com zabbix4.4]# rpm -ql zabbix-web # 查看zabbix-web生成的文件
/etc/httpd/conf.d/zabbix.conf
[aaa@qq.com zabbix4.4]# vim /etc/httpd/conf.d/zabbix.conf # 修改时区
php_value date.timezone Asia/Shanghai
[aaa@qq.com zabbix4.4]# systemctl start httpd
测试:
next step
next step
username:Admin
Password:zabbix
点击右上角的用户,可更改语言