Установка zabbix 7.2 ubuntu 24
1 2 3 4 5 |
wget https://repo.zabbix.com/zabbix/7.2/release/ubuntu/pool/main/z/zabbix-release/zabbix-release_latest_7.2+ubuntu24.04_all.deb sudo dpkg -i zabbix-release_latest_7.2+ubuntu24.04_all.deb sudo apt update sudo apt install zabbix-server-mysql zabbix-frontend-php zabbix-nginx-conf zabbix-sql-scripts zabbix-agent sudo shutdown -r now |
Создание базы mysql
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
sudo apt install mysql-server traceroute mysql -uroot -p password (Mhksdify7BJUgshfw8fdglks234hsf) mysql> create database zabbix character set utf8mb4 collate utf8mb4_bin; mysql> create user zabbix@localhost identified by 'password'; mysql> grant all privileges on zabbix.* to zabbix@localhost; mysql> set global log_bin_trust_function_creators = 1; mysql> quit; zcat /usr/share/zabbix/sql-scripts/mysql/server.sql.gz | mysql --default-character-set=utf8mb4 -uzabbix -p zabbix mysql -uroot -p password mysql> set global log_bin_trust_function_creators = 0; mysql> quit; |
Настройка конфига
1 2 3 4 5 6 7 |
sudo nano /etc/zabbix/zabbix_server.conf DBPassword=password ListenPort=8080 StartPollers=25 StartPollersUnreachable=30 CacheSize=128M EnableGlobalScripts=1 |
1 2 |
sudo systemctl restart zabbix-server zabbix-agent nginx php8.3-fpm sudo systemctl enable zabbix-server zabbix-agent nginx php8.3-fpm |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
sudo rm -r /etc/nginx/sites-enabled/default sudo nano /etc/nginx/sites-enabled/zabbix.conf server { listen 80; server_name zabbix.domain.ru; listen 443 ssl http2; root /usr/share/zabbix; access_log /var/log/nginx/zabbix.access.log; # certs sent to the client in SERVER HELLO are concatenated in ssl_certificate ssl_certificate /etc/ssl/zabbix/domain_ru.crt; ssl_certificate_key /etc/ssl/zabbix/domain_ru.key; ssl_session_timeout 1d; ssl_session_cache shared:MozSSL:10m; # about 40000 sessions # intermediate configuration ssl_protocols TLSv1.2; ssl_ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384; ssl_prefer_server_ciphers off; # Diffie-Hellman parameter for DHE ciphersuites, recommended 2048 bits ssl_dhparam /etc/ssl/zabbix/domain_ru.pem; # HSTS (ngx_http_headers_module is required) (63072000 seconds) add_header Strict-Transport-Security "max-age=63072000" always; gzip on; gzip_comp_level 3; gzip_disable "msie6"; gzip_min_length 1024; gzip_vary on; gzip_proxied any; gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript application/javascript; location / { index index.php index.html index.htm; } location ~ \.php$ { fastcgi_pass unix:/run/php73-fpm.sock; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; fastcgi_param PHP_VALUE " max_execution_time = 300 memory_limit = 128M post_max_size = 16M upload_max_filesize = 2M max_input_time = 300 date.timezone = Europe/Moscow always_populate_raw_post_data = -1 "; fastcgi_buffers 8 256k; fastcgi_buffer_size 128k; fastcgi_intercept_errors on; fastcgi_busy_buffers_size 256k; fastcgi_temp_file_write_size 256k; } client_max_body_size 32m; } sudo service nginx restart |
Для добавления поддержки языков:
1 2 3 4 |
sudo dpkg-reconfigure locales en_US ru_RU sudo systemctl restart php8.3-fpm.service |
Иногда необходимо указать расположение fping
1 2 3 4 |
sudo nano /etc/zabbix/zabbix_server.conf FpingLocation=/usr/bin/fping Fping6Location=/usr/bin/fping6 |
Рассказать: