Centos7系统安装Zabbix4.4步骤详解
1. 虚拟机中安装Centos7系统
本次实验使用最小系统安装,安装完后可以先进行内核软件更新(yum -y update)时间比较久,快速配置可以忽略此步骤。
2.关闭Centos7的SELinux和防火墙配置
关闭SELinux
[root@zabbix-server ~]# setenforce 0
[root@zabbix-server ~]# vi /etc/selinux/config
# This file controls the state of SELinux on the system. # SELINUX= can take one of these three values: # enforcing - SELinux security policy is enforced. # permissive - SELinux prints warnings instead of enforcing. # disabled - No SELinux policy is loaded. SELINUX=disabled # SELINUXTYPE= can take one of three values: # targeted - Targeted processes are protected, # minimum - Modification of targeted policy. Only selected processes are protected. # mls - Multi Level Security protection. SELINUXTYPE=targeted
关闭防火墙配置
[root@zabbix-server ~]# systemctl stop firewalld.service
[root@zabbix-server ~]# systemctl disable firewalld.service
3.部署zabbix4.4服务器、zabbix4.4官网教程链接
1.安装 数据库
[root@zabbix-server ~]# rpm -Uvh https://repo.zabbix.com/zabbix/4.4/rhel/7/x86_64/zabbix-release-4.4-1.el7.noarch.rpm
[root@zabbix-server ~]# yum clean all
[root@zabbix-server ~]# yum makecache
2.安装Zabbix服务器,前端,代理(如果没有安装成功,需多次执行下载才能完全安装)
[root@zabbix-server ~]# yum -y install zabbix-server-MysqL zabbix-web-MysqL zabbix-agent
把三个服务全部安装完成
3. 安装mariadb数据库(设置开机启动)
//更新MARIABD数据库
[root@zabbix-server ~]# yum install -y mariadb-server
//启动服务
[root@zabbix-server ~]# systemctl start mariadb.service
//设置开机启动
[root@zabbix-server ~]# systemctl enable mariadb.service
[root@zabbix-server ~]# MysqL -uroot -p Enter password: //空密码直接按回车键 Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 2 Server version: 5.5.64-MariaDB MariaDB Server copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. 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 zabbix@localhost identified by 'zn123456'; Query OK, 0 rows affected (0.00 sec) MariaDB [(none)]> flush privileges; Query OK, 0 rows affected (0.00 sec) MariaDB [(none)]> quit; Bye
[root@zabbix-server ~]# zcat /usr/share/doc/zabbix-server-MysqL*/create.sql.gz | MysqL -uzabbix -p zabbix Enter password: ###密码:zn123456
6.为Zabbix server配置数据库
[root@zabbix-server ~]# vi /etc/zabbix/zabbix_server.conf
DBHost=localhost dbname=zabbix DBUser=zabbix DBPassword=zn123456
7.修改时区
[root@zabbix-server ~]# vi /etc/httpd/conf.d/zabbix.conf
# # Zabbix monitoring system PHP web frontend # Alias /zabbix /usr/share/zabbix <Directory "/usr/share/zabbix"> Options FollowSymLinks AllowOverride None Require all granted <IfModule mod_PHP5.c> PHP_value max_execution_time 300 PHP_value memory_limit 128M PHP_value post_max_size 16M PHP_value upload_max_filesize 2M PHP_value max_input_time 300 PHP_value max_input_vars 10000 PHP_value always_populate_raw_post_data -1 # PHP_value date.timezone Europe/Riga PHP_value date.timezone Asia/Shanghai </IfModule> </Directory> <Directory "/usr/share/zabbix/conf"> Require all denied </Directory> <Directory "/usr/share/zabbix/app"> Require all denied </Directory> <Directory "/usr/share/zabbix/include"> Require all denied </Directory> <Directory "/usr/share/zabbix/local"> Require all denied </Directory>
8.启动Zabbix server和agent进程
[root@zabbix-server ~]# systemctl restart zabbix-server zabbix-agent httpd
[root@zabbix-server ~]# systemctl enable zabbix-server zabbix-agent httpd
9.为Centos7配置IP地址。
10.配置Zabbix前端
连接到新安装的Zabbix前端:http://10.10.1.88/zabbix
zabbix网页登录
如果浏览器进不去,一直报错,尝试换个浏览器。
在浏览器输入http://zabbix服务器ip/zabbix/index.PHP,输入管理员用户名Admin(区分大小写),默认密码zabbix,点击登入即可。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。