Оглавление
Устанавливаем full ubuntu
Если у вас есть удаленный офис и вы хотите мониторить состояние систем внутри него с помощью ZABBIX, нет необходимости настраивать NAT до каждого отдельного узла. Все данные можно собирать локально и отправлять их централизованно на сервер ZABBIX. Вам просто нужно установить ZABBIX PROXY. Заодно, вы немного разгрузите основной сервер.
Задача
Установить ZABBIX PROXY на UBUNTU 20, связать его с основным сервером
Решение
Для того чтобы все работало, версии zabbix server и zabbix proxy должны совпадать!
Проверьте версию zabbix на основном сервере
root@zabbixmain:/home/administrator# zabbix_server -V
zabbix_server (Zabbix) 6.4.17
Revision c12261f00b4 15 July 2024, compilation time: Jul 15 2024 11:05:06
Copyright (C) 2024 Zabbix SIA
License GPLv2+: GNU GPL version 2 or later <https://www.gnu.org/licenses/>.
This is free software: you are free to change and redistribute it according to
the license. There is NO WARRANTY, to the extent permitted by law.
This product includes software developed by the OpenSSL Project
for use in the OpenSSL Toolkit (http://www.openssl.org/).
Compiled with OpenSSL 3.0.2 15 Mar 2022
Running with OpenSSL 3.0.2 15 Mar 2022
root@zabbixmain:/home/administrator#
Идем в официальные репозитории ZABBIX и скачиваем пакет с нужной нам версией и ставим его:
#cd /tmp/
# wget https://repo.zabbix.com/zabbix/6.4/ubuntu/pool/main/z/zabbix-release/zabbix-release_6.4-1+ubuntu22.04_all.deb
# dpkg -i zabbix-release_6.4-1+ubuntu22.04_all.deb
# apt update
# apt -y install zabbix-proxy-mysql zabbix-sql-scripts
Ставим MYSQL
apt install mysql-server
После установки запускаем MYSQL и добавляем его в автозагрузку:
systemctl start mysql
systemctl enable mysql
# mysql -uroot -p
password
mysql> create database zabbix_proxy character set utf8mb4 collate utf8mb4_bin;
mysql> create user zabbix@localhost identified by 'password';
mysql> grant all privileges on zabbix_proxy.* to zabbix@localhost;
mysql> set global log_bin_trust_function_creators = 1;
mysql> quit;
cat /usr/share/zabbix-sql-scripts/mysql/proxy.sql | mysql --default-character-set=utf8mb4 -uzabbix -p zabbix_proxy
mysql -uroot -p password
mysql> set global log_bin_trust_function_creators = 0;
mysql> quit;
systemctl start zabbix-proxy
e. Start Zabbix proxy process
Start Zabbix proxy process and make it start at system boot.# systemctl restart zabbix-proxy
# systemctl enable zabbix-proxy
Редактируем конфиг Edit file /etc/zabbix/zabbix_proxy.conf
root@zabbix-proxy-office:/home/administrator# cat /etc/zabbix/zabbix_proxy.conf
# This is a configuration file for Zabbix proxy daemon
# To get more information about Zabbix, visit http://www.zabbix.com
############ GENERAL PARAMETERS #################
### Option: ProxyMode
# Proxy operating mode.
# 0 - proxy in the active mode
# 1 - proxy in the passive mode
#
# Mandatory: no
# Default:
# ProxyMode=0
### Option: Server
# If ProxyMode is set to active mode:
# IP address or DNS name (address:port) or cluster (address:port;address2:port) of Zabbix server to get configuration data from and send data to.
# If port is not specified, default port is used.
# Cluster nodes need to be separated by semicolon.
# If ProxyMode is set to passive mode:
# List of comma delimited IP addresses, optionally in CIDR notation, or DNS names of Zabbix server.
# Incoming connections will be accepted only from the addresses listed here.
# If IPv6 support is enabled then '127.0.0.1', '::127.0.0.1', '::ffff:127.0.0.1' are treated equally
# and '::/0' will allow any IPv4 or IPv6 address.
# '0.0.0.0/0' can be used to allow any IPv4 address.
# Example: Server=127.0.0.1,192.168.1.0/24,::1,2001:db8::/32,zabbix.example.com
#
# Mandatory: yes
# Default:
# Server=
Server=5.182.224.247 - тут мы указываем сервер zabbix main
### Option: Hostname
# Unique, case sensitive Proxy name. Make sure the Proxy name is known to the server!
# Value is acquired from HostnameItem if undefined.
#
# Mandatory: no
# Default:
# Hostname=
Hostname=zabbix-proxy-office - тут мы указываем как будет называтся наш сервер
### Option: HostnameItem
# Item used for generating Hostname if it is undefined.
# Ignored if Hostname is defined.
#
# Mandatory: no
# Default:
# HostnameItem=system.hostname
### Option: ListenPort
# Listen port for trapper.
#
# Mandatory: no
# Range: 1024-32767
# Default:
# ListenPort=10051
### Option: SourceIP
# Source IP address for outgoing connections.
#
# Mandatory: no
# Default:
# SourceIP=
### Option: LogType
# Specifies where log messages are written to:
# system - syslog
# file - file specified with LogFile parameter
# console - standard output
#
# Mandatory: no
# Default:
# LogType=file
### Option: LogFile
# Log file name for LogType 'file' parameter.
#
# Mandatory: yes, if LogType is set to file, otherwise no
# Default:
# LogFile=
LogFile=/var/log/zabbix/zabbix_proxy.log
### Option: LogFileSize
# Maximum size of log file in MB.
# 0 - disable automatic log rotation.
#
# Mandatory: no
# Range: 0-1024
# Default:
# LogFileSize=1
LogFileSize=0
### Option: DebugLevel
# Specifies debug level:
# 0 - basic information about starting and stopping of Zabbix processes
# 1 - critical information
# 2 - error information
# 3 - warnings
# 4 - for debugging (produces lots of information)
# 5 - extended debugging (produces even more information)
#
# Mandatory: no
# Range: 0-5
# Default:
# DebugLevel=3
### Option: EnableRemoteCommands
# Whether remote commands from Zabbix server are allowed.
# 0 - not allowed
# 1 - allowed
#
# Mandatory: no
# Default:
# EnableRemoteCommands=0
### Option: LogRemoteCommands
# Enable logging of executed shell commands as warnings.
# 0 - disabled
# 1 - enabled
#
# Mandatory: no
# Default:
# LogRemoteCommands=0
### Option: PidFile
# Name of PID file.
#
# Mandatory: no
# Default:
# PidFile=/tmp/zabbix_proxy.pid
PidFile=/run/zabbix/zabbix_proxy.pid
### Option: SocketDir
# IPC socket directory.
# Directory to store IPC sockets used by internal Zabbix services.
#
# Mandatory: no
# Default:
# SocketDir=/tmp
SocketDir=/run/zabbix
### Option: DBHost
# Database host name.
# If set to localhost, socket is used for MySQL.
# If set to empty string, socket is used for PostgreSQL.
# If set to empty string, the Net Service Name connection method is used to connect to Oracle database; also see
# the TNS_ADMIN environment variable to specify the directory where the tnsnames.ora file is located.
#
# Mandatory: no
# Default:
# DBHost=localhost
### Option: DBName
# Database name.
# For SQLite3 path to database file must be provided. DBUser and DBPassword are ignored.
# If the Net Service Name connection method is used to connect to Oracle database, specify the service name from
# the tnsnames.ora file or set to empty string; also see the TWO_TASK environment variable if DBName is set to
# empty string.
# Warning: do not attempt to use the same database Zabbix server is using.
#
# Mandatory: yes
# Default:
# DBName=
DBName=zabbix_proxy - имя mysql базы нашего установленного прокси
### Option: DBSchema
# Schema name. Used for PostgreSQL.
#
# Mandatory: no
# Default:
# DBSchema=
### Option: DBUser
# Database user. Ignored for SQLite.
#
# Default:
# DBUser=
DBUser=zabbix логин от mysql
### Option: DBPassword
# Database password. Ignored for SQLite.
# Comment this line if no password is used.
#
# Mandatory: no
# Default:
DBPassword=password пароль от mysql
Проверка логов
cat /var/log/zabbix/zabbix_proxy.log
Добавляем на main zabbix


После добавление одного хоста через прокси , он активируется.
Ставим агента на машину которую будем мониторить
cd C:\zabbix
net stop "zabbix agent"
zabbix_agentd.exe --config zabbix_agentd.conf --uninstall
zabbix_agentd.exe --config zabbix_agentd.conf --install
net start"zabbix agent"
LogFile=c:\zabbix\zabbix_agentd.log
Server=10.130.51.250 - сервер прокси
ListenPort=10050
ServerActive=10.130.51.250 - сервер прокси
Hostname=S12RUMSC0200067 - реальное имя машины
Добавляем host где указываем в поле agent реальный ip машины и через кого он проксируется

Настроить Fping
Настройке fping сразу чтобы в будущем не было проблем с ключами icmpping
Настроиваем Locale и часовой пояс
sudo timedatectl set-timezone Europe/Moscow
localectl set-locale LC_TIME=en_GB.UTF-8