码迷,mamicode.com
首页 > 其他好文 > 详细

Zabbix第三章(安装)

时间:2020-05-17 19:17:25      阅读:78      评论:0      收藏:0      [点我收藏+]

标签:httpd   inux   selinux   char   主机   gpg   rest   相关配置   eve   


zabbix安装


1、时间同步、配置主机名/解析、SELinux/firewalld关闭

2、配置zabbix运行环境

  1. 配置yum源文件

[root@zabbix-server ~]# cat /etc/yum.repos.d/cent.repo

[root@zabbix-server ~]# cat /etc/yum.repos.d/centos.repo
[centos]
name=centos
baseurl=ftp://172.16.8.100/centos7u2
enabled=1
gpgcheck=0

[zabbix]
name=zabbix
baseurl=file:///zabbix
enabled=1
gpgcheck=0

  1. 安装依赖的软件

[root@zabbix-server ~]# yum install -y httpd mariadb mariadb-server mariadb-devel libdbi-dbd-mysql net-snmp net-snmp-devel net-snmp-utils curl-devel mod_ssl mod_auth_mysql mod_perl

  1. 开启各项服务并设置为开机自动启动

[root@zabbix-server ~]# systemctl start httpd
[root@zabbix-server ~]# systemctl enable httpd

[root@zabbix-server ~]# systemctl start mariadb
[root@zabbix-server ~]# systemctl enable mariadb

  1. 安装zabbix服务端

[root@zabbix-server ~]# yum install -y zabbix-server-mysql zabbix-web zabbix-web-mysql

  1. 创建并初始化zabbix数据库

mysql> CREATE DATABASE zabbix CHARACTER SET utf8;

mysql> GRANT all ON zabbix.* TO ‘zabbixuser‘@‘localhost‘ IDENTIFIED BY ‘redhat‘;

mysql> FLUSH PRIVILEGES;

  1. 导入数据表

[root@zabbix-server ~]# cd /usr/share/doc/zabbix-server-mysql-3.2.1/

[root@zabbix-server zabbix-server-mysql-3.2.1]# zcat create.sql.gz | mysql -u root -p zabbix

登陆mysql查询是否登陆成功(127张表)

7) 在zabbix_server.conf文件中编辑数据库相关配置

[root@server ~]# vim /etc/zabbix/zabbix_server.conf

DBHost=localhost
DBName=zabbix
DBUser=zabbixuser
DBPassword=redhat
DBSocket=/var/lib/mysql/mysql.sock

8) 启动Zabbix Server并配置其开机启动

[root@zabbix-server ~]# systemctl start zabbix-server
[root@zabbix-server ~]# systemctl enable zabbix-server

[root@server ~]# netstat -antp | grep zabbix
tcp 0 0 0.0.0.0:10051 0.0.0.0:* LISTEN 5909/zabbix_server
tcp 0 0 :::10051 ::?? LISTEN 5909/zabbix_server
[root@server ~]#

  1. 编辑zabbix.conf配置文件,指定PHP的时区

[root@zabbix-server zabbix-web-3.2.1]# vim /etc/httpd/conf.d/zabbix.conf

    php_value date.timezone Asia/Shanghai

[root@zabbix-server ~]# systemctl restart httpd

Zabbix第三章(安装)

标签:httpd   inux   selinux   char   主机   gpg   rest   相关配置   eve   

原文地址:https://www.cnblogs.com/huoxc/p/12899803.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!