Zabbix installation configuration under white can understand the Linux system

lab environment:

OS: Centos 7.6

Server ip: 192.168.10.100

Users running: root

Network: Internet

Zabbix is ​​based on providing a distributed system monitoring and networking capabilities of the web interface of Open Source enterprise-class monitoring tools, as a business operation and maintenance personnel, zabbix can be of great help to businesses and operation and maintenance personnel, zabbix is a very powerful, cross-platform, open-source enterprise-class operation and maintenance management system, consists of two parts: zabbix service and client (agentd), also comes through the system SNMP to collect data.

 

Zabbix can be deployed on Windows, Linux on, unix, MAC OS and other platforms, you can monitor any network devices, operating systems, middleware, database, operation and maintenance technicians as a business, it is very important to monitor to ensure that online business stable operation, a lot more business online and running servers and other network equipment, so we can find a server failure by monitoring, easy operation and maintenance personnel to identify problems and solve technical problems, and can be micro-channel business, enterprise QQ corporate nails, SMS realize alarm function, faults can be timely by the administrator; open source monitoring system as well as nagios, cacti, ganglia, we are here only described in detail zabbix monitoring, but in order to build a monitoring system still needs zabbix there are Linux technology, there must be an understanding of Linux and are familiar with some of the common commands and configuration, operation and maintenance companies now also essential, if you want to operation and maintenance can get to know the direction of development under "Linux in respect of such a study." this side tutorials, which are very detailed, more suitable for beginners, if they feel their Linux can refer to the following basic steps of installation, deployment and configuration to compile zabbix enterprise operation and maintenance monitoring system through the source code.

 

1, install php // install php and some related to the library by yum source php

# yum install php.x86_64 php-cli.x86_64 php-fpm php-gd php-json php-ldap php-mbstring php-mysqlnd php-xml php-xmlrpc php-opcache php-simplexml php-bcmath.x86_64 -y

 

2, install database // yum install source MySQL (Mariadb) database server and client

# yum install mariadb.x86_64 mariadb-devel.x86_64 mariadb-server.x86_64 -y

# Systemctl start mariadb.service // Start the database

 

3, initialize the database

[root@localhost ~]# mysql_secure_installation

NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB

      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current

password for the root user.  If you've just installed MariaDB, and

you haven't set the root password yet, the password will be blank,

so you should just press enter here.

 

Enter current password for root (enter for none):

OK, successfully used password, moving on...

 

Setting the root password ensures that nobody can log into the MariaDB

root user without the proper authorisation.

 

Set root password? [Y/n] y

New password:

Re-enter new password:

Password updated successfully!

Reloading privilege tables..

 ... Success!

 

By default, a MariaDB installation has an anonymous user, allowing anyone

to log into MariaDB without having to have a user account created for

them.  This is intended only for testing, and to make the installation

go a bit smoother.  You should remove them before moving into a

production environment.

 

Remove anonymous users? [Y/n] y

 ... Success!

 

Normally, root should only be allowed to connect from 'localhost'.  This

ensures that someone cannot guess at the root password from the network.

 

Disallow root login remotely? [Y/n] n

 ... skipping.

 

By default, MariaDB comes with a database named 'test' that anyone can

access.  This is also intended only for testing, and should be removed

before moving into a production environment.

 

Remove test database and access to it? [Y/n] n

 ... skipping.

 

Reloading the privilege tables will ensure that all changes made so far

will take effect immediately.

 

Reload privilege tables now? [Y/n] y

 ... Success!

 

Cleaning up...

 

All done!  If you've completed all of the above steps, your MariaDB

installation should now be secure.

 

Thanks for using MariaDB!

 

3, install apache // yum source mounting apache

# yum install httpd.x86_64 -y

4, install zabbix_server // source installation zabbix service and client

# tar -zxvf zabbix-3.4.9.tar.gz && cd zabbix-3.4.9

# Groupadd zabbix && useradd -g zabbix Zabbix // create users and groups zabbix

#./configure --prefix=/usr/local/zabbix user=zabbix group=zabbix --enable-server --enable-agent --enable-proxy --with-mysql --enable-ipv6 --with-net-snmp --with-libcurl --with-libxml2       //配置编译

