Zabbix Installation Deployment Record

Source: Internet
Author: User
Tags symlink

Installing Zabbix Server

Zabbix server nodes need to install MySQL in advance, install Zabbix Web-dependent Apache and PHP modules, and then install three Zabbix components zabbix-server-mysql, Zabbix-web-mysql, Zabbix-get.

After installing Zabbix server, the following files are formed and some files we need to use:

[[email protected] ~]# rpm -ql zabbix-server-mysql/etc/logrotate.d/zabbix-server/etc/zabbix/zabbix_server.conf ? #配置文件/usr/lib/systemd/system/zabbix-server.service ? #Unit File/usr/lib/tmpfiles.d/zabbix-server.conf/usr/lib/zabbix/alertscripts/usr/lib/zabbix/externalscripts/usr/sbin/zabbix_server_mysql/usr/share/doc/zabbix-server-mysql-4.0.0/usr/share/doc/zabbix-server-mysql-4.0.0/AUTHORS/usr/share/doc/zabbix-server-mysql-4.0.0/COPYING/usr/share/doc/zabbix-server-mysql-4.0.0/ChangeLog/usr/share/doc/zabbix-server-mysql-4.0.0/NEWS/usr/share/doc/zabbix-server-mysql-4.0.0/README/usr/share/doc/zabbix-server-mysql-4.0.0/create.sql.gz #数据库初始化脚本,但不包含创建数据库zabbix/usr/share/man/man8/zabbix_server.8.gz/var/log/zabbix/var/run/zabbix

Install MARIADB here does not introduce, install good mariadb after manually create Zabbix database and authorize Zabbix account access, according to the actual situation authorized IP login MySQL, only native login with localhost.
You can then initialize the database based on the SQL scripts that are carried with the Zabbix package

MariaDB [(None)]> CREATE Database Zabbix charset ' UTF8 '; Query OK, 1 row Affected (0.00 sec) MariaDB [(none)]> grant all on zabbix.* to [email protected] ' localhost ' identif IED by ' 123123 '; Query OK, 0 rows Affected (0.00 sec) MariaDB [(none)]> flush privileges; Query OK, 0 rows Affected (0.00 sec) [[email protected] ~]# mysql-uroot-p-dzabbix </usr/share/doc/zabbix-server -mysql-4.0.0/create.sqlenter password:mariadb [zabbix]> show tables;+----------------------------+| Tables_in_zabbix.???? |+----------------------------+| Acknowledges??????? | |  What are the actions????????? || Alerts?????????? | |  Application_discovery?? ||  Application_prototype?? || Application_template??? | | Applications??????? | | Auditlog????????? | | Auditlog_details????? |...|  Trigger_depends????? ||  Trigger_discovery???? ||  Trigger_tag??????? || Triggers????????? | |  Users?????????? || Users_groups???? ? ? ? || Usrgrp?????????? | |  ValueMaps???????? || Widgets?????????? | | Widget_field??????? |+----------------------------+144 rows in Set (0.00 sec)

Edit the Zabbix profile/etc/zabbix/zabbix_server.conf, modify the password for the connection database

DBPassword=123123

Other common Zabbix_server parameters are listed:

#zabbix服务端监听的端口, listenport=10051# Specifies the source IP that is used when Zabbix server and Agent communication is not modified. Security considerations, the Zabbix agent based on IP access control, only allow the designated IP as the server to capture the monitored host data, if the IP is not rejected. When multiple IP addresses are configured on the server side, the source IP that is used to communicate with the agent can be specified through SOURCEIP. Sourceip= #指定哪种方式记录日志, three ways to choose: System, file, console, file is the default. System indicates that sending logs to Syslog,file means using the specified file as the log output, and the console indicates that the log is sent to the console. logtype=filelogfile=/var/log/zabbix/zabbix_server.log# log file to how large the automatic dump, the unit MB, if set to 50, indicating that the log size of 50MB scroll once, logfilesize= 50# Setting the log level #0-basic information about starting and stopping of Zabbix processes#1-critical information#2-error Informa Tion#3-warnings#4-for debugging (produces lots of information) #5-extended debugging (produces even more information) debuglevel=3# configuration Zabbix Database server ip,zabbix_server through the IP connection database, this article MySQL and Zabbix server with host deployment, configuration localhostdbhost=localhost# Configure the name of the database used by Zabbix server dbname=zabbix# Configure Zabbix server login database using the user name dbuser=zabbix# configure Zabbix Server login database Password dbpassword= 123123# Configure the port number used by the Zabbix server login database dbport=3306# if the database and Zabbix server are deployed on the same server, configure the socket file for the Zabbix server login database. dbsocket=/var/lib/mysql/mYsql.sock 

