Zabbix configuration server, proxy, Agent Architecture

Source: Internet
Author: User
Tags snmp openldap

Author: headsen Chen

Date: 19:49:50

Environment:

centos 6.8_x86_64zabbix-server: 192.168.1.130zabbix-proxy : 192.168.1.131zabbix-agent: 192.168.1.138

 

1. zabbix-Server Configuration

Install the dependency package (if an error is reported, add -- skip-broken ):

#yum -y install  lrzsz   gcc*   libxml2-devel net-snmp*  curl-devel unixODBC-devel libssh2-devel openldap openldap-devel OpenIPMI ncurses-devel OpenIPMI-devel  livevent-devel  libpcre*  libpcre-devel pcre* libevent* 

Install MySQL

# Yum-y install MySQL mysql-server mysql-devel # Vim/etc/lD. so. add/usr/local/MySQL/lib/# ldconfig (reload) to the backend of conf # service mysqld start # chkconfig mysqld on

Create a zabbix User:

Useradd zabbixmkdir/a; CD/a#upload zabbixinstallation package abbix-3.4.13.tar.gz to tar FX zabbix-3.4.13.tar.gzcd zabbix-3.4.13 under/mnt

Configure MySQL

Create a MySQL database mysqlmysql> Create Database zabbix Character Set utf8 collate utf8_bin; Authorize zabbix users with the password 123456: mysql> grant all privileges on zabbix. * To [email protected] identified by '808080'; mysql> show databases; import zabbix data table structure mysql> Use zabbix; mysql> source/A/zabbix-3.4.13/database/MySQL/schema. SQL; mysql> source/A/zabbix-3.4.13/database/MySQL/data. SQL; mysql> source/A/zabbix-3.4.13/database/MySQL/images. SQL; mysql> show databases; mysql> quit

Install HTTP and php5.6:

rpm -ivh http://repo.webtatic.com/yum/el6/latest.rpmyum -y install httpd php56w php56w-gd php56w-mysqlnd php56w-bcmath php56w-mbstring php56w-xml php56w-ldap  net-snmp-devel
# vim /etc/php.ini
post_max_size = 16Mmax_execution_time = 300max_input_time = 300date.timezone = Asia/Shanghaialways_populate_raw_post_data = -1
# vim /etc/httpd/conf/httpd.conf
DocumentRoot "/var/www/html/zabbix"<Directory "/var/www/html/zabbix">ServerName 127.0.0.1DirectoryIndex index.html index.html.var index.php
# Install zabbix-servermkdir/var/www/html/zabbixcd/ACP-RP zabbix-3.4.13/frontends/PHP // var/www/html/zabbix/chown-r Apache: apache/var/www/html/zabbix/chkconfig httpd onchmod + x/var/www/html/zabbix/PHP/setup. phpcd/A/zabbix-3.4.13. /configure -- enable-server -- enable-agent -- With-mysql -- With-proxy -- With-net-snmp -- With-libcurl -- with-libxml2 -- With-unixodbc -- with-ssh2 -- With-openipmi -- With-openss L -- prefix =/usr/local/zabbixmake & make installecho $?
# Modify the configuration of zabbix-server. Pay attention to the three parameters # Vim/usr/local/zabbix/etc/zabbix_server.conf dbname = zabbix dbuser = zabbix dbpassword = 123456

Configure the zabbix-server Startup File

CP/A/zabbix-3.4.13/MISC/init. d/Fedora/CORE/zabbix_server/etc/init. d/zabbix_servercp/A/zabbix-3.4.13/MISC/init. d/Fedora/CORE/zabbix_agentd/etc/init. d/zabbix_agentdvim/etc/init. d/zabbix_server on #! Add # chkconfig: 345 95 # next to the line under/bin/sh # "#" in the configuration file to indicate comment # description: zabbix_server # here, the first line "#" in the configuration file will comment on VIM/etc/init. d/zabbix_agentd in #! Add a line under/bin/sh # chkconfig: 345 95 # Here is the line "#" in the configuration file to indicate comments, # description: zabbix_agentd # Here, configure "#" at the beginning of the line in the question price to comment out and modify the basedir absolute path of the two files (the following command is invalid. Manually modify): sed-I's # basedir =/usr/local/zabbix # G'/etc/init. d/zabbix _ {server, agentd}
Add to auto start:
Chkconfig -- add/etc/init. d/zabbix_server
Chkconfig -- add/etc/init. d/zabbix_agentd
Chkconfig zabbix_server on
Chkconfig zabbix_agentd on

Verification:

[[email protected] conf]# ss -tunlNetid  State      Recv-Q Send-Q                           Local Address:Port                             Peer Address:Porttcp    LISTEN     0      128                                         :::10050                                      :::*     tcp    LISTEN     0      128                                          *:10050                                       *:*     tcp    LISTEN     0      128                                         :::10051                                      :::*     tcp    LISTEN     0      128                                          *:10051                                       *:*     tcp    LISTEN     0      50                                           *:3306                                        *:*     tcp    LISTEN     0      128                                         :::80                                         :::*     tcp    LISTEN     0      128                                         :::22                                         :::*     tcp    LISTEN     0      128                                          *:22                                          *:*     tcp    LISTEN     0      100                                        ::1:25                                         :::*     tcp    LISTEN     0      100                                  127.0.0.1:25                                          *:*     