# Make install // install zabbix server compiled by

 

5, zabbix create databases and database users and authorized zabbix

[root@zabbix ~]# mysql -u root -p Enter password:  Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 10 Server version: 5.5.47-MariaDB MariaDB Server Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.MariaDB [(none)]> CREATE DATABASE zabbix CHARACTER SET utf8 COLLATE utf8_bin;

Query OK, 1 row affected (0.00 sec) 

MariaDB [(none)]> GRANT ALL PRIVILEGES ON zabbix.* TO zabbix@localhost IDENTIFIED BY "password";

Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> FLUSH PRIVILEGES;Q

uery OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> exit Bye

 

 

6, import zabbix default database:

#cd /root/zabbix-3.4.9/database/mysql

# mysql -uroot -p zabbix < schema.sql && mysql -uroot -p zabbix < images.sql && mysql -uroot -p zabbix < data.sql

 

7, edit the default installation configuration file

# vim /usr/local/etc/zabbix_server.conf  

# vim /usr/local/zabbix/etc/zabbix_server.conf

ListenPort = 10051 // listening port

DBHost = localhost // database server

DBName = Zabbix // database name

DBUser = Zabbix // database user name

DBPassword = password // database password

 

8, edit and configure zabbix startup script, and set at startup

#cd /root/zabbix-3.4.9/misc/init.d/tru64

# Cp -r /root/zabbix-3.4.9/misc/init.d/tru64/zabbix_* /etc/init.d/

# chmod +x /etc/init.d/zabbix* 

#chown -R zabbix:zabbix /usr/local/zabbix

# cp -r /usr/local/zabbix/sbin/zabbix_* /usr/local/sbin/

#/etc/init.d/zabbix_server restart

#/etc/init.d/zabbix_agentd restart

 

9, the file to copy zabbix web end below the root directory apache

#cd /root/zabbix-3.4.9/frontends/

# mkdir -p /var/www/html/zabbix/

#cp -ra php/* /var/www/html/zabbix/

 

10, access to the web end

http://ip/zabbix

 

Error as follows:

l   Minimum required size of PHP post is 16M (configuration option "post_max_size").

l   Minimum required limit on execution time of PHP scripts is 300 (configuration option "max_execution_time").

l   Minimum required limit on input parse time for PHP scripts is 300 (configuration option "max_input_time").

l   Time zone for PHP is not set (configuration parameter "date.timezone").

l   At least one of MySQL, PostgreSQL, Oracle or IBM DB2 should be supported.

l   PHP bcmath extension missing (PHP configuration parameter --enable-bcmath).

l   PHP mbstring extension missing (PHP configuration parameter --enable-mbstring).

l   PHP gd extension missing (PHP configuration parameter --with-gd).

l   PHP gd PNG image support missing.

l   PHP gd JPEG image support missing.

l   PHP gd FreeType support missing.

l   PHP xmlwriter extension missing.

l   PHP xmlreader extension missing.

 

 

 

 

 

 

Solving steps:

#vim /etc/php.ini

post_max_size8M16M

max_execution_time30300

max_input_time60300

date.timezone = Asia/Shanghai

 

#systemctl restart httpd.service

 

 

 

 

 

Zabbix.conf.php to download configuration files, zabbix.conf.php configuration and then download the configuration file uploaded to / var / www / html / zabbix / conf / directory.

 

restart httpd.service #systemctl           // restart apache service

 

11, administrator information

user / password: Admin / Zabbix // Zabbix front-end default user name and password, if it is using to build a successful business must modify the password, you can modify the user name so safe.

 

12, client install zabbix_agentd // source code to compile and install the client zabbix_agentd

#./configure --prefix=/usr/local/zabbix --enable-agent

# make install

 

13, modify the configuration file agentd

# vim /usr/local/zabbix/etc/zabbix_agentd.conf

LogFile=/usr/local/zabbix/log/zabbix_agentd.log

EnableRemoteCommands=0

Server=192.168.10.100

ServerActive=192.168.10.100

Hostname=192.168.10.100

Timeout=30

Guess you like

Origin www.cnblogs.com/elsa-66/p/10951366.html