Tutorial diagram of installing zabbix2.4 under centos6.5

Tutorial diagram of installing zabbix2.4 under centos6.5

The fixed IP address of the centos-DVD1 version system is 192.168.159.128, and the address of the centos-mininal version system is 192.168.1.* or 192.168.2.* network segment

Zabbix2.4 installation (centos6.5)

Zabbix has its own yum source, and LNMP can be downloaded and installed by yourself at https://lnmp.org/

The first step is to install the official zabbix source of zabbix. The address is as follows:

rpm -ivh http://repo.zabbix.com/zabbix/2.4/rhel/6/x86_64/zabbix-release-2.4-1.el6.noarch.rpm 

The second step is to use the yum installation method to automatically install the zabbix server and agent and other related RPM packages

yum install -y mysql mysql-server zabbix-server-mysql zabbix-web-mysql zabbix-agent 

zabbix-get: This command is mainly used to obtain monitoring data. After successful installation, you need to create a zabbix database and user in mysql.

Failed to enter the database, check if the mysqld service is not started, just start it!

Start the mysql database service: /etc/init.d/mysqld start

Enter the database: mysql -uroot

*****************************************************************************************************************

Format: grant permission on database name.table name to user@login host identified by "user password";

GRANT ALL PRIVILEGES ON *.* TO zabbixuser@"%" IDENTIFIED BY "xxx";
FLUSH PRIVILEGES;

*******************************************************************************************************************************************

Create a database and user:

mysql> createdatabase zabbix character set utf8 collate utf8_bin;
mysql> grant all privileges on zabbix.* to zabbix@localhostidentified by 'zabbix';
flush privileges;
show databases; 

mysql> quit; or \q

The data of the zabbix monitoring system is stored in the database, and some tables need to be created.

View the table creation statement and import it;

[root@localhost~]# cd /usr/share/doc/zabbix-server-mysql-2.4.8/create
[root@localhost create]#ll 

Import the database:

[root@localhost create]# mysql -uroot zabbix< schema.sql
[root@localhostcreate]# mysql -uroot zabbix < images.sql
[root@localhostcreate]# mysql -uroot zabbix < data.sql 

Modify the zabbix server configuration file: (remove the # sign if necessary)

[root@localhost ~]#vi /etc/zabbix/zabbix_server.conf
DBHost=localhost
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix
Installation of vim#yum search vim //View vim related software information#yum install -y vim* //Install vim online 

Change the time zone;

[root@localhost~]# vim /etc/php.ini// Add the following content to the end of the php.ini configuration file [shift+g jump to the last line of the file]
php_valuemax_execution_time 300
php_valuememory_limit 128M
php_valuepost_max_size 16M
php_valueupload_max_filesize 2M
php_valuemax_input_time 300

Remove the semicolon in front of ";date.timezone =", then write it in the top column, and assign the value after the equal sign to: Asia/Shanghai

After the modification is completed, the system will be restarted to take effect!

Check the current time:

[root@localhost~]# date

When checking the current time, the time is not synchronized and needs to be synchronized

Install time synchronization command

[ root@localhost~]#yum install ntpdate

Execute synchronization with US time

[root@localhost~]# ntpdate us.pool.ntp.org

Modify the time zone: (ln sf abb points to a) Synchronize time

[root@localhost~]# ln -sf /usr/share/zoneinfo/Asia/Shanghai /usr/localtime
[root@localhost~]#date 

Start the necessary services (restart): (It is boot-up. If the system is not started, the service will not start. You can start the service manually)

Manually start necessary services (without rebooting)

The firewall is enabled, chkconfig httpd on starts the httpd service, and the zabbix configuration page cannot be opened

Apache starts, but zabbix cannot be opened through the browser. The solution is to turn off the firewall and SELinux

Disable selinux: sed -i "s/SELINUX=enforcing/SELINUX=disabled/g"/etc/selinux/config

Confirm whether the modification is successful: #grepSELINUX /etc/selinux/config

Stop the firewall: /etc/init.d/iptables stop

I accidentally discovered a phenomenon. When I turned off iptables and stopped the iptables service, there were always some surprising things happening. When I started the system again and checked the iptables status, iptables was automatically turned on again. I was very helpless! After research, we found that libvirt (C function library of virtualization tool) will start iptables when booting. The way to permanently shut down iptables is through chkconfig tool. We only need to chkconfig iptables off.

[System environment]

CentOS release 6.7 (Final)

Turn off iptables

Start httpd: chkconfig httpd on

/etc/init.d/iptables stop # Turn off iptables

chkconfig iptables off #Permanently turn off iptables

chkconfig --list iptables # Check iptables

chkconfig --list httpd //Check the httpd startup status

iptables -L or /etc/init.d/iptables status # View the running status of iptables

cat /etc/redhat-release //View system version

To change the time zone:

# vim /etc/php.ini modify; date.timezone = Asia/Shanghai and remove the semicolon in front. You can also add it when modifying the time zone earlier

# /etc/init.d/httpd restart //After the modification is completed, restart

Restarting httpd will result in an error. Edit the httpd.conf file, vi /etc/httpd/conf/httpd.conf, and remove the # before ServerName www.example.com:80!

After restarting the system, the error message "the database has not started" appears again because the database has not been started. Execute the startup, and there will be no error next time you start the machine

[root@localhost ~]# chkconfig mysqld on

After all installations are completed, you just need to start the whole system!

Summarize

The above is the tutorial illustration of installing zabbix2.4 under centos6.5 introduced by the editor. I hope it will be helpful to everyone. If you have any questions, please leave me a message and the editor will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website!

You may also be interested in:
  • Use of Zabbix Api in Linux shell environment
  • Python calls zabbix api method example
  • Super detailed steps to install zabbix3.0 on centos7
  • Python implements Zabbix to send SMS script
  • Python gets the host through the zabbix api
  • How to obtain information from ZabbixAPI and implement Zabbix-API monitoring in Python
  • Centos7.4 zabbix3.4.7 source code installation method and steps
  • Installation and deployment of Zabbix based on Docker
  • Zabbix system port monitoring status
  • How to implement email alert in zabbix

<<:  Native js canvas to achieve a simple snake

>>:  Detailed graphic instructions for downloading and installing the unzipped version of MySQL 5.7.18 and starting the MySQL service

Recommend

Node+express to achieve paging effect

This article shares the specific code of node+exp...

Detailed explanation of Vue component reuse and expansion

Table of contents Overview Is the extension neces...

Detailed steps to install Mysql5.7.19 using yum on Centos7

There is no mysql by default in the yum source of...

Mysql query database capacity method steps

Query the total size of all databases Here’s how:...

JavaScript canvas to achieve code rain effect

This article shares the specific code for canvas ...

Elementui exports data to xlsx and excel tables

Recently, I learned about the Vue project and cam...

Vue realizes simple effect of running light

This article shares the specific code of Vue to a...

A brief discussion on MySQL select optimization solution

Table of contents Examples from real life Slow qu...

MySQL 8.0.15 installation and configuration graphic tutorial

This article records the installation and configu...

Vue Element-ui table realizes tree structure table

This article shares the specific code of Element-...

Detailed explanation of the basic functions and usage of MySQL foreign keys

This article uses examples to illustrate the basi...