标签:pop 要求 mit https fping rhel size ice grant
1 [root@imxhy01 ~]# yum -y install epel-release.noarch 2 [root@imxhy01 ~]# rpm -ivh http://repo.zabbix.com/zabbix/3.2/rhel/7/x86_64/zabbix-release-3.2-1.el7.noarch.rpm 3 [root@imxhy01 ~]# ls /etc/yum.repos.d/ #查看Zabbix源是否安装成功 4 epel.repo epel-testing.repo zabbix.repo 5 [root@imxhy ~]# yum -y install zabbix-get zabbix-server-mysql zabbix-web-mysql zabbix-web zabbix-agent
1 [root@imxhy01 ~]# yum -y install php-bcmath 2 [root@imxhy01 ~]# yum -y install php-mbstring #安装缺少的两个包,v3版本可以不安装。
1 [root@imxhy01 ~]# yum -y install mariadb mariadb-server 2 [root@imxhy01 ~]# vi /etc/my.cnf 3 [mysqld] 4 datadir=/var/lib/mysql 5 socket=/var/lib/mysql/mysql.sock 6 symbolic-links=0 7 character-set-server=utf8 #设置字符集为utf8 8 innodb_file_per_table=1 #设置innodb的每个表文件单独存储 10 [mysqld_safe] 11 log-error=/var/log/mariadb/mariadb.log 12 pid-file=/var/run/mariadb/mariadb.pid 13 …… 14 [root@imxhy01 ~]# systemctl enable mariadb #设为开机启动 15 [root@imxhy01 ~]# systemctl start mariadb #开启MariaDB数据
1 [root@imxhy01 ~]# groupadd zabbix #添加Zabbix组,3.x不需要手动添加 3 [root@imxhy01 ~]# useradd -g zabbix zabbix #添加Zabbix组,3.x不需要手动添加 5 [root@imxhy01 ~]# mysql_secure_installation #设置安全性,并设置数据库root密码 6 [root@imxhy01 ~]# mysql -u root -p 7 MariaDB [(none)]> create database zabbix character set utf8 collate utf8_bin; #创建数据库且字符集为utf8,使web界面显示中文不出现乱码 8 MariaDB [(none)]> grant all privileges on zabbix.* to zabbix@‘localhost‘ identified by ‘x120952576‘; 9 #创建zabbix数据库和Zabbix用户,且赋予此用户拥有此数据库全部权限。 10 MariaDB [(none)]> flush privileges; 11 MariaDB [(none)]> exit;
1 UPDATE zabbix.user SET passwd=md5(‘zabbix‘) WHERE alias=‘Admin‘
1 [root@imxhy01 ~]# cd /usr/share/doc/zabbix-server-mysql-3.2.1/ #进入数据库模板所在目录 2 [root@imxhy01 zabbix-server-mysql-3.2.0]# ls 3 AUTHORS ChangeLog COPYING create.sql.gz NEWS README 4 [root@imxhy01 zabbix-server-mysql-3.2.0]# zcat create.sql.gz | mysql -uroot -p zabbix #将模板数据恢复至Zabbix数据库 6 Enter password: 7 [root@imxhy01 ~]# mysql -u zabbix -p #用Zabbix用户登录
1 MariaDB [(none)]> show databases; 2 +-----------------------+ 3 | Database | 4 +-----------------------+ 5 | information_schema | 6 | zabbix | 7 +-----------------------+ 8 2 rows in set (0.00 sec) 9 MariaDB [(none)]> use zabbix; 10 MariaDB [zabbix]> show tables; #查看数据表项
1 [root@imxhy01 ~]# vi /etc/zabbix/zabbix_server.conf 2 LogFile=/var/log/zabbix/zabbix_server.log 3 LogFileSize=0 4 PidFile=/var/run/zabbix/zabbix_server.pid 5 DBHost=localhost #修改主机 6 DBName=zabbix 7 DBUser=zabbix 8 DBPassword=x120952576 #修改DB密码(之前所创建密码) 9 SNMPTrapperFile=/var/log/snmptrap/snmptrap.log 10 Timeout=4 11 AlertScriptsPath=/usr/lib/zabbix/alertscripts 12 ExternalScripts=/usr/lib/zabbix/externalscripts 13 LogSlowQueries=3000
1 [root@imxhy01 ~]# systemctl enable zabbix-server #设为开机启动Zabbix服务 2 [root@imxhy01 ~]# systemctl start zabbix-server #启动Zabbix服务 3 [root@imxhy01 ~]# systemctl start zabbix-agent #需要监控自己,因此也开启agent 4 [root@imxhy01 ~]# systemctl enable zabbix-agent #启动Zabbix服务
1 [root@imxhy ~] vi /etc/php.ini 2 date.timezone= Asia/Shanghai 3 max_execution_time = 300 4 post_max_size = 16M 5 memory_limit = 128M 6 [root@imxhy ~]# vi /etc/httpd/conf.d/zabbix.conf 7 Alias /zabbix /usr/share/zabbix 8 <Directory "/usr/share/zabbix"> 9 Options FollowSymLinks 10 AllowOverride None 11 Require all granted 12 Allow from all 13 php_value max_execution_time 300 14 php_value memory_limit 128M 15 php_value post_max_size 16M 16 php_value upload_max_filesize 2M 17 php_value max_input_time 300 18 php_value always_populate_raw_post_data -1 19 php_value date.timezone Asia/Shanghai 20 </Directory>
1 [root@imxhy01 ~]# firewall-cmd --permanent --add-service=http #防火墙开放Apache服务 2 [root@imxhy01 ~]# firewall-cmd --permanent --add-port=10051/tcp #防火墙开放Zabbix所需端口 3 [root@imxhy01 ~]# firewall-cmd --permanent --add-port=10050/tcp #防火墙开放Zabbix所需端口 4 [root@imxhy01 ~]# firewall-cmd --reload 5 [root@imxhy01 ~]# chcon -R -t httpd_sys_content_rw_t /usr/share/zabbix/conf 6 [root@imxhy01 ~]# yum -y install policycoreutils-python 7 [root@imxhy01 ~]# setsebool -P httpd_can_network_connect=true 8 [root@imxhy01 ~]# semanage port -a -t http_port_t -p tcp 10051
1 [root@imxhy01 ~]# systemctl start httpd.service 2 [root@imxhy01 ~]# systemctl enable httpd.service
1 [root@imxhy01 ~]# echo -n admin | openssl md5 2 (stdin)= 21232f297a57a5a743894a0e4a801fc3 #admin经过md5生成的加密的密码 3 [root@imxhy01 ~]# mysql -u root -p #进入数据库 4 MariaDB [(none)]> use zabbix; #选择zabbix数据库 5 MariaDB [zabbix]> select * from users; #查看users用户表可知Admin用户的ID为1,passwd为一串加密的密码 6 MariaDB [zabbix]> update users set passwd=‘21232f297a57a5a743894a0e4a801fc3‘ where userid = ‘1‘; #将userid为1的用户即Admin的密码更新。 7 MariaDB [(none)]> flush privileges; #刷新权限即可 8 MariaDB [(none)]> exit;
标签:pop 要求 mit https fping rhel size ice grant
原文地址:https://www.cnblogs.com/itzgr/p/9962771.html