zabbix 4.0 deployment

zabbix deployment

Zabbix is ​​an open source distributed monitoring solution an enterprise.

Zabbix is ​​an ability to monitor various network parameters and the health and integrity of the server software. Zabbix flexible notification mechanism that allows users to configure the mail-based alerts for virtually any event. This quick feedback server problems. Based on the stored data, Zabbix offers excellent reporting and data visualization capabilities. These features make Zabbix ideal for capacity planning program.

Zabbix supports active and passive polling capture. Zabbix all reports, statistics and configuration parameters are accessible Web-based front-end page can be. Web-based front-end page can be sure that you assess the health status of your network and servers in any way. After proper configuration, Zabbix can play an important role in monitoring the IT infrastructure. The same is true for a small organization only a few servers and large companies with large server.

Reference  https://www.zabbix.com/documentation/4.0/zh/manual

 

 

Add Zabbix software repository

[root@zabbix-server ~]# rpm -ivh http://repo.zabbix.com/zabbix/4.0/rhel/7/x86_64/zabbix-release-4.0-1.el7.noarch.rpm

 

 

 

A .zabbix server

Zabbix server install and use the MySQL database:

[root@zabbix-server ~]# yum install zabbix-server-mysql -y

 

Install Zabbix front-end and using MySQL database:

[root@zabbix-server ~]# yum install zabbix-web-mysql -y

 

Mariadb installation and initialization; zabbix authorized users and create zabbix library:

[root@zabbix-server ~]# yum install -y mariadb-server

 

Start mariadb services:

[root@zabbix-server ~]# systemctl start mariadb

[root@zabbix-server ~]# systemctl enable mariadb

 

mysql password initialization:

[root@zabbix-server ~]# 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.

Root password the SET [the Y-/ the n-]? The Y-(set the root password)
New password:    (password: RedHat)
Re-new new the Enter password:      (Re-enter your password)
Password Updated successfully!
Reloading the Tables Privilege ..
... 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.

Anonymous the Users the Remove? [The Y-/ the n-] the Y-(delete anonymous user)
... Success!

Normally, root should only be allowed to connect from 'localhost'. This
ensures that someone cannot guess at the root password from the network.

The Login remotely root Disallow? [The Y-/ the n-] the Y-(does not allow remote root login)
... Success!

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.

Access to the Test Database and the Remove IT [the Y-/ the n-]? The Y-(remove test database and access it)
- Dropping the Test Database ...
... Success!
- Removing privileges ON the Test Database ...
... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Now the Tables Privilege Reload? [The Y-/ the n-] the Y-(immediately reload the privilege tables)
... 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!

 

New zabbix library:

[root@zabbix-server ~]# mysql -uroot -p
Enter password:   (输入密码:redhat)
Welcome to the MariaDB monitor. Commands end with ; or \g.
Your MariaDB connection id is 10
Server version: 5.5.64-MariaDB MariaDB Server

Copyright (c) 2000, 2018, 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;
Query OK, 1 row affected (0.00 sec)

MariaDB [(none)]> grant all privileges on zabbix.* to zabbix@localhost identified by 'zabbix';
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> flush privileges;
Query OK, 0 rows affected (0.00 sec)

 

[root@zabbix-server ~]# zcat /usr/share/doc/zabbix-server-mysql-4.0.14/create.sql.gz |mysql -uzabbix -p zabbix
Enter password:  (输入密码:zabbix)

 

 

 

Modify server configuration

[root@zabbix-server ~]# vim /etc/zabbix/zabbix_server.conf

LogFile=/var/log/zabbix/zabbix_server.log
LogFileSize=0
PidFile=/var/run/zabbix/zabbix_server.pid
SocketDir=/var/run/zabbix
DBHost=localhost   #(取消注释#)
DBName=zabbix
DBUser=zabbix
DBPassword=zabbix  #(取消注释#,密码为zabbix)
SNMPTrapperFile=/var/log/snmptrap/snmptrap.log
Timeout=4
AlertScriptsPath=/usr/lib/zabbix/alertscripts
ExternalScripts=/usr/lib/zabbix/externalscripts
LogSlowQueries=3000

  

Start zabbix-server

[root@zabbix-server ~]# systemctl enable zabbix-server

[root@zabbix-server ~]# systemctl start zabbix-server

 

 

Modify httpd configuration

[root@zabbix-server ~]# vim /etc/httpd/conf.d/zabbix.conf

#
# Zabbix monitoring system php web frontend
#

Alias /zabbix /usr/share/zabbix

<Directory "/usr/share/zabbix">
    Options FollowSymLinks
    AllowOverride None
    Require all granted

    <IfModule mod_php5.c>
        php_value max_execution_time 300
        php_value memory_limit 128M
        php_value post_max_size 16M
        php_value upload_max_filesize 2M
        php_value max_input_time 300
        php_value max_input_vars 10000
        php_value always_populate_raw_post_data -1
        # php_value date.timezone Europe/Riga
        php_value date.timezone Asia/Shanghai
    </IfModule>
</Directory>

<Directory "/usr/share/zabbix/conf">
    Require all denied
</Directory>

<Directory "/usr/share/zabbix/app">
    Require all denied
</Directory>

<Directory "/usr/share/zabbix/include">
    Require all denied
</Directory>

<Directory "/usr/share/zabbix/local">
    Require all denied
</Directory>

  

Start httpd

[root@zabbix-server ~]# systemctl start httpd

[root@zabbix-server ~]# systemctl enable httpd

 

 

 

 

Page views:

 http://10.10.1.106/zabbix

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Guess you like

Origin www.cnblogs.com/xuanbao/p/11888341.html