After the Zabbix-server end is configured, start the Zabbix-server and set the boot up (optional).

[[email protected] ~]# systemctl enable zabbix-serverCreated symlink from /etc/systemd/system/multi-user.target.wants/zabbix-server.service to /usr/lib/systemd/system/zabbix-server.service.[[email protected] ~]# systemctl start zabbix-server

Check the listening port to see that the zabbix-server and MySQL processes are listening on ports 10051 and 3306.

Zabbix_server is just Zabbix server daemon, to access the Zabbix page also need to install Zabbix Web.

Install Zabbix Web

Zabbix Web relies on Apache services and several PHP modules, after installing the dependent modules, install Zabbix-web-mysql

[[email protected] ~]# yum install httpd php php-mysql php-mbstring php-gd php-bcmath php-ldap php-xml[[email protected] ~]# yum install zabbix-web-mysql  zabbix-web

Zabbix specifically provides a profile/etc/httpd/conf.d/zabbix.conf for httpd, which can be used only if the time zone is modified to the East eight zone before starting httpd.

[[email protected] ~]# vi /etc/httpd/conf.d/zabbix.conf...php_value date.timezone Asia/Shanghai

Then start the httpd and set the boot up (optional)

systemctl start httpd.servicesystemctl enable httpd.service
Zabbix initialization Configuration

In this step, the installation configuration of Zabbix Web is completed, and the following is the Zabbix initialization configuration of the login Zabbix Web.
Opens the browser, accesses the Http://Host_IP/zabbix, the initial landing will jump to the/zabbix/setup.php page to initialize the configuration.

P2

To initialize the first step, Zabbix automatically checks to see if the installation environment meets the requirements, and if there are no OK entries for the right column, it needs to be handled separately.

P3

The second step is to configure the database connection by configuring the database type, IP, port, database name, user, and password. The Zabbix account was authorized when MySQL was initialized, the Zabbix database was created, the databases name and user are configured as Zabbix, and the MySQL is configured localhost because it is installed locally.

P4

The third step is to configure Zabbix server details, including IP address (host), port, server name, and so on.

P5

Fourth step, check if the initialization configuration is incorrect. Make sure the information is correct, then click Next.

P6

The Zabbix initialization configuration is complete and the relevant configuration information is saved in the/etc/zabbix/web/zabbix.conf.php. If you want to modify the initialization configuration information, you can modify the file. At this point Zabbix initialization is complete, click Finish.

P7

First login Zabbix Web, account admin, password Zabbix.

Installing the Zabbix Agent

After completing the above steps, you can view the various dashboards on the Web page, but you need to add the monitoring objects in order to collect meaningful monitoring data. This simply installs the Zabbix-agent and zabbix-sender on the monitored host

yum install zabbix-agent zabbix-sender

After installing Zabbix-agent, generate two important files:
?? Config file:/etc/zabbix/zabbix_agentd.conf
? ? Unit File:/usr/lib/systemd/system/zabbix-agent.service

Modify the zabbix_agentd.conf configuration to populate the server with Zabbix server IP, if there are multiple Zabbix server IPs separated by commas

[[email protected] ~]# vim /etc/zabbix/zabbix_agentd.confServer=IP1,IP2,...

Then start the Zabbix-agent service and set the boot up (optional)

[[email protected] ~]# systemctl start zabbix-agent[[email protected] ~]# systemctl enable zabbix-agentCreated symlink from /etc/systemd/system/multi-user.target.wants/zabbix-agent.service to /usr/lib/systemd/system/zabbix-agent.service.

To this Zabbix installation deployment is complete, but to really monitor the operating state of the system requires a more detailed configuration via the Zabbix page.

Zabbix Installation Deployment Record

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.