[ Date: 2017-09-30] | Source: cnblogs.com/it-hack Author: it-hack | [font: medium and small] |
---|
1[ root@linuxidc ~]# cat /etc/RedHat-release
23 CentOS Linux release 7.4.1708(Core)
1[ root@linuxidc ~]# systemctl stop firewalld.service #Turn off the firewall
23[ root@linuxidc ~]# systemctl disable firewalld.service #The firewall does not start at boot
4
1[ root@linuxidc ~]# sed -i 's/SELINUX=enforcing/SELINUX=disabled/'/etc/selinux/config #in/etc/selinux/config put SELNUX=Enforcing replaced with SELINUX=disabled
23[ root@linuxidc ~]# grep SELINUX=disabled /etc/selinux/config #Filter just changed disabled
45 SELINUX=disabled
67[ root@linuxidc ~]# setenforce 0 #Clear selinux configuration
89 setenforce: SELinux is disabled
MariaDB The database management system is a branch of MySQL, which is mainly maintained by the open source community and is licensed under GPL.
The reason for the development of this branch is that after Oracle acquired MySQL, there is a potential risk of closing MySQL to the source, so the community uses branching to avoid this risk.
The purpose of MariaDB is to be fully compatible with MySQL, including API and command line, so that it can easily become a substitute for MySQL.
[ root@linuxidc ~]# yum install mariadb-server mariadb –y
Loaded plugins: fastestmirror, langpacks
base
Omit the installation process
Installed:
mariadb.x86_64 1:5.5.56-2.el7 mariadb-server.x86_64 1:5.5.56-2.el7
Installed as a dependency:
perl-DBD-MySQL.x86_64 0:4.023-5.el7
Upgraded as a dependency:
mariadb-libs.x86_64 1:5.5.56-2.el7
complete!
1[ root@linuxidc ~]# systemctl start mariadb #Start MariaDB
23[ root@linuxidc ~]# systemctl stop mariadb #Stop MariaDB
45[ root@linuxidc ~]# systemctl restart mariadb #Restart MariaDB
67[ root@linuxidc ~]# systemctl enable mariadb #Set boot up
1[ root@linuxidc ~]# rpm -ivh http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-1.el7.centos.noarch.rpm
Get http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-1.el7.centos.noarch.rpm
In preparation... ################################ [100%]
Upgrading/installing...
1:zabbix-release-3.4-1.el7.centos ################################# [100%]
[ root@linuxidc ~]# yum install zabbix-server-mysql zabbix-web-mysql -y
Get http://repo.zabbix.com/zabbix/3.4/rhel/7/x86_64/zabbix-release-3.4-1.el7.centos.noarch.rpm
In preparation... ################################ [100%]
Upgrading/installing...
1:zabbix-release-3.4-1.el7.centos ################################# [100%]
1[ root@linuxidc ~]# yum install zabbix-server-mysql zabbix-web-mysql -y
Loaded plugins: fastestmirror, langpacks
zabbix | 2.9 kB 00:00:00
zabbix-non-supported | 951 B 00:00:00
zabbix/x86_64/primary_db | 18 kB 00:00:00
zabbix-non-supported/x86_64/primary | 1.6 kB 00:00:00
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* epel: mirrors.neusoft.edu.cn
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com
zabbix-non-supported 4/4
Installation omit the intermediate process
Installed:
zabbix-server-mysql.x86_64 0:3.4.1-1.el7 zabbix-web-mysql.noarch 0:3.4.1-1.el7
Installed as a dependency:
OpenIPMI-libs.x86_64 0:2.0.19-15.el7 OpenIPMI-modalias.x86_64 0:2.0.19-15.el7 fping.x86_64 0:3.10-4.el7
httpd.x86_64 0:2.4.6-67.el7.centos.2 httpd-tools.x86_64 0:2.4.6-67.el7.centos.2 iksemel.x86_64 0:1.4-6.el7
libzip.x86_64 0:0.10.1-8.el7 mailcap.noarch 0:2.1.41-2.el7 php.x86_64 0:5.4.16-42.el7
php-bcmath.x86_64 0:5.4.16-42.el7 php-cli.x86_64 0:5.4.16-42.el7 php-common.x86_64 0:5.4.16-42.el7
php-gd.x86_64 0:5.4.16-42.el7 php-ldap.x86_64 0:5.4.16-42.el7 php-mbstring.x86_64 0:5.4.16-42.el7
php-mysql.x86_64 0:5.4.16-42.el7 php-pdo.x86_64 0:5.4.16-42.el7 php-xml.x86_64 0:5.4.16-42.el7
t1lib.x86_64 0:5.1.2-14.el7 unixODBC.x86_64 0:2.3.1-11.el7 zabbix-web.noarch 0:3.4.1-1.el7
complete!
[ root@linuxidc ~]#
1[ root@linuxidc ~]# mysql
23 Welcome to the MariaDB monitor. Commands end with; or \g.45 Your MariaDB connection id is 267 Server version:5.5.56-MariaDB MariaDB Server
891011 Copyright(c)2000,2017, Oracle, MariaDB Corporation Ab and others.12131415 Type 'help;' or '\h'for help. Type '\c' to clear the current input statement.16171819 MariaDB [(none)]>2021 MariaDB [(none)]> create database zabbix character set utf8 collate utf8_bin;2223 Query OK,1 row affected(0.00 sec)2425 MariaDB [(none)]> grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';2627 Query OK,0 rows affected(0.08 sec)2829 MariaDB [(none)]> exit
3031 Bye
[ root@linuxidc ~]# zcat /usr/share/doc/zabbix-server-mysql-3.4.1/create.sql.gz |mysql -uzabbix -pzabbix zabbix
1[ root@linuxidc ~]# grep -n '^'[a-Z]/etc/zabbix/zabbix_server.conf
2338: LogFile=/var/log/zabbix/zabbix_server.log
4549: LogFileSize=06772:PidFile=/var/run/zabbix/zabbix_server.pid
8982: SocketDir=/var/run/zabbix
1011101: DBName=zabbix
1213117: DBUser=zabbix
1415316: SNMPTrapperFile=/var/log/snmptrap/snmptrap.log
1617434: Timeout=41819476:AlertScriptsPath=/usr/lib/zabbix/alertscripts
2021486: ExternalScripts=/usr/lib/zabbix/externalscripts
2223522: LogSlowQueries=3000
[ root
@linuxidc
~]# vim /etc/zabbix/zabbix_server.conf #Modify configuration file
1[ root@linuxidc ~]# systemctl start zabbix-server
23[ root@linuxidc ~]# systemctl enable zabbix-server
4
1[ root@linuxidc ~]# vim /etc/httpd/conf.d/zabbix.conf
Modified to Asia Shanghai
Save and exit
1[ root@linuxidc ~]# setsebool -P httpd_can_connect_zabbix on
23 setsebool: SELinux is disabled.45[root@linuxidc ~]# setsebool -P httpd_can_cetwork_connect_db on
67 setsebool: SELinux is disabled.
1[ root@linuxidc ~]# systemctl start httpd #Start httpd service
23[ root@linuxidc ~]# systemctl enable httpd #Set boot to start httpd service
http://192.168.1.18/zabbix/
Click next step
Click next step
Enter the database password
Click next step
Click next step
After confirming that the information is correct
Click next step
After completing the installation, a configuration file will be generated in /etc/zabbix/web/zabbix.conf.php
Congratulations! You have successfully installed Zabbix frontend.
Configuration file "/etc/zabbix/web/zabbix.conf.php" created.
1[ root@linuxidc ~]# cat /etc/zabbix/web/zabbix.conf.php
23<? php
45 // Zabbix GUI configuration file.67 global $DB;891011 $DB['TYPE']='MYSQL';1213 $DB['SERVER']='localhost';1415 $DB['PORT']='0';1617 $DB['DATABASE']='zabbix';1819 $DB['USER']='zabbix';2021 $DB['PASSWORD']='zabbix';22232425// Schema name. Used for IBM DB2 and PostgreSQL.2627 $DB['SCHEMA']='';28293031 $ZBX_SERVER ='localhost';3233 $ZBX_SERVER_PORT ='10051';3435 $ZBX_SERVER_NAME ='Zabbix monitoring platform';36373839 $IMAGE_FORMAT_DEFAULT = IMAGE_FORMAT_PNG;4041[root@linuxidc ~]#
Click finish
Log in to the latest version of Zabbix3.4 Default user Admin Default password zabbix
After entering the username and password, click sign in
At this point the installation has ended
1[ root@linuxidc ~]# yum install zabbix-agent –y
23 Loaded plugin: fastestmirror, langpacks
45 Loading mirror speeds from cached hostfile
67* base: mirrors.aliyun.com
89* epel: mirrors.tuna.tsinghua.edu.cn
1011* extras: mirrors.aliyun.com
1213* updates: mirrors.aliyun.com
1415 Resolving dependencies
1617 There are unfinished transactions remaining. You might consider running yum-complete-transaction, or "yum-complete-transaction --cleanup-only" and "yum history redo last", first to finish them. If those don't work you'll have to try removing/installing packages by hand(maybe package-cleanup can help).1819-->Checking transaction
2021- - - > Package zabbix-agent.x86_64.0.3.4.1-1.el7 will be installed
2223- - > Resolve dependencies complete
24252627 Dependency resolution
28293031=====================================================================================================================================================3233 Package architecture version source size
3435=====================================================================================================================================================3637 Installing:3839 zabbix-agent x86_64 3.4.1-1.el7 zabbix 353 k
40414243 Business summary
4445=====================================================================================================================================================4647 Install 1 package
48495051 Total downloads: 353 k
5253 Installation size: 1.3 M
5455 Downloading packages:5657 zabbix-agent-3.4.1-1.el7.x86_64.rpm |353 kB 00:00:045859 Running transaction check
6061 Running transaction test
6263 Transaction test succeeded
6465 Running transaction
6667 Installing: zabbix-agent-3.4.1-1.el7.x86_64 1/16869 verifying: zabbix-agent-3.4.1-1.el7.x86_64 1/170717273 installed:7475 zabbix-agent.x86_64 0:3.4.1-1.el7
76777879 complete!
8081
1[ root@linuxidc ~]# vim /etc/zabbix/zabbix_agentd.conf
Modify IP address server IP address
Enter IP address
Modify serverActive IP address
Enter IP address
[ root@linuxidc ~]# systemctl restart zabbix-agent.service
[ root@linuxidc ~]# systemctl enable zabbix-agent.service
Recommended Posts