标签:mmu NPU info zabbix配置 install server pass grep 加域
# 下载zabbix存储库
[root@www ~]# rpm -Uvh https://repo.zabbix.com/zabbix/4.2/rhel/7/x86_64/zabbix-release-4.2-1.el7.noarch.rpm
# 下载阿里存储库
[root@www ~]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
# 安装fedora存储库
[root@www ~]# yum install -y epel-release
# 安装zabbix时它会帮你安装lamp
[root@www ~]# yum -y install zabbix-server-mysql zabbix-web-mysql zabbix-agent zabbix-get
# 安装依赖包
[root@www ~]# yum -y install gcc gcc-c++ ncurses bison libgcrypt perl cmake ncurses-devel
# 下载整合包,大概500Mb左右(你可以yum安装mysql)
wget https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.24-1.el7.x86_64.rpm-bundle.tar
# 解压并安装依赖
[root@www ~]# tar -xvf mysql-5.7.24-1.el7.x86_64.rpm-bundle.tar
[root@www ~]# yum install mysql-community-{client,common,libs}-*
# 安装mysql的server端
[root@www ~]# rpm -ivh mysql-community-server-5.7.24-1.el7.x86_64.rpm
# 启动mysql
[root@www ~]# systemctl start mysqld
[root@www ~]# systemctl enable mysqld
# 获取生成的密码
[root@www ~] grep 'temporary password' /var/log/mysqld.log | awk '{print $NF}'
# 进入数据库并修改密码
[root@www ~] mysql -uroot -p'uWAhEJj+f7l6'
# mysql5.7的密码复杂性要高,否则修改失败。
mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'newpassword';
mysql> flush privileges;
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 'yourpassword';
Query OK, 0 rows affected, 1 warning (0.00 sec)
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> quit;
Bye
# 将数据导入zabbix库
[root@www ~]# zcat /usr/share/doc/zabbix-server-mysql-4.2.0/create.sql.gz | mysql -uzabbix -pyourpassword --database zabbix
# 修改主机名
[root@www ~]# nmcli g h server.zabbix.com
# 添加域名解析
[root@www ~]# echo "192.168.100.101 server.zabbix.com" >> /etc/hosts
# 修改时区
[root@www ~]# vim /etc/httpd/conf.d/zabbix.conf
# 修改如下内容,并删除注释
php_value date.timezone Asia/Shanghai
# 养成备份的好习惯
[root@www zabbix]# cd /etc/zabbix
[root@www zabbix]# cp zabbix_agentd.conf zabbix_agentd.conf.back
[root@www zabbix]# cp zabbix_server.conf zabbix_server.conf.back
[root@www zabbix]# cd
# 数据库密码
[root@www ~]# echo "DBPassword=yourpassword" >> /etc/zabbix/zabbix_server.conf
# 修改agent
[root@www ~]# vim /etc/zabbix/zabbix_agentd.conf
# 修改如下内容
Hostname=server.zabbix.com
Server=192.168.100.101
#ServerActive=127.0.0.1 # 将这一行注释掉
# 重启服务
[root@www ~]# systemctl restart zabbix-server zabbix-agent httpd
[root@www ~]# systemctl enable zabbix-server zabbix-agent httpd
[root@www ~]# netstat -anput | grep 1005
tcp 0 0 0.0.0.0:10050 0.0.0.0:* LISTEN 1718/zabbix_agentd
tcp 0 0 0.0.0.0:10051 0.0.0.0:* LISTEN 1729/zabbix_server
访问:http://192.168.100.101/zabbix
标签:mmu NPU info zabbix配置 install server pass grep 加域
原文地址:https://www.cnblogs.com/liuhedong/p/10677774.html