Compilation of passive mode of installation of proxy zabbix

#: Ready source packages, compile and install 

root @ Ubuntu: / usr / local / src # LS 
zabbix - 4.0 . 12 . Tar .gz 
root @ Ubuntu: / usr / local / src # tar XF zabbix- 4.0 . 12 . Tar . GZ 
the root @ Ubuntu: / usr / local / CD zabbix- the src # 4.0 . 12 is / 

#: install dependencies (not necessary to remove some of their own can be installed) 

the root @ Ubuntu: / usr / local / the src / zabbix- 4.0 . 12 is APT-GET #   install   apache2 apache2-bin apache2-data apache2-utils fontconfig-config fonts-dejavu-core fping libapache2-mod-php   libapache2-mod-php7.2 libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap libfontconfig1 libgd3 libiksemel3   libjbig0 libjpeg-turbo8 libjpeg8 liblua5.2-0 libodbc1 libopenipmi0 libsensors4 libsnmp-base libsnmp30 libsodium23 libssh2-1  libtiff5 libwebp6 libxpm4 php-bcmath php-common php-gd php-ldap php-mbstring php-mysql php-xml php7.2-bcmath php7.2-cli  php7.2-common php7.2-gd php7.2-json php7.2-ldap php7.2-mbstring php7.2PHP7 -MySQL. 2 -opcache PHP7. 2 -readline PHP7. 2 -xml the snmpd SSL-CERT-TTF-Dejavu Core the libmysqlclient the libxml2-dev-dev-dev libsnmp the libxml2 SNMP openjdk- the libevent-dev . 8 -jdk curl libcurl4-openssl- dev 

#: build and install 

the root @ Ubuntu: / usr / local / the src / zabbix- 4.0 . 12 is # ./configure --prefix = --enable-Proxy / Apps / zabbix_proxy --with --enable-Agent-MySQL - --with-NET-IPv6 enable SNMP---with-libcurl --with- the libxml2 
the root @ Ubuntu: / usr / local / the src / zabbix- 4.0 . 12 is # the make && the make  the install 

#: apt to find a station of the installation startup script to test the machine to change what

root@ubuntu:/usr/local/src/zabbix-4.0.12# vim /lib/systemd/system/zabbix-proxy.service

[Unit]
Description=Zabbix Proxy
After=syslog.target
After=network.target

[Service]
Environment="CONFFILE=/apps/zabbix_proxy/etc/zabbix_proxy.conf"
EnvironmentFile=-/etc/default/zabbix-proxy
Type=forking
Restart=on-failure
PIDFile=/run/zabbix/zabbix_proxy.pid
KillMode=control-group
ExecStart=/apps/zabbix_proxy/sbin/zabbix_proxy -c $CONFFILE
ExecStop=/bin/kill -SIGTERM $MAINPID
RestartSec=10s
TimeoutSec=infinity

[Install]
WantedBy=multi-user.target

#;创建数据库并授权

mysql> create database zabbix_proxy_passive character set utf8 collate utf8_bin;
Query OK, 1 row affected (0.00 sec)

mysql> grant all privileges on zabbix_proxy_passive.* to 'zabbix'@'192.168.7.%' IDENTIFIED by ' CentOS ' ; 
Query the OK, 0 rows affected, . 1 warning ( 0.00 sec) 

#; passive modified profile 

the root @ Ubuntu: / usr / local / the src / zabbix- 4.0 . 12 is # Vim / Apps / zabbix_proxy / etc / zabbix_proxy.conf 
ProxyMode = . 1   #; passive mode change 
Server = 192.168 . 7.105 
the ServerPort = 10051 
the Hostname = magedu-PROXY-linux37 passive 
the ListenPort = 10051 
the PidFile = / RUN / ZABBIX /zabbix_proxy.pid #: The path to the startup script and the same 
DBHost = 192.168 . 7.106 
DBName = zabbix_proxy_passive 
DBPassword = CentOS 
ProxyLocalBuffer = 720 
ProxyOfflineBuffer = 720 
StartPollers = 5 
StartHTTPPollers = 20 (this can be appropriate to add some) 
CacheSize = 8M (this should be tone larger) 
StartDBSyncers = 4 (and DB synchronization process must be properly adjusted larger) 
HistoryCacheSize = 16M (historical data cache size) 
HistoryIndexCacheSize = 4M (size of the index historical data) 
Timeout =30 (this is necessary to transfer large) 
        in passive mode heartbeat, configuration update time may not deserve 

