MySQL installation zabbix4.0
A preparation environment
1.shutting down the systemSELinux[[email protected] ~] #vi/etc/selinux/config#This file Controls the state of the 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 these the values:# targeted-targeted processes is protected,# Mls-multi level Security protection.Restart the virtual machine when you are finished setting up2.Setting this parameter does not immediately restart the host when# Setenforce 03.ZabbixInstall reference DocumentationHttps://www.zabbix.com/documentation/4.0/manual/installation/install_from_packages/rhel_centos # #zabbix Installation Documentation
Two installation
4. Install rpm
RPM-IVHhttps://repo.zabbix.com/zabbix/3.5/rhel/7/x86_64/zabbix-release-3.5-1.el7.noarch.rpm5.Download the installation documentationwget https://repo.zabbix.com/zabbix/3.5/rhel/7/x86_64/zabbix-release-3.5-1.el7.noarch.rpm6.installationServer,AgentEndyum install mysql-server httpd phpYum install zabbix-server-mysql zabbix-web-mysqlYum Install zabbix-agent7.CreateZabbixDatabase> CREATE Database Zabbix;
8. Create the required tables in the Zabbix database
# cd/usr/share/doc/zabbix-server-mysql-4.0.0/
# Zcat Create.sql.gz | Mysql-uroot-pzabbix-s/home/mysql/mysqldb/db_master/mysql.sock Zabbix
9.The database creates the user and authorizes> Create user [email protected] ' 10.0.0.69 ';> Grant all privileges on * * to [e-mail protected] ' 10.0.0.69 ' identified by ' Oraclep ';> Flush Privileges;> Grant all privileges on * * to [email protected] ' localhost ' identified by ' Oraclep ';.Edit Filezabbix_server.confJoinServerEnd InformationAdd information:Socketdir=/var/run/zabbixdbhost=10.0.0.53Dbname=zabbixDbuser=zabbixDbpasswd=oraclepDbsocket=/home/mysql/mysqldb/db_slave/mysql.sock Zabbixdbport=33333One by one .View/etc/zabbix/zabbix_server.conf[email protected] ~]# grep-v ' ^# '/etc/zabbix/zabbix_server.conf |grep-v ' ^$ 'Logfile=/var/log/zabbix/zabbix_server.loglogfilesize=0Pidfile=/var/run/zabbix/zabbix_server.pidSocketdir=/var/run/zabbixdbhost=10.0.0.53Dbname=zabbixDbuser=zabbixDbpasswd=oraclepDbsocket=/home/mysql/mysqldb/db_slave/mysql.sock Zabbixdbport=33333Snmptrapperfile=/var/log/snmptrap/snmptrap.logtimeout=4alertscriptspath=/usr/lib/zabbix/alertscriptsexternalscripts=/usr/lib/zabbix/externalscriptslogslowqueries=3000.test the correctness of the above information# mysql-uzabbix-poraclep-s/home/mysql/mysqldb/db_master/mysql.sock-p 55555;Zabbix.start, turn off restart# systemctl Restart Zabbix-server# systemctl Start Zabbix-server# systemctl Stop Zabbix-server# systemctl Status Zabbix-server# systemctl Start zabbix-agent# systemctl Stop zabbix-agent.ViewZabbixLog[email protected] ~]# tail-f/var/log/zabbix/zabbix_server.log[email protected] ~]# tail-f/var/log/zabbix/zabbix_agent.logA .To Modify the time zone:vi/etc/httpd/conf.d/zabbix.confDepending on your time zone, you can cancel"Date.timezone"Set the comment, and configure it correctly. After the configuration file changes, a restart is requiredApache Webserver. Add the following lineDate.timezone = Asia/shanghai.CreateMySQLConnection DirectoryAgent-side database connection and password[email protected] zabbix]# mkdir-p/var/lib/zabbix# vi/var/lib/zabbix/.my.cnf[Client]password=User=rootSocket=/home/mysql/mysqldb/db_master/mysql.sock.Edit/etc/zabbix/zabbix_agentd.dJoinAgentEnd Information# CD/ETC/ZABBIX/ZABBIX_AGENTD.D# VI userparameter_mysql.confUserparameter=mysql.status[*],echo "show global status where Variable_name= ' Binlog_cache_use ';" | Home=/var/lib/zabbix Mysql-n | awk ' {print $} 'Find outHome=/var/lib/zabbix MySQLTest[email protected] zabbix_agentd.d]#Home=/var/lib/zabbix MySQLwith theAgentEnd Database connection with password the same pathcan connect to a database[email protected]host zabbix_agentd.d]# env|grep HOMEHome=/root.View/etc/zabbix/zabbix_agentd.conf[email protected] ~]# grep-v ' ^# '/etc/zabbix/zabbix_agentd.conf |grep-v ' ^$ 'Pidfile=/var/run/zabbix/zabbix_agentd.pidLogfile=/var/log/zabbix/zabbix_agentd.loglogfilesize=0server=10.0.0.69serveractive=10.0.0.69Hostname=localhostinclude=/etc/zabbix/zabbix_agentd.d/*.conf19.webWeb Connection# systemctl Start httpd# http://10.0.0.69/zabbix/setup.php
MySQL Database build Zabbix monitoring