Continue configuration through web:

Http: // 10.101.93.230/PHP/setup. php: zabbix server name: zabbix-Server login: admin/zabbix on the web page

Change font:

[[Email protected] fonts] # RZ-E (upload the font to:/var/www/html/zabbix/PHP/fonts /) [[email protected] fonts] # cd/var/www/html/zabbix/PHP/fonts/[[email protected] fonts] # mv stkaiti. TTF dejavusans. ttfmv: overwrite' dejavusans. ttf '? Yes [[email protected] fonts] # chown Apache. dejavusans. TTF [[email protected] fonts] # service httpd restart

 

2. proxy configuration

Proxy Server IP: 192.168.1.131, Host Name: zabbix-proxy

Install the source code package:

yum install gcc mysql-community-devel libxml2-devel unixODBC-devel net-snmp-devel libcurl-devel libssh2-devel OpenIPMI-devel openssl-devel openldap-devel pcre pcre-develyum -y install mysql mysql-server mysql-develservice mysqld start
useradd zabbix
tar fx  zabbix-3.2.1.tar.gz

Configure MySQL

Mysql>
Create Database zabbix_proxy; grant all on zabbix_proxy. * To 'zabbix' @ 'host' identified by 'zabbix'; grant all on zabbix_proxy. * To 'zabbix' @ 'zabbix-proxy' identified by 'zabbix'; grant all on zabbix_proxy. * To 'zabbix' @ '192. 168.1.131 'identified by 'zabbix'; grant all on zabbix_proxy. * To 'zabbix' '@' % 'identified by 'zabbix'; flush privileges; MySQL zabbix_proxy <zabbix-3.2.1/database/MySQL/schema. SQL # The proxy only needs to import this file

Install zabbix-proxy

cd zabbix-3.2.1./configure --prefix=/usr/local/zabbix --enable-proxy --enable-agent --with-mysql --with-net-snmp --with-libcurlmakemake install

Configure zabbix-proxy

Vim/usr/local/zabbix/etc/zabbix_proxy.confserver = IP # zabbix server iphostname = zabbix_proxy # logfile =/tmp/zabbix_proxy.log # path dbhost = IP # Database ipdbname = zabbix_proxy # Database Name dbuser = user # database username dbpassword = PASSWORD # Database Password configfrequency = 60 # configuration file synchronization interval datasenderfrequency = 5 # data synchronization interval

Configure the agent configuration file on zabbix-proxy

Vim/usr/local/zabbix/etc/zabbix_angetd.conf (modify the configuration in two places) Server = 192.168.1.130 (the IP address is written as the IP address of zabbix-server) serveractive = 192.168.1.130 (the IP address is written as the IP address of zabbix-server)
CP/mnt/zabbix-3.1.12/MISC/init. d/Fedora/CORE/zabbix_agentd/etc/init. d/sed-I's # basedir =/usr/local/zabbix # G'/etc/init. d/zabbix_agentdchmod + x/etc/init. d/zabbix_agentd start zabbix proxy service/usr/local/zabbix/sbin/zabbix_proxy start zabbix agent service/etc/init. d/zabbix_agentd start

 

3. Configure zabbix-agent (IP: 192.168.1.138)

Install zabbix on the client:

yum -y install gcc gcc-c++ make lrzsz  pcre*useradd zabbixtar fx zabbix-3.4.13.tar.gzcd zabbix-3.4.13./configure --enable-agent --prefix=/usr/local/zabbixmake && make install

Configure zabbix-agent

cp misc/init.d/fedora/core/zabbix_agentd /etc/init.d/sed -i ‘s#BASEDIR=/usr/local#BASEDIR=/usr/local/zabbix#g‘ /etc/init.d/zabbix_agentdchmod +x /etc/init.d/zabbix_agentdsed -i ‘s#Server=127.0.0.1#Server=10.101.51.17#g‘ /usr/local/zabbix/etc/zabbix_agentd.confsed -i ‘s#ServerActive=127.0.0.1#ServerActive=10.101.51.17#g‘ /usr/local/zabbix/etc/zabbix_agentd.conf/etc/init.d/zabbix_agentd start

 

Perform operations on the Web terminal on zabbix-Server:

Create Proxy Server

Enter the proxy server host name and the monitored host (note: the configuration file zabbix_agent.conf of the selected host points the server item to the proxy IP address)

Add new client host to proxy
Configure the agent configuration file (prerequisite for successful installation)

Create a monitoring host-> enter relevant information and select a monitoring template

Select the proxy server from the drop-down menu:

Wait for 10 minutes. The last "Monitoring Light" is green.

 


 

Zabbix configuration server, proxy, Agent Architecture

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.