#: Updated configuration to the server end (or add the host updates very slowly) 

root @ Ubuntu: ~ # vim / Apps / zabbix_server / etc / zabbix_server.conf 
ProxyConfigFrequency = 60 
ProxyDataFrequency = 60 

#: initializing the proxy database after changing 

the root @ Ubuntu: / usr / local / the src / zabbix- 4.0 . 12 is / database / MySQL # CD / usr / local / the src / zabbix- 4.0 . 12 is / Database / MySQL / 
the root @ Ubuntu: / usr / local / the src / zabbix- 4.0 . 12 is / Database / MySQL MySQL -uzabbix -pcentos -H # 192.168 . 7.106 zabbix_proxy_passive < schema.sql

#:启动服务

root@ubuntu:/usr/local/src/zabbix-4.0.12/database/mysql# systemctl start zabbix-proxy.service

 

 

#: Find an agent host test 

#: Modify the agent configuration file 

root @ Ubuntu: ~ # vim / etc / zabbix / zabbix_agentd.conf 
Server = 192.168 . 7.105 , 192.168 . 7.110 #; point and proxy server

Add Host

 

 

 

 

Looking for a free host install Java-gateway

#:准备jdk包 解压安装

root@ubuntu:/usr/local/src# tar xf jdk-8u191-linux-x64.tar.gz 
root@ubuntu:/usr/local/src# ln -sv /usr/local/src/jdk1.8.0_191/ /usr/local/jdk

#;配置环境变量

root@ubuntu:/usr/local/src# vim /etc/profile
export JAVA_HOME=/usr/local/jdk
export TOMCAT_HOME=/apps/tomcat
export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$TOMCAT_HOME/bin:$PATH
export CLASSPATH=.$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib:$JAVA_HOME/lib/tools.jar

root@ubuntu:/ usr / local / src # Source / etc / Profile 
root @ Ubuntu: / usr / local / src # the Java - Version 
the Java Version " 1.8.0_191 " 
the Java (TM) SE Runtime Environment (Build 1.8 .0_191- B12) 
the Java HotSpot (TM) 64- -bit Server VM (Build 25.191 - B12, the MODE Mixed) 

#: flexible connection to the Java command / usr / bin 

root @ Ubuntu: / usr / local / src # LN -sv / usr / local / the JDK / bin / the Java / usr / bin 

#: apt source configuration, installation Gateway 

root @ Ubuntu: / usr / local / src # wget HTTPS: //repo.zabbix.com/zabbix/4.0/ubuntu/pool/main/z/zabbix-release/zabbix-release_4.0-2+bionic_all.deb 
root @ Ubuntu: / usr / local / src # dpkg -i zabbix-release_4 . 0 - 2 + bionic_all.deb 
root @ ubuntu: / usr / local / the src APT # Update 
root @ ubuntu: / usr / local / APT # the src the install ZABBIX-Java- gateway 

#: modify profile gateway 

root @ ubuntu: / usr / local / # Vim the src / etc / ZABBIX / zabbix_java_gateway.conf 
LISTEN_IP = " 0.0.0.0 " 
LISTEN_PORT = 10052 
START_POLLERS = . 5 (the machine may be many things to open several) 
TIMEOUT =30 

#: Start Services 
root @ Ubuntu: / usr / local / src # systemctl zabbix-Start the Java-Gateway 


#; Add a host page

Guess you like

Origin www.cnblogs.com/maxuebin/p/11567593.html